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];