-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCandidateGenerationWindow.m
56 lines (53 loc) · 3.08 KB
/
CandidateGenerationWindow.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
47
48
49
50
51
52
53
function [windowCandidates] = CandidateGenerationWindow(mask, window_method, da, im)
switch window_method
case 'ccl'
[windowCandidates] = SegmentationCCL(mask, da);
case 'ccl_corr'
[windowCandidates] = SegmentationCCL(mask, da);
template_method = 'correlation';
[windowCandidates] = CompareWithTemplate(mask, windowCandidates, template_method);
case 'ccl_sub'
[windowCandidates] = SegmentationCCL(mask, da);
template_method = 'subtraction';
[windowCandidates] = CompareWithTemplate(mask, windowCandidates, template_method);
case 'sliding_window'
params.overlap = true; %Do or not Overlap
params.jump = 0.65; %Overlap in percentage of the sliding window
params.dims = 3; %Number width dimensions proved
params.ffs = 3; %Number of form_factors proved
params.method = 'sumcum'; %Filling ratio calculation method: 'sumcum' or 'simple'
[windowCandidates] = SlidingWindow(mask, da, params);
case 'sliding_window_corr'
params.overlap = true; %Do or not Overlap
params.jump = 0.7; %Overlap in percentage of the sliding window
params.dims = 3; %Number width dimensions proved
params.ffs = 3; %Number of form_factors proved
params.method = 'sumcum'; %Filling ratio calculation method: 'sumcum' or 'simple'
[windowCandidates] = SlidingWindow(mask, da, params);
template_method = 'correlation';
[windowCandidates] = CompareWithTemplate(mask, windowCandidates, template_method);
case 'sliding_window_sub'
params.overlap = true; %Do or not Overlap
params.jump = 0.7; %Overlap in percentage of the sliding window
params.dims = 3; %Number width dimensions proved
params.ffs = 3; %Number of form_factors proved
params.method = 'sumcum'; %Filling ratio calculation method: 'sumcum' or 'simple'
[windowCandidates] = SlidingWindow(mask, da, params);
template_method = 'subtraction';
[windowCandidates] = CompareWithTemplate(mask, windowCandidates, template_method);
case 'template_matching'
params.overlap = true; %Do or not Overlap
params.jump = 0.75; %Overlap in percentage of the sliding window
params.dims = 3; %Number width dimensions proved
params.ffs = 3; %Number of form_factors proved
params.threshold = 10; %Threshold that limits the result sumatory
[windowCandidates] = TemplateMatching(da, params, im);
case 'hough'
params.numpeaks = 1000; %Number of lines of hough transform that we take into account
params.t = 9; %Tolerance for horizontal and vertical lines (degres)
params.tt = 21; %Tolerance for tilted lines (degres)
[windowCandidates] = HoughMethod(da, params, im);
otherwise
error('Incorrect method');
end
end