how do we choose circles and rectangulars

I want to determine the rectangles and circles in the picture with different colors and write numbers on them. For example, I want to see how many circles and how many rectangles there are, can you please help with the code?

Answers (1)

  • binarize image
  • use imfindcircles
I0 = imread('img1.jpeg');
I1 = im2bw(I0);
[cc,rr] = imfindcircles(~I1,[50 100]);
imshow(I1)
viscircles(cc,rr)

4 Comments

not select all circles, necessary about rectangulars
i did my best
thanks, you are good :)

This question is closed.

Asked:

on 23 Jun 2020

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!