Plot middle of two lines (Hough Transform)

2 次查看(过去 30 天)
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