Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about 2nd monitor area #8

Open
atraver1 opened this issue Mar 3, 2017 · 3 comments
Open

Question about 2nd monitor area #8

atraver1 opened this issue Mar 3, 2017 · 3 comments

Comments

@atraver1
Copy link

atraver1 commented Mar 3, 2017

Hello greg,

i was just wondering if it was possible to create a 2nd monitoring area and track both?

@gregtinkers
Copy link
Owner

It is certainly possible, though it may tax the power of the pi. If you wanted to, you could move the image processing into a method and each areas coordinates to the method where the original image would be cropped and processed. Give it a try!

@atraver1
Copy link
Author

atraver1 commented Mar 16, 2017 via email

@gregtinkers
Copy link
Owner

The program monitors the area defined by the draw rectangle function. Basically, it saves a portion of the frame without a vehicle and then compares it over an over to that same portion in the current frame. When the comparison shows a difference, it begins the speed calculation using a contour to define the change (a box drawn around the area that is different.) The part of the frame that it is using is defined by the rectangle that you draw. To monitor two rectangles you would need to first draw both on the frame, remember what each area looks like without a car, then repeat the process of comparing those original images to the corresponding area on the current frame.

This post on pyimagesearch may help you understand the principle of detection.

Since you are new to programming, I'd suggest writing a program with a very basic motion detection so that you understand the principle. Carspeed uses the basic principle, but restricts the processing to the area in the rectangle. When it detects movement, it uses the change in location of the contour between frames to compute the speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants