Esta página aún no se ha traducido para esta versión. Puede ver la versión más reciente de esta página en inglés.
En este ejemplo se muestra cómo medir el radio de un rollo de cinta, que el dispensador de cintas oscurece parcialmente. Utilice para realizar esta tarea.imfindcircles
Leer en .tape.png
RGB = imread('tape.png'); imshow(RGB); hTxt = text(15,15,'Estimate radius of the roll of tape',... 'FontWeight','bold','Color','y');
Busque el centro y el radio del círculo en la imagen utilizando .imfindcircles
Rmin = 60; Rmax = 100; [center, radius] = imfindcircles(RGB,[Rmin Rmax],'Sensitivity',0.9)
center = 1×2
236.9291 172.4747
radius = 79.5305
% Display the circle viscircles(center,radius); % Display the calculated center hold on; plot(center(:,1),center(:,2),'yx','LineWidth',2); hold off; delete(hTxt); message = sprintf('The estimated radius is %2.1f pixels', radius); text(15,15,message,'Color','y','FontWeight','bold');