Commit 0e5a4626 authored by Stephane Dallongeville's avatar Stephane Dallongeville
Browse files

Tweak and minor fix on maximum iteration

- added detection of early complete operation when doing tracking and there is no more object to track.
- fixed an issue which was causing the double of maximum allowed number of iteration to be processed on contours (not really hurting but it was slower because of that).
parent e8206e4b
...@@ -29,6 +29,7 @@ public abstract class ActiveContour extends Detection implements Iterable<Point3 ...@@ -29,6 +29,7 @@ public abstract class ActiveContour extends Detection implements Iterable<Point3
protected int id; protected int id;
protected SlidingWindow convergence; protected SlidingWindow convergence;
protected int lastConvergedFrame;
protected VarDouble sampling = new VarDouble("sampling", 1.0); protected VarDouble sampling = new VarDouble("sampling", 1.0);
...@@ -47,6 +48,7 @@ public abstract class ActiveContour extends Detection implements Iterable<Point3 ...@@ -47,6 +48,7 @@ public abstract class ActiveContour extends Detection implements Iterable<Point3
name = ""; name = "";
id = -1; id = -1;
lastConvergedFrame = -1;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
...@@ -56,6 +58,7 @@ public abstract class ActiveContour extends Detection implements Iterable<Point3 ...@@ -56,6 +58,7 @@ public abstract class ActiveContour extends Detection implements Iterable<Point3
name = ""; name = "";
id = -1; id = -1;
lastConvergedFrame = -1;
// follow and shortcut references to avoid memory leaks // follow and shortcut references to avoid memory leaks
while (sampling.getReference() != null) while (sampling.getReference() != null)
...@@ -350,6 +353,16 @@ public abstract class ActiveContour extends Detection implements Iterable<Point3 ...@@ -350,6 +353,16 @@ public abstract class ActiveContour extends Detection implements Iterable<Point3
*/ */
public abstract boolean hasConverged(SlidingWindow.Operation operation, double epsilon); public abstract boolean hasConverged(SlidingWindow.Operation operation, double epsilon);
public int getLastConvergedFrame()
{
return lastConvergedFrame;
}
public void setLastConvergedFrame(int frame)
{
lastConvergedFrame = frame;
}
public void setDivisionSensitivity(Var<Double> divisionSensitivity) public void setDivisionSensitivity(Var<Double> divisionSensitivity)
{ {
this.divisionSensitivity = divisionSensitivity; this.divisionSensitivity = divisionSensitivity;
......
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