Tizen Native API
4.0
|
The Face Detection API provides functions to detect face information about stored image files.
#include <media_content.h>
This API is related with the following feature:
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on a device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
The Face Detection API provides functions to detect face information associated with image files.
Face information detected by mediavision API. To detect faces, you should use media_info_start_face_detection() API.
API allows to:
To obtain the media handle (media_info_h), call the media_info_create() function.
To start face detection, call the media_info_start_face_detection() function.
To cancel face detection after it's been started, call the media_info_cancel_face_detection() function.
Functions | |
int | media_info_start_face_detection (media_info_h media, media_face_detection_completed_cb callback, void *user_data) |
Starts face detection for the given image, asynchronously. | |
int | media_info_cancel_face_detection (media_info_h media) |
Cancels face detection of image for the given media. | |
Typedefs | |
typedef void(* | media_face_detection_completed_cb )(media_content_error_e error, const int face_count, void *user_data) |
Called when face detection on the image is completed. |
typedef void(* media_face_detection_completed_cb)(media_content_error_e error, const int face_count, void *user_data) |
Called when face detection on the image is completed.
The following error codes can be delivered.
MEDIA_CONTENT_ERROR_NONE,
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY,
MEDIA_CONTENT_ERROR_INVALID_OPERATION,
MEDIA_CONTENT_ERROR_DB_FAILED,
MEDIA_CONTENT_ERROR_DB_BUSY,
MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT
[in] | error | The error code |
[in] | face_count | The number of all detected faces |
[in] | user_data | The user data passed from the foreach function |
int media_info_cancel_face_detection | ( | media_info_h | media | ) |
Cancels face detection of image for the given media.
This function cancels face detection for given media item.
If you cancel face detection request before callback is invoked, the callback registered by media_info_start_face_detection() function will not be invoked.
[in] | media | The handle to the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
MEDIA_CONTENT_ERROR_INVALID_OPERATION | Invalid operation |
int media_info_start_face_detection | ( | media_info_h | media, |
media_face_detection_completed_cb | callback, | ||
void * | user_data | ||
) |
Starts face detection for the given image, asynchronously.
This function detects faces for given image item and calls the given callback function when the detection is completed.
The given callback function is called when the detection is completed.
To obtain the detected faces, call the media_info_foreach_face_from_db() function.
[in] | media | The handle to the media info |
[in] | callback | The callback function to be invoked when detection is completed |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_CONTENT_ERROR_DB_FAILED | DB Operation failed |
MEDIA_CONTENT_ERROR_DB_BUSY | DB Operation busy |
MEDIA_CONTENT_ERROR_NETWORK | Network fail |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
MEDIA_CONTENT_ERROR_NOT_SUPPORTED | Not supported |