Ask Your Question
0

Some image from the same series load, others don't (assertion error)

asked 2014-11-11 12:43:10 -0600

Doombot gravatar image

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 :)

edit retag flag offensive close merge delete

Comments

Ok in my case, this was a stupid error. For the faulty images, there were some regions where no keypoint descriptors were detected. So my program tried to match some nonexistent keypoint. -_- I will delete the question.

Doombot gravatar imageDoombot ( 2014-11-13 08:36:55 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-11-13 08:37:46 -0600

Doombot gravatar image

Well I will keep it there so it might help someone someday actually.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-11-11 12:43:10 -0600

Seen: 474 times

Last updated: Nov 11 '14