Plot middle of two lines (Hough Transform)

2 visualizaciones (últimos 30 días)
Antonio Stankoski
Antonio Stankoski el 16 de En. de 2019
Editada: Geoff Hayes el 17 de En. de 2019
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');

Respuestas (0)

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by