update header for Doxygen
[platform/framework/native/vision.git] / inc / FUixVisionImageRecognizer.h
index ef11c30..bcc5205 100644 (file)
@@ -18,7 +18,9 @@
 
 /**
  * @file     FUixVisionImageRecognizer.h
- * @brief    This is the header file for the %Tizen::Uix::Vision::ImageRecognizer class.
+ * @brief    This is the header file for the %ImageRecognizer class.
+ *
+ * This header file contains the declarations of the %ImageRecognizer class.
  */
 
 #ifndef _FUIX_VISION_IMAGE_RECOGNIZER_H_
@@ -32,52 +34,88 @@ namespace Tizen { namespace Uix { namespace Vision
 class ImageFeatureManager;
 /**
  * @class    ImageRecognizer
- * @brief    This class provides methods to find same image objects to input image in the feature set which stores features of the reference images.
- *           And this class also provide methods to calculate 2D position and 3D pose transform matrix of the recognized image objects.
+ * @brief    This class provides methods to find same image objects to input image in the feature set that stores features of the reference images.
  *
  * @since    2.1
  *
- * The following example demonstrates how to use the ImageRecognizer class.
+ * The %ImageRecognizer class provides methods to find same image objects to input image in the feature set that stores features of the reference images.
+ *           This class also provide methods to calculate the 2D position and 3D pose transform matrix of the recognized image objects.
  *
- * @code
+ * The following example demonstrates how to use the %ImageRecognizer class.
  *
- *  //Process of initalization follows
- * void
- * Tracker::Initialize()
+ * @code
+ * #include <FBase.h>
+ * #include <FUix.h>
+ * #include <FGraphics.h>
+ * #include <FIo.h>
+ * #include <FMedia.h>
+ * 
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Media;
+ * using namespace Tizen::Graphics;
+ * using namespace Tizen::Io;
+ * using namespace Tizen::Uix::Vision;
+ * class MyClass
+ *     : ICameraEventListener
  * {
- *     //Creating and initializing recognition engine
- *     __pImageRecognizer = new Tizen::Uix::Vision::ImageRecognizer();
- *     __pImageRecognizer->Construct();
- *
- *     //Creating an initialized ImageFeatureManager
- *     __pFeatureManager  = new Tizen::Uix::Vision::ImageFeatureManager();
- *     __pFeatureManager->Construct();
- *
- *     //Loading feature set
- *     __pFeatureManager->Load("/mnt/ums/Images/sharks/testFeatureSet.xdb");
- *
- *     //Configuring recognition engine
- *     __pImageRecognizer->SetFeatureManager(__pFeatureManager);
- *     __pImageRecognizer->SetImageSize(CAMERA_WIDTH, CAMERA_HEIGHT);
+ * public:
+ *     MyClass();
+ *     ~MyClass();
+ *     result Initialize(void);
+ * 
+ *     // Called when camera auto focus occurred
+ *     void OnCameraAutoFocused(bool completeCondition);
+ *     // Called when camera preview occurred
+ *     void OnCameraPreviewed(Tizen::Base::ByteBuffer& previewedData, result r);
+ *     // Called when camera captured image
+ *     void OnCameraCaptured(Tizen::Base::ByteBuffer& capturedData, result r);
+ *     // Called when camera  error occurred
+ *     void OnCameraErrorOccurred(Tizen::Media::CameraErrorReason r);
+ * 
+ * private:
+ *     ImageRecognizer*        __pImageRecognizer;
+ *     ImageFeatureManager*    __pFeatureManager;
+ * };
+ * 
+ * result
+ * MyClass::Initialize(void)
+ * {
+ *     result r;
+ * 
+ *     // Creates and initializes recognition engine
+ *     __pImageRecognizer = new Tizen::Uix::Vision::ImageRecognizer();
+ *     r = __pImageRecognizer->Construct();
+ *     // Creates an initialized ImageFeatureManager
+ *     __pFeatureManager  = new Tizen::Uix::Vision::ImageFeatureManager();
+ *     r = __pFeatureManager->Construct();
+ * 
+ *     // Loads feature set
+ *     r = __pFeatureManager->Load("/opt/usr/media/Images/testFeatureSet.xdb");
+ * 
+ *     // Configures recognition engine
+ *     r =__pImageRecognizer->SetFeatureManager(*__pFeatureManager);
  *
- *     __pImageRecognizer->SetMultiTracking(true);
+ *      //Image size must be same as camera preview size
+ *     r = __pImageRecognizer->SetImageSize(640, 480);
+ * 
+ *     __pImageRecognizer->SetMultiTrackingEnabled(false);
+ * 
+ *     return r;
  * }
- *
- * //We suppose camera to be initialized with Tizen::Graphics::PIXEL_FORMAT_YCbCr420_PLANAR format
- *
+ * 
+ * // We suppose camera to be initialized with Tizen::Graphics::PIXEL_FORMAT_YCbCr420_PLANAR format
  * void
- * Tracker::OnCameraPreviewed(Tizen::Base::ByteBuffer& previewedData, result r)
+ * MyClass::OnCameraPreviewed(Tizen::Base::ByteBuffer& previewedData, result r)
  * {
- *     //Processing of the camera image follows
- *     __pImageRecognizer->ProcessImage(previewedData);
- *
- *     //Loop through all recognized images
- *     for (int i = 0; i < __pImageRecognizer->GetRecognizedObjectCount(); i++)
- *     {
- *         const Tizen::Uix::Vision::ImageObject *o = __pImageRecognizer->GetRecognizedObject(i);
- *         int featId = o->GetFeatureId();
- *      }
- *
+ *     // Processing of the camera image follows
+ *     __pImageRecognizer->ProcessImage(previewedData);
+ * 
+ *     // Loops through all recognized images
+ *     for (int i = 0; i < __pImageRecognizer->GetRecognizedObjectCount(); i++)
+ *     {
+ *             const ImageObject *o = __pImageRecognizer->GetRecognizedObject(i);
+ *             int featId = o->GetFeatureId();
+ *     }
  * }
  *
  * @endcode
@@ -89,8 +127,8 @@ class _OSP_EXPORT_ ImageRecognizer
 public:
 
     /**
-     * This is the default constructor for this class.
-     * The object is not fully constructed after this constructor is called.
+     * This is the default constructor for this class. @n
+     * The object is not fully constructed after this constructor is called. @n
      * For full construction, the Construct() method must be called right after calling this constructor.
      *
      * @since    2.1
@@ -107,102 +145,103 @@ public:
     ~ImageRecognizer(void);
 
     /**
-     * Initializes this instance of ImageRecognizer.
-     * Every application must call Construct() before calling any other method of ImageRecognizer.
+     * Initializes this instance of %ImageRecognizer. @n
+     * Every application must call %Construct() before calling any other methods of %ImageRecognizer.
      *
      * @since        2.1
+     *
+     * @feature      %http://tizen.org/feature/vision.image_recognition
+     *
      * @exception    E_SUCCESS          The method is successful.
-     * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
-     * @see
+     * @exception    E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature. 
+     * 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&).
      */
     result Construct(void);
 
     /**
-     * Enables single or multiple tracking mode
-     *
+     * Enables single or multiple tracking mode.
      *
      * @since        2.1
-     * @param[in]    enable        Enable multiple tracking mode on true, default is single tracking mode.
+        *
+     * @param[in]    enable        Enable multiple tracking mode on @c true, default is single tracking mode
      *
-     * @remarks      In single tracking mode, only one image will be recognized in the screen at once.
-     *               In multiple tracking mode, multiple images can be recognized and tracked simultaneously.
-     *               (Max : 3 images simultaneously)
-     * @exception
-     * @see
+     * @remarks      
+     *                 - In single tracking mode, only one image is recognized in the screen at once.
+     *                 - In multiple tracking mode, multiple images (maximum 3) can be recognized and tracked simultaneously.
      */
     void SetMultiTrackingEnabled(bool enable);
 
     /**
-     * Sets width and height of input image
+     * Sets the width and height of an input image.
      *
      * @since        2.1
      *
-     * @return       An error code.
+     * @return       An error code
      *
-     * @param[in]    width            Input image width
-     * @param[in]    height           Input image height
+     * @param[in]    width            The width of the input image
+     * @param[in]    height           The height of the input image
      *
      * @exception    E_SUCCESS        The method is successful.
      * @exception    E_INVALID_ARG    A specified input parameter is invalid.
-     * @see
      */
     result SetImageSize(int width, int height);
 
     /**
-     * Sets ImageFeatureManager instance for initialization
+     * Sets the ImageFeatureManager instance for initialization.
      *
      * @since       2.1
-     * @pre         ImageFeatureManager should be initialized by loading feature set file using call Load() method.
+     * @pre         ImageFeatureManager should be initialized by loading a feature set file using the ImageFeatureManager::Load() method.
      *
-     * @return      An error code.
-     * @param[in]   imageFeatureManager      ImageFeatureManager managing image feature set to be used for recognition
+     * @return      An error code
+     * @param[in]   imageFeatureManager      The ImageFeatureManager instance managing image feature set to use for recognition
      * @exception   E_SUCCESS                The method is successful.
      * @exception   E_INVALID_ARG            An input ImageFeatureManager is invalid.
      *
-     * @remarks     ImageFeatureManager should be initialized by loading feature set file.
-     * @see         result ImageFeatureManager::Load(const Tizen::Base::String& featureSetFilePath).
+     * @remarks     ImageFeatureManager should be initialized by loading a feature set file.
      */
     result SetFeatureManager(ImageFeatureManager& imageFeatureManager);
 
     /**
-     * Gets the number of the recognized image object
+     * Gets a count of the recognized image object.
      *
      * @since        2.1
      *
-     * @return       Number of recognized image object
+     * @return       A count of the recognized image object
      *
-     * @remarks      The recognized object has index value from 0 to (number of the recognized image objects - 1)
-     * @see          GetRecognizedObject(int index)
+     * @remarks      The recognized object has index value from @c 0 to (count of the recognized image objects - 1)
+     * @see          GetRecognizedObject(int)
      */
     int GetRecognizedObjectCount(void);
 
     /**
-     * Gets the recognized image object to get information
+     * Gets the recognized image object to get information.
      *
      * @since        2.1
      *
-     * @return       The pointer of ImageObject including all information about the reconginzed image object
-     * @param[in]    index             Index of the recognized image object.
-     *                                 Valid range of this parameter is 0 to (number of the recognized image objects - 1).
+     * @return       A pointer to ImageObject that includes all information about the recognized image object
+     * @param[in]    index             The index of the recognized image object @n
+     *                                 Valid range of this parameter is @c 0 to (count of the recognized image objects - 1).
      * @exception    E_SUCCESS         The method is successful.
      *
-     * @see          GetRecognizedObjectCount(void)
+     * @see          GetRecognizedObjectCount()
      */
     const ImageObject* GetRecognizedObject(int index) const;
 
     /**
-     * Process input image for recognition
+     * Processes an input image for recognition.
      *
      * @since        2.1
      *
-     * @return       An error code.
+     * @return       An error code
      *
-     * @param[in]    imageBuffer        Input image buffer
-     *                                  It must be allocated outside and have size of (width*height) by SetImageSize().
+     * @param[in]    imageBuffer        The input image buffer @n
+     *                                  It must be allocated outside and have size of (width*height) set by SetImageSize().
      * @exception    E_SUCCESS          The method is successful.
-     * @exception    E_INVALID_ARG      imageBuffer is not allocated or the size of imageBuffer is not equal to input image size by SetImageSize().
+     * @exception    E_INVALID_ARG      The specified @c imageBuffer is not allocated or the size of @c imageBuffer is not equal to the input image size set by SetImageSize().
      * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
-     * @see          SetImageSize(int width, int height)
+     * @see          SetImageSize(int, int)
      */
     result ProcessImage(const Tizen::Base::ByteBuffer& imageBuffer);