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

option to perspective-warp the input image before motion-detection #153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jeremybmerrill
Copy link
Contributor

Adds a MO_WARP_ON option that, if True, uses opencv's perspective warp to warp the image such that the four points specified in MO_WARP_INPUT_PTS become located at the points specified in MO_WARP_OUTPUT_PTS.

The points are specified as a list of two-element lists. The points are in clockwise format [bottom-left, top-left, top right, bottom right]. The points are calculated against the 320x240 image (not the source resolution of the camera).

On my 4gb Raspberry Pi 4, this costs about 1% of FPS (from 16.17fps to 15.98fps) -- i.e. the performance cost is negligible.

The reason for this PR is that my street curves within the motion tracking crop area -- so pixel distances within the crop area don't have a consistent relationship to real-world distances in feet/meters/miles. I decided to crop the area to make the distances consistent.

I don't anticipate that this PR is ready to be merged right away, so happy to address any questions.

@jeremybmerrill jeremybmerrill changed the title Feature/warp option to perspective-warp the input image before motion-detection Nov 8, 2023
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

Successfully merging this pull request may close these issues.

1 participant