Class LandmarksImpl
java.lang.Object
cz.fidentis.analyst.data.landmarks.impl.LandmarksImpl
- All Implemented Interfaces:
Landmarks
,Serializable
Implementation of the Landmarks interface.
This class is responsible for managing landmarks on a human face.
Including standard feature points and custom (user) landmarks.
It provides methods to load, add, remove, and retrieve landmarks.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor with no landmarks.LandmarksImpl
(Collection<Landmark> landmarks) Constructor that initializes the landmarks with a given collection of landmarks. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addLandmark
(Landmark landmark) Adds all types ofLandmark
(including standard or custom) to the face if they are not already present.clone()
Clones the landmarksReturns all feature points or empty list.int
Generates a new unique ID for a user-defined landmark.boolean
Checks if HumanFace has feature pointsboolean
removeLandmark
(Landmark landmark) Removes any type ofLandmark
from the face.
-
Constructor Details
-
LandmarksImpl
public LandmarksImpl()Default constructor with no landmarks. -
LandmarksImpl
Constructor that initializes the landmarks with a given collection of landmarks.- Parameters:
landmarks
- Collection of landmarks to initialize with.
-
-
Method Details
-
getAllLandmarks
Description copied from interface:Landmarks
Returns all feature points or empty list.- Specified by:
getAllLandmarks
in interfaceLandmarks
- Returns:
- All landmarks of the face or empty list if no landmarks are present.
-
getStandardFeaturePoints
- Specified by:
getStandardFeaturePoints
in interfaceLandmarks
- Returns:
- list of standard feature points
-
getCustomLandmarks
- Specified by:
getCustomLandmarks
in interfaceLandmarks
- Returns:
- list of custom feature points
-
addLandmark
Description copied from interface:Landmarks
Adds all types ofLandmark
(including standard or custom) to the face if they are not already present.- Specified by:
addLandmark
in interfaceLandmarks
- Parameters:
landmark
-Landmark
to add- Returns:
true
if the landmark was added,false
otherwise
-
removeLandmark
Description copied from interface:Landmarks
Removes any type ofLandmark
from the face.- Specified by:
removeLandmark
in interfaceLandmarks
- Parameters:
landmark
- Landmark to remove- Returns:
- true if the landmark was removed, false otherwise
-
hasLandmarks
public boolean hasLandmarks()Description copied from interface:Landmarks
Checks if HumanFace has feature points- Specified by:
hasLandmarks
in interfaceLandmarks
- Returns:
- true if yes and false if not
-
getNextUserLandmarkId
public int getNextUserLandmarkId()Description copied from interface:Landmarks
Generates a new unique ID for a user-defined landmark. The ID series for user-defined landmarks starts fromID 501
.- Specified by:
getNextUserLandmarkId
in interfaceLandmarks
- Returns:
- a new unique ID for a user-defined landmark
-
clone
Description copied from interface:Landmarks
Clones the landmarks
-