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 CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by