cloud-annotations/object-tracking-js

Retrieve scaled rectangle on .next update (feature request)

periman2 opened this issue · 2 comments

First of all, I'd like to say a huge bravo for the creation of this library. It's by far the fastest and most reliable object tracking algorithm for the web and I've used tons so far.

I would like to know if it would be possible for the rectangle on the update method to have the information if the object is moving towards or away from the camera and not just the x,y direction translation. Basically scaling the rectangle also instead of only moving it in the picture according to the size change of the object in the next frame. I'm currently using this library: speedy-vision to try and find the scale factor of the cut rectangle area in the next frame using keypoints and then creating a new tracker to get the updated result every few frames with a larger/smaller starting rectangle. This is quite a performance overhead but it does work relatively reliably and can track objects that are coming towards and away from the camera for many seconds or even minutes in videos. I'm simply wondering if it could be implemented natively.

Thank you 😊 Unfortunately, I don’t think this feature is easily possible. The algorithm used is only tracking the pixels within the selected area and isn’t able to detect size changes

Thanks for the quick response. If that's the case then I'll be using my workaround method. It's still faster than anything else even counting the performance overhead!