Commit 380538e4 authored by Andrew Cohen's avatar Andrew Cohen

CellDistance - size gating & occlusion penalty

parent 75da6973
...@@ -72,20 +72,30 @@ for nChannel=1:CONSTANTS.imageData.NumberOfChannels ...@@ -72,20 +72,30 @@ for nChannel=1:CONSTANTS.imageData.NumberOfChannels
if d > abs(t1-t0) * max(r0,r1)*VMAX if d > abs(t1-t0) * max(r0,r1)*VMAX
continue continue
end end
if size(pts1,1)<5 % size gate - if you're > 10x the size, no go
d12=size(pts1,1)*d; if (min([size(pts0,1),size(pts1,1)])/max([size(pts0,1),size(pts1,1)])) <0.1
else continue
d12=sum(mahal(pts0,pts1));
end end
if size(pts0,1)<5 MIN_MAHAL_POINTS=15
d21=size(pts0,1)*d; if size(pts0,1)<MIN_MAHAL_POINTS && size(pts1,1)<MIN_MAHAL_POINTS
d12=max([size(pts0,1),size(pts1,1)])*d;
d21=d12;
elseif size(pts0,1)<MIN_MAHAL_POINTS && size(pts1,1)>=MIN_MAHAL_POINTS
d12=max([size(pts0,1),size(pts1,1)])*(max(mahal(pts0,pts1))+...
max(mahal(pts1,pts1)));
d21=d12;
elseif size(pts1,1)<MIN_MAHAL_POINTS && size(pts0,1)>=MIN_MAHAL_POINTS
d21=max([size(pts1,1),size(pts0,1)])*(max(mahal(pts1,pts0))+...
max(mahal(pts0,pts0)));
d12=d21;
else else
d12=sum(mahal(pts0,pts1));
d21=sum(mahal(pts1,pts0)); d21=sum(mahal(pts1,pts0));
end end
dCC = max(d12,d21); dCC = max(d12,d21);
% penalize occlusion distances % penalize occlusion distances
tDiff=abs(t1-t0); tDiff=abs(t1-t0);
dCC=dCC^(tDiff-1); dCC=dCC^(tDiff);
end end
if t0<t1 if t0<t1
updateDistance.setInt(1,id0); updateDistance.setInt(1,id0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment