imfindcircles giving the wrong center point co-ordinates

조회 수: 1 (최근 30일)
Optical_Stress
Optical_Stress 2017년 4월 7일
Hi,
I'm trying to run i'm findcircles to detect the (x,y) of the circle. My code is:
imageFile = [Directory,samples(2).name]; % Returns an image with a disk
SS = 0.89
R=[20 25]
imshow(imageFile)
imageFile=imread(imageFile); % Returns an array of the image
[centers, radii] = imfindcircles(imageFile,R,'ObjectPolarity','Bright','Method','TwoStage','Sensitivity',SS);
However, it returns the following output:
x y
855.256156864934 144.357353529456
864.922986956490 149.085194829211
These results are quite close, but they are not at the center. The radius is given. I plan on using the radius to then determine the the position of the disk within the image array (i.e. the grid of array values that represent the disk). This is an image:
I have already tried decreasing the sensitivity but this did not work. It doesn't matter what is done to the image so long as the correct center and radius (should be 22 pixels - this has come out fine) is determined.
I have created a loop to process multiple images. But it fails because imfindcircles returns more than one center value (they're also wrong) so the matrix fills up faster because i'm receiving more than 1 result per image. My other images contain circles where the black and white patterns on the circle are swapped.
Any ideas would be appreciated.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by