필터 지우기
필터 지우기

Smooth region contour by taking local average (ROI)

조회 수: 5 (최근 30일)
Christoph
Christoph 2013년 1월 17일
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
Christoph
Christoph 2013년 1월 17일
I just want to add that even if this is not the best way t do it, it would be quite important to process the image in this way so the results can be compared with results we obtained with a proprietary product (that we try to 'emulate' for a lab exercise).

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by