get the inflection points of a contour

6 ビュー (過去 30 日間)
Sylvain Ard
Sylvain Ard 2020 年 6 月 25 日
回答済み: Sylvain Ard 2020 年 6 月 30 日
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 件のコメント
Kanika Gupta
Kanika Gupta 2020 年 6 月 25 日
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 2020 年 6 月 25 日
I have already tested these solutions but they're don't work with my example, the result is too bad with every filtering method

サインインしてコメントする。

回答 (2 件)

darova
darova 2020 年 6 月 28 日
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 2020 年 6 月 30 日
finally I succeeded with the function approxPolyDP of OpenCV not Matlab function

カテゴリ

Help Center および File ExchangeSmoothing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by