I have an binary image containing the contours of some superpixels. I want to overlay this image on top of the original image but the contour lines are so thick that its hard to see what is inside the superpixels?
What would be a good way to narrow the contour lines of the superpixels down to a thickness of 1 pixel at maximum?
I tried to use opencv's erode
function with the standard 3x3 kernel but the result looked poorly (see image b) ). One cannot see the contours of the superpixels anymore. Has someone a better idea?
I was thinking of non-maximum suppression, but that only works if the pixels have more than two values such that a gradient can be computed ...
a) Raw image displaying contour lines of superpixels
b) Eroded image, contour lines are erased as well
Edit:
c) Image after thinning using Zhang-Suen's & Guo-Hall's algorithm