I am trying to detect straight vertical lines in an image. I used vertical edge detection and then I tried to check which objects has the
orientation > 80 & < 100.
% Vertical Edge Detection v = edge(img,'sobel','vertical'); v = bwlabel(v); stats = regionprops(v, 'All'); % ids = find([stats.Orientation] > 80 & [stats.Orientation] < 100); % v = ismember(v,ids); figure,imshow(v);title('Vertical');
The problem is that most of the objects are having some weird orientation (some -ve value e.g. -53.xyz)
when I try to filter the objects, it gives me a full black image as an output.
Someone please explain this behavior. How can I get only straight vertical lines?