im = imread('lego1.png' );
im = rgb2gray(im);
 

%gafilt = fspecial('gaussian', size(im), 2); % gaussian filter

%newim = filter2(gafilt,im);   



%figure(1)
%imagesc(newim), colormap(gray);

% horifilt = [-1  0  1];
% vertfilt = [-1; 0; 1];

% newedge = filter2(horifilt, newim);

% imagesc(newedge), colormap(gray);


%[BW, thresh] = EDGE(newim,'canny',[0.0125    0.0313]);

%figure(2)
%imagesc(BW), colormap(gray);

h = hough(im, [0.0125    0.0313], 400, 628);



houghlines(im, h, 200);
