SRMD icon indicating copy to clipboard operation
SRMD copied to clipboard

data_augmentation function

Open yiyunchen opened this issue 5 years ago • 5 comments

When I was runing the generatepatches.m, a error was raised that "undefined function or variable 'data_augmentation'. I would like asking about it, is it a default function or user defined function that no provided? thank you very much!

yiyunchen avatar Mar 12 '19 13:03 yiyunchen

https://github.com/cszn/SRMD/blob/master/TrainingCodes/utilities/data_augmentation.m

cszn avatar Mar 12 '19 13:03 cszn

thank you! and I am confused about the code:

for x = 1 : stride : (hei-size_input+1) for y = 1 : stride : (wid-size_input+1) x_l = stride_low*(x-1)/stride + 1; y_l = stride_low*(y-1)/stride + 1; if x_l+size_input/scale-1 > size(LR,1) || y_l+size_input/scale-1 > size(LR,2) continue; end count=count+1; end end

in generatedpatches. May I ask what this is trying to do. Thank you.

yiyunchen avatar Mar 13 '19 01:03 yiyunchen

In matlab, pre-define the large matrix is useful to the memery.

For example,

n = 1000000;
A = zeros(1, n); 
for i = 1:n
  A(i) = i; 
end

is better than

n = 1000000;
for i = 1:n
  A(i) = i; 
end

cszn avatar Mar 13 '19 02:03 cszn

Is it used to compute the 'count'?

yiyunchen avatar Mar 13 '19 02:03 yiyunchen

Yes. @yiyunchen

cszn avatar Mar 13 '19 02:03 cszn