-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.m
More file actions
19 lines (13 loc) · 676 Bytes
/
train.m
File metadata and controls
19 lines (13 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function [keys values] = train(inputImage, alpha)
%read in input image
inputImage = im2double(imread(inputImage));
%perform preprocessing steps, blur/downsample/interpolate/highpass
[subsampled interpolatedSubsampled lowResImage] = prepareLowRes(inputImage);
highResImage = im2double(inputImage) - im2double(interpolatedSubsampled);
%make lowResPatches
[lowResPatches lowResRows, lowResCols] = make2dPatchMap(lowResImage, 7);
%DO NOT USE HIGH RES DIMENSIONS
[highResPatches highResRows, highResCols] = make2dPatchMap(highResImage, 5);
%create key/values based on patches
[keys values] = createVectors(alpha, lowResPatches, highResPatches, lowResRows, lowResCols);
end