/**
* @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_
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 similar image objects that are used as the input images to the feature set that stores the 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 similar image objects that are used as the input images to the feature set that stores the features of the reference images.
+ * This class also provides 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");
+ * 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 a recognition engine
+ * __pImageRecognizer = new Tizen::Uix::Vision::ImageRecognizer();
+ * r = __pImageRecognizer->Construct();
*
- * //Configuring recognition engine
- * __pImageRecognizer->SetFeatureManager(__pFeatureManager);
- * __pImageRecognizer->SetImageSize(CAMERA_WIDTH, CAMERA_HEIGHT);
+ * // Creates an initialized ImageFeatureManager
+ * __pFeatureManager = new Tizen::Uix::Vision::ImageFeatureManager();
+ * r = __pFeatureManager->Construct();
+ *
+ * // Loads a feature set
+ * r = __pFeatureManager->Load("/opt/usr/media/Images/testFeatureSet.xdb");
+ *
+ * // Configures the recognition engine
+ * r =__pImageRecognizer->SetFeatureManager(*__pFeatureManager);
*
- * __pImageRecognizer->SetMultiTracking(true);
+ * // Sets the image size to be same as the 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();
- * }
- *
+ * // Processes the camera image
+ * __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
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
~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 the %Construct() method before calling any other method of %ImageRecognizer.
*
* @since 2.1
*
* @feature %http://tizen.org/feature/vision.image_recognition
*
- * @exception E_SUCCESS The method is successful.
+ * @exception E_SUCCESS The method is successful.
* @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() methods.
- * @see
+ * 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 or disables the 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 The boolean value that enables or disables the multiple tracking mode @n
+ * The default mode is the 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 the single tracking mode, only one image is recognized at a time on the screen.
+ * - In the 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 the height of the 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 The ImageFeatureManager should be initialized by loading the 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 that manages the image feature set to use for recognition
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG An input ImageFeatureManager is invalid.
+ * @exception E_INVALID_ARG The ImageFeatureManager is invalid.
*
- * @remarks ImageFeatureManager should be initialized by loading feature set file.
- * @see result ImageFeatureManager::Load(const Tizen::Base::String& featureSetFilePath).
+ * @remarks The ImageFeatureManager should be initialized by loading the feature set file.
*/
result SetFeatureManager(ImageFeatureManager& imageFeatureManager);
/**
- * Gets the number of the recognized image object
+ * Gets the count of the recognized image object.
*
* @since 2.1
*
- * @return Number of recognized image object
+ * @return The 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 an index value that ranges from @c 0 to (count of the recognized image objects) @c - 1.
+ * @see GetRecognizedObject()
*/
int GetRecognizedObjectCount(void);
/**
- * Gets the recognized image object to get information
+ * Gets the recognized image object that contains the 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 the ImageObject instance that includes all the information about the recognized image object
+ * @param[in] index The index of the recognized image object @n
+ * The valid range for this parameter is @c 0 to (count of the recognized image objects) @c - 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 the 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 externally and have a 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 Either of the following conditions has occurred:
+ * - The specified @c imageBuffer is not allocated.
+ * - The size of the specified @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);