xuduo35 / STAPLE

C++ implementation of staple algorithm for object tracking.
MIT License
121 stars 48 forks source link

Incorrect template created when target close to image border. #4

Closed aoikonomop closed 6 years ago

aoikonomop commented 6 years ago

When the target is close to the image border the template created for the correlation filter and the histogram model is off, causing the tracker to drift after a few frames. This is due to the lefttopLimit and rightbottomLimit of STAPLE_TRACKER::getSubwindow, which clip subWindow and causing the aforementioned issue.

A quick solution is to pad subWindow accordingly by replicating the border pixels.

I managed to solve the problem like this, however I am not allowed to submit a PR, could I be given permission in order to share my solution? Thanks in advance

xuduo35 commented 6 years ago

Welcome to create PR for this project. It's first time for me :) Seems I already allow PR in the setting page. If you know how to make PR allow, please tell me.

xuduo35 commented 6 years ago

In my experience, I always fork project first before create a PR. But I didn't see you do the fork, I think you just clone the project. Can you try fork first?

aoikonomop commented 6 years ago

You are absolutely right, I should have forked it instead of cloning. Submitted the PR, let me know if it makes sense. Thank you!

xuduo35 commented 6 years ago

Done!