-
Notifications
You must be signed in to change notification settings - Fork 4
/
procTD.m
33 lines (22 loc) · 801 Bytes
/
procTD.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% Jervis Muindi
% Biometrics Final Project
% 11th December 2011
function r = procTD( images )
% Process the traing data (image cell array) by bouding digits to bounding box.
% this is for trainig data.
length = size(images,2);
%process all img samples.
disp('Processing images in Training Set...');
for i = 1:length
if(mod(i,1000) == 0)
fprintf('Processed %d of 60000 training samples\n',i);
end
img_sample = images{i};
img_sample = binarize(img_sample);
img_sample = extract(img_sample); % bound it
img_sample = imresize(img_sample, [28 28]); % resize
img_sample = binarize(img_sample); % re-binarize
images{i} = img_sample;
end
r = images;
end