Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get GUI working #23

Closed
vdc4j95 opened this issue Apr 19, 2018 · 1 comment
Closed

get GUI working #23

vdc4j95 opened this issue Apr 19, 2018 · 1 comment

Comments

@vdc4j95
Copy link

vdc4j95 commented Apr 19, 2018

I am having some issues getting the GUI working on my Raspi2.

Settings -------------------------------------

Plugins ......... pluginEnable=False pluginName=picam480
Message Display . verbose=True display_fps=False calibrate=True
show_out_range=True
Logging ......... Log_data_to_CSV=True log_filename=speed-cam.csv (CSV format)
loggingToFile=True logFilePath=speed-cam.log
Log if max_speed_over > 1 mph
Speed Trigger ... If track_len_trig > 75 px
Exclude Events .. If x_diff_min < 1 or x_diff_max > 15 px
If y_upper < 140 or y_lower > 340 px
or x_left < 150 or x_right > 490 px
If max_speed_over < 1 mph
If event_timeout > 0 seconds Start New Track
track_timeout=0 sec wait after Track Ends (avoid retrack of same object)
Speed Photo ..... Size=960x720 px image_bigger=1 rotation=180 VFlip=True HFlip=True
image_path=media/images image_Prefix=speed-
image_font_size=22 px high image_text_bottom=False
Motion Settings . Size=640x480 px px_to_kph=0.086600 speed_units=mph
OpenCV Settings . MIN_AREA=200 sq-px BLUR_SIZE=10 THRESHOLD_SENSITIVITY=20 CIRCLE_SIZE=4 px
WINDOW_BIGGER=1 gui_window_on=True (Display OpenCV Status Windows on GUI Desktop)
CAMERA_FRAMERATE=25 fps video stream speed
Sub-Directories . imageSubDirMaxHours=0 (0=off) imageSubDirMaxFiles=1000 (0=off)
imageRecentDir=media/recent imageRecentMax=100 (0=off)
Disk Space ..... Enabled - Manage Target Free Disk Space. Delete Oldest jpg Files if Needed
Check Every spaceTimerHrs=24 hr(s) (0=off) Target spaceFreeMB=500 MB min is 100 MB)
If Needed Delete Oldest spaceFileExt=jpg spaceMediaDir=media/images


(Movement (q Quits):1481): Gtk-WARNING **: cannot open display:

@pageauc
Copy link
Owner

pageauc commented Apr 19, 2018

gui_window_on=True should show the opencv windows cv2.imshow(). There are also variables for show_thresh_on, show_crop_on plus the default full image2 window. You may need to add your own cv2.imshow() to display what you want. Your problem may be how you put in the new logic since you may not have the window name variable and image to display set correctly. Check logic and make sure the variables are correct. The speed-cam.py code to display windows is below. It is located just above if name == 'main': near end of code.
Make sure variables for the image you want to show are compatible with the new code you added. You can always add some debug code to help find out where the problem is.

    if gui_window_on:
        # cv2.imshow('Difference Image',difference image)
        cv2.line(image2, (x_left, y_upper), (x_right, y_upper), cvRed, 1)
        cv2.line(image2, (x_left, y_lower), (x_right, y_lower), cvRed, 1)
        cv2.line(image2, (x_left, y_upper), (x_left, y_lower), cvRed, 1)
        cv2.line(image2, (x_right, y_upper), (x_right, y_lower), cvRed, 1)
        image_view = cv2.resize(image2, (image_width, image_height))
        cv2.imshow('Movement (q Quits)', image_view)
        if show_thresh_on:
            cv2.imshow('Threshold', thresholdimage)
        if show_crop_on:
            cv2.imshow('Crop Area', image_crop)
        # Close Window if q pressed
        if cv2.waitKey(1) & 0xFF == ord('q'):
            cv2.destroyAllWindows()
            logging.info("End Motion Tracking ......")
            vs.stop()
            still_scanning = False

@pageauc pageauc closed this as completed Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants