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