spline for corner object
古いコメントを表示
I have a contour that I have extracted important points of it based on detectHarrisFeatures. Now I need to connect these points with spline using cscvn function to get the primary contour. But, points fed into cscvn function need to be in a order but the the output points of detectHarrisFeatures are not in order. sort function does not work as its the closed contour and the numbers are not in ascending/descending order. I've attached main image that I've extracted the contour and corner points.

採用された回答
その他の回答 (1 件)
David Goodmanson
2022 年 7 月 24 日
HI Mehri,
try sorting by angle around a point in the center:
x0 = 350;
y0 = 325;
theta = atan2(y-y0,x-x0);
[~,ind] = sort(theta);
xnew = x(ind);
ynew = y(ind);
カテゴリ
ヘルプ センター および File Exchange で Splines についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!