Re: Computation of curvature of 2-D curve
- From: ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx (Roger Stafford)
- Date: Tue, 21 Mar 2006 01:42:24 GMT
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
.
- References:
- Computation of curvature of 2-D curve
- From: Varun
- Re: Computation of curvature of 2-D curve
- From: Ken Garrard
- Computation of curvature of 2-D curve
- Prev by Date: Re: Can't Install X11 on Mac OS X 10.4.4
- Next by Date: Re: neural net classification problem
- Previous by thread: Re: Computation of curvature of 2-D curve
- Next by thread: Curve fitting with 'semilog'
- Index(es):
Relevant Pages
|