Home > Matching_SYM_LSM > src > 2D_LSM_62 > 2D_LSM_62_sym_Functions > image_pair_provide_images_and_coordinates.m

image_pair_provide_images_and_coordinates

PURPOSE ^

% provide iamges and coordinates

SYNOPSIS ^

function [Nig,Nih,Image_l,Image_r,X,par] = image_pair_provide_images_and_coordinates(par);

DESCRIPTION ^

% provide iamges and coordinates

 images by path and file name
 coordinates either interactive or from file

 Nig, Nih          half window sizes in left and right image
 Image_l, Image_r  left and right image
 X                 2x4 coordinates begin and end of arrow
                   (begin = centre, end-begi -> scale and direction)

 wf 7/2020

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Nig,Nih,Image_l,Image_r,X,par] = image_pair_provide_images_and_coordinates(par);
0002 %% provide iamges and coordinates
0003 %
0004 % images by path and file name
0005 % coordinates either interactive or from file
0006 %
0007 % Nig, Nih          half window sizes in left and right image
0008 % Image_l, Image_r  left and right image
0009 % X                 2x4 coordinates begin and end of arrow
0010 %                   (begin = centre, end-begi -> scale and direction)
0011 %
0012 % wf 7/2020
0013 
0014 
0015 % Images
0016 Image_l = imread(fullfile(par.im_path,par.Image_name_l));
0017 Image_r = imread(fullfile(par.im_path,par.Image_name_r));
0018 par.coordinate_name = fullfile(par.pt_path,[par.Image_name_l(1:end-4),...
0019     par.Image_name_r(1:end-4)]);
0020 
0021 
0022 display(['image file name 1                                : ', fullfile(par.im_path,par.Image_name_l)])
0023 display(['image file name 2                                : ', fullfile(par.im_path,par.Image_name_r)])
0024 % show images
0025 f1 = figure('name','Left image');
0026 imshow(Image_l);
0027 set(f1,'Position',[0 par.ss(2)/2.4 par.ss(1)/2 par.ss(2)/2]);
0028 
0029 f2 = figure('name','Right image');
0030 imshow(Image_r);
0031 set(f2,'Position',[par.ss(1)/2 par.ss(2)/2.4 par.ss(1)/2 par.ss(2)/2]);
0032 
0033 
0034 if par.readX == 0   % measure image correspondencies
0035     
0036     [x1, x2] = measure_homologeous_Points_with_s_and_d(f1, f2, Image_l, Image_r, 1,'xy');
0037     
0038     if x1 < 0
0039         disp('Measurements interrupted')
0040         return
0041     end
0042     X = [round(x1(1:2)'), x1(3:4)'; round(x2(1:2)'), x2(3:4)'];
0043     
0044     save(par.coordinate_name,'X');
0045     
0046 else  % read measured image correspondencies from file
0047     
0048     load(par.coordinate_name,'X');
0049     
0050     
0051     figure(f1)
0052     hold on
0053     plot_circle_direction_with_background(X(1,2),X(1,1),3*X(1,3),X(1,4),8,4)
0054     %plot_square_with_background(X(n,2),X(n,1),100,plot_params.f1,plot_params.f2);
0055     
0056     figure(f2)
0057     hold on
0058     plot_circle_direction_with_background(X(2,2),X(2,1),3*X(2,3),X(2,4),8,4)
0059     %plot_square_with_background(X(n,4),X(n,3),100,plot_params.f1,plot_params.f2);
0060 end
0061 
0062 % half size of window in left image
0063 Nig = round(par.factor_s*X(1,3));
0064 Nih = round(par.factor_s*X(2,3));
0065 end
0066

Generated on Sun 19-Jul-2020 23:00:25 by m2html © 2005