[H,theta,rho] = hough(w);
imshow(H,[],'XData',theta,'YData',rho,...
'InitialMagnification','fit');
xlabel('\theta'), ylabel('\rho');
axis on, axis normal, hold on;
P = houghpeaks(H,5,'threshold',ceil(0.3*max(H(:))));
x = theta(P(:,2));
y = rho(P(:,1));
plot(x,y,'s','color','white');
lines = houghlines(w,theta,rho,P,'FillGap',10,'MinLength',50);
figure,imshow(w); hold on