Re: Computation of curvature of 2-D curve



In article <ef2cb00.0@xxxxxxxxxxxxxxxx>, "Ken Garrard"
<ken_garrard@xxxxxxxx> wrote:

Varun wrote:

Hi,
I have a set of discrete [x,y] coordinates of a curve I obtain
after
image processing.
How do I calculate the average curvature of this curve?
Thanks

Curvature is defined as the derivative of slope with respect to arc
length. For closely spaced, smooth data you can easily estimate the
curvature using finite differencing.

dx = gradient(x);
dy = gradient(y);
curv = gradient(atan2(dy,dx)) ./ hypot(dx,dy);

If your data is noisy, then the estimate of slope will be garbage and
so will the curvature values. The hypotenuse is a poor estimate of
arc length unless the points are close together or the radius of
curvature is large. In either case you'll need to smooth the data,
estimate slope over larger intevals, fit a curve to the data and use
it's curvature, ...

Ken
--------------
You might interested in this alternate form. It works even for unevenly
spaced points in x and y. Let x and y be column vectors of the same
length with at least three points. Curvature to the left will be positive
and to the right, negative.

xe = [x(3);x;x(end-2)]; ye = [y(3);y;y(end-2)];
dx = diff(xe); dy = diff(ye);
dxb = dx(1:end-1); dyb = dy(1:end-1);
dxf = dx(2:end); dyf = dy(2:end);
d2x = xe(3:end)-xe(1:end-2); d2y = ye(3:end)-ye(1:end-2);
curv = 2*(dxb.*dyf-dyb.*dxf)./ ...
sqrt((dxb.^2+dyb.^2).*(dxf.^2+dyf.^2).*(d2x.^2+d2y.^2));

This is based on the idea that the curvature of a circle running through
three points is equal to four times the area of the triangle formed by
them, divided by the product of its three sides.

As Ken has indicated, formulas like this based on three nearby points
are very sensitive to noise in the data, and they work better if the
points are not spaced too closely together.

(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford
.



Relevant Pages

  • Re: Exposure function
    ... I scrapped the old function I had, because the slope of the linear part ... again that in semilog-x scale the curve looks quite a bit like sigmoid. ... I probably need a third parameter for the curvature of the ...
    (rec.photo.digital)
  • Re: Fast maximum curvature calculation for a 3d bezier curve
    ... Its a cubic curve. ... Sometimes people use the term "curvature" to mean ... About the subdivision of the cubic curve using a test ...
    (comp.graphics.algorithms)
  • Re: Fast maximum curvature calculation for a 3d bezier curve
    ... Its a cubic curve. ... Sometimes people use the term "curvature" to mean ... About the subdivision of the cubic curve using a test ... Consider the same analysis for a quadratic Bezier curve. ...
    (comp.graphics.algorithms)
  • Re: Fast maximum curvature calculation for a 3d bezier curve
    ... Its a cubic curve. ... Sometimes people use the term "curvature" to mean ... About the subdivision of the cubic curve using a test ... I am going to try to convert to quadratics using the following. ...
    (comp.graphics.algorithms)
  • Re: Approx. Curvature from Three points in space
    ... I tried to look up information about curvature of curves (i.e. 1- ... dimensional manifolds) in n-dimensional spaces but did not find any ... I would like to approximate the curvature of the curve at some ... where v1 and v2 denote unit tangential and normal vectors and s the arc ...
    (sci.math)