SuTanTank / BundledCameraPathVideoStabilization

Bundled Camera Path Video Stabilization [SIGGRAPH 2013]
BSD 2-Clause "Simplified" License
42 stars 13 forks source link

Bug report #4

Closed MSKTHU closed 3 years ago

MSKTHU commented 3 years ago

I used your code on MATLAB 2019a and it crashed since nMore equals to 0 when calling getMorePoints at line 53 of GetTracks.m. Error message tells that pNew = pNew.selectStrongest(nMore) at line 85 of GetTracks.m should have a positive input. So I added the three line

if nMore == 0
  nMore = 1;
end

at line 77 and it runs. However, I don't know if anything will be wrong if I limit nMore no less than 1.

SuTanTank commented 3 years ago

It's a bug. nMore is just a rough estimation of how many more points should be added to tracking. If nMore is 0, which means no more point is needed, so maybe just skipping the following lines to avoid crashing is the fix.