Java API Documentation (Experimental)¶
Tracker interface¶
-
public interface
Tracker
¶ The Tracker interface
-
public TrackerResultFuture
track
(ImageHeader imageHeader, long timestamp)¶ Tracks the given frame asynchronously with the TrackerResultFuture API.
Note
Calling this function is non-blocking, so calling it again with the next frame without waiting for the result is possible. Also see get_concurrent_calculations().
- Parameters:
imageHeader – image descriptor
timestamp – timestamp of the image (in ms)
-
public java.util.List<EmotionID>
getEmotionIDs
()¶ Returns the emotion IDs provided by the loaded model. The order is the same as returned by
ResultType.getEmotions()
.See also:
ResultType
-
public java.util.List<String>
getEmotionNames
()¶ Returns the emotion names provided by the loaded model. The order is the same as returned by
ResultType.getEmotions()
.See also:
ResultType
-
public float
getMinimumFaceRatio
()¶ Gets the current minimum face ratio
See also:
setMinimumFaceRatio
-
public void
setMinimumFaceRatio
(float minimumFaceRatio)¶ Sets the minimum face ratio
The minimum face ratio defines the minimum face size the algorithm is looking for. The actual size is calculated from the smaller image dimension multiplied by the set minimum face ratio. The default value is 1/4.8, i.e., in case of VGA resolution input (640x480), the minimum face size is 100x100.
Warning
The shape alignment and classifier performance can degrade in case of low resolution, tracking faces smaller than 75x75 is ill advised.
- Parameters:
minimumFaceRatio – new minimum face size as a ratio of the smaller image dimension
-
public boolean
isFaceTrackingEnabled
()¶ Returns wether the face tracker is enabled
-
public void
setFaceTrackingEnabled
(boolean enable)¶ Sets the face tracker to be enabled or disabled
- Parameters:
enable – boolean to set to
-
public boolean
isEmotionEnabled
(EmotionID emoID)¶ Returns wether the specified emotion is enabled
- Parameters:
emoID – emotion to query
-
public void
setEmotionEnabled
(EmotionID emoID, boolean enable)¶ Sets the specified emotion to enabled or disabled
- Parameters:
emoID – emotion to set
enable – boolean to set to
-
public String
getModelName
()¶ Returns the name (version etc) of the loaded model.
- Returns:
name of the model
-
public Version
getSdkVersion
()¶ Returns the version of the SDK (and not the model)
- Returns:
version of the SDK
-
public String
getSdkVersionString
()¶ Returns the version string of the SDK (and not the model)
- Returns:
version string of the SDK
NelTracker class¶
ImageHeader class¶
-
public class
ImageHeader
¶ Descriptor class for image data (non-owning)
-
public
ImageHeader
()¶ Constructor
-
public java.nio.ByteBuffer
getData
()¶ - Returns:
pointer to the byte array of the image
-
public void
setData
(java.nio.ByteBuffer value)¶ - Parameters:
value – pointer to the byte array of the image
-
public ImageFormat
getFormat
()¶ - Returns:
image format
-
public void
setFormat
(ImageFormat value)¶ - Parameters:
value – image format
-
public int
getHeight
()¶ - Returns:
height of the image in pixels
-
public void
setHeight
(int value)¶ - Returns:
height of the image in pixels
-
public int
getStride
()¶ - Returns:
length of one row of pixels in bytes (e.g: 3*width + padding)
-
public void
setStride
(int value)¶ - Parameters:
value – length of one row of pixels in bytes (e.g: 3*width + padding)
-
public int
getWidth
()¶ - Returns:
width of the image in pixels
-
public void
setWidth
(int value)¶ - Parameters:
value – width of the image in pixels
-
public
-
public enum
ImageFormat
¶ -
public static final ImageFormat
BGR
¶ 24-bit BGR
-
public static final ImageFormat
BGRA
¶ 32-bit BGRA or 32-bit BGR_
-
public static final ImageFormat
Grayscale
¶ 8-bit grayscale
-
public static final ImageFormat
RGB
¶ 24-bit RGB
-
public static final ImageFormat
RGBA
¶ 32-bit RGBA or 32-bit RGB_
-
public static final ImageFormat
Result classes¶
EmotionID¶
-
public enum
EmotionID
¶ IDs for the supported emotions/behaviours
TrackerResultFuture¶
-
public interface
TrackerResultFuture
¶ Simple wrapper over the C++ future class
-
ResultType
get
()¶ Blocks until the future is ready and returns the result.
-
ResultType
ResultType¶
-
public interface
ResultType
¶ The ResultType struct.
-
java.util.List<EmotionData>
getEmotions
()¶ Detected emotions.
-
LandmarkData
getLandmarks
()¶ Tracked landmarks.
-
java.util.List<EmotionData>
LandmarkData¶
-
public interface
LandmarkData
¶ -
double
getScale
()¶ Scale of the face.
-
double
getRoll
()¶ Roll pose angle.
-
double
getPitch
()¶ Pitch pose angle.
-
double
getYaw
()¶ Yaw pose angle.
-
java.util.List<Point3d>
getLandmarks3d
()¶ Positions of the 49 landmarks, in an un-scaled face-centered 3D space.
-
boolean
getIsGood
()¶ Whether the tracking is good quality or not.
-
double
Point2d¶
Point3d¶
EmotionData¶
-
public TrackerResultFuture