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

Support Object Tracking #39

Open
doudar opened this issue Aug 26, 2020 · 5 comments
Open

Support Object Tracking #39

doudar opened this issue Aug 26, 2020 · 5 comments

Comments

@doudar
Copy link

doudar commented Aug 26, 2020

I think that with the dynamic mask stuff you guys are working on, it would also be possible to use that same information to enable smart object tracking with a PTZ camera. Exciting Stuff!

@VorlonCD
Copy link

Hmm seems like this should be an option directly in BI... but according to blueiris.pdf, it maybe can be done externally?

"/admin?camera=x&ptz=n PTZ command n on camera x (short name). n=0,1... for
left,right,up,down,center,zoom+,zoom-
"

@doudar
Copy link
Author

doudar commented Aug 26, 2020

Just below that is also:

/cam/{cam-short-name}/pos=x Performs a PTZ command on the specified camera, where x=
0=left, 1=right, 2=up, 3=down, 4=home, 5=zoom in, 6=zoom out 

It would be nice if there was an option to specify the step size but I guess you're left to the camera default. Which isn't horrible.

@doudar
Copy link
Author

doudar commented Aug 26, 2020

Sorry for the suggestion of this feature creep, but this would be a killer app for extremely cheap PTZ cameras like the Amcrest ProHD.

@VorlonCD
Copy link

I'm seriously considering renaming my username to 'FeatureCreep' :) So how would this work? Lets say a detection was at lower left of camera. How do I know how many downs and lefts to take to make the detection in the center? And how to revert back to original location?

@doudar
Copy link
Author

doudar commented Aug 26, 2020

Well, returning to the original location is easy. If the object is no longer detected or hasn't moved in X number of snapshots, return to home position: /cam/{cam-short-name}/pos=4

For tracking I'd recommend percentage. Calculate the objects 2D percentage from center. Always start with (in your example) one down and one left if it's outside the defined center deadzone. (analyze another snapshot). Then recalculate the percentage from center and compare it to the original percentage from center. Then apply an approximated number of movements as a function of the percentage delta (using a minimum of 0 and a maximum of (user defined).

i.e. Object was originally 20%down & 10%left. Now is 10%down and 0%left so apply 1 Down and 0 Left movements.
or
i.e. Object was actually further away from center (because it moved), so apply (max) movements.

If you have to switch direction (object was left of center. is now right of center((&outside of dead zone)), revert back to 1 movement.

It sounds so easy it's basically writing its-self! 😅
🤣🤣🤣

classObject added a commit to classObject/bi-aidetection that referenced this issue Sep 23, 2020
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