Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 1.7 KB

README.md

File metadata and controls

27 lines (22 loc) · 1.7 KB

roi-detections

light_detectionmotion_detection_cropped

A simple OpenCV interface for light and motion detection within a drawn ROI.

Key Features

  • draw a rectangle ROI of any size directly onto your video of interest
  • set a threshold for motion or light detection
  • save frames in which light or motion is detected

Getting Started

  1. download and run draw_roi.py
  2. to run roi detection, run detection(vid, type, threshold)
    • tip: to use your video webcam, set vid as 0
  3. a separate window for the videofeed should open.
  4. draw your roi by clicking the point that you want to be the top left corner of the roi followed by the point you want to be the bottom right corner of the roi. this should draw a blue rectangle roi on the frame.
  5. to delete a drawn roi, right click and the blue box should disappear.
  6. once an roi is drawn, between frame motion or pixel intensity will be calculated within it. frames in which motion or intensity is greater than the given threshold will be labeled ROI: motion/light on {}th frame and saved to your output csv.
  7. close the window by hitting q on the keyboard. this may take multiple tries if you haven't selected the video feed window.
  8. detection will keep running until the last frame in the video or until the window is closed.
  9. detected frames will be saved in a csv to the file path specified!

Extensions

roi-detection is integratable with Bonsai.

Dependencies

OpenCV, numpy, pandas