% version up can apply non square image  version 2004.02.07 http://www.gerox.com
close all;
clear all
figure(1);count = 1;
xmax=50;
ymax=80;
rhomax=100;
thetamax=150;
for theta=[0 30 60 90 120 150]
	bw=zeros(ymax,xmax);
	bw(xmax/2,:)=1;
	bw=imrotate(bw,90+theta,'crop');
  subplot(6,3,count);count=count+1;
  imshow(bw,[0 1]);
  title(['\theta =' num2str(theta)]);
  subplot(6,3,count);count=count+1;
  hdata = houghf(bw,rhomax,thetamax);
  mesh(hdata);
  xlabel('\theta');ylabel('\rho');
  subplot(6,3,count);count=count+1;
  imshow(hdata,[]);axis on
  xlabel('\theta');ylabel('\rho');
end
figure(2);count = 1;

for y=round(1:(ymax/6):ymax)
	bw=zeros(ymax,xmax);
	bw(y,:)=1;
  subplot(6,3,count);count=count+1;
  imshow(bw,[0 1]);
  title(['y =' num2str(ymax/2-y)]);
  subplot(6,3,count);count=count+1;
  hdata = houghf(bw,rhomax,thetamax);
  mesh(hdata);
  xlabel('\theta');ylabel('\rho');
  subplot(6,3,count);count=count+1;
  imshow(hdata,[]);axis on
  xlabel('\theta');ylabel('\rho');
end
