% lsd_example.m
% Test LSD algorithm with MATLAB
%% show the image.
clear
close all
im = imread('005.png');
 imshow(im);
im=double(im);
%% get the start_points and end_points of each straight line use LSD.
% note: input parameter is the path of image, use '/' as file separator.
lines=LSDmexWD(im');

%% plot the lines.
hold on;
for i = 1:size(lines, 2)
    plot([lines(1, i) lines(3, i)], [lines(2, i) lines(4, i)], 'Color', [1, 0, 0]);
end
