forked from erhanbas/pipeline-stitching
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtileProcessor_debug.m
48 lines (39 loc) · 2.26 KB
/
tileProcessor_debug.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
function [descriptors,paireddescriptor,curvemodel,scopeparams] = tileProcessor_debug(scopeloc,descriptorfolder,desc_ch,params)
checkthese = [1 4 5 7]; % 0 - right - bottom - below
[neighbors] = buildNeighbor(scopeloc.gridix(:,1:3)); %[id -x -y +x +y -z +z] format
% accumulator for steps
[paireddescriptor,R,curvemodel,scopeparams]=deal([]);
%% get tile descriptors
if 0
descriptors = getDescriptorsPerFolder(descriptorfolder,scopeloc,desc_ch);
else
load('/nrs/mouselight/cluster/classifierOutputs/2017-09-25/matfiles/descriptors_ch1_.mat','descriptors')
end
%% descriptor match
% [paireddescriptor{end+1},R{end+1},curvemodel{end+1}] = match.xymatch(descriptors,neighbors(:,checkthese),scopeloc,params);
[paireddescriptor{1},R{1},curvemodel{1}] = match.xymatch(descriptors,neighbors(:,checkthese),scopeloc,params);
%%
% [paireddescriptor{end+1},curvemodel{end+1},unreliable] = match.curvatureOutlierElimination(paireddescriptor{end},curvemodel{end},scopeloc);
[paireddescriptor{2},curvemodel{2},unreliable] = match.curvatureOutlierElimination(paireddescriptor{1},curvemodel{1},scopeloc);
%%
% tile base affine
if params.singleTile
% [scopeparams{1},scopeparams{2},paireddescriptor{end+1},curvemodel{end+1}] = homographyPerTile6Neighbor(...
% params,neighbors,scopeloc,paireddescriptor{end},R,curvemodel{end});
% debug
[scopeparams{1},scopeparams{2},paireddescriptor{3},curvemodel{3}] = homographyPerTile6Neighbor(...
params,neighbors,scopeloc,paireddescriptor{2},R,curvemodel{2});
else
%%
% joint affine estimation
% [scopeparams{end+1}] = match.estimatejointaffine(paireddescriptor{end},neighbors,scopeloc,params,curvemodel{end},0);
[scopeparams{3}] = match.estimatejointaffine(paireddescriptor{2},neighbors,scopeloc,params,curvemodel{2},0);
[scopeparams{4}, paireddescriptor{4}, curvemodel{4}] = match.affineOutlierElimination( scopeloc, scopeparams{3}, paireddescriptor{2},curvemodel{2} );
end
% %%
% matfolder='/nrs/mouselight/cluster/classifierOutputs/2017-09-25/matfiles/'
% load(fullfile(matfolder,'scopeparams_pertile'),'paireddescriptor', ...
% 'scopeparams', 'curvemodel','params')
% %%
% save(fullfile(matfolder,'scopeparams_pertile_joint'),'paireddescriptor', ...
% 'scopeparams', 'curvemodel','params','-v7.3')