How to get a uniform circle?
Mostra commenti meno recenti
Hi I have the following Image of a circle I want to make its edges uniform can any body help ??

Risposta accettata
Più risposte (1)
Image Analyst
il 25 Dic 2013
Modificato: Image Analyst
il 25 Dic 2013
Get the area and the Equivalent Circular Diameter of the black spot with regionprops. Then use the FAQ or rectangle() to draw a perfect circle.
binaryImage = grayImage < 128;
measurements = regionprops(binaryImage, 'Centroid', 'EquivDiameter');
centroid = [measurements.Centroid]
diameter = measurements.EquivDiameter
% Draw circle in the overlay.
rectangle('Position',[centroid(1)-diameter/2,centroid(2)-diameter/2,diameter, diameter],...
'Curvature',[1,1],'LineWIdth', 2, 'EdgeColor', 'r');
Attached is the full blown demo. Let me know of any difficulties.
1 Commento
Christine Ak
il 26 Dic 2013
Categorie
Scopri di più su Image Filtering and Enhancement in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!