-
Notifications
You must be signed in to change notification settings - Fork 0
/
DoGSearch.m
executable file
·34 lines (31 loc) · 1.03 KB
/
DoGSearch.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
function [LOG Mask] = DoGSearch(IMG,type,sigma)
low=0.8;
up=1.5;
num_interval=(up-low)/0.1;
if nargin<3
disp(['Searching best DoG Space ...']);
t=1;
maxt=0;maxi=0;T=zeros(t,1);
for sigma=low:0.1:up
TLOG=sigma.^(2-1).*(GaussianTransformer(IMG,sigma+0.001)-GaussianTransformer(IMG,sigma))./0.001;
[Temp,T(t)]=ConvexDetector(TLOG,type);
if T(t)>maxi
LOG=TLOG;
Mask=Temp;
maxt=sigma;
maxi=T(t);
end
t=t+1;
end
disp(['Optimum Space with sigma=',num2str(maxt)]);
% LOG=CIMG(:,:,:,maxt+1)-CIMG(:,:,:,maxt-1);
% [Mask tmp]=ConvexDetector(LOG,type);
elseif nargin==3
if sigma==0
LOG=Laplacian(IMG);
[Mask,T]=ConvexDetector(LOG,type);
else
LOG=sigma.^(2-1)*(GaussianTransformer(IMG,sigma+0.001)-GaussianTransformer(IMG,sigma))./0.001;
[Mask,T]=ConvexDetector(LOG,type);
end
end