visageSDK
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
VisageCSWrapper.FDP Class Reference

Feature points of a face. More...

Public Member Functions

 FDP ()
 Constructor. More...
 
 FDP (FDP featurePoints)
 Copy constructor. More...
 
int readFromFile (String name)
 Read from an FDP file. More...
 
void saveToFile (String fileName)
 Write feature point definitions to the FDP file, changing the FDP file name. More...
 
FeaturePoint getFP (int group, int n)
 Get a feature point by its group and index. More...
 
const FeaturePoint getFP (String name)
 Get a feature point by its name. More...
 
void setFP (int group, int n, FeaturePoint f)
 Set a feature specified by its group and index. More...
 
void setFP (String name, FeaturePoint fp)
 Set a feature specified by its name. More...
 
float[] getFPPos (int group, int n)
 Get the position of a feature point specified by its group and index. More...
 
float[] getFPPos (String name)
 Get the position of a feature point specified by its name. More...
 
void setFPPos (int group, int n, float[] pos)
 Set the position of a feature point specified by its group and index. More...
 
void setFPPos (String name, float[] pos)
 Set the position of a feature point specified by its name. More...
 
void setFPPos (int group, int n, float x, float y, float z)
 Set the position of a feature point specified by its group and index. More...
 
void setFPPos (String name, float x, float y, float z)
 Set the position of a feature point specified by its name. More...
 
float getFPQuality (int group, int n)
 Get the quality of a feature point specified by its group and index. More...
 
float getFPQuality (String name)
 Get the quality of a feature point specified by its name. More...
 
void setFPQuality (int group, int n, float quality)
 Set the quality of a feature point specified by its group and index. More...
 
void setFPQuality (String name, float quality)
 Set the position of a feature point specified by its name. More...
 
void reset ()
 Resets all feature points. More...
 
bool FPIsDefined (int group, int n)
 Returns true if the feature point is defined. More...
 
bool FPIsDefined (String name)
 Returns true if the feature point is defined. More...
 
bool FPIsDetected (int group, int n)
 Returns true if the feature point is detected. More...
 
bool FPIsDetected (String name)
 Returns true if the feature point is detected. More...
 

Static Public Member Functions

static void parseFPName (String name, ref int group, ref int n)
 Get feature point group and index from its name. More...
 
static String getFPName (int group, int n)
 Get feature point name from group and index. More...
 
static bool FPIsValid (int group, int n)
 Returns true if specified feature point identifier is valid. More...
 
static bool FPIsValid (String name)
 Returns true if specified feature point identifier is valid. More...
 
static int GroupSize (int group)
 Get the size of the specified feature point group. More...
 

Public Attributes

FeaturePoint[] ul
 Vertices that are part of the upper lip region. More...
 
FeaturePoint[] ll
 Vertices that are part of the lower lip region. More...
 

Static Public Attributes

static int FP_START_GROUP_INDEX = 2
 Index of the first feature point group.
 
static int FP_END_GROUP_INDEX = 17
 Index of the last feature point group.
 
static int FP_NUMBER_OF_GROUPS = 16
 Number of groups.
 

Detailed Description

Feature points of a face.

This class is a container for facial feature points as defined by MPEG-4 FBA standard, as well as some additional feature points. Feature points are identified by their group (for example, feature points of the nose constitute their own group) and index. So, for example, the tip of the chin belongs to group 2 and has index 1, so it is identified as point 2.1. The identification of all feature points is illustrated in the image below:

mpeg-4_fba.png
Facial Feature Points (FP)
half_profile_physical_2d.png
Physical contour

Groups 2 - 11 contain feature points defined according to the MPEG-4 FBA standard, and groups 12, 14, 16 and 17 contain additional feature points that are not part of the MPEG-4 standard (12.1, 12.5, 12.6, 12.7, 12.8, 12.9, 12.10, 12.11, 12.12, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 14.9, 14.10, 14.11, 14.12, 14.21, 14.22, 14.23, 14.24, 14.25, 16.1, 16.2, 16.3, 16.4, 16.5, 16.6, 16.7, 16.8, 16.9, 16.10, 16.11, 16.12, 16.13, 16.14, 16.15, 16.16, 16.17, 16.18, 16.19, 16.20, 16.21, 16.22, 16.23, 16.24, 16.25, 16.26, 16.27, 16.28, 17.5, 17.6, 17.7, 17.8, 17.9, 17.10, 17.11, 17.12, 17.13, 17.14, 17.15, 17.16, 17.17, 17.18, 17.19, 17.20).
Group 15 contains the physical contour points (15.1-15.17). Please note that point 15.17 is exactly identical to point 2.1 (2.1 point exists for MPEG-4 compatibility purposes).

FDP class stores feature point information. It also provides functions for reading and writing the feature point data as files, as well as certain auxiliary members that deal with normalization of feature points and their classification according to facial region.

The actual data for each feature point is stored in the structure FeaturePoint. One such structure is allocated for each feature point. To access a feature point, use one of the functions getFP() that access a feature point by its group and index expressed either as integer values, or as a string (e.g. "2.1"). Functions getFPPos() are available as a convenience, to access the feature point coordinates directly, without first accessing the FeaturePoint structure.

The feature points may relate to a particular 3D model. In such a case it is interesting to know, for each feature point, to which vertex it belongs. For this purpose, the FeaturePoint structure contains the mesh identifier and vertex index that correspond to the feature point and the FDP class provides functions to access this data.

Left-right convention

References to left and right in feature point definitions are given from the perspective of the face itself so "right eye" can be imagined as "my right eye". When referring to feature points in an image, it is assumed that image is taken by camera and not mirrored so "right eye" is on the left in the image, as shown in feature points illustration above.

See also
FeaturePoint

Definition at line 102 of file FDP.cs.

Constructor & Destructor Documentation

VisageCSWrapper.FDP.FDP ( )

Constructor.

Creates an empty FDP object.

VisageCSWrapper.FDP.FDP ( FDP  featurePoints)

Copy constructor.

Makes a copy of FDP object.

Parameters
featurePoints

Member Function Documentation

bool VisageCSWrapper.FDP.FPIsDefined ( int  group,
int  n 
)

Returns true if the feature point is defined.

For more information see FeaturePoint.defined.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
Returns
True if the feature point is defined, false otherwise.
bool VisageCSWrapper.FDP.FPIsDefined ( String  name)

Returns true if the feature point is defined.

For more information see FeaturePoint.defined.

Parameters
nameFeature point name (e.g. "7.1").
Returns
True if the feature point is defined, false otherwise.
bool VisageCSWrapper.FDP.FPIsDetected ( int  group,
int  n 
)

Returns true if the feature point is detected.

For more information see FeaturePoint.detected.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
Returns
True if the feature point is detected, false otherwise.
bool VisageCSWrapper.FDP.FPIsDetected ( String  name)

Returns true if the feature point is detected.

For more information see FeaturePoint.detected.

Parameters
nameFeature point name (e.g. "7.1").
Returns
True if the feature point is detected, false otherwise.
static bool VisageCSWrapper.FDP.FPIsValid ( int  group,
int  n 
)
static

Returns true if specified feature point identifier is valid.

Identifier is valid if it consists of feature point group and feature point index within valid ranges.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
Returns
True if specified feature point identifier is valid, false otherwise.
static bool VisageCSWrapper.FDP.FPIsValid ( String  name)
static

Returns true if specified feature point identifier is valid.

Identifier i.e. feature point name is valid if it consists of feature point group and feature point index within valid ranges and is of the correct format. Valid range for feature point group is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX. Valid range for feature point index is from 1 to the size of particular group.

Parameters
nameFeature point name (e.g. "7.1").
Returns
True if specified feature point identifier is valid, false otherwise.
FeaturePoint VisageCSWrapper.FDP.getFP ( int  group,
int  n 
)

Get a feature point by its group and index.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
Returns
Feature point.
const FeaturePoint VisageCSWrapper.FDP.getFP ( String  name)

Get a feature point by its name.

Parameters
nameFeature point name (e.g. "7.1").
Returns
Feature point.
static String VisageCSWrapper.FDP.getFPName ( int  group,
int  n 
)
static

Get feature point name from group and index.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
Returns
Feature point name.
float [] VisageCSWrapper.FDP.getFPPos ( int  group,
int  n 
)

Get the position of a feature point specified by its group and index.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
Returns
Vertex position (array of 3 floating point numbers).
float [] VisageCSWrapper.FDP.getFPPos ( String  name)

Get the position of a feature point specified by its name.

Parameters
nameFeature point name (e.g. "7.1").
Returns
Vertex position (array of 3 floating point numbers).
float VisageCSWrapper.FDP.getFPQuality ( int  group,
int  n 
)

Get the quality of a feature point specified by its group and index.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
Returns
Quality value.
float VisageCSWrapper.FDP.getFPQuality ( String  name)

Get the quality of a feature point specified by its name.

Parameters
nameFeature point name (e.g. "7.1").
Returns
Quality value.
static int VisageCSWrapper.FDP.GroupSize ( int  group)
static

Get the size of the specified feature point group.

Valid range for group is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
Returns
Size of the specified feature point group.
static void VisageCSWrapper.FDP.parseFPName ( String  name,
ref int  group,
ref int  n 
)
static

Get feature point group and index from its name.

Parameters
nameFeature point name (e.g. "7.1").
groupReturned feature point group.
nReturned feature point index.
int VisageCSWrapper.FDP.readFromFile ( String  name)

Read from an FDP file.

The FDP file format consists of one line of text for each feature point, in the following format: <group>.<index> <x> <y> <z> <mesh_index>.<vertex_index>

Parameters
nameFilename.
Returns
0 - failure, 1 - success, -1 - old version, needs re-indexing.
void VisageCSWrapper.FDP.reset ( )

Resets all feature points.

The value of all feature points is set to "undefined".

void VisageCSWrapper.FDP.saveToFile ( String  fileName)

Write feature point definitions to the FDP file, changing the FDP file name.

Parameters
fileNameFilename.
void VisageCSWrapper.FDP.setFP ( int  group,
int  n,
FeaturePoint  f 
)

Set a feature specified by its group and index.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
fThe feature point to set.
void VisageCSWrapper.FDP.setFP ( String  name,
FeaturePoint  fp 
)

Set a feature specified by its name.

Parameters
nameFeature point name (e.g. "7.1").
fpThe feature point to set.
void VisageCSWrapper.FDP.setFPPos ( int  group,
int  n,
float[]  pos 
)

Set the position of a feature point specified by its group and index.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
posVertex position (array of 3 floating point values).
void VisageCSWrapper.FDP.setFPPos ( String  name,
float[]  pos 
)

Set the position of a feature point specified by its name.

Parameters
nameFeature point name (e.g. "7.1").
posVertex position (array of 3 floating point numbers).
void VisageCSWrapper.FDP.setFPPos ( int  group,
int  n,
float  x,
float  y,
float  z 
)

Set the position of a feature point specified by its group and index.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
xVertex x position.
yVertex y position.
zVertex z position.
void VisageCSWrapper.FDP.setFPPos ( String  name,
float  x,
float  y,
float  z 
)

Set the position of a feature point specified by its name.

Parameters
nameFeature point name (e.g. "7.1").
xVertex x position.
yVertex y position.
zVertex z position.
void VisageCSWrapper.FDP.setFPQuality ( int  group,
int  n,
float  quality 
)

Set the quality of a feature point specified by its group and index.

Parameters
groupFeature point group. Valid range is from FDP::FP_START_GROUP_INDEX to FDP::FP_END_GROUP_INDEX.
nFeature point index. Valid range is from 1 to the size of particular group. Group sizes can be obtained using groupSize().
qualityQuality value.
void VisageCSWrapper.FDP.setFPQuality ( String  name,
float  quality 
)

Set the position of a feature point specified by its name.

Parameters
nameFeature point name (e.g. "7.1").
qualityVertex position (array of 3 floating point numbers).

Member Data Documentation

FeaturePoint [] VisageCSWrapper.FDP.ll

Vertices that are part of the lower lip region.

Definition at line 308 of file FDP.cs.

FeaturePoint [] VisageCSWrapper.FDP.ul

Vertices that are part of the upper lip region.

Definition at line 302 of file FDP.cs.


The documentation for this class was generated from the following file: