is there a way to sort rectangle to 4 lines

1 回表示 (過去 30 日間)
Michael scheinfeild
Michael scheinfeild 2014 年 7 月 9 日
コメント済み: David Young 2014 年 7 月 11 日
i want to sort the points to 4 groups upper line lower line left and right please dont use hough tranbsform
m=zeros(200,300);
m=logical(m);
m(50,30:190)=1;
m(100,30:190)=1;
m(50:100,30)=1;
m(50:100,190)=1;
figure,imshow(m)
  1 件のコメント
David Young
David Young 2014 年 7 月 11 日
I'm curious: what's the reason for avoiding the Hough transform?

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

回答 (1 件)

Image Analyst
Image Analyst 2014 年 7 月 10 日
Uh yeah. Why not just do
topLine = [50,30; 50, 190]; % The x,y coordinates where each row is one endpoint.
bottomLIne = [100,30; 100, 190];
leftLine = [50,30; 100,30];
rightLine = [50,190; 100,190];
If you don't mean that , then you'd better explain specifically what you mean by "4 groups".
  2 件のコメント
Image Analyst
Image Analyst 2014 年 7 月 10 日
Michael's "Answer" moved here since it's not an Answer to the original problem.
Not that, I mean here is the image:
Image Analyst
Image Analyst 2014 年 7 月 10 日
I can think of a few methods. What are you thinking of? You could use RANSAC or use traditional image processing methods (like convhull, activecontour, morphological closing, etc.) and try to extract out upper, lower, left, and right parts and then call polyfit().

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

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by