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 view (last 30 days)
Show older comments
Accepted Answer
KALYAN ACHARJYA
on 2 Mar 2021
Edited: KALYAN ACHARJYA
on 2 Mar 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 Comments
More Answers (0)
See Also
Categories
Find more on Image Filtering and Enhancement in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!