Circle Detection using Hough Transform
Find circles using circular Hough transform
Syntax
centers = imfindcircles(A,radius)
[centers,radii] = imfindcircles(A,radiusRange)
[centers,radii,metric] = imfindcircles(A,radiusRange)
[___] = imfindcircles(___,Name,Value)
Description
centers = imfindcircles(A,radius) finds the circles in image A whose radii are approximately equal to radius. The output, centers, is a two-column matrix containing the (x,y) coordinates of the circles centers in the image.
[centers,radii] = imfindcircles(A,radiusRange) finds circles with radii in the range specified by radiusRange. The additional output argument, radii, contains the estimated radii corresponding to each circle center in centers.
[centers,radii,metric] = imfindcircles(A,radiusRange) also returns a column vector, metric, containing the magnitudes of the accumulator array peaks for each circle (in descending order). The rows of centers and radii correspond to the rows of metric.
[___] = imfindcircles(___,Name,Value) specifies additional options with one or more Name,Value pair arguments, using any of the previous syntaxes.
Find circles using circular Hough transform MATLAB Documentation Link: https://www.mathworks.com/help/images...
clc
clear all
close all
warning off
t=0:0.001:2*pi;
x=cos(t);
y=sin(t);
plot(x,y);
axis square
pause(1);
hold on;
t=0:pi/20:2*pi;
x2=cos(t);
y2=sin(t);
t=0:0.001:2*pi;
for i=1:length(x2)
x3=x2(i)+cos(t);
y3=y2(i)+sin(t);
plot(x3,y3);
axis square
hold on;
pause(0.1);
i=i+1;
end
Video Explanation
No comments