public class DetectedFace extends Object implements ReadWriteableBinary
Modifier and Type | Field and Description |
---|---|
protected Rectangle |
bounds
The upright bounds of the face in the image in which it was detected
|
protected float |
confidence
The confidence of the detection; higher numbers mean higher confidence.
|
protected FImage |
facePatch
The extracted sub-image representing the face.
|
Constructor and Description |
---|
DetectedFace()
Default constructor with an empty rectangle as bounds
|
DetectedFace(Rectangle bounds,
FImage patch,
float confidence)
Construct with a bounds rectangle (the bounding box of the face in the
detection image) and an image patch that describes the contents of the
bounds rectangle from the original image.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
binaryHeader()
Header for binary input.
|
Rectangle |
getBounds()
Get the bounding box of the face in the detection image.
|
float |
getConfidence()
Get the confidence of the detection.
|
FImage |
getFacePatch()
Returns the sub-image representing the face.
|
Shape |
getShape()
Get the shape of the detection.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
void |
setBounds(Rectangle rect)
Set the bounds of this face.
|
void |
setConfidence(int confidence)
Set the confidence of the detection.
|
void |
setFacePatch(FImage img)
Reset the face patch image
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
protected Rectangle bounds
protected FImage facePatch
protected float confidence
public DetectedFace()
public DetectedFace(Rectangle bounds, FImage patch, float confidence)
bounds
- The bounding box of the face in the detection image.patch
- The subimage describing the contents of the bounding box.confidence
- The confidence of the detection.public FImage getFacePatch()
public void setFacePatch(FImage img)
img
- The imagepublic Rectangle getBounds()
getShape()
, or it might
encompass that shape.public void setBounds(Rectangle rect)
rect
- The new boundspublic void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to outpublic byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
public void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
in
- source to read from.IOException
- an error reading inputpublic float getConfidence()
public Shape getShape()
public void setConfidence(int confidence)
confidence
- the confidence.