tryolabs / norfair

Lightweight Python library for adding real-time multi-object tracking to any detector.
https://tryolabs.github.io/norfair/
BSD 3-Clause "New" or "Revised" License
2.41k stars 247 forks source link

Object Placement using Homography #320

Open sarthakg2002 opened 6 months ago

sarthakg2002 commented 6 months ago

I am working on adding object placement in video which is anchored to scene so if the camera performs any PTZ the position of the object is maintained.

I was wondering if it is possible to tweak the norfair camera_motion module to achieve the above. I'm aware that norfair only does Pan and tilt detection so i'll be working on implementing zoom part separately. Also wanted general guidance on how i can use the library for my purpose.

aguscas commented 6 months ago

Norfair also allows for zooms since homographies also contemplate zooms. You can use the HomographyTransformationGetter class for the transformation getter of our MotionEstimator for that purpose. There is an example in our camera_motion demo which might be helpful.

sarthakg2002 commented 6 months ago

Is it possible to use the norfair model on top of some other models than the recommended ones. Specifically i want to use the Segment-anything (SAM) model to get a mask of a surface (not a object) which can also give the bounding box for the same and use the Homographymethod to place an object there and then track it throughout the video. Will the yolo_dectections_to_norfair_dections be somewhat similar?