简体   繁体   中英

Problems to compute a distance map on a contour image

Is it possible to compute a distance map on a image full of contours? I used to compute distance maps on images that were previously processed with gradient magnitude filters and this worked fine, the point farthest to the boundaries obtained with the gradient was in black & the boundaries had the brightest values in the image. Now I'm trying to compute a distance map on a image that was submitted to Canny edge detection filtering and I get the exact same result as the Canny filter, except the fact that the intensity values differ (with the distance map the contours have value 1 and everything else has value 0, my Canny filter was computed on short images).

Is it normal that I can't compute a distance map on a contour image? If not, how could I do differently?

I've found the solution to my problem. After looking at this picture I realized that the issue may come from the fact that my image consists in fine bright contours on a wide dark background. I inverted the brightness intensities of my picture (so the contours became dark on a bright background) and this works well. It seems like it is necessary for distance maps to focus on bright objects instead of dark ones. If anybody could explain this regarding the code of the VTK euclidean distance map or correct me if I'm wrong, any help is welcomed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM