W
W
wickedwannabe2017-03-13 18:09:55
Programming
wickedwannabe, 2017-03-13 18:09:55

How to decide on the type of shape (square or circle) in a binary image?

Greetings. There is an array of zeros and ones representing a binary image. It can show geometric shapes. Example :
000000000000000
000111111000000
000111111000000
000111111000000
000111111000000
000111111000000
000111111000000
00000000
At the moment, the markup of figures and the collection of parameters characterizing a geometric figure have been implemented:

  • The moments for the rows and columns of the figure are calculated (If the moments are approximately equal, then this is a symmetrical figure)
  • The ratio of the distances between the centroid of the figure and the maximum distant point of the perimeter and the minimum remote point of the perimeter (If approximately equal to 1.41, then this is a square)
  • The compactness (circularity) of Haralik is calculated (the parameter increases as the shape of the figure approaches the circle)

Based on these parameters, a simple decision tree "If-Then-Else" is made. Tell me, are there more beautiful methods for deciding on the type of figure? Now the trend is neural networks and various automata, but, unfortunately, I am not at all familiar with this topic. Doubts about the correctness arose due to additional. conditions in the problem: it is necessary to derive the probability of the correctness of the decision made, and the decision tree method does not provide such an opportunity.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
GavriKos, 2017-03-13
@wickedwannabe

The neural network will give you a probability and is great for these inputs. Smoke articles on them, starting with the simplest ones where numbers are recognized - that's your case right there.

A
Andrew, 2017-03-13
@OLS

I really like your (especially) second and third characteristics. I would propose to build a two-dimensional space from their values, calculate the probability function on it, and as a result solve the problem of a curve separating areas that are more characteristic of squares and more characteristic of circles.

A
Alexander Skusnov, 2017-03-14
@AlexSku

The Image Processing toolbox (MatLab) has a regionprops function. Example .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question