How to implement TrackerSamplerPF in OpenCv 3.3

asked 2017-09-21 10:30:42 -0500

Vince Li gravatar image

updated 2017-09-21 10:32:36 -0500

I have tried different ways to implement the TrackerSamplerPF in OpenCV 3.3. But finally failed, and I can't find the sample from the official document. Thanks a lot.

edit retag flag offensive close merge delete


I cannot find any sample. I don't know method but I found two bugs... looking for third...

LBerger gravatar imageLBerger ( 2017-09-21 16:44:54 -0500 )edit

Thanks for comment, I also find bugs when i implement TrackerSamplerPF, So does it means the method have something wrong in itself?

Vince Li gravatar imageVince Li ( 2017-09-22 01:07:33 -0500 )edit

Do you use window or linux?

LBerger gravatar imageLBerger ( 2017-09-22 06:34:15 -0500 )edit

I use windows 10, Visual studio 2015 &Opencv3.3. Thanks,

Vince Li gravatar imageVince Li ( 2017-09-22 23:43:27 -0500 )edit

can you reproduce this on your configuration?

LBerger gravatar imageLBerger ( 2017-09-23 01:13:01 -0500 )edit

Actually, I was failed to reproduce this on my configuration for many times, and I followed the below method in this website:

and with the code in this website, i got the same ERROR:

OpenCV Error: Assertion failed (0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows) in cv::Mat::Mat, file C:\OpenCV\source\modules\core\src\matrix.cpp, line 477

I don't know that is the method wrong or the internal bug in the TrackersamplerPF in opencv 3.3. Thanks

Vince Li gravatar imageVince Li ( 2017-09-23 01:32:46 -0500 )edit

Have you try this code in your program? If you can reproduce results it would be helpfull to solve TrackerSamplePF bugs

LBerger gravatar imageLBerger ( 2017-09-23 01:58:56 -0500 )edit

yeap, I tried this code, and I got the same error, but I failed to fixed this bug after several efforts. Thanks

Vince Li gravatar imageVince Li ( 2017-09-23 02:12:03 -0500 )edit

You cannot fixed this bug. You can avoid it change _std.rows in _std.cols here

and change this line in

int posMax[2];
minMaxIdx(_logweight, 0, &max_element,0,posMax);
Mat_<double> maxrow=_particles.row((int)posMax[1]);

But there is another bug and I don't know where...

LBerger gravatar imageLBerger ( 2017-09-23 02:22:35 -0500 )edit

Thanks, I can't find other bug either. So , maybe there are someone who have successfully implemented this methods. I hope I can find other substituted method.

Vince Li gravatar imageVince Li ( 2017-09-25 02:22:53 -0500 )edit