Regionprops vs. imfindcircles

조회 수: 1 (최근 30일)
KatherineL
KatherineL 2020년 3월 25일
Hello, I want to detect circles in a live video and I manage to do that with a while-loop. When using imfindcircles(), the circles' center are in order of strength, the most likely circles is the first one and so on. I am wondering how regionprops outputs its regions. It finds more circles than I need, so I would like to choose which circles to use further in my code.
Short one: regionprops() finds circles, I want the 3 strongest circles. Is this possible with regionprops()?

답변 (1개)

Harikrishnan Balachandran Nair
Harikrishnan Balachandran Nair 2021년 8월 17일
From my understanding, you want to know if 'regionprops' can be used to extract the strongest three circles from a frame.
The 'regionprops' function returns , as a structure or table, the measure for the set of specified properties, for all the connected components in the binary image.It can also return the 'PixelList' for each connected component, centroid, boundingbox etc .You can sort the structure with respect to the measure of property of interest, and plot the pixels in the corresponding 'n' objects which have the highest value for the specified property. Alternatively, you can use the 'bwpropfilt' function to directly extract the 'n' objects from the binary image, which have the largest values for the specified attribute. The following line of code does the same.
bw2=bwpropfilt(bw,attrib,n);

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by