get the inflection points of a contour

5 views (last 30 days)
Sylvain Ard
Sylvain Ard on 25 Jun 2020
Answered: Sylvain Ard on 30 Jun 2020
Hello,
I want to find the inflexion points of a contour made by adjacents pixels.
An example of contour can be find here : http://sylvain-ard.fr/temp/cnt.csv
It must delete noise (small inflexions).
Please help me
Thank you
The image of the example contour is here :
  2 Comments
Kanika Gupta
Kanika Gupta on 25 Jun 2020
I think you can find a solution here :
  1. https://www.mathworks.com/matlabcentral/answers/131760-how-to-find-contour-inflection-points?s_tid=answers_rc1-2_p2_MLT
  2. https://www.mathworks.com/matlabcentral/answers/385053-how-to-find-a-number-of-inflection-points-in-a-contour?s_tid=answers_rc1-1_p1_MLT
Sylvain Ard
Sylvain Ard on 25 Jun 2020
I have already tested these solutions but they're don't work with my example, the result is too bad with every filtering method

Sign in to comment.

Answers (2)

darova
darova on 28 Jun 2020
Here is a start:
  • use boundary function to find (x,y) coordinates of your contour (and order)
  • Smooth the curve: reduce points and interpolate the data using this 3d interpolation
  • use cross product to find inflection points
simple example
x = 0:0.2:10;
y = sin(x).*x.^2;
dx = diff(x)';
dy = diff(y)';
v0 = dx(2:end)*0;
a1 = [dx(1:end-1) dy(1:end-1) v0];
b1 = [dx(2:end) dy(2:end) v0];
n = cross(a1,b1,2);
ix = find( diff(sign(n(:,3))) );
plot(x(ix),y(ix),'or')
line(x,y)

Sylvain Ard
Sylvain Ard on 30 Jun 2020
finally I succeeded with the function approxPolyDP of OpenCV not Matlab function

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!