how to extract the area of highlighted circle from the original image? I don't want to include part 2 area. I have attached original file along with the highlighted file
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Akzeptierte Antwort
KALYAN ACHARJYA
am 2 Mär. 2021
Bearbeitet: KALYAN ACHARJYA
am 2 Mär. 2021
This one:
#Step 1: Morphological Operation to remove those unwanted Region (You may avoid Morpho operation. Please see the difference in axex lengths and centroid without using morpho operation)
bwImage=imread(.....)
se=strel('disk',60);
BW1=imerode(bwImage,se);
BW2=imdilate(BW1,se);
figure,imshow([bwImage,BW2]);
Step 2: Get the circles (Get the properties using regionprops function and Draw circles using viscircles)
figure,imshow(bwImage);
hold on;
stats= regionprops(BW2,'Centroid','MajorAxisLength','MinorAxisLength')
centers=stats.Centroid;
diameters = mean([stats.MajorAxisLength stats.MinorAxisLength],2);
viscircles(stats.Centroid,diameters/2,'Color','b');
Result:
Hope it Helps!
Kalyan:)
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Filtering and Enhancement finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!