-
Notifications
You must be signed in to change notification settings - Fork 0
/
tutorial_im2minPS.m
51 lines (38 loc) · 1.57 KB
/
tutorial_im2minPS.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
clear;
% This is tutorial of im2minPS
% G Okazawa (2015)
%% load image
% The input image should satisfy following requirements:
% 1) should be 128 x 128 pixels grayscale
% 2) should have a unit of luminance (cd/m2)
% 3) the mean and SD of luminance should be 15 and 6cd/m2
%
% These are needed to meet the standard in Okazawa et al. (2015).
S = load('demo_img.mat');
Limg = S.Limg;
figure;
imagesc(Limg);
axis square;
set(gca, 'visible', 'off');
h = colorbar;
ylabel(h, 'Luminance (cd/m2)');
colormap gray;
%% run im2minPS
[minPS, minPSraw, minPSstruct] = im2minPS(Limg)
% minPS has a vector of 29 parameters.
% for the definition of each parameter, see minPS_list.pdf
% The values are normalized with respect to the dataset in Okazawa et al.
% (2015)
% minPSraw contains unnormalized data, but note that, during the
% calculation of minPS, there are several steps where the normalization of
% values is necessary to obtain meaningful parameters. Those normalization
% is performed using the dataset in Okazawa et al, so the parameters cannot
% be completely immuned to the dependency on the dataset. Moreover, the
% dimensionality of linear cross position and energy cross position was
% reduced using PCA, which is also dependent on the dataset. Thus, it is
% impossible to generate a "raw" value of minPS parameters, but one can
% still use the relative magnitude of these parameters across images to fit
% neural responses etc.
% minPSstruct stores the same data (minPSraw) in a struct format, which
% is directly related to the output of textureAnalysis in Portilla &
% Simoncelli's code.