RANSAC Algorithm on dense points

2 ビュー (過去 30 日間)
Kah Seng
Kah Seng 2022 年 10 月 4 日
回答済み: Matt J 2022 年 10 月 4 日
I am trying to fit a line unto a 2D Cartesian points as shown in the image such that the line would be on the edge of the rectangle (ignoring the noisy points around the shape). I ran RANSAC algorithm with different parameters but I am unable to get the green line to be on the edge of the rectangle. (The detected line can either be the bottom or top as I understand RANSAC can only detect one line each time it is run). I understand that RANSAC runs random samples of my points so there are rare occasions where the green line would be on the edge, in such cases is there a sure way to get the line on the edge rather than using a probabilistic method?
Am I doing something wrong or are there better methods to find the linear equation of the rectangle's edge(s) ? Any help would be appreciated.

回答 (1 件)

Matt J
Matt J 2022 年 10 月 4 日
I would just histogram the y-coordinates of all the points. Then you can just use find() to get the first and last point where the histogram reaches say 98% of its maximum value.

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by