I am working with image segmentation in Matlab.
I need to find a line perpendicular to a set of points in order to calculate the maximum distance between that line and the set of points.
Here's an example of the problem:
The red point represents the concavity of the contour and that point was found from the curvature of the contour.
The black line and the green points, which are the limit of the line, were manually drawn to show the result that I am looking for.
After finding the line, the next task is to calculate the maximum distance between the line and the part of the contour highlighted in yellow.
Could anyone suggest a possible solution?