Smooth region contour by taking local average (ROI)
Ältere Kommentare anzeigen
Hi guys!
I have created a program in matlab that detects edges by using adapthisteq and im2bw, working actually quite well. I thereby obtain a (binary mask) contour that is quite zigzag.
Now I want to replace the almost rectangular shapes in the image by smoother versions by taking local average of 30 or something px and replace the segment by a straight line with the average x-value (all lines are perpendicular to the x-axis).
I thought it might be possible to select a local region using imrect() and perform the operation therein, then calculate the line separation distance (= the value I actually need).
Can someone point me into the right direction or help me out with a code snipplet (especially how to create the average on the mask matrix in x-direction)?
I don't want to smooth the image too much first (which I tried) as it gives me a bad alignment with the original edge.

1 Kommentar
Christoph
am 17 Jan. 2013
Antworten (0)
Kategorien
Mehr zu Contour Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!