Finding a pixel / concave point in a binary map using Matlab

Given a binary mask with an object in Matlab. I am going to find the concavity point of the boundary of the object. The concavity point that I have in mind here is the deepest concavity point relative to the Euclidean distance to the convex chords K_1, K_2 and K_3 in the concavity regions B_1, B_2, B_3, respectively. The red dot indicates the concavity point I want to find, where in the concavity area B_1 I draw three lines perpendicular to the chord K_1, the deepest concave point is the middle one, since it has the longest length.

enter image description here

Who has an efficient way / code for this? Thanks.

The following figure shows an example with a convex hull, where the red dot indicates the actual concavity point.

enter image description here

+6
source share
1 answer

Effective Relative ...

How about computing a convex hull (there are standard algorithms for it), and then compress it until it is completely inside the boundaries of the object. The last touch touches your desired concave point.

Alternative strategy:

  • compute convex hull
  • find all the differences between the convex hull and the boundary of the object (there should be straight lines, K1 K2 K3 in your case)
  • for each line, rotate the image so that the line is horizontal.
  • take the bottom pixel of the object border below the line
+4
source

Source: https://habr.com/ru/post/886929/


All Articles