Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding the concavness pixel/point in binary map using Matlab

Given an binary mask with an object in Matlab. I am going to find the concavity point of the object boundary. The concavity point I mean here is the deepest concavity point with respect to the Euclidean distance to the convex hull 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 concavity region B_1 I draw three lines perpendicular to the chord K_1, the deepest concavity point is the middle one since it has the largest length.

enter image description here

Anyone have efficient way/code to do that? Thanks.

Another figure below gives an example with the convex hull, where the red dot indicates the valid concavity point.

enter image description here

like image 806
Cheung Avatar asked Apr 28 '11 22:04

Cheung


1 Answers

Efficient is relative...

How about computing the convex hull (there are standard algorithms for it) and then shrinking it until it is completely inside the object boundaries. The last point touching is your desired concavity point.

Alternative strategy:

  • calculate convex hull
  • find all differences between convex hull and object boundary (have to be straight lines, K1 K2 K3 in your case)
  • for every line, rotate image such that line is horizontal
  • take the lowest pixel of the object boundary below the line
like image 64
groovingandi Avatar answered Nov 15 '22 08:11

groovingandi