Skip to content

Commit

Permalink
add option to purge clusters if they overlap the border/edge, not jus…
Browse files Browse the repository at this point in the history
…t center of cluster
  • Loading branch information
Tobi Delbruck authored and Tobi Delbruck committed May 15, 2024
1 parent 1b9a5e0 commit aff2e48
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public class RectangularClusterTracker extends EventFilter2D
protected float thresholdVelocityForVisibleCluster = getFloat("thresholdVelocityForVisibleCluster", 0);
protected int clusterMassDecayTauUs = getInt("clusterMassDecayTauUs", 10000);
protected boolean enableClusterExitPurging = getBoolean("enableClusterExitPurging", true);
private boolean purgeIfClusterOverlapsBorder = getBoolean("purgeIfClusterOverlapsBorder", true);
protected float velAngDiffDegToNotMerge = getFloat("velAngDiffDegToNotMerge", 60);
protected boolean showClusterNumber = getBoolean("showClusterNumber", false);
protected boolean showClusterEps = getBoolean("showClusterEps", false);
Expand Down Expand Up @@ -238,6 +239,7 @@ protected void setTooltips() {
final String sizing = "Sizing", mov = "Movement", life = "Lifetime", disp = "Display", global = TOOLTIP_GROUP_GLOBAL,
update = "Update", logg = "Logging", pi = "PI Controller";
setPropertyTooltip(life, "enableClusterExitPurging", "enables rapid purging of clusters that hit edge of scene");
setPropertyTooltip(life, "purgeIfClusterOverlapsBorder", "purge any cluster that overlaps edge (if false, center must go outside border)");
setPropertyTooltip(life, "clusterMassDecayTauUs", "time constant of exponential decay of \"mass\" of cluster between events (us)");
setPropertyTooltip(life, "thresholdMassForVisibleCluster",
"Cluster needs this \"mass\" to be visible. Mass increments with each event and decays with e-folding time constant of clusterMassDecayTauUs. Use \"showAllClusters\" to diagnose fleeting clusters.");
Expand Down Expand Up @@ -1599,6 +1601,10 @@ protected boolean hasHitEdge() {
if (!enableClusterExitPurging) {
return false;
}

if(isPurgeIfClusterOverlapsBorder()){
return isOverlappingBorder();
}

int lx = (int) location.x, ly = (int) location.y;
int sx = chip.getSizeX(), sy = chip.getSizeY();
Expand Down Expand Up @@ -4226,4 +4232,19 @@ private double sqrt(double d){
return sqrt;

}

/**
* @return the purgeIfClusterOverlapsBorder
*/
public boolean isPurgeIfClusterOverlapsBorder() {
return purgeIfClusterOverlapsBorder;
}

/**
* @param purgeIfClusterOverlapsBorder the purgeIfClusterOverlapsBorder to set
*/
public void setPurgeIfClusterOverlapsBorder(boolean purgeIfClusterOverlapsBorder) {
this.purgeIfClusterOverlapsBorder = purgeIfClusterOverlapsBorder;
putBoolean("purgeIfClusterOverlapsBorder",purgeIfClusterOverlapsBorder);
}
}

0 comments on commit aff2e48

Please sign in to comment.