I know this had been asked some times all over the internet.
OpenCV Error: Assertion failed (type == src2.type() && src1.cols == src2.cols &&
(type == CV_32F || type == CV_8U)) in cv::batchDistance,
file D:\OpenCV3\Sources\modules\core\src\stat.cpp, line 3606
So there is a mismatch between the types of the matrices in batchDistance. A lot of people are suggesting some hack like copy-pasting the image into another one, but is there, as of Nov.2014, a solution?
Just to make sure, I took tens of pictures of a scene with the same camera every ~5-10s, making sure to move the scene a little bit to generate a different image every time. All of the images are of the BMP format and they should have no difference in their "meta-characteristics" (size, format, encoding, greyscale, etc.). They are all loaded with imread. But still, some images just won't make it through the batchDistance function. The model object to be found by the program stays easily visible through each frames.
So for now I will "do the hack" but I will try to solve it properly so if anyone has an idea...
Thanks :)