Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Detect Slow Gradual Change in Background with Live Video and Python 3?

Hello everyone. How can I go about detecting slow gradual change in a live video? I am experienced with writing Python OpenCV code for motion detection, but not for slow gradual change in live video. I would like to write a Python OpenCV script to detect smoke build-up in a home.

Here is what I think I need help with:

  1. Create and initialize a bool variable "frameChange = False"
  2. Recognize and remember the initial frames of the live video from cv2.VideoCapture().
  3. Read the current frame, and compare to the initial frames.
  4. If the initial frame and the current frame differ by 25%, then frameChange = True.

I'm thinking I can get the average pixel value for the initial frame, and compare that value to the average pixel value of the current frame. If there are any other ideas, I'd be very grateful.