Skip to content

Commit 76cfd36

Browse files
committed
Passing asserts when no self-similarity feature
1 parent f61914a commit 76cfd36

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

stDetect.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
I = imPad(I,opts.radius,'symmetric');
3838
chns = stChns( I, opts );
3939
[cids1,cids2] = computeCids(size(chns),opts);
40-
chnsSs = convBox(chns,opts.cellRad);
40+
if opts.nCells
41+
chnsSs = convBox(chns,opts.cellRad);
42+
else
43+
chnsSs = [];
44+
end
4145

4246
% run forest on image
4347
S = stDetectMex( chns, chnsSs, model.thrs, model.fids, model.child, ...
@@ -80,12 +84,14 @@
8084
m=opts.cellStep;
8185
nCellTotal=(n*n)*(n*n-1)/2;
8286

83-
assert(mod(n,2)==1); n1=(n-1)/2;
87+
assert((n==0) || (mod(n,2)==1));
88+
n1=(n-1)/2;
8489
nSimFtrs=nCellTotal*nChns;
8590
fids=uint32(0:nSimFtrs-1);
8691
ind=mod(fids,nCellTotal);
8792
ch=(fids-ind)/nCellTotal;
8893

94+
ind1 = []; ind2 = [];
8995
k=0;
9096
for i=1:n*n-1,
9197
k1=n*n-i;

stTrain.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
opts.cellRad = round(patchSiz/nCells/2);
9191
tmp=opts.cellRad*2+1;
9292
opts.cellStep = tmp-ceil((nCells*tmp-patchSiz)/(nCells-1)); disp(opts);
93-
assert( mod(nCells,2)==1 && (nCells-1)*opts.cellStep+tmp <= patchSiz );
93+
assert( (nCells == 0) || (mod(nCells,2)==1 && (nCells-1)*opts.cellStep+tmp <= patchSiz ));
9494

9595
% generate stream for reproducibility of model
9696
stream=RandStream('mrg32k3a','Seed',opts.seed);

0 commit comments

Comments
 (0)