A different approach is to use the fact that all the lines that depict bonds have the same aspect ratio and area. after filtering the image leaving it with only the bonds, we can look at the orientation or at the list of indices that compose them to detect if they are vertical or whatnot. All this can be done using regionprops
.
image=rgb2gray(imread('benzene.png'));
d=abs(255-image); % inverse the image
d=im2bw(d);
stat=regionprops(d,'Area', 'Orientation','PixelIdxList');
areas=[stat.Area];
hist(areas)

Inspecting the histogram shows where to cut for the lines, the lines have smaller areas than the letters, and they should have approximately the same area. So I cut for areas below 1000 pixels:
idx=find(areas<1000);
angs=round([stat(idx).Orientation]);
now you can use the angs
and idx
to get which ever type of line you want. For example lets just plot the 30 deg lines:
d2=zeros(size(d));
d2(vertcat(stat(idx(angs==30)).PixelIdxList))=1;
imagesc(d2)

Note that at the time I started answering this question the image I took was the benzene.png file. Now I realize that you have provided a different image than the original one, such that the lines that depict bonds are not separate, rather you have "rings". I'll see later if I can address that as well if you want me to.
EDIT:
To find the relevant line for the new image, where you have rings, the only difference the lines have is that, well, they are straight "lines" and not curved. So I resort to the beloved Hough transform to pick them up:
image=imread('https://i.stack.imgur.com/bdNOt.png');
d=abs(1-image); % inverse the image
BW=im2bw(d);
BW = bwmorph(BW,'skel',1);
[H, T, R] = hough(BW,'Theta',-90:10:80);
P = houghpeaks(H, 100,'NHoodSize',[3 3],'threshold',1);
lines = houghlines(BW, T, R, P, 'FillGap',5, 'MinLength', 35);
Let's obtain the angles of the detected lines:
angs=round([lines.theta]);
you'll see that here angs
will generate values of 0,-60 or 60 degrees.
say you want to plot only those that are 0 degrees:
p1=vertcat(lines(angs==0).point1);
p2=vertcat(lines(angs==0).point2);
imshow(BW, 'InitialMag',200, 'Border','tight'), hold on
for k = 1:size(p1,1)
line([p1(k,1) p2(k,1)],[p1(k,2) p2(k,2)], 'LineWidth',4,...
'Color',[1 0 0]); hold on
end
hold off
