The hausdorff distance is not zero even when 2 same images are passed
I am passing 2 same images in hausdorff and shapeContextDistanceExtractor to calculate distance. We are expecting the answer to be zero since the images are same but we are getting a non-zero value. Can somebody please explain why.
// Hausdorff Distant Extractor
Ptr<HausdorffDistanceExtractor> model = createHausdorffDistanceExtractor();
dist = model->computeDistance(c1, c2);
I am passing 2 images and extracting the points using samplecounters. Here c1 and c2 are the vector of countour points which are passed to the computeDistance function. The 2 images that I pass are same yet the distance I am getting in dist is non-zero. Please help.
this means, your contours are not identical.
please check. (e.g.
cerr << Mat(c1) << endl << Mat(c2) << endl;
)are you using jpg images ? (lossy compression, just don't)
Yes. I am using jpg images. If not jpg, what images should I use?
png, bmp, any non-lossy format