フィルターのクリア

Plot middle of two lines (Hough Transform)

2 ビュー (過去 30 日間)
Antonio Stankoski
Antonio Stankoski 2019 年 1 月 16 日
編集済み: Geoff Hayes 2019 年 1 月 17 日
My program is detecting the desired lines
But how do i plot the middle of them lines.
Program is plotting lines (green), start point (yellow), end point (red)
% Hough Transform
[H,theta,rho] = hough(filled_a_image);
P = houghpeaks(H,2,'threshold',ceil(0.3*max(H(:))));
lines = houghlines(filled_a_image,theta,rho,P,'FillGap',5,'MinLength',10);
figure, imshow(filled_a_image), hold on
max_len = 0;
for k = 1:length(lines)
xy = [lines(k).point1; lines(k).point2];
plot(xy(:,1),xy(:,2),'LineWidth',1,'Color','green');
% Plot beginnings and ends of lines
plot(xy(1,1),xy(1,2),'x','LineWidth',2,'Color','yellow');
plot(xy(2,1),xy(2,2),'x','LineWidth',2,'Color','red');

回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by