hallway3

clear, close all
filename = '2011_0328_131452AA.JPG';
rgb = im2double(imread(filename));
rgbsm = imresize(rgb,0.4);
imshow(rgbsm);
load hallway1_project
% [x y] = ginput(8);
% save hallway1_project filename x y

imshow(rgbsm);
% show hallway edges
hold on
plot(x(1:2),y(1:2),'g','LineWidth',2);
plot(x(3:4),y(3:4),'m','LineWidth',2);
plot(x(5:6),y(5:6),'m','LineWidth',2);
plot(x(7:8),y(7:8),'g','LineWidth',2);
% show image center
sz = size(rgbsm);
cen = sz/2;
plot(cen(2),cen(1),'yo','MarkerSize',8);
fprintf('image center %g %g\n',cen(2),cen(1));
hold off
image center 410 307.5
hold on
% show hallway vanishing points
vp1 = intersect([x(1:2) y(1:2)],[x(7:8) y(7:8)],'gx');
fprintf('  floor vanishing point %g %g\n',vp1);
vp2 = intersect([x(3:4) y(3:4)],[x(5:6) y(5:6)],'mx');
fprintf('ceiling vanishing point %g %g\n',vp2);
hold off
  floor vanishing point 431.898 289.802
ceiling vanishing point 431.898 283.219
load hallway_project2

% show checkerboard edges and vanishing point
pts = [input_points; input_points(1,:)];
hold on
plot(pts(:,1),pts(:,2),'b','LineWidth',2);
intersect(pts(2:3,:),pts(4:5,:),'bx');
hold off