MATLAB Answers

0

Find all rectangle(or another shape like circle, square, and triangle) in image

Asked by Junwon Park on 15 Jun 2018 at 1:33
Latest activity Edited by Junwon Park on 15 Jun 2018 at 5:26

Hi.

I want to fine corners of rectangle in images for tracking changing coordination. For this, i think that find edge and corners of rectangle first.

How to find all rectangle's outline.

I attached 2 images. The attached image have 40 rectangles. I want to get "40". However, the image have noise. How to i get target's exactly number.

Please, help me.

Thanks.

.

Noise Rectangle 1

Noise Rectangle 2

  0 Comments

Sign in to comment.

1 Answer

Answer by Image Analyst
on 15 Jun 2018 at 2:04
 Accepted Answer

Find the red stuff using color segmentation. Then erode the mask to separate the squares. Then examine each blob to see how many vertices it has and determine if it's a square, triangle, pentagon, or whatever. See attached demo.

  0 Comments

Sign in to comment.


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today