%% Read it in
clear
I=rgb2gray(imread('edge_image.png'));
imshow(I);

S = size(I);

%% First canny
BW = edge(I, 'canny', 0.1, 1);

red = cat(3, ones(S), zeros(S), zeros(S));

imshow(I)
hold on
h = imshow(red);

set(h, 'AlphaData', BW);

%% Hough stuff
[H, T, R] = hough(BW);

peaks = houghpeaks(H, 10, 'Threshold', 0.1*max(H(:)));

lines = houghlines(BW, T, R, peaks);

%% Draw the lines on the image (borrowed from the "doc houghlines")
drawLines(I, lines);


