|
"Mario " <nospam@yahoo.com> wrote in message <fqgmnf$oin
$1@fred.mathworks.com>...
> Hi.
> I have a list of points describing the outlines points of a
> shape. I'd want to find the points of maximum curvature. To
> do that I should calculate the tangential angle of each
> point on the shape outline ad from these angles I'll
> calculate the curvature by differentiation. I was wondering
> if there's any matlab function to solve this problem.
> Thanks in advance.
>
> Mario
----------
If your outline points are specified with sufficient accuracy, you can calculate
the curvature of a circumscribing circle through each three successive points
as an approximation to the curvature at the middle of these. That is, if P1,
P2, and P3 are three successive outline points given as two-element row or
column vectors in terms of their x,y coordinates, then do this:
a = norm(P2-P1); % Distance from P1 to P2
b = norm(P3-P2); % Distance from P2 to P3
c = norm(P3-P1); % Distance from P1 to P3
cv = sqrt((a+b+c)*(b+c-a)*(c+a-b)*(a+b-c))/(a*b*c); % Curvature
Then cv is the curvature (the reciprocal of the radius) of a circle through the
points P1, P2, and P3, and as such constitutes an approximation to the
curvature at the middle point, P2.
Using this technique avoids the problem of dealing with points where the
slope of the tangent line, dy/dx, becomes very large or infinite.
Roger Stafford
|