OpenCV => 3.2.0
Operating System / Platform => ios 5/6/7
Compiler => Xcode 8.2.1
OpenCV Error: Assertion failed (type == srcB.type() && srcA.size() == srcB.size()) in mulSpectrums, file /Users/alberli/Documents/git/opencv_contrib_track/modules/core/src/dxt.cpp, line 3546
I used KCF, TLD, MIL, BOOSTING, MEDIANFLOW.
But the KCF and BOOSTING crash sometimes. Probably crash 3 times when run 5 times.
The code,
- (void)createKCF {
trackerKCF = Tracker::create( "KCF" );
bInit = true;
}
- (void)processImage:(cv::Mat&)image {
// The KCF only support 3 channels, so i convert it to BGR.
Mat bgr;
cvtColor(image, bgr, CV_BGRA2BGR);
image = bgr;
// When i changed the select bound, it will init.
if (bInit) {
if(boundInit.height == 0 || image.rows==0 || image.cols==0)
return;
trackerKCF->init(image,boundInit);
boundSelect = boundInit;
bInit = false;
}
trackerKCF->update(image, boundSelect);
rectangle( image, boundSelect, Scalar( 255, 0, 0 ), 2, 1 );
}