![ui.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/253267/ui.png)
find main area of image
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Very Determined
le 6 Déc 2019
Modifié(e) : Image Analyst
le 10 Déc 2019
Hello,
I am trying to lear how I can remove the small objects to find the main area of the image (the black section between the long lines (edges)? I want ot get rid of external and internal objects.
Thanks for the helps
![Capture.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/253254/Capture.png)
0 commentaires
Réponse acceptée
KALYAN ACHARJYA
le 6 Déc 2019
#Approximate Here
se = strel('line',3,3);
BW1=imdilate(binaryImage,se);
BW2=bwareafilt(~BW1,1);
se = strel('line',3,3);
BW3=imerode(BW2,se);
se=strel('disk',7);
result=imclose(BW3,se);
imshow(result);
![ui.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/253267/ui.png)
8 commentaires
KALYAN ACHARJYA
le 6 Déc 2019
Modifié(e) : KALYAN ACHARJYA
le 6 Déc 2019
#Try
BW = rgb2gray(imread('Capture.png'));
figure,imshow(BW)
BW = imbinarize(BW);
se = strel('line',3,3);
BW1=imdilate(BW,se);
BW2=bwareafilt(~BW1,1);
se = strel('line',3,3);
BW3=imerode(BW2,se);
se=strel('disk',7);
result=imclose(BW3,se);
figure,imshow(result);
Plus de réponses (1)
Image Analyst
le 6 Déc 2019
Looks like you're doing an edge detection for some reason. Can I see the original image? Because usually edge detection is NOT what you want to do, for exactly the reasons you are seeing. It would probably be better to use a different segmentation method, like thresholding.
4 commentaires
Image Analyst
le 10 Déc 2019
I changed the keyword to subject. It looks like the images are no longer there for some reason, perhaps because you took them down from your site.
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!