Finding circle in an image

2 ビュー (過去 30 日間)
Damian Wierzbicki
Damian Wierzbicki 2017 年 7 月 19 日
回答済み: Image Analyst 2017 年 7 月 19 日
Hi guys. I have an image ( attached ) and I'm trying to find the location of the centre of the hole ( circle ) that is apparent in that image. I've been using imfindcircles ( tried different sensitivities ) with no success, probably due to that light reflection ( ? ) that is visible in the hole. Can anyone propose how to resolve that issue ? Thank you.

回答 (1 件)

Image Analyst
Image Analyst 2017 年 7 月 19 日
I'd try to zero out the bright stuff, then threshold and call regionprops() and compute the circularity. Here's a start:
mask = grayImage > 200;
grayImage(mask) = 0;
binaryImage = grayImage < 50; % or whatever works.
labeledImage = bwlabel(binaryImage);
props = regionprops(labeledImage, 'Area', 'Perimeter');
allAreas = [props.Area];
allPerims = [props.Perimeter];
circularities = allPerimeters .^ 2 ./ (4 * pi * allAreas);
roundBlobIndexes = find(circularities < 2);
roundBlobs = ismember(labeledImage, roundBlobIndexes);
imshow(roundBlobs);

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by