[1422d3]: / util / adjustFormat.m

Download this file

28 lines (19 with data), 588 Bytes

 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
function [imagesCellTrain, meanAll, imageSize] = adjustFormat(imagesCellTrain)
% %compute image size
% %image size must be a power of 2
% im = imagesCellTrain{1};
% closPow2 = pow2(floor(log2(size(im,1))));
% imageSize = [closPow2 closPow2];
meanAll = zeros(numel(imagesCellTrain), 1);
for i = 1 : numel(imagesCellTrain)
%load
im = imagesCellTrain{i};
%cast
%im = double(im);
%mean
meanAll(i) = mean2(im);
%subtract mean
im = im - meanAll(i);
%assign
imagesCellTrain{i} = im;
end %for i = 1 : numel(imagesCellTrain)