0001 function [Nig,Nih,Image_l,Image_r,X,par] = image_pair_provide_images_and_coordinates(par);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
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
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
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
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
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
0060 end
0061
0062
0063 Nig = round(par.factor_s*X(1,3));
0064 Nih = round(par.factor_s*X(2,3));
0065 end
0066