Merge commits Tizen 2.2 to Tizen 2.2.1 47/13547/1 accepted/tizen/mobile tizen accepted/tizen/mobile/20131216.220436 submit/tizen/20131210.003506
authorhowon kim <howon.kim@samsung.com>
Mon, 9 Dec 2013 09:30:10 +0000 (18:30 +0900)
committerhowon kim <howon.kim@samsung.com>
Mon, 9 Dec 2013 09:30:10 +0000 (18:30 +0900)
Change-Id: Ic0b50d3cf05f5ed84b88f7e346105b3978b3c16d
Signed-off-by: howon kim <howon.kim@samsung.com>
16 files changed:
inc/FUixVision.h
inc/FUixVisionFaceComponentsPosition.h
inc/FUixVisionFaceDetector.h
inc/FUixVisionFaceRecognitionInfo.h
inc/FUixVisionFaceRecognizer.h
inc/FUixVisionFaceTypes.h
src/FUixVisionFaceComponentsPosition.cpp
src/FUixVisionFaceDetector.cpp
src/FUixVisionFaceRecognizer.cpp
src/FUixVision_FaceDetectorImpl.cpp
src/FUixVision_FaceRecognizerImpl.cpp
src/FUixVision_FaceRecognizerImpl.h
src/FUixVision_FaceUtil.cpp
src/caBasicDef.h
src/caBasicDef_ENUM.h
src/caFaceAPP_interface.h

index 4f6ecff..8845030 100644 (file)
@@ -19,7 +19,7 @@
  * @file       FUixVision.h
  * @brief      This is the header file for the %Vision namespace.
  *
- * This header file contains the declarations and descriptions of the %Vision namespace.
+ * This header file contains the declarations and descriptions of the %Tizen::Uix::Vision namespace.
  */
 
 #ifndef _FUIX_VISION_H_
 #include <FUixVisionFaceRecognizer.h>
 #include <FUixVisionFaceBuffer.h>
 #include <FUixVisionFaceComponentsPosition.h>
-#include <FUixVisionImageFeatureInfo.h>
-#include <FUixVisionImageObject.h>
-#include <FUixVisionImageFeatureManager.h>
-#include <FUixVisionImageRecognizer.h>
-#include <FUixVisionQrCodeGenerator.h>
-#include <FUixVisionQrCodeObject.h>
-#include <FUixVisionQrCodeRecognizer.h>
-#include <FUixVisionQrCodeTypes.h>
 
 /**
  * @namespace Tizen::Uix::Vision
- * @brief      This namespace contains the classes for the vision and its related functions.
+ * @brief      This namespace contains the classes for the face and its related functions.
  * @since      2.0
  *
  * @remarks    @b Header @b %file: @b \#include @b <FUix.h> @n
- *          @b Library : @b osp-face @b osp-vision
+ *          @b Library : @b osp-face
  *
- * The %Vision namespace provides the ability to automatically detect and trace natural objects including faces, image and QR Code in a still image or a video stream.
+ * The %Vision namespace provides the ability to automatically detect and trace faces in a still image or a video stream.
  * @n
- * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/face_detector_recognizer.htm">Face Detector and Recognizer</a>, <a href="../org.tizen.native.appprogramming/html/guide/uix/recognize_2d_image.htm">Image recognizer and feature manager</a> and <a href="../org.tizen.native.appprogramming/html/guide/uix/recognize_qr_code.htm">QR code recognizer and generator</a>
+ * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/face_detector_recognizer.htm">Face Detector and Recognizer</a>.
  *
  * The following diagram illustrates the relationships between the classes belonging to the %Vision namespace.
  * @image html uix_vision_namespace_classdiagram.png
index 9f19084..d2cbaa7 100644 (file)
@@ -45,12 +45,11 @@ namespace Tizen { namespace Uix { namespace Vision
  *
  * The %FaceComponentsPosition class encapsulates the extracted face component's information that is processed by the FaceDetector class.
  *
- * This class provides the following functionalities:
+ * This class provides the following functionalities: @n
  * - Getting/Setting the position of a face.
  * - Getting/Setting the position of the eyes.
  * - Getting/Setting the position of the mouth.
- * 
- * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/face_detector_recognizer.htm">Face Detector and Recognizer</a>.
+ * <p> For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/face_detector_recognizer.htm">Face Detector and Recognizer</a>. </p>
  */
 
 class _OSP_EXPORT_ FaceComponentsPosition
@@ -59,7 +58,7 @@ class _OSP_EXPORT_ FaceComponentsPosition
 public:
        /**
         * This is the default constructor for this class. @n
-        * All values of the attributes are set to @c -1 when this instance is initialized.
+        * Initializes this instance of %FaceComponentsPosition with all its attributes set to @c -1.
         *
         * @since      2.0
         */
@@ -151,7 +150,8 @@ public:
         *                                This position can be obtained using the FaceDetector::ExtractFaceComponentsN() method.
         * @param[in]    rightEyePos      The eye position on the right @n
         *                                This position can be obtained using the FaceDetector::ExtractFaceComponentsN() method. @n
-        *                                The position of the right eye must be greater than or equal to @c 0, and must be greater than the position of @c leftEyePos.
+        *                                The position of the eyes must be greater than or equal to @c 0. @n
+        *                                The position of @c rightEyePos must be greater than the position of @c leftEyePos.
         * @exception    E_SUCCESS        The method is successful.
         * @exception    E_INVALID_ARG    A specified input parameter is invalid.
         */
@@ -174,7 +174,7 @@ public:
 
        /**
         * This is the copy constructor for the %FaceComponentsPosition class. @n
-        * Initializes this instance of %FaceComponentsPosition with the specified parameter. @n
+        * Initializes this instance of %FaceComponentsPosition with the specified parameter.
         * Copying of objects using this copy constructor is allowed.
         *
         * @since        2.0
index 2dbc808..7d5e377 100644 (file)
@@ -133,7 +133,7 @@ class _OSP_EXPORT_ FaceDetector
 // Lifecycle
 public:
        /**
-        * This is the default constructor for this class. @n
+        * This is the default constructor for this class.
         * The object is not fully constructed after this constructor is called.
         * For full construction, the Construct() method must be called right after calling this constructor.
         *
@@ -158,13 +158,9 @@ public:
         *
         * @since        2.0
         *
-        * @feature      %http://tizen.org/feature/vision.face_recognition
         * @return       An error code
         * @exception    E_SUCCESS          The method is successful.
-        * @exception    E_UNSUPPORTED_OPERATION   The target device does not support the face detection feature. @b Since: @b 2.1
-        * For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
-        * @remarks      Before calling this method, check whether the feature is supported by 
-        *                      Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
+        * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
         */
        result Construct(void);
 
@@ -272,9 +268,9 @@ public:
         * @exception    E_SUCCESS          The method is successful.
         * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
         * @exception    E_FAILURE          A system error has occurred.
-        * @remarks
-        *                        - The specific error code can be accessed using the GetLastResult() method.
-        *                        - BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
+        * @remarks      
+        *                      - The specific error code can be accessed using the GetLastResult() method.
+        *                      - BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
         * @endif
         */
        Tizen::Base::Collection::IList* DetectFacesFromStillImageN(const Tizen::Graphics::Bitmap& bitmap);
@@ -293,13 +289,14 @@ public:
         * @param[in]    byteBuffer         The buffer containing the input image data
         * @param[in]    dim                The width and height of the input image @n
         *                                  Both the width and height must be greater than @c 0.
-        * @param[in]    format             The color format @n
-        *                                                      @c BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
+        * @param[in]    format             The color format defined by Tizen::Graphics::BitmapPixelFormat
         * @exception    E_SUCCESS          The method is successful.
         * @exception    E_INVALID_ARG      A specified input parameter is invalid.
         * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
         * @exception    E_FAILURE          A system error has occurred.
-        * @remarks      The specific error code can be accessed using the GetLastResult() method.  
+        * @remarks      
+        *                      - The specific error code can be accessed using the GetLastResult() method.
+        *                      - BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
         */
        Tizen::Base::Collection::IList* DetectFacesFromStillImageN(const Tizen::Base::ByteBuffer& byteBuffer, const Tizen::Graphics::Dimension& dim, Tizen::Graphics::BitmapPixelFormat format);
 
@@ -372,7 +369,7 @@ public:
 
        /**
         * Gets the position difference of the face. @n
-        * The %GetFaceMovement() method can be used for tracking the face from a sequential video data.
+        * This can be used for tracking the face from a sequential video data.
         *
         * @since         2.0
         *
@@ -390,7 +387,7 @@ public:
         * @exception     E_SUCCESS             The method is successful.
         * @exception     E_INVALID_ARG         A specified input parameter is invalid.
         * @exception     E_OPERATION_FAILED    The method has failed to get the position difference of the specified region, but there is no error reported. @n
-        *                                      In this case, @c xDiff and @c yDiff are returned with @c 0. @n
+        *                                      In this case, @c xDiff and @c yDiff will be returned with @c 0. @n
         *                                      It can happen when the detected faces are too small or two video data are different even if they contain the same face.
         *                                      This is the result of a normal operation.
         * @remarks       The specific error code can be accessed using the GetLastResult() method.
index 59cd8ad..46bad8f 100644 (file)
@@ -51,8 +51,7 @@ class _FaceRecognizerImpl;
  * The %FaceRecognitionInfo class encapsulates the information of a face recognized using the FaceRecognizer class by:
  * - Getting the position of a recognized face.
  * - Getting the facial features of a recognized face.
- * 
- * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/face_detector_recognizer.htm">Face Detector and Recognizer</a>.
+ * <p> For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/face_detector_recognizer.htm">Face Detector and Recognizer</a>. </p>
  */
 
 class _OSP_EXPORT_ FaceRecognitionInfo
@@ -60,7 +59,7 @@ class _OSP_EXPORT_ FaceRecognitionInfo
 {
 public:
        /**
-        * This is the default constructor for this class. @n
+        * This is the default constructor for this class.
         * The object is not fully constructed after this constructor is called.
         * For full construction, the Construct() method must be called right after calling this constructor.
         *
index f74815b..097f9cf 100644 (file)
@@ -172,13 +172,9 @@ public:
         *
         * @since        2.0
         *
-        * @feature      %http://tizen.org/feature/vision.face_recognition
         * @return       An error code
         * @exception    E_SUCCESS          The method is successful.
-        * @exception    E_UNSUPPORTED_OPERATION   The target device does not support the face detection feature. @b Since: @b 2.1
-        * For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
-        * @remarks      Before calling this method, check whether the feature is supported by 
-        *                      Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
+        * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
         */
        result Construct(void);
 
@@ -289,9 +285,9 @@ public:
         * @exception    E_SUCCESS          The method is successful.
         * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
         * @exception    E_FAILURE          A system error has occurred.
-        * @remarks
-        *                        - The specific error code can be accessed using the GetLastResult() method.
-        *                        - BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
+        * @remarks      
+        *                      - The specific error code can be accessed using the GetLastResult() method.
+        *                      - BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
         * @endif
         */
        Tizen::Base::Collection::IList* ExtractFaceInfoFromStillImageN(const Tizen::Graphics::Bitmap& bitmap);
@@ -310,13 +306,14 @@ public:
         * @param[in]    byteBuffer         The buffer containing the input image data
         * @param[in]    dim                The width and height of the input image @n
         *                                  Both the width and height must be greater than @c 0.
-        * @param[in]    format             The color format @n
-        *                                                      @c BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
+        * @param[in]    format             The color format defined by Tizen::Graphics::BitmapPixelFormat
         * @exception    E_SUCCESS          The method is successful.
         * @exception    E_INVALID_ARG      A specified input parameter is invalid.
         * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
         * @exception    E_FAILURE          A system error has occurred.
-        * @remarks      The specific error code can be accessed using the GetLastResult() method.
+        * @remarks      
+        *                      - The specific error code can be accessed using the GetLastResult() method.
+        *                      - BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method.
         */
        Tizen::Base::Collection::IList* ExtractFaceInfoFromStillImageN(const Tizen::Base::ByteBuffer& byteBuffer, const Tizen::Graphics::Dimension& dim, Tizen::Graphics::BitmapPixelFormat format);
 
@@ -365,11 +362,9 @@ public:
         * @param[in]    preprocessedFaceBuffer    The preprocessed data
         * @param[in]    faceComponentPos          The facial information that is obtained from the
         *                                         FaceDetector::ExtractFaceComponentsN() method @n
-        *                                         The specified facial information must contain the eye position. @n
+        *                                         The @c faceComponentPos parameter must contain the eye position.
         *                                         The position of the eyes must be greater than or equal to @c 0.
-        *                                         The position of the eyes must be within @c preprocessedFaceBuffer. @n
-        *                                                      If there are wrong values in the specified facial information, the result cannot be guaranteed even if it returns @c E_SUCCESS. @n
-        *                                                      Therefore, be sure not to change the value of facial information after getting it from FaceDetector::ExtractFaceComponentsN().
+        *                                         The position of the eyes must be within @c preprocessedFaceBuffer.
         * @exception    E_SUCCESS                 The method is successful.
         * @exception    E_INVALID_ARG             A specified input parameter is invalid.
         * @exception    E_OUT_OF_MEMORY           The memory is insufficient.
@@ -377,9 +372,10 @@ public:
         * @exception    E_OPERATION_FAILED        The method has failed to extract the facial information but there is no error reported. @n
         *                                         This can happen when the detected faces are too small or the input data is not clear.
         *                                         This is the result of a normal operation.
-        * @remarks      The specific error code can be accessed using the GetLastResult() method.
+        * @remarks      
+        *                      - The specific error code can be accessed using the GetLastResult() method.
+        *                      - If there are wrong values in the @c faceComponentPos, the result cannot be guaranteed even if it returns @c E_SUCCESS. Therefore, be sure not to change the value of @c faceComponentPos after getting it from FaceDetector::ExtractFaceComponentsN().
         * @see          FaceDetector::PreprocessDataN()
-        * @see          FaceDetector::ExtractFaceComponentsN()
         */
        Tizen::Base::ByteBuffer* ExtractFeatureN(const FaceBuffer& preprocessedFaceBuffer, const FaceComponentsPosition& faceComponentPos);
 
@@ -392,11 +388,9 @@ public:
         *               else @c EYE_STATE_NONE if an exception occurs
         * @param[in]    preprocessedFaceBuffer    The preprocessed data
         * @param[in]    faceComponentPos          The facial information that is obtained from the FaceDetector::ExtractFaceComponentsN() method @n
-        *                                         The specified facial information must contain the eye position. @n
+        *                                         The @c faceComponentPos parameter must contain the eye position.
         *                                         The position of the eyes must be greater than or equal to @c 0.
-        *                                         The position of the eyes must be within @c preprocessedFaceBuffer. @n
-        *                                                      If there are wrong values in the specified facial information, the result cannot be guaranteed even if it returns @c E_SUCCESS. @n
-        *                                                      Therefore, be sure not to change the value of facial information after getting it from FaceDetector::ExtractFaceComponentsN().
+        *                                         The position of the eyes must be within @c preprocessedFaceBuffer.
         * @exception    E_SUCCESS                 The method is successful.
         * @exception    E_INVALID_ARG             A specified input parameter is invalid.
         * @exception    E_OUT_OF_MEMORY           The memory is insufficient.
@@ -404,7 +398,10 @@ public:
         * @exception    E_OPERATION_FAILED        The method has failed to detect the eye state but there is no error reported. @n
         *                                         This can happen when the detected faces are too small or the input data is not clear.
         *                                         This is the result of a normal operation.
-        * @remarks      The specific error code can be accessed using the GetLastResult() method.
+        * @remarks      
+        *                      - The specific error code can be accessed using the GetLastResult() method.
+        *                      - If there are wrong values in the @c faceComponentPos, the result cannot be guaranteed even if it returns @c E_SUCCESS.
+        *                              Therefore, be sure not to change the value of @c faceComponentPos after getting it from FaceDetector::ExtractFaceComponentsN().
         * @see          FaceDetector::PreprocessDataN()
         */
        EyeState GetEyeState(const FaceBuffer& preprocessedFaceBuffer, const FaceComponentsPosition& faceComponentPos);
@@ -418,11 +415,9 @@ public:
         *               else @c FACIAL_EXPRESSION_NONE if an exception occurs
         * @param[in]    preprocessedFaceBuffer    The preprocessed data
         * @param[in]    faceComponentPos          The facial information that is obtained from the FaceDetector::ExtractFaceComponentsN() method @n
-        *                                         The specified facial information must contain the eye position. @n
+        *                                         The @c faceComponentPos parameter must contain the eye position.
         *                                         The position of the eyes must be greater than or equal to @c 0.
-        *                                         The position of the eyes must be within @c preprocessedFaceBuffer. @n
-        *                                                      If there are wrong values in the specified facial information, the result cannot be guaranteed even if it returns @c E_SUCCESS. @n
-        *                                                      Therefore, be sure not to change the value of facial information after getting it from FaceDetector::ExtractFaceComponentsN().
+        *                                         The position of the eyes must be within @c preprocessedFaceBuffer.
         * @exception    E_SUCCESS                 The method is successful.
         * @exception    E_INVALID_ARG             A specified input parameter is invalid.
         * @exception    E_OUT_OF_MEMORY           The memory is insufficient.
@@ -431,6 +426,8 @@ public:
         *                                         This can happen when the detected faces are too small or the input data is not clear.
         *                                         This is the result of a normal operation.
         * @remarks      The specific error code can be accessed using the GetLastResult() method.
+        * @remarks      If there are wrong values in the @c faceComponentPos, the result cannot be guaranteed even if it returns @c E_SUCCESS. Therefore,
+        *               be sure not to change the value of @c faceComponentPos after getting it from FaceDetector::ExtractFaceComponentsN().
         * @see          FaceDetector::PreprocessDataN()
         */
        FacialExpression RecognizeExpression(const FaceBuffer& preprocessedFaceBuffer, const FaceComponentsPosition& faceComponentPos);
index 3ad2e9f..33c7a4e 100644 (file)
@@ -17,9 +17,9 @@
 
 /**
  * @file     FUixVisionFaceTypes.h
- * @brief    This is the header file for the declarations of the Vision namespace.
+ * @brief    This is the header file for the declarations of the Tizen::Uix::Vision namespace.
  *
- * This header file contains the declarations of the Vision namespace.
+ * This header file contains the declarations of the Tizen::Uix::Vision namespace.
  */
 
 #ifndef _FUIX_VISION_FACE_TYPES_H_
@@ -42,13 +42,13 @@ enum FaceDetectorConfigProperty
 {
        /**
         * The maximum number of faces to detect from a video stream. @n
-        * This is used when FaceDetector::DetectFacesFromVideoStreamN() is called.
+        * This will be used when FaceDetector::DetectFacesFromVideoStreamN() is called.
         */
        FACEDETECTOR_MAXNUMBER_VIDEO,
 
        /**
         * The maximum number of faces to detect from a still image. @n
-        * This is used when FaceDetector::DetectFacesFromStillImageN(const Tizen::Base::ByteBuffer&, const Tizen::Graphics::Dimension&, Tizen::Graphics::BitmapPixelFormat) is called.
+        * This will be used when FaceDetector::DetectFacesFromStillImageN() is called.
         */
        FACEDETECTOR_MAXNUMBER_IMAGE,
 
@@ -60,7 +60,7 @@ enum FaceDetectorConfigProperty
         * The value @c 3 is used when FaceDetector::DetectFacesFromVideoStreamN() is called unless it has been changed earlier
         * using the FaceDetector::SetProperty() method. @n
         *
-        * This is used when %FaceDetector::DetectFacesFromVideoStreamN() is called.
+        * This will be used when %FaceDetector::DetectFacesFromVideoStreamN() is called.
         */
        FACEDETECTOR_SCALE_VIDEO,
 
@@ -69,18 +69,18 @@ enum FaceDetectorConfigProperty
         * The range is from values @c 1 to @c 3, where the value @c 1 has the longest execution time and @c 3 has
         * the shortest execution time. The value @c 1 detects small faces.
         * Therefore, for an application handling images, the value @c 1 is an appropriate option.
-        * The value @c 1 is used when FaceDetector::DetectFacesFromStillImageN(const Tizen::Base::ByteBuffer&, const Tizen::Graphics::Dimension&, Tizen::Graphics::BitmapPixelFormat) is called unless it has been changed
+        * The value @c 1 is used when FaceDetector::DetectFacesFromStillImageN() is called unless it has been changed
         * earlier using the FaceDetector::SetProperty() method. @n
         *
-        * This is used when %FaceDetector::DetectFacesFromStillImageN(const %Tizen::Base::ByteBuffer&, const %Tizen::Graphics::Dimension&, %Tizen::Graphics::BitmapPixelFormat) is called.
+        * This will be used when %FaceDetector::DetectFacesFromStillImageN() is called.
         */
        FACEDETECTOR_SCALE_IMAGE,
 
        /**
         * The maximum number of faces to detect. @n
-        * The value @c 1 is used when FaceDetector::DetectFacesN() is called unless it has been changed earlier
+        * The value @c 1 is used when DetectFacesN() is called unless it has been changed earlier
         * using the FaceDetector::SetProperty() method. @n
-        * This is used when %FaceDetector::DetectFacesN() is called.
+        * This will be used when FaceDetector::DetectFacesN() is called.
         */
        FACEDETECTOR_MAXNUMBER_FACES,
 
@@ -91,7 +91,7 @@ enum FaceDetectorConfigProperty
         * The value @c 3 is used when FaceDetector::DetectFacesN() is called unless it has been changed earlier using
         * the FaceDetector::SetProperty() method. @n
         *
-        * This is used when %FaceDetector::DetectFacesN() is called.
+        * This will be used when %FaceDetector::DetectFacesN() is called.
         */
        FACEDETECTOR_SCALE_FACTOR,
 };
@@ -110,13 +110,13 @@ enum FaceRecognizerConfigProperty
 {
        /**
         * The maximum number of faces to extract face information from a video stream. @n
-        * This is used when FaceRecognizer::ExtractFaceInfoFromVideoStreamN() is called.
+        * This will be used when FaceRecognizer::ExtractFaceInfoFromVideoStreamN() is called.
         */
        FACERECOGNIZER_MAXNUMBER_VIDEO,
 
        /**
         * The maximum number of faces to extract face information from a still image. @n
-        * This is used when FaceRecognizer::ExtractFaceInfoFromStillImageN(const Tizen::Base::ByteBuffer&, const Tizen::Graphics::Dimension&, Tizen::Graphics::BitmapPixelFormat) is called.
+        * This will be used when FaceRecognizer::ExtractFaceInfoFromStillImageN() is called.
         */
        FACERECOGNIZER_MAXNUMBER_IMAGE,
 
@@ -125,10 +125,10 @@ enum FaceRecognizerConfigProperty
         * The range is from values @c 1 to @c 3, where the value @c 1 has the longest execution time and @c 3 has
         * the shortest execution time. The value @c 1 detects small faces.
         * Therefore, for an application using a camera or a video file, the value @c 3 is an appropriate option.
-        * The value @c 3 is used when FaceRecognizer::ExtractFaceInfoFromVideoStreamN() is called unless it has been changed
+        * The value @c 3 is used when ExtractFaceInfoFromVideoStreamN() is called unless it has been changed
         * earlier using the FaceDetector::SetProperty() method. @n
         *
-        * This is used when %FaceRecognizer::ExtractFaceInfoFromVideoStreamN() is called.
+        * This will be used when FaceRecognizer::ExtractFaceInfoFromVideoStreamN() is called.
         */
        FACERECOGNIZER_SCALE_VIDEO,
 
@@ -138,10 +138,10 @@ enum FaceRecognizerConfigProperty
         * the shortest execution time.
         * The value @c 1 detects small faces.
         * Therefore, for an application handling images, the value @c 1 is an appropriate option.
-        * The value @c 1 is used when FaceRecognizer::ExtractFaceInfoFromStillImageN(const Tizen::Base::ByteBuffer&, const Tizen::Graphics::Dimension&, Tizen::Graphics::BitmapPixelFormat) is called unless it has been changed
+        * The value @c 1 is used when ExtractFaceInfoFromStillImageN() is called unless it has been changed
         * earlier using the FaceDetector::SetProperty() method. @n
         *
-        * This is used when %FaceRecognizer::ExtractFaceInfoFromStillImageN(const %Tizen::Base::ByteBuffer&, const %Tizen::Graphics::Dimension&, %Tizen::Graphics::BitmapPixelFormat) is called.
+        * This will be used when FaceRecognizer::ExtractFaceInfoFromStillImageN() is called.
         */
        FACERECOGNIZER_SCALE_IMAGE,
 };
index f594a83..f45e7b8 100644 (file)
@@ -57,7 +57,7 @@ FaceComponentsPosition::FaceComponentsPosition(const Tizen::Graphics::Rectangle&
        __faceRect.height = faceRect.height;
 }
 
-FaceComponentsPosition::FaceComponentsPosition(const Tizen::Graphics::Rectangle& faceRect, const Tizen::Graphics::Point& eyeLeft, const Tizen::Graphics::Point& eyeRight)
+FaceComponentsPosition::FaceComponentsPosition(const Tizen::Graphics::Rectangle& faceRect, const Tizen::Graphics::Point& eyeRight, const Tizen::Graphics::Point& eyeLeft)
        : __mouthRect(-1, -1, -1, -1)
 {
        __faceRect.x = faceRect.x;
index 26a8049..a6cb5bb 100644 (file)
@@ -270,7 +270,7 @@ FaceDetector::PreprocessDataN(const Tizen::Base::ByteBuffer& byteBuffer, const T
        pGrayBuf = __pFaceDetectorImpl->ConvertToGrayN(byteBuffer, dim, format);
 
        pProcessedData = std::unique_ptr<FaceBuffer>(new (std::nothrow) FaceBuffer(*pGrayBuf, dim));
-       SysTryCatch(NID_UIX, pProcessedData.get() != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed."
+       SysTryCatch(NID_UIX, pProcessedData != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed."
                        , GetErrorMessage(E_OUT_OF_MEMORY));
 
        delete pGrayBuf;
index 0a7cc73..2d178cf 100644 (file)
@@ -330,7 +330,7 @@ FaceRecognizer::ExtractFeatureN(const FaceBuffer& preprocessedFaceBuffer, const
                                        r = E_OPERATION_FAILED, E_OPERATION_FAILED, "[%s] Fail to extract the facial information.", GetErrorMessage(E_OPERATION_FAILED));
        }
 
-       return __pFaceRecognizerImpl->ExtractFeatureN(*(preprocessedFaceBuffer.GetBuffer()), resolution, faceRect, eyeLeft, eyeRight);
+       return __pFaceRecognizerImpl->ExtractFeatureN(*(preprocessedFaceBuffer.GetBuffer()), resolution, faceRect);
 
 CATCH:
        SetLastResult(r);
index 229802d..7c7516f 100644 (file)
@@ -120,10 +120,11 @@ _FaceDetectorImpl::Construct(void)
        std::unique_ptr< FaceEngineInfo > pFaceEngineInfo(new (std::nothrow) FaceEngineInfo);
        SysTryReturn(NID_UIX, pFaceEngineInfo != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
+       __pFaceEngineInfo = pFaceEngineInfo.release();
+
        std::unique_ptr< _FaceUtil > pFaceUtil(new (std::nothrow) _FaceUtil);
        SysTryReturn(NID_UIX, pFaceUtil != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       __pFaceEngineInfo = pFaceEngineInfo.release();
        __pFaceUtil = pFaceUtil.release();
 
        return r;
@@ -305,7 +306,6 @@ _FaceDetectorImpl::DetectFacesFromBufferN(const Tizen::Base::ByteBuffer& byteBuf
        result r = E_SUCCESS;
        int retValue = 0;
        unsigned char* pImageBuffer = null;
-       Tizen::Graphics::Rectangle* pRect = null;
 
        ClearLastResult();
 
@@ -347,7 +347,7 @@ _FaceDetectorImpl::DetectFacesFromBufferN(const Tizen::Base::ByteBuffer& byteBuf
        {
                for (int i = 0; i < __pFaceEngineInfo->g_iFaceDetectNum; i++)
                {
-                       pRect =
+                       Tizen::Graphics::Rectangle* pRect =
                                new (std::nothrow) Tizen::Graphics::Rectangle(__pFaceEngineInfo->g_FaceROI[i].x, __pFaceEngineInfo->g_FaceROI[i].y,
                                                                                                                          __pFaceEngineInfo->g_FaceROI[i].width, __pFaceEngineInfo->g_FaceROI[i].height);
 
@@ -362,12 +362,8 @@ _FaceDetectorImpl::DetectFacesFromBufferN(const Tizen::Base::ByteBuffer& byteBuf
        return pDetectList.release();
 
 CATCH:
-       if (pRect != null)
-       {
-               delete pRect;
-       }
        SetLastResult(r);
-       pDetectList->RemoveAll(true);
+       pDetectList->RemoveAll();
        return pDetectList.release();
 }
 
@@ -378,7 +374,6 @@ _FaceDetectorImpl::DetectFacesFromBitmapN(const Tizen::Graphics::Bitmap& bitmap)
        BufferInfo bitmapInfo;
        unsigned char* pImageBuffer = null;
        int retValue = 0;
-       Tizen::Graphics::Rectangle* pRect = null;
 
        ClearLastResult();
 
@@ -424,9 +419,7 @@ _FaceDetectorImpl::DetectFacesFromBitmapN(const Tizen::Graphics::Bitmap& bitmap)
        {
                for (int i = 0; i < __pFaceEngineInfo->g_iFaceDetectNum; i++)
                {
-                       //The null assingment is to avoid possible memory leak
-                       pRect = null;
-                       pRect =
+                       Tizen::Graphics::Rectangle* pRect =
                                new (std::nothrow) Tizen::Graphics::Rectangle(__pFaceEngineInfo->g_FaceROI[i].x, __pFaceEngineInfo->g_FaceROI[i].y,
                                                                                                                          __pFaceEngineInfo->g_FaceROI[i].width, __pFaceEngineInfo->g_FaceROI[i].height);
 
@@ -448,13 +441,10 @@ _FaceDetectorImpl::DetectFacesFromBitmapN(const Tizen::Graphics::Bitmap& bitmap)
        return pDetectList.release();
 
 CATCH:
-       if (pRect)
-       {
-               delete pRect;
-       }
+       SysLogException(NID_UIX, r, "XXXX - CATCH: _FaceDetectorImpl::DetectFacesFromBitmapN");
        ReleaseFaceEngine();
        SetLastResult(r);
-       pDetectList->RemoveAll(true);
+       pDetectList->RemoveAll();
        return pDetectList.release();
 }
 
@@ -466,7 +456,6 @@ _FaceDetectorImpl::DetectFacesFromBitmapN(const Tizen::Base::ByteBuffer& byteBuf
        result r = E_SUCCESS;
        int retValue = 0;
        unsigned char* pImageBuffer = null;
-       Tizen::Graphics::Rectangle* pRect = null;
 
        std::unique_ptr< unsigned char[] > pBuffer(new (std::nothrow) unsigned char[resolution.width * resolution.height]);
        SysTryReturn(NID_UIX, pBuffer != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed."
@@ -507,9 +496,7 @@ _FaceDetectorImpl::DetectFacesFromBitmapN(const Tizen::Base::ByteBuffer& byteBuf
        {
                for (int i = 0; i < __pFaceEngineInfo->g_iFaceDetectNum; i++)
                {
-                       //The null assingment is to avoid possible memory leak
-                       pRect = null;
-                       pRect =
+                       Tizen::Graphics::Rectangle* pRect =
                                new (std::nothrow) Tizen::Graphics::Rectangle(__pFaceEngineInfo->g_FaceROI[i].x, __pFaceEngineInfo->g_FaceROI[i].y,
                                                                                                                          __pFaceEngineInfo->g_FaceROI[i].width, __pFaceEngineInfo->g_FaceROI[i].height);
 
@@ -526,13 +513,9 @@ _FaceDetectorImpl::DetectFacesFromBitmapN(const Tizen::Base::ByteBuffer& byteBuf
        return pDetectList.release();
 
 CATCH:
-       if (pRect)
-       {
-               delete pRect;
-       }
        SetLastResult(r);
        ReleaseFaceEngine();
-       pDetectList->RemoveAll(true);
+       pDetectList->RemoveAll();
        return pDetectList.release();
 }
 
@@ -542,14 +525,12 @@ _FaceDetectorImpl::ConvertToGrayN(const Tizen::Base::ByteBuffer& byteBuffer, con
 {
        result r = E_SUCCESS;
        ClearLastResult();
-       int capacity = 0;
 
        std::unique_ptr< Tizen::Base::ByteBuffer > pGrayBuf(new (std::nothrow) Tizen::Base::ByteBuffer());
        SysTryReturn(NID_UIX, pGrayBuf != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed."
                                , GetErrorMessage(E_OUT_OF_MEMORY));
 
-       capacity = byteBuffer.GetCapacity();
-       r = pGrayBuf->Construct(capacity);
+       r = pGrayBuf->Construct(resolution.width * resolution.height);
        SysTryReturn(NID_UIX, r == E_SUCCESS, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(r));
 
        switch (format)
@@ -565,7 +546,8 @@ _FaceDetectorImpl::ConvertToGrayN(const Tizen::Base::ByteBuffer& byteBuffer, con
                break;
 
        case PIXEL_FORMAT_YCbCr420_PLANAR:
-               memcpy((unsigned char*)(pGrayBuf->GetPointer()), (unsigned char*)(byteBuffer.GetPointer()), capacity);
+               memcpy((unsigned char*) (pGrayBuf->GetPointer()),
+                          (unsigned char*) byteBuffer.GetPointer(), sizeof(unsigned char) * resolution.width * resolution.height);
                break;
 
        default:
@@ -583,7 +565,6 @@ _FaceDetectorImpl::DetectFacesN(const Tizen::Base::ByteBuffer& grayBuffer, const
        int retValue = 0;
        result r = E_SUCCESS;
        unsigned char* pImageBuffer = null;
-       Tizen::Graphics::Rectangle* pRect = null;
 
        ClearLastResult();
 
@@ -618,9 +599,7 @@ _FaceDetectorImpl::DetectFacesN(const Tizen::Base::ByteBuffer& grayBuffer, const
        {
                for (int i = 0; i < __pFaceEngineInfo->g_iFaceDetectNum; i++)
                {
-                       //The null assingment is to avoid possible memory leak
-                       pRect = null;
-                       pRect =
+                       Tizen::Graphics::Rectangle* pRect =
                                new (std::nothrow) Tizen::Graphics::Rectangle(__pFaceEngineInfo->g_FaceROI[i].x, __pFaceEngineInfo->g_FaceROI[i].y,
                                                                                                                          __pFaceEngineInfo->g_FaceROI[i].width, __pFaceEngineInfo->g_FaceROI[i].height);
 
@@ -635,12 +614,9 @@ _FaceDetectorImpl::DetectFacesN(const Tizen::Base::ByteBuffer& grayBuffer, const
        ReleaseFaceEngine();
        return pDetectList.release();
 CATCH:
-       if (pRect)
-       {
-               delete pRect;
-       }
+       SysLogException(NID_UIX, r, "XXXX - CATCH _FaceDetectorImpl::DetectFacesN");
        SetLastResult(r);
-       pDetectList->RemoveAll(true);
+       pDetectList->RemoveAll();
        return pDetectList.release();
 }
 
@@ -650,6 +626,7 @@ _FaceDetectorImpl::ExtractFaceComponents(const Tizen::Base::ByteBuffer& grayBuff
                                                                                 Tizen::Graphics::Point& eyeLeft, Tizen::Graphics::Rectangle& mouthRect)
 {
        result r = E_SUCCESS;
+       int index = -1;
        int retVal = 0;
        FaceEngineInfo* pFaceEngineInfo = null;
 
index b65a6c1..f7e2923 100644 (file)
@@ -105,10 +105,14 @@ _FaceRecognizerImpl::Construct(void)
        std::unique_ptr< FaceEngineInfo > pFaceEngineInfo(new (std::nothrow) FaceEngineInfo);
        SysTryReturn(NID_UIX, pFaceEngineInfo != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
+       __pFaceEngineInfo = pFaceEngineInfo.release();
+
+       //int  retValue = caApp_FaceEngineInit(__pFaceEngineInfo, FD_MODE_ROLo_YAWo, FD_SIZE_COVERAGE_HIGH,__maxFacesImage, _FT_INTERVAL_DEFAULT);
+       //SysTryReturn(NID_UIX, retValue == _FACEENGINE_INIT_SUCCESS, E_FAILURE, E_FAILURE, "[%s] Face Engine Init failed.", GetErrorMessage(E_FAILURE));
+
        std::unique_ptr< _FaceUtil > pFaceUtil(new (std::nothrow) _FaceUtil);
        SysTryReturn(NID_UIX, pFaceUtil != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       __pFaceEngineInfo = pFaceEngineInfo.release();
        __pFaceUtil = pFaceUtil.release();
 
        return res;
@@ -319,6 +323,7 @@ _FaceRecognizerImpl::ExtractFaceFeaturesFromBufferN(const Tizen::Base::ByteBuffe
        int featureLength = 0;
        unsigned char* pImageBuffer = null;
        ByteBuffer buffer;
+       int isValidFREngine = 0;
 
        std::unique_ptr< FaceRecognitionInfo > pFaceInfo;
 
@@ -368,7 +373,10 @@ _FaceRecognizerImpl::ExtractFaceFeaturesFromBufferN(const Tizen::Base::ByteBuffe
                                   , GetErrorMessage(E_FAILURE));
        }
 
-       caApp_FtsExInit(FR_MODE_MPL2, _FACE_ENGINE_BIN_PATH);
+       //isValidFREngine = caApp_FtsExInit(FR_MODE_MPL2, "/usr/share/face-engine/data/");
+       isValidFREngine = caApp_FtsExInit(FR_MODE_MPL2, _FACE_ENGINE_BIN_PATH);
+
+       //SysTryCatch(NID_UIX, isValidFREngine == _FACEENGINE_RETURN_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed caApp_FtsExInit", GetErrorMessage(E_FAILURE));
 
        featureLength = caApp_FtsExVecLength();
        SysTryCatch(NID_UIX, featureLength > 0, r = E_FAILURE, E_FAILURE, "[%s] Failed caApp_FtsExInit", GetErrorMessage(E_FAILURE));
@@ -405,7 +413,7 @@ _FaceRecognizerImpl::ExtractFaceFeaturesFromBufferN(const Tizen::Base::ByteBuffe
 CATCH:
        SetLastResult(r);
        caApp_FtsExRelease();
-       pDetectList->RemoveAll(true);
+       pDetectList->RemoveAll();
        return pDetectList.release();
 }
 
@@ -419,6 +427,7 @@ _FaceRecognizerImpl::ExtractFaceFeaturesFromBitmapN(const Tizen::Base::ByteBuffe
        result r = E_SUCCESS;
        unsigned char* pImageBuffer = null;
        int retValue = 0;
+       int isValidFREngine = 0;
        int featureLength = 0;
 
        std::unique_ptr< FaceRecognitionInfo > pFaceInfo;
@@ -466,7 +475,9 @@ _FaceRecognizerImpl::ExtractFaceFeaturesFromBitmapN(const Tizen::Base::ByteBuffe
                                   , GetErrorMessage(E_FAILURE));
        }
 
-       caApp_FtsExInit(FR_MODE_MPL2, _FACE_ENGINE_BIN_PATH);
+       //isValidFREngine = caApp_FtsExInit(FR_MODE_MPL2,"/usr/share/face-engine/data/");
+       isValidFREngine = caApp_FtsExInit(FR_MODE_MPL2, _FACE_ENGINE_BIN_PATH);
+       //SysTryCatch(NID_UIX, isValidFREngine == _FACEENGINE_RETURN_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed caApp_FtsExInit", GetErrorMessage(E_FAILURE));
 
        featureLength = caApp_FtsExVecLength();
        SysTryCatch(NID_UIX, featureLength > 0, r = E_FAILURE, E_FAILURE, "[%s] Failed caApp_FtsExInit", GetErrorMessage(E_FAILURE));
@@ -505,7 +516,7 @@ CATCH:
        SetLastResult(r);
        caApp_FtsExRelease();
        ReleaseFaceEngine();
-       pDetectList->RemoveAll(true);
+       pDetectList->RemoveAll();
        return pDetectList.release();
 }
 
@@ -516,6 +527,7 @@ _FaceRecognizerImpl::ExtractFaceFeaturesFromBitmapN(const Tizen::Graphics::Bitma
        result r = E_SUCCESS;
        unsigned char* pImageBuffer = null;
        int retValue = 0;
+       int isValidFREngine = 0;
        int featureLength = 0;
        std::unique_ptr< FaceRecognitionInfo > pFaceInfo;
 
@@ -564,7 +576,9 @@ _FaceRecognizerImpl::ExtractFaceFeaturesFromBitmapN(const Tizen::Graphics::Bitma
                                   , GetErrorMessage(E_FAILURE));
        }
 
-       caApp_FtsExInit(FR_MODE_MPL2, _FACE_ENGINE_BIN_PATH);
+       //isValidFREngine = caApp_FtsExInit(FR_MODE_MPL2,"/usr/share/face-engine/data/");
+       isValidFREngine = caApp_FtsExInit(FR_MODE_MPL2, _FACE_ENGINE_BIN_PATH);
+       //SysTryCatch(NID_UIX, isValidFREngine == _FACEENGINE_RETURN_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed caApp_FtsExInit", GetErrorMessage(E_FAILURE));
 
        featureLength = caApp_FtsExVecLength();
        SysTryCatch(NID_UIX, featureLength > 0, r = E_FAILURE, E_FAILURE, "[%s] Failed caApp_FtsExInit", GetErrorMessage(E_FAILURE));
@@ -597,10 +611,10 @@ _FaceRecognizerImpl::ExtractFaceFeaturesFromBitmapN(const Tizen::Graphics::Bitma
 
                pFaceInfo->SetFacePosition(pRect->x, pRect->y, pRect->width, pRect->height);
 
-               delete pRect;
-
                r = pDetectList->Add(*(pFaceInfo.release()));
                SysTryCatch(NID_UIX, r == E_SUCCESS, r = E_FAILURE, r, "[%s] Failed to add the FaceRecognitionInfo.", GetErrorMessage(E_FAILURE));
+
+               delete pRect;
        }
 
        caApp_FtsExRelease();
@@ -614,7 +628,7 @@ CATCH:
        SetLastResult(r);
        caApp_FtsExRelease();
        ReleaseFaceEngine();
-       pDetectList->RemoveAll(true);
+       pDetectList->RemoveAll();
        return pDetectList.release();
 }
 
@@ -668,7 +682,7 @@ _FaceRecognizerImpl::DetectBlinksFromBitmapN(const Tizen::Base::ByteBuffer& byte
        pDetectList(new (std::nothrow) HashMapT< Tizen::Graphics::Rectangle, EyeState >);
        SysTryReturn(NID_UIX, pDetectList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       std::unique_ptr< unsigned char[] > pBuffer(new (std::nothrow) unsigned char[resolution.width * resolution.height]);
+       std::unique_ptr< unsigned char > pBuffer(new (std::nothrow) unsigned char[resolution.width * resolution.height]);
        SysTryCatch(NID_UIX, pBuffer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
        pImageBuffer = pBuffer.get();
@@ -745,6 +759,7 @@ _FaceRecognizerImpl::DetectBlinksFromBitmapN(const Tizen::Base::ByteBuffer& byte
        return pDetectList.release();
 
 CATCH:
+       SysLogException(NID_UIX, E_SUCCESS, "XXXX - CATCH _FaceRecognizerImpl::DetectBlinksFromBitmapN-");
        SetLastResult(r);
        ReleaseFaceEngine();
        pDetectList->RemoveAll();
@@ -776,7 +791,7 @@ _FaceRecognizerImpl::RecognizeExpressionsFromBitmapN(const Tizen::Base::ByteBuff
        pDetectList(new (std::nothrow) HashMapT< Tizen::Graphics::Rectangle, FacialExpression >);
        SysTryReturn(NID_UIX, pDetectList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       std::unique_ptr< unsigned char[] > pBuffer(new (std::nothrow) unsigned char[resolution.width * resolution.height]);
+       std::unique_ptr< unsigned char > pBuffer(new (std::nothrow) unsigned char[resolution.width * resolution.height]);
        SysTryCatch(NID_UIX, pBuffer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
        pImageBuffer = pBuffer.get();
        SysTryCatch(NID_UIX, pImageBuffer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Failed to create the Buffer.",
@@ -864,6 +879,7 @@ _FaceRecognizerImpl::RecognizeExpressionsFromBitmapN(const Tizen::Base::ByteBuff
        return pDetectList.release();
 
 CATCH:
+       SysLogException(NID_UIX, E_SUCCESS, "XXXX - CATCH _FaceRecognizerImpl::RecognizeExpressionsFromBitmapN-");
        ReleaseFaceEngine();
        SetLastResult(r);
        pDetectList->RemoveAll();
@@ -927,7 +943,11 @@ _FaceRecognizerImpl::DetectBlinksFromBufferN(const Tizen::Base::ByteBuffer& byte
                                   , GetErrorMessage(E_FAILURE));
        }
 
+       SysLogException(NID_UIX, E_SUCCESS, "XXXX - REACH 001");
+
        retValue = caApp_RunFaceDetection(pImageBuffer, resolution.width, resolution.height, __pFaceEngineInfo);
+       SysLogException(NID_UIX, E_SUCCESS, "XXXX - REACH 002 __pFaceEngineInfo->g_iFaceDetectNum = %d", __pFaceEngineInfo->g_iFaceDetectNum);
+
        SysTryCatch(NID_UIX, retValue == _FACEENGINE_RETURN_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed to create the Buffer."
                           , GetErrorMessage(E_FAILURE));
        for (int i = 0; i < __pFaceEngineInfo->g_iFaceDetectNum; i++)
@@ -1034,19 +1054,23 @@ _FaceRecognizerImpl::RecognizeExpressionsFromBufferN(const Tizen::Base::ByteBuff
        SysTryCatch(NID_UIX, retValue == _FACEENGINE_RETURN_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed to create the Buffer."
                           , GetErrorMessage(E_FAILURE));
 
+       //SysLogException(NID_UIX, E_SUCCESS, "XXXX - Entering RecognizeExpressionsFromBufferN  faces= %d",__pFaceEngineInfo->g_iFaceDetectNum);
        for (int i = 0; i < __pFaceEngineInfo->g_iFaceDetectNum; i++)
        {
                retValue = caApp_RunEyeDetection(pImageBuffer, resolution.width, resolution.height, __pFaceEngineInfo, i);
                SysTryCatch(NID_UIX, retValue == _FACEENGINE_RETURN_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed to create the Buffer."
                                   , GetErrorMessage(E_FAILURE));
+               SysLogException(NID_UIX, E_SUCCESS, "XXXX - REACH 003");
                retValue = caApp_RunMouthDetection(pImageBuffer, resolution.width, resolution.height, __pFaceEngineInfo, i);
                SysTryCatch(NID_UIX, retValue == _FACEENGINE_RETURN_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed to create the Buffer."
                                   , GetErrorMessage(E_FAILURE));
+               SysLogException(NID_UIX, E_SUCCESS, "XXXX - REACH 004");
 
                retValue = caApp_RunFERDetection(pImageBuffer, resolution.width, resolution.height, __pFaceEngineInfo, true);
                SysTryCatch(NID_UIX, retValue == _FACEENGINE_RETURN_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed to create the Buffer."
                                   , GetErrorMessage(E_FAILURE));
 
+               SysLogException(NID_UIX, E_SUCCESS, "XXXX - REACH 005");
                FacialExpression expression = FACIAL_EXPRESSION_NONE;
 
                switch (*(__pFaceEngineInfo->g_Expression[i]))
@@ -1082,6 +1106,7 @@ _FaceRecognizerImpl::RecognizeExpressionsFromBufferN(const Tizen::Base::ByteBuff
        return pDetectList.release();
 
 CATCH:
+       //SysLogException(NID_UIX, r, "XXXX -CATCH _FaceRecognizerImpl::RecognizeExpressionsFromBufferN-");
        pDetectList->RemoveAll();
        SetLastResult(r);
        return pDetectList.release();
@@ -1089,13 +1114,13 @@ CATCH:
 
 Tizen::Base::ByteBuffer*
 _FaceRecognizerImpl::ExtractFeatureN(const Tizen::Base::ByteBuffer& grayBuffer, const Tizen::Graphics::Dimension& resolution,
-                                                                        const Tizen::Graphics::Rectangle& faceRect, Tizen::Graphics::Point eyeLeft,
-                                                                       Tizen::Graphics::Point eyeRight)
+                                                                        const Tizen::Graphics::Rectangle& faceRect)
 {
        ClearLastResult();
        result r = E_SUCCESS;
        int featureLength = 0;
        int retValue = 0;
+       int isValidFREngine = 0;
        long* pFaceData = null;
        FaceEngineInfo* __pFaceEngineInfoTemp = null;
 
@@ -1103,10 +1128,8 @@ _FaceRecognizerImpl::ExtractFeatureN(const Tizen::Base::ByteBuffer& grayBuffer,
        SysTryReturn(NID_UIX, pBuffer != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
        std::unique_ptr< FaceEngineInfo > pFaceEngineInfo(new (std::nothrow) FaceEngineInfo);
-       SysTryReturn(NID_UIX, pFaceEngineInfo != null, null, E_OUT_OF_MEMORY, "[%s] Failed to create the Buffer.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       __pFaceEngineInfoTemp = pFaceEngineInfo.get();
-       SysTryReturn(NID_UIX, __pFaceEngineInfoTemp != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",   GetErrorMessage(E_OUT_OF_MEMORY));
+       __pFaceEngineInfoTemp = pFaceEngineInfo.release();
 
        retValue = caApp_FaceEngineInit(__pFaceEngineInfoTemp, FD_MODE_ROLx_YAWx, FD_SIZE_COVERAGE_HIGH, __maxFacesImage, 20);
        SysTryCatch(NID_UIX, retValue == _FACEENGINE_INIT_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed to create the Buffer."
@@ -1116,12 +1139,11 @@ _FaceRecognizerImpl::ExtractFeatureN(const Tizen::Base::ByteBuffer& grayBuffer,
        __pFaceEngineInfoTemp->g_FaceROI[0].y = faceRect.y;
        __pFaceEngineInfoTemp->g_FaceROI[0].width = faceRect.width;
        __pFaceEngineInfoTemp->g_FaceROI[0].height = faceRect.height;
-       __pFaceEngineInfoTemp->g_EyeROI[0].lx = eyeLeft.x;
-       __pFaceEngineInfoTemp->g_EyeROI[0].ly = eyeLeft.y;
-       __pFaceEngineInfoTemp->g_EyeROI[0].rx = eyeRight.x;
-       __pFaceEngineInfoTemp->g_EyeROI[0].ry = eyeRight.y;
 
-       caApp_FtsExInit(FR_MODE_MPL2, _FACE_ENGINE_BIN_PATH);
+       //caApp_RunFaceDetection((unsigned char*)grayBuffer, resolution.width, resolution.height, __pFaceEngineInfoTemp);
+       //isValidFREngine = caApp_FtsExInit(FR_MODE_MPL2,"/usr/share/face-engine/data/");
+       isValidFREngine = caApp_FtsExInit(FR_MODE_MPL2, _FACE_ENGINE_BIN_PATH);
+       //SysTryCatch(NID_UIX, isValidFREngine == _FACEENGINE_RETURN_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed caApp_FtsExInit", GetErrorMessage(E_FAILURE));
 
        featureLength = caApp_FtsExVecLength();
        SysTryCatch(NID_UIX, featureLength > 0, r = E_FAILURE, E_FAILURE, "[%s] Failed caApp_FtsExInit", GetErrorMessage(E_FAILURE));
@@ -1141,8 +1163,8 @@ _FaceRecognizerImpl::ExtractFeatureN(const Tizen::Base::ByteBuffer& grayBuffer,
        SysTryCatch(NID_UIX, retValue == _FACEENGINE_INIT_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed to delete FaceEngine.", GetErrorMessage(E_FAILURE));
 
        return pBuffer.release();
-
 CATCH:
+       SysLogException(NID_UIX, E_SUCCESS, "XXXX - CATCH _FaceRecognizerImpl::ExtractFeatureN-");
        caApp_FtsExRelease();
        caApp_FaceEngineRelease(__pFaceEngineInfoTemp);
        SetLastResult(r);
@@ -1163,13 +1185,9 @@ _FaceRecognizerImpl::DetectEyeState(const Tizen::Base::ByteBuffer& grayBuffer, c
        //Way to get the index is to loop for all rects and get the index..
 
        std::unique_ptr< FaceEngineInfo > pFaceEngineInfo(new (std::nothrow) FaceEngineInfo);
-       SysTryReturn(NID_UIX, pFaceEngineInfo != null, eyeState, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-       __pFaceEngineInfoTemp = pFaceEngineInfo.get();
-       SysTryReturn(NID_UIX, __pFaceEngineInfoTemp != null, eyeState, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",       GetErrorMessage(E_OUT_OF_MEMORY));      
+       __pFaceEngineInfoTemp = pFaceEngineInfo.release();
 
-       retVal = caApp_FaceEngineInit(__pFaceEngineInfoTemp, FD_MODE_ROLx_YAWx, FD_SIZE_COVERAGE_HIGH,__maxFacesImage, 20);
-       SysTryCatch(NID_UIX, retVal == _FACEENGINE_INIT_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed to create the Buffer."
-                               , GetErrorMessage(E_FAILURE));
+       caApp_FaceEngineInit(__pFaceEngineInfoTemp, FD_MODE_ROLx_YAWx, FD_SIZE_COVERAGE_HIGH, __maxFacesImage, 20);
 
        __pFaceEngineInfoTemp->g_FaceROI[0].x = faceRect.x;
        __pFaceEngineInfoTemp->g_FaceROI[0].y = faceRect.y;
@@ -1202,8 +1220,8 @@ _FaceRecognizerImpl::DetectEyeState(const Tizen::Base::ByteBuffer& grayBuffer, c
        SysTryCatch(NID_UIX, retVal == _FACEENGINE_INIT_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed to delete FaceEngine.", GetErrorMessage(E_FAILURE));
 
        return eyeState;
-
 CATCH:
+       SysLogException(NID_UIX, E_SUCCESS, "XXXX - CATCH _FaceRecognizerImpl::DetectEyeState");
        caApp_FaceEngineRelease(__pFaceEngineInfoTemp);
        SetLastResult(r);
        return EYE_STATE_NONE;
@@ -1220,14 +1238,10 @@ _FaceRecognizerImpl::RecognizeExpression(const Tizen::Base::ByteBuffer& grayBuff
        FaceEngineInfo* __pFaceEngineInfoTemp = null;
 
        std::unique_ptr< FaceEngineInfo > pFaceEngineInfo(new (std::nothrow) FaceEngineInfo);
-       SysTryReturn(NID_UIX, pFaceEngineInfo != null, expression, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",   GetErrorMessage(E_OUT_OF_MEMORY));
 
-       __pFaceEngineInfoTemp = pFaceEngineInfo.get();
-       SysTryReturn(NID_UIX, __pFaceEngineInfoTemp != null, expression, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",     GetErrorMessage(E_OUT_OF_MEMORY));      
+       __pFaceEngineInfoTemp = pFaceEngineInfo.release();
 
-       retVal = caApp_FaceEngineInit(__pFaceEngineInfoTemp, FD_MODE_ROLx_YAWx, FD_SIZE_COVERAGE_HIGH,__maxFacesImage, 20);
-       SysTryCatch(NID_UIX, retVal == _FACEENGINE_INIT_SUCCESS, r = E_FAILURE, E_FAILURE, "[%s] Failed to create the Buffer."
-                               , GetErrorMessage(E_FAILURE));
+       caApp_FaceEngineInit(__pFaceEngineInfoTemp, FD_MODE_ROLx_YAWx, FD_SIZE_COVERAGE_HIGH, __maxFacesImage, 20);
 
        __pFaceEngineInfoTemp->g_FaceROI[0].x = faceRect.x;
        __pFaceEngineInfoTemp->g_FaceROI[0].y = faceRect.y;
@@ -1274,6 +1288,7 @@ _FaceRecognizerImpl::RecognizeExpression(const Tizen::Base::ByteBuffer& grayBuff
 
        return expression;
 CATCH:
+       SysLogException(NID_UIX, E_SUCCESS, "XXXX -CATCH  _FaceRecognizerImpl::RecognizeExpression");
        caApp_FaceEngineRelease(__pFaceEngineInfoTemp);
        SetLastResult(r);
        return FACIAL_EXPRESSION_NONE;
index efd20bd..d122826 100644 (file)
@@ -289,8 +289,7 @@ public:
         *                                                                      It can be happened when the detected faces are too small or the image is not clear. @n
         *                                                                      This is the result of a normal operation. @n
         */
-       Tizen::Base::ByteBuffer* ExtractFeatureN(const Tizen::Base::ByteBuffer& grayBuffer, const Tizen::Graphics::Dimension& resolution, const Tizen::Graphics::Rectangle& faceRect,
-                                                                                               Tizen::Graphics::Point eyeLeft, Tizen::Graphics::Point eyeRight);
+       Tizen::Base::ByteBuffer* ExtractFeatureN(const Tizen::Base::ByteBuffer& grayBuffer, const Tizen::Graphics::Dimension& resolution, const Tizen::Graphics::Rectangle& faceRect);
 
        /**
         *      Extracts the eye state.
index cde82e0..006685e 100644 (file)
@@ -89,6 +89,7 @@ _FaceUtil::ConvertRgb565ToGray(const unsigned char& buf, unsigned char* pGrayBuf
 void
 _FaceUtil::ConvertArgb8888ToGray(const unsigned char& buf, unsigned char* pGrayBuf, int width, int height)
 {
+       SysAssert(pGrayBuf != null);
        if (pGrayBuf == null)
        {
                return;
index 9fe6d7c..1b342ae 100644 (file)
@@ -1,20 +1,3 @@
-//\r
-// Open Service Platform\r
-// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Flora License, Version 1.1 (the License);\r
-// you may not use this file except in compliance with the License.\r
-// You may obtain a copy of the License at\r
-//\r
-//     http://floralicense.org/license/\r
-//\r
-// Unless required by applicable law or agreed to in writing, software\r
-// distributed under the License is distributed on an AS IS BASIS,\r
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-// See the License for the specific language governing permissions and\r
-// limitations under the License.\r
-// \r
-\r
 #ifndef _CA_BASIC_INFO_DEF_H_\r
 #define _CA_BASIC_INFO_DEF_H_\r
 \r
index 29aeb4b..a9f1701 100644 (file)
@@ -1,20 +1,3 @@
-//\r
-// Open Service Platform\r
-// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Flora License, Version 1.1 (the License);\r
-// you may not use this file except in compliance with the License.\r
-// You may obtain a copy of the License at\r
-//\r
-//     http://floralicense.org/license/\r
-//\r
-// Unless required by applicable law or agreed to in writing, software\r
-// distributed under the License is distributed on an AS IS BASIS,\r
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-// See the License for the specific language governing permissions and\r
-// limitations under the License.\r
-// \r
-\r
 #ifndef _CA_BASIC_INFO_DEF_ENUM_H_\r
 #define _CA_BASIC_INFO_DEF_ENUM_H_\r
 \r
index 1096340..99fd4a5 100644 (file)
@@ -1,20 +1,3 @@
-//\r
-// Open Service Platform\r
-// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Flora License, Version 1.1 (the License);\r
-// you may not use this file except in compliance with the License.\r
-// You may obtain a copy of the License at\r
-//\r
-//     http://floralicense.org/license/\r
-//\r
-// Unless required by applicable law or agreed to in writing, software\r
-// distributed under the License is distributed on an AS IS BASIS,\r
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-// See the License for the specific language governing permissions and\r
-// limitations under the License.\r
-// \r
-\r
 #ifndef _CA_FACE_APP_INTERFACE_H_\r
 #define _CA_FACE_APP_INTERFACE_H_\r
 \r