Commit 4f1faf35f5db4eb48dd33913c41793d5989be726

Authored by Daniel Bourgault
1 parent 5854a924
Exists in master

Small changes made to g_stabilize.m

Showing 1 changed file with 7 additions and 4 deletions   Show diff stats
src/g_stabilize/g_stabilize.m
... ... @@ -111,6 +111,8 @@ im2 = imread(img_ref_fname);
111 111 % Convert into gray scale if not already a B/W image
112 112 if size(im2,3) ~= 1
113 113 im2_BW = g_rgb2gray(im2);
  114 +else
  115 + im2_BW = im2;
114 116 end
115 117  
116 118 im2_BW_cooked = im2_BW;
... ... @@ -140,7 +142,6 @@ end
140 142  
141 143 frames(2).im = im2_BW_cooked;
142 144  
143   -
144 145 %% Some figures to make sure everything is ok
145 146 figure(1);
146 147 imagesc(im2_BW);
... ... @@ -205,7 +206,7 @@ for i = 1:N
205 206 im1 = imread([pathstr,'/',all_img(i).name]);
206 207 im_info = imfinfo([pathstr,'/',all_img(i).name]);
207 208 end
208   -
  209 +
209 210 if i == 1
210 211 display([' Processing image: ',all_img(i).name]);
211 212 display([' Time remaining: Yet undetermined. Please wait until next image.']);
... ... @@ -219,10 +220,12 @@ for i = 1:N
219 220 % Convert into gray scale if not already a B/W image
220 221 if size(im1,3) ~= 1
221 222 im1_BW = g_rgb2gray(im1);
  223 + else
  224 + im1_BW = im1;
222 225 end
223 226  
224 227 im1_BW_cooked = im1_BW;
225   -
  228 +
226 229 % May equalize with this equalizer.
227 230 if equalize
228 231 im1_BW_cooked = clahs(im1_BW_cooked,nry,nrx);
... ... @@ -240,7 +243,7 @@ for i = 1:N
240 243 end
241 244  
242 245 frames(1).im = im1_BW_cooked;
243   -
  246 +
244 247 [motion,stable] = g_videostabilize(frames,roi,L);
245 248  
246 249 % Warp the original image and not the image that has been manipulated
... ...