-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathget_texton_map.m
More file actions
28 lines (21 loc) · 814 Bytes
/
get_texton_map.m
File metadata and controls
28 lines (21 loc) · 814 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 texelMap = get_texton_map(im)
global textonData;
texMode = '1_1_0_0_1_tex_texton128_malik_0x5_3_universal_intensity_8.mat';
[scale, elongate] = getFilterParameters(texMode);
% Filterbank parameters
fbParams.no = 12;
fbParams.ns = 1;
fbParams.sc = sqrt(2);
fb = fbCreate(fbParams.no, scale, fbParams.ns, fbParams.sc, elongate);
% Filter image
fim = fbRun(fb, im);
%% Universal
if ~isempty(strfind(texMode, 'universal'))
% Assign universal textons
% Load universal texton dictionary
textons = textonData.tex;
nTexels = size(textons, 2);
texelMap = assignTextons(fim, textons); % Assign textons
end
texelMap = texelMap (1:200,1:200);
end