Question
OpenCv for Python: Detect Motion 1 Capture an image 2 Create blank images: A. grayscale image with proper dimensions B. 32f, 3 channel image C.
OpenCv for Python:
Detect Motion
1 Capture an image
2 Create blank images:
A. grayscale image with proper dimensions
B. 32f, 3 channel image
C. a capture clone we'll call image1
D. One to hold the result from the absDiff function. (absolute difference)
3 while loop to capture images......
4 grab new frame
A. I brightened image a bit first which helped
5. blur the image
6. take running average of frame: accumulateWeighted
7 swap running average result from step 6 to same bits as frame: convertScaleAbs
8 Take difference, built in OpenCV function to do a diff between two images.
9 convert to grayscale
10 Threshhold grayscale (using a low number)
11 Blur grayscale image
12 Threshhold grayscale again (using a high number)
13 find contours: findContours
14 Use contours to find significant blobs,
15 draw polygons of blobs
16 use dimensions of blobs to draw bounding boxes and center on original image
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started