public class MeshWarpAligner extends Object implements FaceAligner<KEDetectedFace>
PiecewiseMeshWarp
Constructor and Description |
---|
MeshWarpAligner()
Default constructor
|
MeshWarpAligner(String[][] meshDefinition)
Construct with the given mesh definition
|
Modifier and Type | Method and Description |
---|---|
FImage |
align(KEDetectedFace descriptor)
For the provided face detection, return an aligned version of the face.
|
byte[] |
binaryHeader()
Header for binary input.
|
protected List<Pair<Shape>> |
createMesh(FacialKeypoint[] det) |
protected FacialKeypoint[] |
getActualPoints(FacialKeypoint[] keys,
Jama.Matrix tf0) |
FImage |
getMask()
Return a mask image for aligned faces.
|
protected FImage |
getWarpedImage(FacialKeypoint[] kpts,
FImage patch,
Jama.Matrix tf0) |
void |
readBinary(DataInput in)
Read internal state from in.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
public MeshWarpAligner()
public MeshWarpAligner(String[][] meshDefinition)
meshDefinition
- The mesh definitionprotected FacialKeypoint[] getActualPoints(FacialKeypoint[] keys, Jama.Matrix tf0)
protected List<Pair<Shape>> createMesh(FacialKeypoint[] det)
public FImage align(KEDetectedFace descriptor)
FaceAligner
align
in interface FaceAligner<KEDetectedFace>
descriptor
- the face to alignprotected FImage getWarpedImage(FacialKeypoint[] kpts, FImage patch, Jama.Matrix tf0)
public FImage getMask()
FaceAligner
getMask
in interface FaceAligner<KEDetectedFace>
public void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
in
- source to read from.IOException
- an error reading inputpublic byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
public void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to out