Effacer les filtres
Effacer les filtres

Maximum line length in houghlines

5 vues (au cours des 30 derniers jours)
SS
SS le 23 Mai 2021
Commenté : SS le 23 Mai 2021
Hi. Is it possible to detect the lines using houghlines conditioned on maximum line length than the minimum line length. Meaning that, to detect only the lines that are less than or equal to X pixels.
Attached are some lines from the houghlines documentation.
lines = houghlines(BW,T,R,P,'FillGap',5,'MinLength',7);
figure, imshow(rotI), hold on
max_len = 0;
for k = 1:length(lines)
xy = [lines(k).point1; lines(k).point2];
plot(xy(:,1),xy(:,2),'LineWidth',2,'Color','green');

Réponse acceptée

Matt J
Matt J le 23 Mai 2021
Modifié(e) : Matt J le 23 Mai 2021
No, but you can discard the results that exceed the length you want, easily enough.
lines = houghlines(BW,T,R,P,'FillGap',5);
keep = vecnorm(vertcat(lines.point1)-vertcat(lines.point2),2,2) <= X;
lines=lines(keep);
  1 commentaire
SS
SS le 23 Mai 2021
Thanks.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Geometric Transformation and Image Registration dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by