
imfindcircles not giving answer
조회 수: 3 (최근 30일)
이전 댓글 표시
I want to find circles in a image,i used imfindcircles ,and used example in it which gave good result,but if i use my own image i am not getting the result,kindly assist
rgb=imread('sample6.bmp');
%rgb=~rgb;
[centers, radii] = imfindcircles(rgb,[10 55],'ObjectPolarity','bright')
imshow(rgb)
viscircles(centers, radii,'EdgeColor','b');
댓글 수: 0
답변 (1개)
Jayanti
2025년 5월 12일
Hi Pat,
Please refer to the following updated code that successfully detects circles in the provided image:
[centers, radii] = imfindcircles(rgb,[10 55],'ObjectPolarity','dark','Sensitivity',0.91)
In this case, the circular object appears darker than the background, so I set the 'ObjectPolarity' to 'dark'. The 'sensitivity' parameter in imfindcircles controls how aggressively the algorithm searches for circles. Increasing it from the default value of 0.85 to 0.91 improves detection in this image, though it may also increase the chance of false positives with very high value. With this adjustment, the circles are detected correctly.
Below is the output image I am getting:

To get more information on the name value arguments of this function please refer to the below link:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!