-
Camera Feed Not Displaying
- Added proper thread synchronization between the monitoring thread and GUI update thread
- Fixed the frame display mechanism to properly handle canvas resizing
- Improved error handling in frame acquisition and display
-
Detection Not Working
- Ensured detection results are properly passed from monitoring system to GUI
- Added explicit frame copying to avoid thread-related corruption
- Increased the GUI update rate for smoother video display
-
General System Improvements
- Added camera reinitialization logic in case of frame reading failures
- Improved camera frame handling and processing
- Optimized the display mechanism for better performance
-
Thread Synchronization Issues:
- Added proper thread-safe handling of shared resources (frames, detection results)
- Implemented frame copying to prevent data corruption
-
Missing
run()Method:- Added the missing
run()method to theDriverMonitoringGUIclass to start the Tkinter main loop
- Added the missing
-
Canvas Handling:
- Improved the canvas image display logic to handle window resizing
- Added fallback for initial canvas dimensions
-
Performance Improvements:
- Increased GUI refresh rate for smoother video (16ms/~60FPS)
- Added small delays in the monitoring thread to avoid CPU hogging
Created a new diagnostic utility in utils/diagnostic.py to:
- Test camera functionality independently
- Verify that detection modules initialize correctly
- Process test frames and verify results
- Report overall system health
-
Run the diagnostic tool:
python utils/diagnostic.py -
Launch the GUI:
python main.py --gui -
Press "Start Monitoring" to begin camera feed and detection
- If facial recognition is important, you may want to add sample face images to the system
- Consider adjusting detection thresholds based on real-world testing
- Monitor system performance on different hardware configurations