This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Measuring the Radius of a Roll of Tape

This example shows how to measure the radius of a roll of tape, which is partially obscured by the tape dispenser. Utilize imfindcircles to accomplish this task.

Step 1: Read Image

Read in tape.png.

RGB = imread('tape.png');

hTxt = text(15,15,'Estimate radius of the roll of tape',...

Step 2: Find the Circle

Find the center and the radius of the circle in the image using imfindcircles.

Rmin = 60;
Rmax = 100;
[center, radius] = imfindcircles(RGB,[Rmin Rmax],'Sensitivity',0.9)
center =

  236.9291  172.4747

radius =


Step 3: Highlight the Circle Outline and Center

% Display the circle

% Display the calculated center
hold on;
hold off;

message = sprintf('The estimated radius is %2.1f pixels', radius);

Was this topic helpful?