![]() |
ROC SDK
2.4.0
Scalable Face Recognition Software
|
Biometric data storage format and related functions. More...
Data Structures | |
| struct | roc_landmark |
| Data structure for a landmark detection. More... | |
| struct | roc_detection |
| Data structure for a face detection. More... | |
| struct | roc_template |
| A digital encoding of a face. More... | |
Macros | |
| #define | ROC_SUGGESTED_RELATIVE_MIN_SIZE 0.04f |
| Suggested relative minimum face size. More... | |
| #define | ROC_SUGGESTED_ABSOLUTE_MIN_SIZE 20 |
| Suggested absolute minimum face size. More... | |
| #define | ROC_SUGGESTED_FALSE_DETECTION_RATE 0.02f |
| Suggested false detection rate. More... | |
| #define | ROC_OBJECT_SUGGESTED_FALSE_DETECTION_RATE 0.005f |
| Suggested false detection rate for ROC_ALL_OBJECT_DETECTION. More... | |
| #define | ROC_GUN_SUGGESTED_FALSE_DETECTION_RATE 0.1f |
| Suggested false detection rate for ROC_GUN_DETECTION. More... | |
| #define | ROC_TEXT_SUGGESTED_FALSE_DETECTION_RATE 0.02f |
| Suggested false detection rate for ROC_TEXT_DETECTION. More... | |
| #define | ROC_FINGERPRINT_SUGGESTED_FALSE_DETECTION_RATE 0.5f |
| Suggested false detection rate for ROC_FINGERPRINT_DETECTION. More... | |
| #define | ROC_NO_MIN_QUALITY -FLT_MAX |
| Disable minimum quality threshold. More... | |
| #define | ROC_NO_MIN_QUALITY -FLT_MAX |
| Disable minimum quality threshold. More... | |
| #define | ROC_TEXT_SUGGESTED_MIN_QUALITY 0.8f |
| Suggested minimum quality threshold for ROC_TEXT_REPRESENTATION. More... | |
| #define | ROC_TEXT_SUGGESTED_MIN_QUALITY 0.8f |
| Suggested minimum quality threshold for ROC_TEXT_REPRESENTATION. More... | |
| #define | ROC_TATTOO_SUGGESTED_MIN_QUALITY 0.0f |
| Suggested minimum quality threshold for ROC_TATTOO_REPRESENTATION. More... | |
| #define | ROC_TATTOO_SUGGESTED_MIN_QUALITY 0.0f |
| Suggested minimum quality threshold for ROC_TATTOO_REPRESENTATION. More... | |
| #define | ROC_FINGERPRINT_SUGGESTED_MIN_QUALITY -3.0f |
| Suggested minimum quality threshold for ROC_FINGERPRINT_REPRESENTATION. More... | |
| #define | ROC_FINGERPRINT_SUGGESTED_MIN_QUALITY -3.0f |
| Suggested minimum quality threshold for ROC_FINGERPRINT_REPRESENTATION. More... | |
| #define | ROC_DEEP_SUGGESTED_MIN_QUALITY -0.2f |
| Suggested minimum quality threshold for ROC_DEEP_REPRESENTATION. More... | |
| #define | ROC_DEEP_SUGGESTED_MIN_QUALITY -0.2f |
| Suggested minimum quality threshold for ROC_DEEP_REPRESENTATION. More... | |
| #define | ROC_FAST_SUGGESTED_MIN_QUALITY -FLT_MAX |
| Suggested minimum quality threshold for ROC_FAST_REPRESENTATION. More... | |
| #define | ROC_FAST_SUGGESTED_MIN_QUALITY -FLT_MAX |
| Suggested minimum quality threshold for ROC_FAST_REPRESENTATION. More... | |
| #define | ROC_STANDARD_SUGGESTED_MIN_QUALITY -FLT_MAX |
| Suggested minimum quality threshold for ROC_STANDARD_REPRESENTATION. More... | |
| #define | ROC_STANDARD_SUGGESTED_MIN_QUALITY -FLT_MAX |
| Suggested minimum quality threshold for ROC_STANDARD_REPRESENTATION. More... | |
| #define | ROC_STANDARD_FV_SIZE 261 |
| Length of a ROC_STANDARD_REPRESENTATION feature vector in bytes. | |
| #define | ROC_DEEP_FV_SIZE 261 |
| Length of a ROC_DEEP_REPRESENTATION feature vector in bytes. | |
| #define | ROC_OBJECT_FV_SIZE 262 |
| Length of a ROC_OBJECT_REPRESENTATION feature vector in byte. | |
| #define | ROC_FAST_FV_SIZE 261 |
| Length of a ROC_FAST_REPRESENTATION feature vector in bytes. | |
| #define | ROC_TATTOO_FV_SIZE 37 |
| Length of a ROC_TATTOO_REPRESENTATION feature vector in bytes. | |
| #define | ROC_FINGERPRINT_FV_SIZE 262 |
| Length of a ROC_FINGERPRINT_REPRESENTATION feature vector in bytes. | |
| #define | ROC_TEMPLATE_VERSION (((int64_t) ROC_VERSION_MAJOR << 61) + ((int64_t) ROC_VERSION_MINOR << 55)) |
| The format of roc_template::fv changes between most releases, this field is used to check template compatibility. More... | |
| #define | ROC_FAST_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 3 << 55)) |
| Minimum compatible version for templates generated with ROC_FAST_REPRESENTATION. More... | |
| #define | ROC_STANDARD_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 1 << 55)) |
| Minimum compatible version for templates generated with ROC_STANDARD_REPRESENTATION. More... | |
| #define | ROC_DEEP_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 4 << 55)) |
| Minimum compatible version for templates generated with ROC_DEEP_REPRESENTATION. More... | |
| #define | ROC_TATTOO_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 3 << 55)) |
| Minimum compatible version for templates generated with ROC_TATTOO_REPRESENTATION. More... | |
| #define | ROC_FINGERPRINT_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 4 << 55)) |
| Minimum compatible version for templates generated with ROC_FINGERPRINT_REPRESENTATION. More... | |
| #define | ROC_OBJECT_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 1 << 55)) |
| Minimum compatible version for templates generated with ROC_OBJECT_REPRESENTATION. More... | |
| #define | ROC_TEMPLATE_VERSION_MASK 0x7F80000000000000 |
| See ROC_TEMPLATE_VERSION. | |
Typedefs | |
| typedef enum roc_pose_options | roc_pose_options |
| Coarse face pose. | |
| typedef uint32_t | roc_pose |
| See roc_pose_options. | |
| typedef struct roc_landmark | roc_landmark |
| Data structure for a landmark detection. More... | |
| typedef struct roc_detection | roc_detection |
| Data structure for a face detection. | |
| typedef int64_t | roc_algorithm_id |
| A combination of roc_algorithm_options. More... | |
| typedef enum roc_color_options | roc_color_options |
| Supported colors in ROC_COLOR_REPRESENTATION. More... | |
| typedef int64_t | roc_color_selection |
| A combination of roc_color_options. | |
| typedef uint8_t | roc_finger_id |
| A single roc_finger_options. More... | |
| typedef enum roc_finger_options | roc_finger_options |
| Supported fingerprint indices for use in roc_represent_fingerprint. More... | |
| typedef struct roc_template | roc_template |
| A digital encoding of a face. More... | |
Functions | |
| const char * | roc_pose_to_string (roc_pose pose) |
| A printable roc_pose. More... | |
| bool | roc_landmark_is_visible (roc_landmark l) |
| Determine if a landmark is visible. More... | |
| roc_error | roc_adaptive_minimum_size (size_t image_width, size_t image_height, float relative_min_size, size_t absolute_min_size, size_t *adaptive_min_size) |
| A method for determining the minimum face detection size as a fraction of the image size. More... | |
| roc_error | roc_algorithm_option_to_string (roc_algorithm_options algorithm_option, const char **str) |
| String representation of a roc_algorithm_options. More... | |
| roc_error | roc_algorithm_option_from_string (const char *str, roc_algorithm_options *algorithm_option) |
| The opposite of roc_algorithm_option_to_string. More... | |
| roc_error | roc_finger_id_to_string (roc_finger_id finger_id, roc_string *str) |
| String representation of a roc_finger_id. More... | |
| roc_error | roc_finger_id_from_string (roc_string str, roc_finger_id *finger_id) |
| The opposite of roc_finger_id_to_string. More... | |
| roc_error | roc_check_template_version (roc_algorithm_id algorithm_id) |
| Return an error if the specified roc_algorithm_id is incompatible with this version of the SDK. More... | |
| float | roc_get_suggested_quality_threshold (roc_algorithm_id algorithm_id) |
| Returns the suggested quality threshold for roc_represent for the specified representation. More... | |
| roc_error | roc_new_template (roc_template *template_, uint32_t md_size, uint32_t fv_size, uint32_t tn_size) |
| Allocate memory for a new template. More... | |
| roc_error | roc_new_color_template (roc_template *template_, const roc_color_selection color_selection, const char *object_type) |
| Construct a new template for color-based searching. More... | |
| roc_error | roc_new_person_color_template (roc_template *template_, const roc_color_selection torso_color_selection, const roc_color_selection thigh_color_selection) |
| Construct a new person template for color-based searching. More... | |
| roc_error | roc_free_template (roc_template *template_) |
| Call this function on a template after it is no longer needed. More... | |
| roc_error | roc_copy_template (const roc_template src, roc_template *dst) |
| Deep-copy a template. More... | |
| roc_error | roc_flatten (const roc_template template_, uint8_t *output_byte_array) |
| Serialize a template to a memory buffer. More... | |
| roc_error | roc_unflatten (const uint8_t *input_byte_array, roc_template *template_) |
| Deserialize a template from a memory buffer. More... | |
| roc_error | roc_flattened_bytes (const roc_template template_, size_t *bytes) |
| Calculate the bytes required to flatten a template. More... | |
| void | roc_flattened_version (const uint8_t *input_byte_array, int *major_version, int *minor_version) |
| Obtain the SDK version of a flattened template. More... | |
| void * | roc_cast (uint8_t *pointer) |
Cast and return a uint8_t* as a void*. More... | |
Variables | |
| const size_t | roc_template_header_size |
| Size of the fixed-length portion of a roc_template. More... | |
Biometric data storage format and related functions.
Copy a template with roc_copy_template, flatten a template with roc_flatten, and free a template with roc_free_template.
| struct roc_landmark |
Data structure for a landmark detection.
If roc_landmark::x and roc_landmark::y are both 0 this indicates the landmark is not visible.
| Data Fields | ||
|---|---|---|
| float | x | Landmark horizontal position (pixels). |
| float | y | Landmark vertical position (pixels). |
| struct roc_detection |
Data structure for a face detection.
| Data Fields | ||
|---|---|---|
| float | x | Detection center horizontal offset (pixels). |
| float | y | Detection center vertical offset (pixels). |
| float | width | Detection horizontal size (pixels). |
| float | height | Detection vertical size (pixels). |
| float | rotation | Detection rotation (degrees). |
| float | confidence | Detection confidence. |
| roc_pose | pose |
See roc_pose_options. |
| roc_landmark | right_eye | Subject's right eye location. |
| roc_landmark | left_eye | Subject's left eye location. |
| roc_landmark | nose | Subject's nose location. |
| roc_landmark | right_mouth_corner | Subject's right mouth corner location. |
| roc_landmark | left_mouth_corner | Subject's left mouth corner location. |
| roc_landmark | chin | Subject's chin location. |
| int32_t | image_width | Detection source image width (pixels). |
| int32_t | image_height | Detection source image height (pixels). |
| struct roc_template |
A digital encoding of a face.
A pair of templates can be compared for similarity.
Templates are designed with the following considerations in mind:
A template's metadata string is a Java Script Object Notation (JSON) object containing at least the following keys:
| Key | Definition |
|---|---|
IOD | Interocular distance between the right and left eyes (pixels). Not reported for profile faces where one eye is present. |
OCD | Distance between the eyes and chin tip (pixels). |
Quality | See Face Quality. |
Additional keys exist for the requested Metadata Options, including:
| Key | Definition |
|---|---|
Pitch | See ROC_PITCHYAW. |
Yaw | See ROC_PITCHYAW. |
Lips | See ROC_PITCHYAW. |
Age | See ROC_ANALYTICS. |
GaussianBlur | See ROC_ANALYTICS. |
Gender | See ROC_ANALYTICS. |
Male | See ROC_ANALYTICS. |
Female | See ROC_ANALYTICS. |
GeographicOrigin | See ROC_ANALYTICS. |
African | See ROC_ANALYTICS. |
EastAsian | See ROC_ANALYTICS. |
European | See ROC_ANALYTICS. |
LatinAmerican | See ROC_ANALYTICS. |
MiddleEastern | See ROC_ANALYTICS. |
SouthAsian | See ROC_ANALYTICS. |
SoutheastAsian | See ROC_ANALYTICS. |
Emotion | See ROC_ANALYTICS. |
Anger | See ROC_ANALYTICS. |
Disgust | See ROC_ANALYTICS. |
Fear | See ROC_ANALYTICS. |
Joy | See ROC_ANALYTICS. |
Neutral | See ROC_ANALYTICS. |
Sadness | See ROC_ANALYTICS. |
Surprise | See ROC_ANALYTICS. |
Glasses | See ROC_ANALYTICS. |
None | See ROC_ANALYTICS. |
Eye | See ROC_ANALYTICS. |
Sun | See ROC_ANALYTICS. |
FacialHair | See ROC_ANALYTICS. |
Artwork | See ROC_ANALYTICS. |
Cartoon | See ROC_ANALYTICS. |
Human | See ROC_ANALYTICS. |
Painting | See ROC_ANALYTICS. |
Mask | See ROC_ANALYTICS. |
NoMask | See ROC_ANALYTICS. |
Spoof | See ROC_SPOOF. |
Metadata may be queried and edited using roc_get_metadata and roc_set_metadata.
A template's feature vector is the statistical model of the distinguishing characteristics of a face and is the basis for measuring roc_similarity. It is stored in the template as roc_template::fv and has length roc_template::fv_size.
| Data Fields | ||
|---|---|---|
| roc_algorithm_id | algorithm_id | The value of roc_algorithm_id passed to roc_represent to construct this template bitwise OR'd with ROC_TEMPLATE_VERSION. |
| roc_time | timestamp | Face video timestamp or ROC_NO_TIMESTAMP by default. |
| roc_template_id | template_id | Unique identifier for the template. |
| roc_person_id | person_id | Unique identifier for the person or roc_uuid_get_null by default. |
| roc_media_id | media_id | Origin image roc_image::media_id. |
| roc_camera_id | camera_id | Origin image roc_image::camera_id. |
| roc_archive_id | archive_id | Output image/video, if any. |
| roc_detection | detection | Face position, see roc_detection. |
| uint32_t | md_size |
Length of metadata buffer md. This value is greater than or equal to strlen+1 of md. |
| uint32_t | fv_size | Length of the feature vector fv. |
| uint32_t | tn_size | Length of face thumbnail tn. |
| const char * | md |
Null-terminated JSON string, or NULL if empty. |
| const uint8_t * | fv |
Feature Vector of length fv_size, or NULL if empty. |
| const uint8_t * | tn |
JPEG-encoded ROC_THUMBNAIL of length tn_size, or NULL if empty. |
| #define ROC_SUGGESTED_RELATIVE_MIN_SIZE 0.04f |
Suggested relative minimum face size.
4% of image width/height.
| #define ROC_SUGGESTED_ABSOLUTE_MIN_SIZE 20 |
| #define ROC_SUGGESTED_FALSE_DETECTION_RATE 0.02f |
Suggested false detection rate.
Approximately one non-face detected in every 50 images (1 / 50 = 0.02).
| #define ROC_OBJECT_SUGGESTED_FALSE_DETECTION_RATE 0.005f |
Suggested false detection rate for ROC_ALL_OBJECT_DETECTION.
| #define ROC_GUN_SUGGESTED_FALSE_DETECTION_RATE 0.1f |
Suggested false detection rate for ROC_GUN_DETECTION.
| #define ROC_TEXT_SUGGESTED_FALSE_DETECTION_RATE 0.02f |
Suggested false detection rate for ROC_TEXT_DETECTION.
| #define ROC_FINGERPRINT_SUGGESTED_FALSE_DETECTION_RATE 0.5f |
Suggested false detection rate for ROC_FINGERPRINT_DETECTION.
| #define ROC_NO_MIN_QUALITY -FLT_MAX |
Disable minimum quality threshold.
| #define ROC_NO_MIN_QUALITY -FLT_MAX |
Disable minimum quality threshold.
| #define ROC_TEXT_SUGGESTED_MIN_QUALITY 0.8f |
Suggested minimum quality threshold for ROC_TEXT_REPRESENTATION.
| #define ROC_TEXT_SUGGESTED_MIN_QUALITY 0.8f |
Suggested minimum quality threshold for ROC_TEXT_REPRESENTATION.
| #define ROC_TATTOO_SUGGESTED_MIN_QUALITY 0.0f |
Suggested minimum quality threshold for ROC_TATTOO_REPRESENTATION.
| #define ROC_TATTOO_SUGGESTED_MIN_QUALITY 0.0f |
Suggested minimum quality threshold for ROC_TATTOO_REPRESENTATION.
| #define ROC_FINGERPRINT_SUGGESTED_MIN_QUALITY -3.0f |
Suggested minimum quality threshold for ROC_FINGERPRINT_REPRESENTATION.
| #define ROC_FINGERPRINT_SUGGESTED_MIN_QUALITY -3.0f |
Suggested minimum quality threshold for ROC_FINGERPRINT_REPRESENTATION.
| #define ROC_DEEP_SUGGESTED_MIN_QUALITY -0.2f |
Suggested minimum quality threshold for ROC_DEEP_REPRESENTATION.
| #define ROC_DEEP_SUGGESTED_MIN_QUALITY -0.2f |
Suggested minimum quality threshold for ROC_DEEP_REPRESENTATION.
| #define ROC_FAST_SUGGESTED_MIN_QUALITY -FLT_MAX |
Suggested minimum quality threshold for ROC_FAST_REPRESENTATION.
| #define ROC_FAST_SUGGESTED_MIN_QUALITY -FLT_MAX |
Suggested minimum quality threshold for ROC_FAST_REPRESENTATION.
| #define ROC_STANDARD_SUGGESTED_MIN_QUALITY -FLT_MAX |
Suggested minimum quality threshold for ROC_STANDARD_REPRESENTATION.
| #define ROC_STANDARD_SUGGESTED_MIN_QUALITY -FLT_MAX |
Suggested minimum quality threshold for ROC_STANDARD_REPRESENTATION.
| #define ROC_TEMPLATE_VERSION (((int64_t) ROC_VERSION_MAJOR << 61) + ((int64_t) ROC_VERSION_MINOR << 55)) |
The format of roc_template::fv changes between most releases, this field is used to check template compatibility.
| #define ROC_FAST_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 3 << 55)) |
Minimum compatible version for templates generated with ROC_FAST_REPRESENTATION.
| #define ROC_STANDARD_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 1 << 55)) |
Minimum compatible version for templates generated with ROC_STANDARD_REPRESENTATION.
| #define ROC_DEEP_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 4 << 55)) |
Minimum compatible version for templates generated with ROC_DEEP_REPRESENTATION.
| #define ROC_TATTOO_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 3 << 55)) |
Minimum compatible version for templates generated with ROC_TATTOO_REPRESENTATION.
| #define ROC_FINGERPRINT_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 4 << 55)) |
Minimum compatible version for templates generated with ROC_FINGERPRINT_REPRESENTATION.
| #define ROC_OBJECT_COMPATIBILITY_VERSION (((int64_t) 2 << 61) + ((int64_t) 1 << 55)) |
Minimum compatible version for templates generated with ROC_OBJECT_REPRESENTATION.
| typedef struct roc_landmark roc_landmark |
Data structure for a landmark detection.
If roc_landmark::x and roc_landmark::y are both 0 this indicates the landmark is not visible.
| typedef int64_t roc_algorithm_id |
A combination of roc_algorithm_options.
| typedef enum roc_color_options roc_color_options |
Supported colors in ROC_COLOR_REPRESENTATION.
An enumeratation used to represent the colors in ROC_COLOR_REPRESENTATION via roc_new_color_template and roc_new_person_color_template.
| typedef uint8_t roc_finger_id |
A single roc_finger_options.
| typedef enum roc_finger_options roc_finger_options |
Supported fingerprint indices for use in roc_represent_fingerprint.
| typedef struct roc_template roc_template |
A digital encoding of a face.
A pair of templates can be compared for similarity.
Templates are designed with the following considerations in mind:
A template's metadata string is a Java Script Object Notation (JSON) object containing at least the following keys:
| Key | Definition |
|---|---|
IOD | Interocular distance between the right and left eyes (pixels). Not reported for profile faces where one eye is present. |
OCD | Distance between the eyes and chin tip (pixels). |
Quality | See Face Quality. |
Additional keys exist for the requested Metadata Options, including:
| Key | Definition |
|---|---|
Pitch | See ROC_PITCHYAW. |
Yaw | See ROC_PITCHYAW. |
Lips | See ROC_PITCHYAW. |
Age | See ROC_ANALYTICS. |
GaussianBlur | See ROC_ANALYTICS. |
Gender | See ROC_ANALYTICS. |
Male | See ROC_ANALYTICS. |
Female | See ROC_ANALYTICS. |
GeographicOrigin | See ROC_ANALYTICS. |
African | See ROC_ANALYTICS. |
EastAsian | See ROC_ANALYTICS. |
European | See ROC_ANALYTICS. |
LatinAmerican | See ROC_ANALYTICS. |
MiddleEastern | See ROC_ANALYTICS. |
SouthAsian | See ROC_ANALYTICS. |
SoutheastAsian | See ROC_ANALYTICS. |
Emotion | See ROC_ANALYTICS. |
Anger | See ROC_ANALYTICS. |
Disgust | See ROC_ANALYTICS. |
Fear | See ROC_ANALYTICS. |
Joy | See ROC_ANALYTICS. |
Neutral | See ROC_ANALYTICS. |
Sadness | See ROC_ANALYTICS. |
Surprise | See ROC_ANALYTICS. |
Glasses | See ROC_ANALYTICS. |
None | See ROC_ANALYTICS. |
Eye | See ROC_ANALYTICS. |
Sun | See ROC_ANALYTICS. |
FacialHair | See ROC_ANALYTICS. |
Artwork | See ROC_ANALYTICS. |
Cartoon | See ROC_ANALYTICS. |
Human | See ROC_ANALYTICS. |
Painting | See ROC_ANALYTICS. |
Mask | See ROC_ANALYTICS. |
NoMask | See ROC_ANALYTICS. |
Spoof | See ROC_SPOOF. |
Metadata may be queried and edited using roc_get_metadata and roc_set_metadata.
A template's feature vector is the statistical model of the distinguishing characteristics of a face and is the basis for measuring roc_similarity. It is stored in the template as roc_template::fv and has length roc_template::fv_size.
| enum roc_pose_options |
Coarse face pose.
| Enumerator | |
|---|---|
| ROC_POSE_FRONTAL | Both eyes visible. |
| ROC_POSE_LEFT_PROFILE | See Right vs. Left. |
| ROC_POSE_RIGHT_PROFILE | See Right vs. Left. |
| ROC_POSE_NUM_POSES | Number of coarse pose bins. |
Supported algorithm configurations for use in roc_represent.
In order to keep the core roc library reasonably sized, certain large algorithms are factored out into their own libraries. For example, ROC_DEEP_REPRESENTATION lives in libroc_deep_representation.so (roc_deep_representation.dll on Windows). This allows developers to omit algorithms that are not needed by their application. The SDK will automatically search for these libraries in standard system locations at runtime if they are invoked. If you recieve an error that the library can't be found then you will need to inform the SDK where to look using roc_set_model_path.
| Enumerator | |
|---|---|
| ROC_NO_ALGORITHM_OPTIONS | Type-safe default. |
| ROC_STANDARD_REPRESENTATION | Represent faces for comparison. See ROC_FAST_REPRESENTATION for a faster alternative, and ROC_DEEP_REPRESENTATION for a more accurate alternative. Suggested |
| ROC_FAST_REPRESENTATION | Faster but less accurate alternative to ROC_STANDARD_REPRESENTATION. Approximately 6x faster at the cost of 7x the false negative rate. Suggested |
| ROC_OBJECT_REPRESENTATION | Represent objects for comparison. This is primarily only used for object tracking. |
| ROC_DEEP_REPRESENTATION | Slower but more accurate alternative to ROC_STANDARD_REPRESENTATION. Approximately 3x slower for a 3x reduction in the false negative rate. Suggested |
| ROC_TATTOO_REPRESENTATION | Represent a law enforcement booking-style scar/mark/tattoo (SMT) image. For law enforcement style booking images, where the tattoos are generally only in subregions of the image, ROC_TATTOO_DETECTION should be specified to localize the tattoos. In this case, the input image will be automatically cropped around each detection before being processed by ROC_TATTOO_REPRESENTATION. Conversely, for use cases that involve processing an image of a logo, drawing, or other image that is pre-cropped around the region of interest, ROC_TATTOO_DETECTION should be omitted and the entire image will be considered a single tattoo. In this case, the image will not be cropped before being processed by ROC_TATTOO_REPRESENTATION. Suggested |
| ROC_COLOR_REPRESENTATION | Estimate the color(s) of an object. A JSON-like object is stored in the For cases where the detected object is a |
| ROC_TEXT_REPRESENTATION | Perform optical character recognition on text in images. Suggested
|
| ROC_FINGERPRINT_REPRESENTATION | Represent fingerprints for comparison. Use with ROC_FINGERPRINT_DETECTION. |
| ROC_STANDARD_DETECTION | Detect faces from -100 to +100 degrees yaw with high accuracy. Slightly slower than ROC_FRONTAL_DETECTION. This algorithm can be accelerated on large images with a CUDA compatible GPU. |
| ROC_FRONTAL_DETECTION | Detect faces from -30 to +30 degrees yaw. Slightly faster than ROC_STANDARD_DETECTION. Recommended when using ROC_FAST_REPRESENTATION. |
| ROC_TATTOO_DETECTION | Detect tattoos in the image. See ROC_TATTOO_REPRESENTATION for details on when to specify this option. |
| ROC_TEXT_DETECTION | Detect text in an image. Requires setting roc_set_model_path to the
|
| ROC_MANUAL_DETECTION | Bypass automatic face detection by using caller-provided bounding boxes.
All other fields in the template may be left uninitialized.
|
| ROC_ENHANCE_CONTRAST | If face detection fails, normalize the image using roc_enhance_contrast and re-attempt face detection. roc_enhance_contrast is called with a |
| ROC_IGNORE_PARTIAL | Ignore detections that are partially off-image. The minimum fraction of the detection which must be in frame should be provided to roc_represent_roi as |
| ROC_ANALYTICS | Estimate age, emotion, gaussian blur, geographic origin, gender, glasses, facial hair, artwork and mask detection. The unit
|
| ROC_IGNORE_ARTWORK | Do not return templates for faces classified as Eliminate templates with a low However, this flag is not effective as a Face Liveness metric. This flag implies ROC_ANALYTICS. |
| ROC_LANDMARKS | Add the full set of landmark locations to the template metadata. The |
| ROC_PITCHYAW | Add Yaw is defined to be negative when the subject's face is oriented towards the subject's left shoulder (positive
This algorithm will also add |
| ROC_ICAO_METRICS | Compute ICAO face portrait quality measures. In roc_represent, compute a subset of ICAO quality metrics. See ICAO for more information on these metrics. Metrics will be added to the template metadata.
|
| ROC_ICAO_BACKGROUND | Compute ICAO uniform background face portrait quality metric. Compute the uniform background face quality metric. See ICAO for more information on this metric. Metric will be added to the template metadata. If ROC_THUMBNAIL is specified roc_template::tn will be populated with a
|
| ROC_SPOOF | Add A real-valued number between 0.0 and 1.0 where a higher value indicates a greater chance of a spoof face and a lower value indicates a greater chance of a live face. See ROC_CONVENIENT_SPOOF_THRESHOLD and ROC_SECURE_SPOOF_THRESHOLD for recommended default thresholds. Due to the diverse nature of camera sensors, a single threshold may not be optimal across multiple sensors. Please thoroughly test the performance on sensors of interest to select an appropriate threshold for your needs.
This algorithm will only be run for ROC_POSE_FRONTAL faces. |
| ROC_THUMBNAIL | An aligned and cropped face image suitable for displaying. Align, scale, crop, Control thumbnail quality with roc_set_thumbnail_parameters. Decode a thumbnail with roc_decode_image or write it to a file and open it with roc_read_image.
|
| ROC_SERIAL | Don't parallelize face representation or search. In roc_represent, by default each detected face is processed in parallel up to the thread count limitation imposed by the license file. In roc_search and roc_knn, by default gallery templates are compared in parallel up to the thread count limitation imposed by the license file. |
| ROC_FILTER_TEXT | Filter non-compliant text results. Requires that ROC_TEXT_REPRESENTATION is set. Automatically filter out text results that don't match a set of user defined regular expressions. The list of regular expressions can be passed to roc_represent_roi. |
| ROC_AIRPLANE_DETECTION | Detect airplanes in the image. |
| ROC_BICYCLE_DETECTION | Detect bicycles in the image. |
| ROC_BOAT_DETECTION | Detect boats in the image. |
| ROC_BUS_DETECTION | Detect buses in the image. |
| ROC_CAR_DETECTION | Detect cars in the image. |
| ROC_GUN_DETECTION | Detect guns in the image. Suggested false detection rate is ROC_GUN_SUGGESTED_FALSE_DETECTION_RATE. |
| ROC_LICENSE_PLATE_DETECTION | Detect license plates in the image. |
| ROC_MILITARY_VEHICLE_DETECTION | Detect military vehicles in the image. |
| ROC_MOTORCYCLE_DETECTION | Detect motorcycles in the image. |
| ROC_PERSON_DETECTION | Detect people in the image. |
| ROC_TRUCK_DETECTION | Detect trucks in the image. |
| ROC_ALL_OBJECT_DETECTION | Detect all objects in an image. The following types of objects can be detected: airplane, bicycle, boat, bus, car, gun, military_vehicle, motorcycle, person, truck.
The type of object is stored in the A real-valued number between Suggested |
| ROC_FINGERPRINT_DETECTION | Detect fingerprints in the image. Use with ROC_FINGERPRINT_REPRESENTATION. |
| enum roc_color_options |
Supported colors in ROC_COLOR_REPRESENTATION.
An enumeratation used to represent the colors in ROC_COLOR_REPRESENTATION via roc_new_color_template and roc_new_person_color_template.
| enum roc_finger_options |
Supported fingerprint indices for use in roc_represent_fingerprint.
| Enumerator | |
|---|---|
| ROC_NO_FINGER | Ignored finger, fingers with this value won't be used. |
| ROC_THUMB | The subject's left or right thumb. To specify a hand combine with ROC_RIGHT_HAND or ROC_LEFT_HAND. For example, the left thumb would be specified as |
| ROC_INDEX_FINGER | The subject's left or right index finger. To specify a hand combine with ROC_RIGHT_HAND or ROC_LEFT_HAND. For example, the left index finger would be specified as |
| ROC_MIDDLE_FINGER | The subject's left or right middle finger. To specify a hand combine with ROC_RIGHT_HAND or ROC_LEFT_HAND. For example, the left middle finger would be specified as |
| ROC_RING_FINGER | The subject's left or right ring finger. To specify a hand combine with ROC_RIGHT_HAND or ROC_LEFT_HAND. For example, the left ring finger would be specified as |
| ROC_LITTLE_FINGER | The subject's left or right little finger. To specify a hand combine with ROC_RIGHT_HAND or ROC_LEFT_HAND. For example, the left little finger would be specified as |
| ROC_EXTRA_FINGER | An extra finger that is not a thumb, index, middle, ring, or little. |
| ROC_RIGHT_HAND | The finger belongs to the subjects right hand. Can be combined with one or more fingers. |
| ROC_LEFT_HAND | The finger belongs to the subjects left hand. Can be combined with one or more fingers. |
| ROC_FOUR_FINGERS | A utility value to indicate the 4 non-thumb fingers. |
| ROC_ANY_FINGER | A utility value to indicate all 5 fingers. |
| ROC_ANY_HAND | A utility value to indicate either the left or right hands. |
| ROC_UNKNOWN_FINGER | A utility value to indicate any of the ten fingers. |
| const char* roc_pose_to_string | ( | roc_pose | pose | ) |
A printable roc_pose.
The return value is statically allocated and should not be modified or freed.
| [in] | pose | Pose to convert to a string. |
| bool roc_landmark_is_visible | ( | roc_landmark | l | ) |
Determine if a landmark is visible.
A landmark is visible if either roc_landmark::x or roc_landmark::y is not 0.
| [in] | l | Landmark to determine the visibility of. |
| roc_error roc_adaptive_minimum_size | ( | size_t | image_width, |
| size_t | image_height, | ||
| float | relative_min_size, | ||
| size_t | absolute_min_size, | ||
| size_t * | adaptive_min_size | ||
| ) |
A method for determining the minimum face detection size as a fraction of the image size.
In the interest of efficiency, it is recommended to set a lower bound on the minimum face detection size as a fraction of the image size. Given a relative minimum size of 4% of the image dimensions, and an absolute minimum size of 20 pixels, the adaptive minimum size is: max(max(image.width, image.height) * 0.04f, 20).
| [in] | image_width | Image width dimension to use for the relative minimum size calculation. |
| [in] | image_height | Image height dimension to use for the relative minimum size calculation. |
| [in] | relative_min_size | Faces will be no smaller than this fraction of the image width and height. |
| [in] | absolute_min_size | Faces will be no smaller than this in pixels. |
| [out] | adaptive_min_size | Maximum of the relative and absolute minimum sizes. |
| roc_error roc_algorithm_option_to_string | ( | roc_algorithm_options | algorithm_option, |
| const char ** | str | ||
| ) |
String representation of a roc_algorithm_options.
The string form uses the same character sequence as the code form. For example, ROC_FRONTAL_DETECTION is "ROC_FRONTAL_DETECTION". The returned str is statically-allocated data and should not be freed.
| [in] | algorithm_option | Algorithm option to convert to a string. |
| [out] | str | String version of algorithm_option. |
| roc_error roc_algorithm_option_from_string | ( | const char * | str, |
| roc_algorithm_options * | algorithm_option | ||
| ) |
The opposite of roc_algorithm_option_to_string.
| [in] | str | String to convert to a algorithm_option. |
| [out] | algorithm_option | Code version of str. |
| roc_error roc_finger_id_to_string | ( | roc_finger_id | finger_id, |
| roc_string * | str | ||
| ) |
String representation of a roc_finger_id.
The string form uses an aggregate formulation of the bit field. For example, ROC_RIGHT_HAND | ROC_THUMB is "Right+Thumb". ROC_ANY_HAND | ROC_ANY_FINGER is "Right+Left+Thumb+Index+Middle+Ring+Pinky". The returned str is dynamically-allocated data and must be freed with a call to roc_free_string.
| [in] | finger_id | Finger ID to convert to a string. |
| [out] | str | String version of finger_option. |
| roc_error roc_finger_id_from_string | ( | roc_string | str, |
| roc_finger_id * | finger_id | ||
| ) |
The opposite of roc_finger_id_to_string.
| [in] | str | String to convert to a finger_option. |
| [out] | finger_id | Finger ID version of str. |
| roc_error roc_check_template_version | ( | roc_algorithm_id | algorithm_id | ) |
Return an error if the specified roc_algorithm_id is incompatible with this version of the SDK.
| [in] | algorithm_id | Value to check for compatibility. |
| float roc_get_suggested_quality_threshold | ( | roc_algorithm_id | algorithm_id | ) |
Returns the suggested quality threshold for roc_represent for the specified representation.
| [in] | algorithm_id | Representation for which to return the suggested quality threshold. |
| roc_error roc_new_template | ( | roc_template * | template_, |
| uint32_t | md_size, | ||
| uint32_t | fv_size, | ||
| uint32_t | tn_size | ||
| ) |
Allocate memory for a new template.
This function should be used when you have stored template fields in an external database and wish to reconstruct the roc_template. Generally you don't need to call this function because templates are constructed by calling roc_represent.
Free templates after use with roc_free_template.
| [out] | template_ | Template to initialize. |
| [in] | md_size | roc_template::md_size. |
| [in] | fv_size | roc_template::fv_size. |
| [in] | tn_size | roc_template::tn_size. |
| roc_error roc_new_color_template | ( | roc_template * | template_, |
| const roc_color_selection | color_selection, | ||
| const char * | object_type | ||
| ) |
Construct a new template for color-based searching.
This function creates a new template which can be used for searching a gallery based on color. Templates must have been generated with ROC_COLOR_REPRESENTATION. The generated template will have no metadata and should only be used to perform searches.
| [out] | template_ | Template to initialize. |
| [in] | color_selection | roc_color_selection. |
| [in] | object_type | String representing the object being searched for (see ROC_ALL_OBJECT_DETECTION for strings). |
| roc_error roc_new_person_color_template | ( | roc_template * | template_, |
| const roc_color_selection | torso_color_selection, | ||
| const roc_color_selection | thigh_color_selection | ||
| ) |
Construct a new person template for color-based searching.
This function creates a new template which can be used for searching a gallery based on color. Templates must have been generated with ROC_COLOR_REPRESENTATION. The generated template will have no metadata and should only be used to perform searches.
This function differs from roc_new_color_template because it is specific to the person object class. It requires a color for both the torso and thigh regions to match (color can be ROC_COLOR_NONE to ignore a region).
| [out] | template_ | Template to initialize. |
| [in] | torso_color_selection | roc_color_selection. |
| [in] | thigh_color_selection | roc_color_selection. |
| roc_error roc_free_template | ( | roc_template * | template_ | ) |
Call this function on a template after it is no longer needed.
Frees the memory previously allocated for roc_template::fv, roc_template::md, and roc_template::tn. Sets roc_template::algorithm_id to ROC_NO_ALGORITHM_OPTIONS. If template_ is NULL, this function does nothing.
| [in,out] | template_ | The template to deallocate. |
| roc_error roc_copy_template | ( | const roc_template | src, |
| roc_template * | dst | ||
| ) |
Deep-copy a template.
In-place copying is supported with dst pointing to src.
Free dst after use with roc_free_template.
| [in] | src | Template to copy. |
| [out] | dst | Unallocated pointer to hold a copy of src. |
| roc_error roc_flatten | ( | const roc_template | template_, |
| uint8_t * | output_byte_array | ||
| ) |
Serialize a template to a memory buffer.
Use roc_flattened_bytes to determine the appropriate size for buffer.
| [in] | template_ | Template to serialize. |
| [out] | output_byte_array | Pre-allocated buffer to hold the serialized template. |
| roc_error roc_unflatten | ( | const uint8_t * | input_byte_array, |
| roc_template * | template_ | ||
| ) |
Deserialize a template from a memory buffer.
Free template_ after use with roc_free_template.
| [in] | input_byte_array | Buffer holding the serialized template. |
| [out] | template_ | Uninitialized address to hold the deserialized template. |
| roc_error roc_flattened_bytes | ( | const roc_template | template_, |
| size_t * | bytes | ||
| ) |
Calculate the bytes required to flatten a template.
Use this function to determine the appropriate buffer size for roc_flatten.
| [in] | template_ | Template to calculate the serialized size. |
| [out] | bytes | Bytes required to serialize the template. |
| void roc_flattened_version | ( | const uint8_t * | input_byte_array, |
| int * | major_version, | ||
| int * | minor_version | ||
| ) |
Obtain the SDK version of a flattened template.
To be used when you have an old template and are unsure what version of the ROC SDK was used to construct it.
| [in] | input_byte_array | Flattened template. |
| [out] | major_version | SDK roc_version_major used to construct input_byte_array. |
| [out] | minor_version | SDK roc_version_minor used to construct input_byte_array. |
| void* roc_cast | ( | uint8_t * | pointer | ) |
Cast and return a uint8_t* as a void*.
Helper function for some of the API language wrappers that don't support this type cast.
| [in] | pointer | Input pointer. |
| const size_t roc_template_header_size |
Size of the fixed-length portion of a roc_template.
1.8.15