2 Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved
4 This file is part of face-engine
5 Written by Hyunwoo Kim <hw4444.kim@samsung.com>
7 PROPRIETARY/CONFIDENTIAL
9 This software is the confidential and proprietary information of
10 SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
11 disclose such Confidential Information and shall use it only in
12 accordance with the terms of the license agreement you entered
13 into with SAMSUNG ELECTRONICS.
14 SAMSUNG make no representations or warranties about the suitability
15 of the software, either express or implied, including but not limited
16 to the implied warranties of merchantability, fitness for a particular
17 purpose, or non-infringement. SAMSUNG shall not be liable for any
18 damages suffered by licensee as a result of using, modifying or
19 distributing this software or its derivatives.
23 #ifndef __FACE_ENGINE_H__
24 #define __FACE_ENGINE_H__
29 * @brief Facial engine handle type.
31 typedef void* face_engine_h;
34 * @brief Enumerations of error codes for the FacialEngine API.
37 FACE_ENGINE_ERROR_NONE = 0, /**< Successful */
38 FACE_ENGINE_ERROR_INVALID_PARAMTER = -1, /**< A specified input parameter is invalid. */
39 FACE_ENGINE_ERROR_OUT_OF_MEMORY = -2, /**< The memory is insufficient. */
40 FACE_ENGINE_ERROR_OPERATION_FAILED = -3, /**< Does not support this property. À߸øµÈ state */
41 FACE_ENGINE_ERROR_FAILURE = -4, /**< A system error has occurred. ³»ºÎ error */
42 FACE_ENGINE_ERROR_ENGINE_NOT_FOUND = -5,
43 } face_engine_error_e;
46 * @brief Enumerations of input image format for the FacialEngine API.
49 FACE_ENGINE_IMAGE_FORMAT_Y, /**< luminance only image*/
50 } face_engine_image_colorspace_e;
53 * @brief Enumerations of facial expression that recognized for the FacialEngine API.
56 FACE_ENGINE_EXPRESSION_UNKNOWN,
57 FACE_ENGINE_EXPRESSION_NUETRAL, /**< Normal expression */
58 FACE_ENGINE_EXPRESSION_ANGRY, /**< Angry expression */
59 FACE_ENGINE_EXPRESSION_SMILE, /**< Cheerful expression */
60 FACE_ENGINE_EXPRESSION_SURPRISE, /**< Suprised expression */
61 } face_engine_expression_e;
64 * @brief Enumerations of the eye state for the FacialEngine API.
67 FACE_ENGINE_EYE_UNKNOWN, /**< The no eye state, when the eye detect fails */
68 FACE_ENGINE_EYE_OPENED, /**< The state when eye is opened */
69 FACE_ENGINE_EYE_CLOSED, /**< The state when eye is closed */
73 FACE_ENGINE_IMAGE_TYPE_SINGLE, /**< */
74 FACE_ENGINE_IMAGE_TYPE_CONTINIOUS,
75 } face_engine_image_type_e;
78 int x; /**< x-coordinate */
79 int y; /**< y-coordinate */
80 } face_engine_point_t;
83 int x; /**< most left coordinate of detected face region */
84 int y; /**< most top coordinate of detected face region */
85 int w; /**< width of detected face region */
86 int h; /**< height of detected face region */
90 unsigned char *pixel; /**< pixel data */
92 int width; /**< image data's width */
93 int height; /**< image data's height */
95 face_engine_image_colorspace_e colorspace; /**< color space */
96 } face_engine_image_t;
100 face_engine_rect_t face; // 16
102 face_engine_point_t lefteye; // 8
103 face_engine_point_t righteye; // 8
105 face_engine_rect_t mouse; // 16
109 } face_engine_component_t;
113 int nMaxFaceNum; /**< */
115 int nInterval; /**< */
116 int nDetectionOption; /* 0 for FAST, 1 for ROBUST */
120 } face_engine_param_t;
123 unsigned char *data; /**< result data of face information */
124 unsigned int len; /**< size of result data */// in byte unit
125 } face_engine_feature_t;
133 face_engine_error_e face_engine_create(face_engine_h *handle);
134 face_engine_error_e face_engine_destroy(face_engine_h handle);
136 face_engine_error_e face_engine_get_param(face_engine_h handle, face_engine_param_t *param);
137 face_engine_error_e face_engine_set_param(face_engine_h handle, const face_engine_param_t *param);
139 face_engine_error_e face_engine_detect_faces(face_engine_h handle, face_engine_image_type_e image_type, const face_engine_image_t *image, face_engine_rect_t *face[], int *count);
141 face_engine_error_e face_engine_track_faces(face_engine_h handle, const face_engine_rect_t *prev_rect, face_engine_rect_t *cur_rect);
143 face_engine_error_e face_engine_extract_face_component(face_engine_h handle, const face_engine_image_t *image, const face_engine_rect_t *rect, face_engine_component_t *component);
144 face_engine_error_e face_engine_extract_face_feature(face_engine_h handle, const face_engine_image_t *image, const face_engine_component_t *component, face_engine_feature_t *feature);
146 face_engine_error_e face_engine_compare_face_feature(const face_engine_feature_t *A, const face_engine_feature_t *B, int *similarity);
148 face_engine_error_e face_engine_recognize_face_expression(face_engine_h handle, const face_engine_image_t *image , const face_engine_component_t *component, face_engine_expression_e *expression);
150 face_engine_error_e face_engine_recognize_blink(face_engine_h handle, const face_engine_image_t *image, const face_engine_component_t *component, face_engine_eye_e *lefteye, face_engine_eye_e *righteye);
158 #endif // __TIZEN_UIX_FACE_ENGINE_H__