I'm trying to run i'm findcircles to detect the (x,y) of the circle. My code is:
imageFile = [Directory,samples(2).name];
SS = 0.89
[centers, radii] = imfindcircles(imageFile,R,'ObjectPolarity','Bright','Method','TwoStage','Sensitivity',SS);
However, it returns the following output:
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.