Line detection in image
I am new to image processing and I was trying to detect vertical lines using this code- image=imread('benzene.jpg'); BW = im2bw(image); w1=[-1 2 -1 ; -1 2 -1 ; -1 2 -1]; g=(imfilter(double(BW),w1)); g=abs(g); T=max(g(:)); g=g>=T; imshow(g); This was my image- And this is what I got after performming the operations- So my question is why am I getting this output?There are 10 vertical lines if vertical double bonds are counted as 2 distinct vertical lines.Also what if I want to get horizontal,vertical,45 and -45 all the lines,how can I use all the 4 masks to get one single output? One simple