PDF is here

I have read this PDF. But i don't know what the Invariance means in page 3 and 5. Calculation/estimation of κ is NOT invariant and Invariant to viewpoint. What's the meaning of these sayings? When i read "Invariant to viewpoint", i think it means the k value is same when rotation and translation. But after i read "Calculation/estimation of κ is NOT invariant" ,i have no idea. Then i try the code what i got here,to caculate the k value.

Code is here

And i have found that, the k value is different when shape have rotated which have the same sigma. Then i changed the sigma, k value is also different while the shape is same. When i set the sigma as 0.6667, the curvature of straight line is 1.6 not 0, why? The curvature of straight line should be zero,right? I don't why the value is 1.6. Then I tried to rotate the straight line, the curvature changed!!new value is -6.6. The papge said to find zero crossing to get concave-convex. But here curvature of straight line is not 0 is 1.6? Can somebody help me. Thank you very much!


1 Answer 1


OK, so let's look at the curvature of some standard objects.

First, a circle: $$ x(s) = \cos(s)\ ;\ \dot{x}(s) = -\sin(s)\ ;\ \ddot{x}(s) = -\cos(s)\\ y(s) = \sin(s)\ ;\ \dot{y}(s) = \cos(s)\ ;\ \ddot{y}(s) = -\sin(s)\\ $$ so the curvature is: $$ \kappa(s) = \frac{\sin(s)\sin(s) + \cos(s)\cos(s)}{(\sin^2(s) + \cos^2(s))^{3/2}} = 1 $$

Rotating the circle gives: $$ x'(s) = \cos(\theta) x(s) - \sin(\theta) y(s)\\ y'(s) = \sin(\theta) x(s) + \cos(\theta) y(s)\\ $$ so that $$ \dot{x}'(s) = -\cos(\theta)\sin(s) -\sin(\theta)\cos(s) = -\sin(\theta + s)\\ \ddot{x}'(s) = -\cos(\theta)\cos(s) +\sin(\theta)\sin(s) = -\cos(\theta + s)\\ \dot{y}'(s) = \sin(\theta)\sin(s) +\cos(\theta)\cos(s) = \cos(\theta - s)\\ \ddot{y}'(s) = \sin(\theta)\cos(s) - \cos(\theta)\sin(s) = \sin(\theta - s)\\ $$ Even thought it looks like I got a sign wrong somewhere, this will also evaluate to 1.

So, at least for a circle, the formula is rotationally invariant.

The trouble comes when you try to implement this.

function [kappa,xdot,ydot,xdotdot,ydotdot] = curvature(x,y,delta_s)
    xdot = diff([x x([1 2])])/delta_s;
    xdotdot = diff([xdot])/delta_s;
    ydot = diff([y y([1 2])])/delta_s;
    ydotdot = diff([ydot])/delta_s;

    xdot = xdot(1:length(xdot)-1);
    ydot = ydot(1:length(ydot)-1);

    kappa = (xdot.*ydotdot - xdotdot.*ydot)./sqrt(xdot.^2 + ydot.^2 + 10^9).^3;


The only way to get the "derivatives" of your parameterized curves will be to take differences. For the circle, this isn't too bad, but for more complex shapes, rotations might make these values a little different --- especially if the shapes are generated from two different sets of measurements.

For example the plot below shows:

  • The original curvature (note problem at end of range)
  • The curvature of a circle rotated
  • The curvature of a noisy circle
  • The curvature of a rotated noisy circle

enter image description here

// 25885
delta_s = .01;
s = -%pi:delta_s:(%pi-delta_s);
N = length(s);

x = cos(s);
y = sin(s);

xn = cos(s) + 0.001*rand(1,N,'norm');
yn = sin(s) + 0.001*rand(1,N,'norm');

[k,xd,xdd,yd,ydd] = curvature(x,y,delta_s);
[kn,xdn,xddn,ydn,yddn] = curvature(xn,yn,delta_s);

theta = %pi/4;
rot = [cos(theta), -sin(theta); sin(theta) cos(theta)];

all = rot*[x;y];
xdash = all(1,:);
ydash = all(2,:);

alln = rot*[xn;yn];
xdashn = alln(1,:);
ydashn = alln(2,:);

[k2,xd2,xdd2,yd2,ydd2] = curvature(xdash,ydash,delta_s);
[k2n,xd2n,xdd2n,yd2n,ydd2n] = curvature(xdashn,ydashn,delta_s);

title('Curvature of a noiseless circle')
title('Curvature of a ROTATED noiseless circle')
title('Curvature of a NOISY circle')
title('Curvature of a ROTATED NOISY circle')
  • $\begingroup$ Thank you for your comment.Curve smoothing prior to curvature measurement reduces the effects of noise. The computation starts by convolving each coordinate of the curve with a Gaussian function. X(u,σ)=x(u)★g(u,σ),Y(u,σ)=y(u)★g(u,σ).Also use derivatives of g(u,σ) to calculate the x, y derivatives Formula is here,but why the curvature of straight line is not zero. And why the curvature will change when rotation? $\endgroup$
    – kookoo121
    Commented Sep 18, 2015 at 5:40
  • $\begingroup$ If I change the code above to have x = s; y = m*s + c; then I get a zero curvature. The curvature does not change with rotation either (except for the end effects). $\endgroup$
    – Peter K.
    Commented Sep 18, 2015 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.