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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!