public class CLMFaceTracker extends Object
Modifier and Type | Field and Description |
---|---|
double |
clamp
Number of standard deviations from the mean face to allow in the model
|
int[][] |
connections
The face connections
|
boolean |
fcheck
Whether to use the face check (using pixels as a face classifier)
|
int |
fpd
Number of frames on which to force a redetection
|
double |
fTol
Model fitting optimisation tolerance
|
MultiTracker |
model
The tracker to use
|
int |
nIter
Number of iterations to use for model fitting
|
float |
scale
The scale at which to process the video
|
float |
searchAreaSize
The size of the search area for redetection (template matching)
|
int[][] |
triangles
The face mesh
|
int[] |
wSize1
Search window size while tracking
|
int[] |
wSize2
Search window size when initialising after a failed track
|
Constructor and Description |
---|
CLMFaceTracker()
Instantiates a tracker for tracking faces based on some default values
and models.
|
Modifier and Type | Method and Description |
---|---|
static void |
drawFaceModel(MBFImage image,
MultiTracker.TrackedFace f,
boolean drawTriangles,
boolean drawConnections,
boolean drawPoints,
boolean drawSearchArea,
boolean drawBounds,
int[][] triangles,
int[][] connections,
float scale,
Float[] boundingBoxColour,
Float[] meshColour,
Float[] connectionColour,
Float[] pointColour)
Draw onto the given image, the given face model.
|
void |
drawModel(MBFImage image,
boolean drawTriangles,
boolean drawConnections,
boolean drawPoints,
boolean drawSearchArea,
boolean drawBounds)
Draw the model onto the image
|
Float[] |
getBoundingBoxColour() |
Float[] |
getConnectionColour() |
MultiTracker.TrackerVars |
getInitialVars()
Returns the initial variables that will be used by the tracker for each
found face.
|
Float[] |
getMeshColour() |
MultiTracker |
getModelTracker()
Returns the model tracker
|
Float[] |
getPointColour() |
int[][] |
getReferenceConnections()
Get the reference connections
|
int[][] |
getReferenceTriangles()
Get the reference triangles
|
Float[] |
getSearchAreaColour() |
float |
getSearchAreaSize() |
List<MultiTracker.TrackedFace> |
getTrackedFaces() |
static List<Triangle> |
getTriangles(Jama.Matrix shape,
Jama.Matrix visi,
int[][] triangles)
Get the triangle mesh corresponding to a tracked face.
|
List<Triangle> |
getTriangles(MultiTracker.TrackedFace face)
Get the triangle mesh corresponding to a tracked face.
|
void |
initialiseFaceModel(MultiTracker.TrackedFace face)
Initialises the face model for the tracked face by calling
MultiTracker.initShape(Rectangle, Matrix, Matrix) with the
rectangle of MultiTracker.TrackedFace.redetectedBounds and the face shape and
the reference shape. |
void |
reset()
Force a reset on the next frame to be tracked.
|
void |
setBoundingBoxColour(Float[] boundingBoxColour) |
void |
setConnectionColour(Float[] connectionColour) |
void |
setMeshColour(Float[] meshColour) |
void |
setPointColour(Float[] pointColour) |
void |
setRedetectEvery(int nFrames)
Set the number of frames after which a redection is forced by the tracker.
|
void |
setSearchAreaColour(Float[] searchAreaColour) |
void |
setSearchAreaSize(float searchAreaSize) |
void |
track(FImage im)
Track the face in the given frame.
|
void |
track(MBFImage frame)
Track the face in the given frame.
|
public MultiTracker model
public int[][] triangles
public int[][] connections
public float scale
public boolean fcheck
public int fpd
public int[] wSize1
public int[] wSize2
public int nIter
public double clamp
public double fTol
public float searchAreaSize
public CLMFaceTracker()
public void track(MBFImage frame)
frame
- The framepublic void reset()
public void drawModel(MBFImage image, boolean drawTriangles, boolean drawConnections, boolean drawPoints, boolean drawSearchArea, boolean drawBounds)
image
- The image to draw ontodrawTriangles
- Whether to draw the trianglesdrawConnections
- Whether to draw the connectionsdrawPoints
- Whether to draw the pointsdrawSearchArea
- Whether to draw the search areadrawBounds
- Whether to draw the boundspublic static void drawFaceModel(MBFImage image, MultiTracker.TrackedFace f, boolean drawTriangles, boolean drawConnections, boolean drawPoints, boolean drawSearchArea, boolean drawBounds, int[][] triangles, int[][] connections, float scale, Float[] boundingBoxColour, Float[] meshColour, Float[] connectionColour, Float[] pointColour)
image
- The image to draw ontof
- The face model to drawdrawTriangles
- Whether to draw the trianglesdrawConnections
- Whether to draw the connectionsdrawPoints
- Whether to draw the pointsdrawSearchArea
- Whether to draw the search areadrawBounds
- Whether to draw the boundstriangles
- The reference trianglesconnections
- The reference connectionsscale
- The scale at which to drawboundingBoxColour
- Colour to draw the bounding boxmeshColour
- Colour to draw the meshconnectionColour
- Colour to draw the connectionspointColour
- Colour to draw the pointspublic int[][] getReferenceTriangles()
public int[][] getReferenceConnections()
public MultiTracker getModelTracker()
public MultiTracker.TrackerVars getInitialVars()
public void initialiseFaceModel(MultiTracker.TrackedFace face)
MultiTracker.initShape(Rectangle, Matrix, Matrix)
with the
rectangle of MultiTracker.TrackedFace.redetectedBounds
and the face shape and
the reference shape. Assumes that the bounds have been already set up.face
- The face to initialisepublic float getSearchAreaSize()
public void setSearchAreaSize(float searchAreaSize)
searchAreaSize
- the searchAreaSize to setpublic Float[] getConnectionColour()
public void setConnectionColour(Float[] connectionColour)
connectionColour
- the connectionColour to setpublic Float[] getPointColour()
public void setPointColour(Float[] pointColour)
pointColour
- the pointColour to setpublic Float[] getMeshColour()
public void setMeshColour(Float[] meshColour)
meshColour
- the meshColour to setpublic Float[] getBoundingBoxColour()
public void setBoundingBoxColour(Float[] boundingBoxColour)
boundingBoxColour
- the boundingBoxColour to setpublic Float[] getSearchAreaColour()
public void setSearchAreaColour(Float[] searchAreaColour)
searchAreaColour
- the searchAreaColour to setpublic List<MultiTracker.TrackedFace> getTrackedFaces()
track(MBFImage)
or track(FImage)
.public List<Triangle> getTriangles(MultiTracker.TrackedFace face)
face
- the MultiTracker.TrackedFace
public static List<Triangle> getTriangles(Jama.Matrix shape, Jama.Matrix visi, int[][] triangles)
shape
- the shape matrixvisi
- the visibility matrixtriangles
- the triangle definitionspublic void setRedetectEvery(int nFrames)
nFrames
- The number of frames.