How to Detect shape and number of shapes in image

Hello Everyone, I hope you are doing well.
I have the following image i want to detect the shape in the image and count how many time shapes exist for example in image im_003002 (1) The peroidic shape which comes six time, i want to detect the shape and show the shapes exist 6 time in the image. similarly in im_005001 (1) the shapes comes 7 times
Can any body help me in this please

5 Comments

im_005001 (1).png is a piece of cake.
But the problem is im_003002 (1).png. Could you tell us how to determine the element shape?
If the element shape is given, the problem will be an another piece of cake. But if not, how we can determine, for example, if "the sine shapes exist 6 time" or "two period of the sine shape exists 3 times" is correct?
@Akira Agata The sine shapes exist 6 times,
I don't understand about your "two period of the sine shape exists 3 times"
I have attached the sample in the attachment to see the sine shapes exist 6 times in the image.
@Akira Agata the method for the left side image i want.
@Akira Agata did you understand my point?

Sign in to comment.

Answers (1)

I = imread('https://in.mathworks.com/matlabcentral/answers/uploaded_files/940849/im_005001%20(1).png') ;
I1 = imbinarize(I) ;
[y,x] = find(I1) ;
findpeaks(y)

2 Comments

@KSSV but in image i have 7 shapes it doest not work
@Image Analyst Can you please comment on this

Sign in to comment.

Categories

Products

Release

R2021b

Asked:

on 25 Mar 2022

Commented:

on 25 Mar 2022

Community Treasure Hunt

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

Start Hunting!