Commit efeaed0f62b508eafb2de9b5e82ebef124c1e311

Authored by Daniel Bourgault
1 parent ea630c82
Exists in master

Small changes so that the new code would work just as fine if elevations are not provided for GCPs.

Showing 2 changed files with 12 additions and 4 deletions   Show diff stats
src/g_rect/g_rect.m
... ... @@ -132,7 +132,15 @@ i_gcp = gcp.data(:,1);
132 132 j_gcp = gcp.data(:,2);
133 133 lon_gcp0 = gcp.data(:,3);
134 134 lat_gcp0 = gcp.data(:,4);
135   -h_gcp = gcp.data(:,5);
  135 +
  136 +[ngcp n_column] = size(gcp.data)
  137 +
  138 +% If there are 5 columns it means that elevation are provided
  139 +if n_column == 5
  140 + h_gcp = gcp.data(:,5);
  141 +else % otherwise elevation are considered to be zero
  142 + h_gcp(1:ngcp) = 0.0;
  143 +end
136 144  
137 145 %%
138 146 % Check if the elevation of the GCPs are not too high and above
... ... @@ -148,7 +156,6 @@ if length(i_bad) > 0
148 156 display([' FIX AND RERUN.']);
149 157 return
150 158 end
151   -ngcp = length(i_gcp);
152 159  
153 160 % Get the image size
154 161 imgInfo = imfinfo(imgFname);
... ... @@ -288,7 +295,7 @@ if nUnknown > 0
288 295 theta0 = (thetaGuess - dtheta) + 2*dtheta*rand(1);
289 296 end
290 297  
291   - % Cretae vector cv0 for the initial guesses.
  298 + % Create vector cv0 for the initial guesses.
292 299 i = 0;
293 300 if dhfov > 0.0
294 301 i = i+1;
... ... @@ -408,7 +415,6 @@ clear LON LAT
408 415 fprintf('\n')
409 416 fprintf('Making figure\n');
410 417  
411   -figure;
412 418 if field
413 419 g_viz_field(imgFname,outputFname);
414 420 else
... ...
src/g_rect/g_viz_lab.m
1 1 function g_viz_lab(imgFname,rectFile);
2 2  
  3 +figure
  4 +
3 5 % Set some plotting parameters
4 6 ms = 10; % Marker Size
5 7 fs = 10; % Font size
... ...