how can i count square objects are in the image ?

답변 (1개)

Image Analyst
Image Analyst 2020년 12월 1일

0 개 추천

See my attached shape recognition demos.

댓글 수: 2

Thank you very much for your interest.
But this solution seems complicated to me or difficult for me to understand .
Is there an easier solution than this by Morphology and logical operations like (imerode ,imdilate,imclose
,imopen ..... ) and the output is a number of squares objects only ?
Thank you again for your interest.
Depends on how robust you want to be. The method many/most people use is to find the centroid, then find the boundary, then find the distance from the centroid to each boundary point. Then call findpeaks() to count the number of peaks. So that's not too difficult to understand. One of my demos does it that way.
Did you try to adapt it to use your image instead of the synthetically generated shapes that I created in the demo? If not, why not? Just delete the part where I create the shapes and replace it with a call to imread().

댓글을 달려면 로그인하십시오.

제품

릴리스

R2017a

질문:

2020년 11월 30일

댓글:

2020년 12월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by