I have a binary image that has a non-smoothing contour. As prior information, the contour has to be smooth. Could you suggest to me the solution to smooth the contour as the below image in python? Thanks all
Asked
Active
Viewed 1,399 times
1
-
It is best to smooth the contour *before* binarizing. Simply apply a low-pass filter, preferably a Gaussian. The larger the filter kernel, the smoother the contour will be. – Cris Luengo Dec 03 '18 at 16:21
-
Thanks for your suggestion. However, the binary comes from the probability map. For example, prob background = 0.1 at a pixel then its prob foreground is 0.9. If we smooth the prob, does it change the decision? – John Dec 03 '18 at 16:49
-
1Yes, of course it changes the decision. But that is what you do when you smooth the boundary of the binary shape too. You change the decision for pixels near the boundary so that the boundary is smoother. – Cris Luengo Dec 03 '18 at 16:55
-
Great solution. So, If my shape is 2x256x256 where a concatenation of 256x256 prob map of background and background. So, I have to apply the gaussian filter two times. Am I right? – John Dec 03 '18 at 17:08
-
1Yes, that's right. – Cris Luengo Dec 03 '18 at 17:35