Code.m
I = imread('circuit.tif');
rotI = imrotate(I, 33, 'crop');
BW = edge(rotI, 'canny');
[H, T, R]...= hough(BW);
imshow(H, [], 'XData', T, 'YData', R, 'InitialMagnification', 'fit');
xlabel('\theta'),...axis normal, hold on;
P = houghpeaks(H, 5, 'threshold', ceil(0.3 * max(H(:))));
x = T(P(:, 2));
y = R(...P(:, 1));
plot(x, y, 's', 'color', 'white');
%Find lines and plot them
lines = houghlines(BW, T, R, P...= hough(BW);
imshow(H, [], 'XData', T, 'YData', R, 'InitialMagnification', 'fit');
xlabel('\theta'),