Morphological Transformation, remove border border of a closed image

1 次查看(过去 30 天)
Hello
I need to remove the upper border (red highligth) of this binarized image without affecting the bottom section, i haven't been able to figure out exactly which functions of the Image Processing Toolbox could help me.

采纳的回答

Mahesh Taparia
Mahesh Taparia 2020-3-27
Hi
Using morphological operations and connected components algorithm, the problem can be solved with the minor loss of bottom pixels.For example:
a=imread('imag.jpeg');
figure;imshow(a)
se = strel('line',8,90);
eroded = imerode(a,se);
b=logical(eroded);
st=regionprops('Table',b(:,:,1),'Area');
m=maxk(st.Area,2);
biggest = bwareafilt(b(:,:,1),[m(2) m(1)]);
figure;imshow(biggest)
dil=imdilate(biggest,se);
figure;imshow(dil)
The above code results in the below image. You can try with some other parameters of morphological processing and check if it will be more clear.
Hope it will helps.
  1 个评论
Daniel Tofino
Daniel Tofino 2020-3-29
Thank you,
I obtained similar results using:
a=imread('imag.jpeg');
figure;imshow(a)
se = strel('rectangle',[4 3]);
open = imopen(a,se);
figure;imshow(open)

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by