Package org.jmrtd.lds.iso19794
Class FaceImageInfo
- java.lang.Object
-
- org.jmrtd.lds.AbstractImageInfo
-
- org.jmrtd.lds.iso19794.FaceImageInfo
-
- All Implemented Interfaces:
Serializable
,ImageInfo
,LDSElement
public class FaceImageInfo extends AbstractImageInfo
Data structure for storing facial image data. This represents a facial record data block as specified in Section 5.5, 5.6, and 5.7 of ISO/IEC FCD 19794-5 (2004-03-22, AKA Annex D). A facial record data block contains a single facial image.- Version:
- $Revision: 1808 $
- Author:
- The JMRTD team ([email protected])
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FaceImageInfo.Expression
Expression code based on Section 5.5.7 of ISO 19794-5.static class
FaceImageInfo.EyeColor
Eye color code based on Section 5.5.4 of ISO 19794-5.static class
FaceImageInfo.FaceImageType
Face image type code based on Section 5.7.1 of ISO 19794-5.static class
FaceImageInfo.FeaturePoint
Feature points as described in Section 5.6.3 of ISO/IEC FCD 19794-5.static class
FaceImageInfo.Features
Feature flags meaning based on Section 5.5.6 of ISO 19794-5.static class
FaceImageInfo.HairColor
Hair color code based on Section 5.5.5 of ISO 19794-5.static class
FaceImageInfo.ImageColorSpace
Color space code based on Section 5.7.4 of ISO 19794-5.static class
FaceImageInfo.ImageDataType
Image data type code based on Section 5.7.2 of ISO 19794-5.static class
FaceImageInfo.SourceType
Source type based on Section 5.7.6 of ISO 19794-5.
-
Field Summary
-
Fields inherited from interface org.jmrtd.lds.ImageInfo
JPEG_MIME_TYPE, JPEG2000_MIME_TYPE, TYPE_FINGER, TYPE_IRIS, TYPE_PORTRAIT, TYPE_SIGNATURE_OR_MARK, TYPE_UNKNOWN, WSQ_MIME_TYPE
-
-
Constructor Summary
Constructors Constructor Description FaceImageInfo(InputStream inputStream)
Constructs a new face information structure from binary encoding.FaceImageInfo(net.sf.scuba.data.Gender gender, FaceImageInfo.EyeColor eyeColor, int featureMask, int hairColor, int expression, int[] poseAngle, int[] poseAngleUncertainty, int faceImageType, int colorSpace, int sourceType, int deviceType, int quality, FaceImageInfo.FeaturePoint[] featurePoints, int width, int height, InputStream imageInputStream, int imageLength, int imageDataType)
Constructs a new face information data structure instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getColorSpace()
Returns the image color space (rgb, grayscale, etc).int
getDeviceType()
Returns the device type.int
getExpression()
Returns the expression (neutral, smiling, eyebrow raised, etc).FaceImageInfo.EyeColor
getEyeColor()
Returns the eye color (black, blue, brown, etc).int
getFaceImageType()
Returns the face image type (full frontal, token frontal, etc).int
getFeatureMask()
Returns the feature mask.FaceImageInfo.FeaturePoint[]
getFeaturePoints()
Returns the available feature points of this face.net.sf.scuba.data.Gender
getGender()
Returns the gender (male, female, etc).int
getHairColor()
Returns the hair color (bald, black, blonde, etc).int
getImageDataType()
Returns the image data type.int[]
getPoseAngle()
Returns the pose angle as an integer array of length 3, containing yaw, pitch, and roll angle in encoded form.int[]
getPoseAngleUncertainty()
Returns the pose angle uncertainty as an integer array of length 3, containing yaw, pitch, and roll angle uncertainty.int
getQuality()
Returns the quality as unsigned integer.long
getRecordLength()
Returns the record length.int
getSourceType()
Returns the source type (camera, scanner, etc).int
hashCode()
protected void
readObject(InputStream inputStream)
Reads this object from a stream.String
toString()
Generates a textual representation of this object.void
writeObject(OutputStream outputStream)
Writes this face image info to output stream.-
Methods inherited from class org.jmrtd.lds.AbstractImageInfo
getEncoded, getHeight, getImageInputStream, getImageLength, getMimeType, getType, getWidth, readImage, setHeight, setImageBytes, setMimeType, setType, setWidth, writeImage
-
-
-
-
Field Detail
-
EYE_COLOR_UNSPECIFIED
public static final int EYE_COLOR_UNSPECIFIED
- See Also:
- Constant Field Values
-
EYE_COLOR_BLACK
public static final int EYE_COLOR_BLACK
- See Also:
- Constant Field Values
-
EYE_COLOR_BLUE
public static final int EYE_COLOR_BLUE
- See Also:
- Constant Field Values
-
EYE_COLOR_BROWN
public static final int EYE_COLOR_BROWN
- See Also:
- Constant Field Values
-
EYE_COLOR_GRAY
public static final int EYE_COLOR_GRAY
- See Also:
- Constant Field Values
-
EYE_COLOR_GREEN
public static final int EYE_COLOR_GREEN
- See Also:
- Constant Field Values
-
EYE_COLOR_MULTI_COLORED
public static final int EYE_COLOR_MULTI_COLORED
- See Also:
- Constant Field Values
-
EYE_COLOR_PINK
public static final int EYE_COLOR_PINK
- See Also:
- Constant Field Values
-
EYE_COLOR_UNKNOWN
public static final int EYE_COLOR_UNKNOWN
- See Also:
- Constant Field Values
-
HAIR_COLOR_UNSPECIFIED
public static final int HAIR_COLOR_UNSPECIFIED
- See Also:
- Constant Field Values
-
HAIR_COLOR_BALD
public static final int HAIR_COLOR_BALD
- See Also:
- Constant Field Values
-
HAIR_COLOR_BLACK
public static final int HAIR_COLOR_BLACK
- See Also:
- Constant Field Values
-
HAIR_COLOR_BLONDE
public static final int HAIR_COLOR_BLONDE
- See Also:
- Constant Field Values
-
HAIR_COLOR_BROWN
public static final int HAIR_COLOR_BROWN
- See Also:
- Constant Field Values
-
HAIR_COLOR_GRAY
public static final int HAIR_COLOR_GRAY
- See Also:
- Constant Field Values
-
HAIR_COLOR_WHITE
public static final int HAIR_COLOR_WHITE
- See Also:
- Constant Field Values
-
HAIR_COLOR_RED
public static final int HAIR_COLOR_RED
- See Also:
- Constant Field Values
-
HAIR_COLOR_GREEN
public static final int HAIR_COLOR_GREEN
- See Also:
- Constant Field Values
-
HAIR_COLOR_BLUE
public static final int HAIR_COLOR_BLUE
- See Also:
- Constant Field Values
-
HAIR_COLOR_UNKNOWN
public static final int HAIR_COLOR_UNKNOWN
- See Also:
- Constant Field Values
-
EXPRESSION_UNSPECIFIED
public static final short EXPRESSION_UNSPECIFIED
- See Also:
- Constant Field Values
-
EXPRESSION_NEUTRAL
public static final short EXPRESSION_NEUTRAL
- See Also:
- Constant Field Values
-
EXPRESSION_SMILE_CLOSED
public static final short EXPRESSION_SMILE_CLOSED
- See Also:
- Constant Field Values
-
EXPRESSION_SMILE_OPEN
public static final short EXPRESSION_SMILE_OPEN
- See Also:
- Constant Field Values
-
EXPRESSION_RAISED_EYEBROWS
public static final short EXPRESSION_RAISED_EYEBROWS
- See Also:
- Constant Field Values
-
EXPRESSION_EYES_LOOKING_AWAY
public static final short EXPRESSION_EYES_LOOKING_AWAY
- See Also:
- Constant Field Values
-
EXPRESSION_SQUINTING
public static final short EXPRESSION_SQUINTING
- See Also:
- Constant Field Values
-
EXPRESSION_FROWNING
public static final short EXPRESSION_FROWNING
- See Also:
- Constant Field Values
-
FACE_IMAGE_TYPE_BASIC
public static final int FACE_IMAGE_TYPE_BASIC
- See Also:
- Constant Field Values
-
FACE_IMAGE_TYPE_FULL_FRONTAL
public static final int FACE_IMAGE_TYPE_FULL_FRONTAL
- See Also:
- Constant Field Values
-
FACE_IMAGE_TYPE_TOKEN_FRONTAL
public static final int FACE_IMAGE_TYPE_TOKEN_FRONTAL
- See Also:
- Constant Field Values
-
IMAGE_DATA_TYPE_JPEG
public static final int IMAGE_DATA_TYPE_JPEG
- See Also:
- Constant Field Values
-
IMAGE_DATA_TYPE_JPEG2000
public static final int IMAGE_DATA_TYPE_JPEG2000
- See Also:
- Constant Field Values
-
IMAGE_COLOR_SPACE_UNSPECIFIED
public static final int IMAGE_COLOR_SPACE_UNSPECIFIED
- See Also:
- Constant Field Values
-
IMAGE_COLOR_SPACE_RGB24
public static final int IMAGE_COLOR_SPACE_RGB24
- See Also:
- Constant Field Values
-
IMAGE_COLOR_SPACE_YUV422
public static final int IMAGE_COLOR_SPACE_YUV422
- See Also:
- Constant Field Values
-
IMAGE_COLOR_SPACE_GRAY8
public static final int IMAGE_COLOR_SPACE_GRAY8
- See Also:
- Constant Field Values
-
IMAGE_COLOR_SPACE_OTHER
public static final int IMAGE_COLOR_SPACE_OTHER
- See Also:
- Constant Field Values
-
SOURCE_TYPE_UNSPECIFIED
public static final int SOURCE_TYPE_UNSPECIFIED
- See Also:
- Constant Field Values
-
SOURCE_TYPE_STATIC_PHOTO_UNKNOWN_SOURCE
public static final int SOURCE_TYPE_STATIC_PHOTO_UNKNOWN_SOURCE
- See Also:
- Constant Field Values
-
SOURCE_TYPE_STATIC_PHOTO_DIGITAL_CAM
public static final int SOURCE_TYPE_STATIC_PHOTO_DIGITAL_CAM
- See Also:
- Constant Field Values
-
SOURCE_TYPE_STATIC_PHOTO_SCANNER
public static final int SOURCE_TYPE_STATIC_PHOTO_SCANNER
- See Also:
- Constant Field Values
-
SOURCE_TYPE_VIDEO_FRAME_UNKNOWN_SOURCE
public static final int SOURCE_TYPE_VIDEO_FRAME_UNKNOWN_SOURCE
- See Also:
- Constant Field Values
-
SOURCE_TYPE_VIDEO_FRAME_ANALOG_CAM
public static final int SOURCE_TYPE_VIDEO_FRAME_ANALOG_CAM
- See Also:
- Constant Field Values
-
SOURCE_TYPE_VIDEO_FRAME_DIGITAL_CAM
public static final int SOURCE_TYPE_VIDEO_FRAME_DIGITAL_CAM
- See Also:
- Constant Field Values
-
SOURCE_TYPE_UNKNOWN
public static final int SOURCE_TYPE_UNKNOWN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FaceImageInfo
public FaceImageInfo(net.sf.scuba.data.Gender gender, FaceImageInfo.EyeColor eyeColor, int featureMask, int hairColor, int expression, int[] poseAngle, int[] poseAngleUncertainty, int faceImageType, int colorSpace, int sourceType, int deviceType, int quality, FaceImageInfo.FeaturePoint[] featurePoints, int width, int height, InputStream imageInputStream, int imageLength, int imageDataType) throws IOException
Constructs a new face information data structure instance.- Parameters:
gender
- gendereyeColor
- eye colorfeatureMask
- feature mask (least significant 3 bytes)hairColor
- hair colorexpression
- expressionposeAngle
- (encoded) pose angleposeAngleUncertainty
- pose angle uncertaintyfaceImageType
- face image typecolorSpace
- color spacesourceType
- source typedeviceType
- capture device type (unspecified is0x00
)quality
- qualityfeaturePoints
- feature pointswidth
- widthheight
- heightimageInputStream
- encoded image bytesimageLength
- length of encoded imageimageDataType
- either IMAGE_DATA_TYPE_JPEG or IMAGE_DATA_TYPE_JPEG2000- Throws:
IOException
- on error reading input
-
FaceImageInfo
public FaceImageInfo(InputStream inputStream) throws IOException
Constructs a new face information structure from binary encoding.- Parameters:
inputStream
- an input stream- Throws:
IOException
- if input cannot be read
-
-
Method Detail
-
readObject
protected void readObject(InputStream inputStream) throws IOException
Description copied from class:AbstractImageInfo
Reads this object from a stream.- Specified by:
readObject
in classAbstractImageInfo
- Parameters:
inputStream
- the stream to read from- Throws:
IOException
- on error reading from the stream
-
writeObject
public void writeObject(OutputStream outputStream) throws IOException
Writes this face image info to output stream.- Specified by:
writeObject
in classAbstractImageInfo
- Parameters:
outputStream
- an output stream- Throws:
IOException
- if writing fails
-
getRecordLength
public long getRecordLength()
Returns the record length.- Returns:
- the record length
-
getFeaturePoints
public FaceImageInfo.FeaturePoint[] getFeaturePoints()
Returns the available feature points of this face.- Returns:
- feature points
-
getExpression
public int getExpression()
Returns the expression (neutral, smiling, eyebrow raised, etc).- Returns:
- expression
-
getEyeColor
public FaceImageInfo.EyeColor getEyeColor()
Returns the eye color (black, blue, brown, etc).- Returns:
- eye color
-
getGender
public net.sf.scuba.data.Gender getGender()
Returns the gender (male, female, etc).- Returns:
- gender
-
getHairColor
public int getHairColor()
Returns the hair color (bald, black, blonde, etc).- Returns:
- hair color
-
getFaceImageType
public int getFaceImageType()
Returns the face image type (full frontal, token frontal, etc).- Returns:
- face image type
-
getFeatureMask
public int getFeatureMask()
Returns the feature mask.- Returns:
- feature mask
-
getQuality
public int getQuality()
Returns the quality as unsigned integer.- Returns:
- quality
-
getSourceType
public int getSourceType()
Returns the source type (camera, scanner, etc).- Returns:
- source type
-
getImageDataType
public int getImageDataType()
Returns the image data type.- Returns:
- image data type
-
getColorSpace
public int getColorSpace()
Returns the image color space (rgb, grayscale, etc).- Returns:
- image color space
-
getDeviceType
public int getDeviceType()
Returns the device type.- Returns:
- device type
-
getPoseAngle
public int[] getPoseAngle()
Returns the pose angle as an integer array of length 3, containing yaw, pitch, and roll angle in encoded form.- Returns:
- an integer array of length 3
-
getPoseAngleUncertainty
public int[] getPoseAngleUncertainty()
Returns the pose angle uncertainty as an integer array of length 3, containing yaw, pitch, and roll angle uncertainty.- Returns:
- an integer array of length 3
-
toString
public String toString()
Generates a textual representation of this object.- Overrides:
toString
in classAbstractImageInfo
- Returns:
- a textual representation of this object
- See Also:
Object.toString()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractImageInfo
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractImageInfo
-
-