Class HumanFaceImpl
java.lang.Object
cz.fidentis.analyst.data.face.impl.HumanFaceImpl
- All Implemented Interfaces:
HumanFace
,Serializable
A human face implementation.
- See Also:
-
Field Summary
Fields inherited from interface cz.fidentis.analyst.data.face.HumanFace
LANDMARK_FILE_SUFFIX
-
Constructor Summary
ConstructorsConstructorDescriptionHumanFaceImpl
(File file) Reads a 3D human face from the given OBJ file.HumanFaceImpl
(File file, boolean loadLandmarks) Reads a 3D human face from the given OBJ file.HumanFaceImpl
(String name, MeshModel model, boolean isAverageFace) Creates a human face from existing mesh model. -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected File
findLandmarks
(String fileId) Tries to find a file with landmarks definition based on the name of the face's OBJ file.Returns bounding box ornull
Gets face frontal direction.Gets the glyphs of the face or empty listReturns already computed k-d tree of the triangular mesh ornull
.Returns landmarks of the face.Returns already computed left-balanced k-d tree of the triangular mesh ornull
.Returns the triangular mesh model of the human face.Returns already computed octree of the triangular mesh ornull
.Returns short name of the face without its path in the name.getState()
Returns a deep copy of current state.Returns Interactive mask.boolean
Checks if the human face has assigned a bounding boxboolean
Checks face frontal direction is computed.boolean
Checks if the human face has assigned glyphsint
hashCode()
boolean
Checks if HumanFace has KdTree calculatedboolean
Checks if HumanFace has LeftBalancedKdTree calculatedboolean
Checks if HumanFace has octree calculatedboolean
Returnstrue
if the face has the symmetry plane computed.boolean
void
setBoundingBox
(Box boundingBox) Set a bounding box.void
setFaceFrontalDirection
(Ray faceFrontalDirection) Set face frontal direction.void
Sets the glyphs.void
Sets the k-d treevoid
Sets the k-d tree left-balanced k-d tree.void
Sets the octreevoid
setState
(HumanFaceState state) Falls back to given state.void
setSurfaceMask
(SurfaceMask surfaceMask) Set a surface mask.void
setSymmetryPlane
(Plane plane) Sets the symmetry plane.
-
Constructor Details
-
HumanFaceImpl
Reads a 3D human face from the given OBJ file.- Parameters:
file
- OBJ fileloadLandmarks
- Iftrue
, then the constructor aims to load landmarks along with the mesh. Useinvalid @link
{@link #getLandmarks().hasLandmarks()
- Throws:
IOException
- on I/O failure
-
HumanFaceImpl
Reads a 3D human face from the given OBJ file. Also loads landmarks (feature points) if appropriate file is found.- Parameters:
file
- OBJ file- Throws:
IOException
- on I/O failure
-
HumanFaceImpl
Creates a human face from existing mesh model. The mesh model is stored directly (not copied).- Parameters:
model
- Mesh model- Throws:
IllegalArgumentException
- if themodel
isnull
-
-
Method Details
-
getMeshModel
Returns the triangular mesh model of the human face.- Specified by:
getMeshModel
in interfaceHumanFace
- Returns:
- the triangular mesh model of the human face
-
setSymmetryPlane
Description copied from interface:HumanFace
Sets the symmetry plane. If the input argument isnull
, then removes the plane.- Specified by:
setSymmetryPlane
in interfaceHumanFace
- Parameters:
plane
- The new symmetry plane
-
getSymmetryPlane
- Specified by:
getSymmetryPlane
in interfaceHumanFace
- Returns:
- The face's symmetry plane
-
hasSymmetryPlane
public boolean hasSymmetryPlane()Description copied from interface:HumanFace
Returnstrue
if the face has the symmetry plane computed.- Specified by:
hasSymmetryPlane
in interfaceHumanFace
- Returns:
true
if the face has the symmetry plane computed.
-
getLandmarks
Description copied from interface:HumanFace
Returns landmarks of the face.- Specified by:
getLandmarks
in interfaceHumanFace
- Returns:
Landmarks
of the face
-
getShortName
Description copied from interface:HumanFace
Returns short name of the face without its path in the name. May not be unique.- Specified by:
getShortName
in interfaceHumanFace
- Returns:
- short name of the face without its path in the name
-
getOctree
Description copied from interface:HumanFace
Returns already computed octree of the triangular mesh ornull
. -
hasOctree
public boolean hasOctree()Description copied from interface:HumanFace
Checks if HumanFace has octree calculated -
setOctree
Description copied from interface:HumanFace
Sets the octree -
getKdTree
Description copied from interface:HumanFace
Returns already computed k-d tree of the triangular mesh ornull
. -
setKdTree
Description copied from interface:HumanFace
Sets the k-d tree -
hasKdTree
public boolean hasKdTree()Description copied from interface:HumanFace
Checks if HumanFace has KdTree calculated -
getLeftBalancedKdTree
Description copied from interface:HumanFace
Returns already computed left-balanced k-d tree of the triangular mesh ornull
.- Specified by:
getLeftBalancedKdTree
in interfaceHumanFace
- Returns:
- Already computed left-balanced k-d tree of the triangular mesh or
null
-
setLeftBalancedKdTree
Description copied from interface:HumanFace
Sets the k-d tree left-balanced k-d tree.- Specified by:
setLeftBalancedKdTree
in interfaceHumanFace
- Parameters:
kdTree
- New left-balanced k-d tree. Can benull
.
-
hasLeftBalancedKdTree
public boolean hasLeftBalancedKdTree()Description copied from interface:HumanFace
Checks if HumanFace has LeftBalancedKdTree calculated- Specified by:
hasLeftBalancedKdTree
in interfaceHumanFace
- Returns:
- true if yes and false if not
-
getSurfaceMask
Description copied from interface:HumanFace
Returns Interactive mask. The mask can be empty;- Specified by:
getSurfaceMask
in interfaceHumanFace
- Returns:
- the interactive mask
-
getState
Description copied from interface:HumanFace
Returns a deep copy of current state. -
setState
Description copied from interface:HumanFace
Falls back to given state. No event is triggered - it up to the caller. -
getGlyphs
Description copied from interface:HumanFace
Gets the glyphs of the face or empty list -
setGlyphs
Description copied from interface:HumanFace
Sets the glyphs. -
hasGlyphs
public boolean hasGlyphs()Description copied from interface:HumanFace
Checks if the human face has assigned glyphs -
getBoundingBox
Description copied from interface:HumanFace
Returns bounding box ornull
- Specified by:
getBoundingBox
in interfaceHumanFace
- Returns:
- bounding box or
null
-
setBoundingBox
Description copied from interface:HumanFace
Set a bounding box.- Specified by:
setBoundingBox
in interfaceHumanFace
- Parameters:
boundingBox
- Bounding box ornull
-
hasBoundingBox
public boolean hasBoundingBox()Description copied from interface:HumanFace
Checks if the human face has assigned a bounding box- Specified by:
hasBoundingBox
in interfaceHumanFace
- Returns:
true
, if the bounding box exists
-
setSurfaceMask
Description copied from interface:HumanFace
Set a surface mask.- Specified by:
setSurfaceMask
in interfaceHumanFace
- Parameters:
surfaceMask
- surfaceMask ornull
-
getFaceFrontalDirection
Description copied from interface:HumanFace
Gets face frontal direction.- Specified by:
getFaceFrontalDirection
in interfaceHumanFace
- Returns:
- face frontal direction
-
setFaceFrontalDirection
Description copied from interface:HumanFace
Set face frontal direction.- Specified by:
setFaceFrontalDirection
in interfaceHumanFace
- Parameters:
faceFrontalDirection
- new face frontal direction
-
hasFaceFrontalDirection
public boolean hasFaceFrontalDirection()Description copied from interface:HumanFace
Checks face frontal direction is computed.- Specified by:
hasFaceFrontalDirection
in interfaceHumanFace
- Returns:
true
if face frontal direction exists
-
hashCode
public int hashCode() -
equals
-
isAverageFace
public boolean isAverageFace()- Specified by:
isAverageFace
in interfaceHumanFace
- Returns:
- is average face
-
findLandmarks
Tries to find a file with landmarks definition based on the name of the face's OBJ file.- Returns:
- The file with landmarks or
null
-