Ask Your Question

Revision history [back]

Possible bug in distanceTransform if you use CV_DIST_MASK_PRECISE

Hi,

currently I'm wirting on my OpenCV code here and I noticed some weird behaviour of my data processing. I looked into it and it seems that if you use

cv::distanceTransform(copy, copy, CV_DIST_L2, CV_DIST_MASK_PRECISE);

which results in [Felzenszwalb04] instead of [Borgefors86] there are wrong values introduced in the Mat after a given size (it starts at 4098 I think). The pattern looks quite regular so it's likely some memory access problem.

I provide some sample code at http://pastebin.com/UNwMF8uU demonstrating the issue.

Possible bug in distanceTransform if you use CV_DIST_MASK_PRECISE

Hi,

currently I'm wirting on my OpenCV code here and I noticed some weird behaviour of in my data processing. I looked into it and it seems that if you use

cv::distanceTransform(copy, copy, CV_DIST_L2, CV_DIST_MASK_PRECISE);

which results in [Felzenszwalb04] instead of [Borgefors86] there are wrong values introduced in the Mat after a given size (it starts at 4098 I think). The pattern looks quite regular so it's likely some memory access problem.

I provide some sample code at http://pastebin.com/UNwMF8uU demonstrating the issue.