Home > 10-Uncertain-Geometry > Functions > h_transfer_points.m

h_transfer_points

PURPOSE ^

demo_h_transfer_points: transfer point in demo_homography

SYNOPSIS ^

function h_transfer_points(H,CP,Image_l,Image_r,magnification)

DESCRIPTION ^

 demo_h_transfer_points: transfer point in demo_homography

 Wolfgang Förstner 3/2011
 wfoerstn@uni-bonn.de

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % demo_h_transfer_points: transfer point in demo_homography
0002 %
0003 % Wolfgang Förstner 3/2011
0004 % wfoerstn@uni-bonn.de
0005 
0006 function h_transfer_points(H,CP,Image_l,Image_r,magnification)
0007 
0008 figure(1)
0009 imshow(Image_l);
0010 hold on
0011 h_plot_CP(CP,1);
0012 
0013 while true
0014     %% wait until a button is pressed
0015     figure(1)
0016     disp('grab point with mouse in image 1 or press keyboard for stop')
0017     title('grab point with mouse or press keyboard for stop')
0018     keydown = waitforbuttonpress;    
0019     % if a keyboard button was pressed, stop cycle
0020     
0021     if keydown == 1
0022         break
0023     end
0024     %% grab mouse position
0025     figure(1)
0026     imshow(Image_l);
0027     hold on
0028     h_plot_CP(CP,1);
0029     X=get(gca,'currentPoint');
0030     
0031     %% refresh image left
0032     % save only coordinates
0033     z = X(1,1:2)';
0034     
0035     %% plot ellipse in left image
0036     plot_square_with_background(z(1),z(2),10);
0037     hold on
0038     xl = sugr_Point_2D(z,10^(-4)*eye(2));
0039     
0040     %% refresh image right
0041     %
0042     figure(2)
0043     imshow(Image_r);
0044     hold on
0045     h_plot_CP(CP,2);
0046     % transferred point
0047     
0048     xr = sugr_transform_with_Homography_2D(H,xl);
0049     
0050     %% plot ellipse in right image
0051     sugr_plot_Point_2D(xr,'.y','-y',3,magnification);
0052     sugr_plot_Point_2D(xr,'ok','-k',1,magnification);
0053     hold off
0054 end
0055

Generated on Sat 21-Jul-2018 20:56:10 by m2html © 2005