* The following example demonstrates how to use the %ImageFeatureManager class.
*
* @code
- * void GenerateImageFeatureSet()
+ *
+ * #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
* {
- * Tizen::Uix::Vision::ImageFeatureManager imageFeatureManager;
- * imageFeatureManager.Construct();
+ *
+ * public:
+ * MyClass();
+ * ~MyClass();
+ * result GenerateFeatureSet(void);
+ * result AddImageFeatureSet(void);
+ * };
+ *
+ * result
+ * MyClass::GenerateFeatureSet(void)
+ * {
+ * result r;
+ * ImageFeatureManager imageFeatureManager;
+ * r = imageFeatureManager.Construct();
+ * //Creating new feature set
* imageFeatureManager.AddFeature("/opt/usr/media/Images/image1.jpg");
* imageFeatureManager.AddFeature("/opt/usr/media/Images/image2.jpg");
* imageFeatureManager.AddFeature("/opt/usr/media/Images/image3.jpg");
- * imageFeatureManager.Flush("/opt/usr/media/Images/testFeatureSet.xdb");
+ * r = imageFeatureManager.Flush(new String("/opt/usr/media/Images/testFeatureSet.xdb"));
+ *
+ * return r;
* }
*
- * void AddImageFeatureSet()
+ * result
+ * MyClass::AddImageFeatureSet()
* {
- * Tizen::Uix::Vision::ImageFeatureManager imageFeatureManager;
+ * result r;
+ * ImageFeatureManager imageFeatureManager;
* imageFeatureManager.Construct();
* imageFeatureManager.Load("/opt/usr/media/Images/testFeatureSet.xdb");
* imageFeatureManager.AddFeature("/opt/usr/media/Images/image1.jpg");
* imageFeatureManager.AddFeature("/opt/usr/media/Images/image2.jpg");
* imageFeatureManager.AddFeature("/opt/usr/media/Images/image3.jpg");
- * imageFeatureManager.Flush();
+ * r = imageFeatureManager.Flush();
+ *
+ * return r;
* }
* @endcode
*/
* The following example demonstrates how to use the %ImageRecognizer class.
*
* @code
- *
- * // Process of initialization follows
- * void
- * Tracker::Initialize()
+ * #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
* {
- * // Creates and initializes recognition engine
- * __pImageRecognizer = new Tizen::Uix::Vision::ImageRecognizer();
- * __pImageRecognizer->Construct();
- *
- * // Creates an initialized ImageFeatureManager
- * __pFeatureManager = new Tizen::Uix::Vision::ImageFeatureManager();
- * __pFeatureManager->Construct();
- *
- * // Loads feature set
- * __pFeatureManager->Load("/mnt/ums/Images/sharks/testFeatureSet.xdb");
- *
- * // Configures 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
- *
* 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);
- *
- * // Loops 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
* The following example demonstrates how to use the %QrCodeGenerator class.
*
* @code
- * Tizen::Uix::Vision::QrCodeGenerator qrGen;
- * qrGen.Construct();
- *
- * qrGen.EncodeToFile("test message", Tizen::Uix::Vision::QR_MODE_UTF8, Tizen::Uix::Vision::QR_ECL_Q, "/mnt/ums/Others/temp.bmp", Tizen::Media::IMG_FORMAT_PNG);
+ * #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
+ * {
+ * public:
+ * MyClass();
+ * ~MyClass();
+ * result TestQrCodeGenerator(void);
+ * };
+ *
+ * result
+ * MyClass::TestQrCodeGenerator(void)
+ * {
+ * result r;
+ * QrCodeGenerator qrGen;
+ * qrGen.Construct();
+ *
+ * int width(0), height(0);
+ * r = qrGen.EncodeToFile("Hello Tizen!",
+ * QR_CODE_MODE_UTF8,
+ * QR_CODE_ERROR_CORRECTION_LEVEL_Q,
+ * true,
+ * "/opt/usr/media/Images/temp.png",
+ * Tizen::Media::IMG_FORMAT_PNG,
+ * width,
+ * height);
+ * return r;
+ * }
* @endcode
*/
class _OSP_EXPORT_ QrCodeGenerator
*
* @return A pointer to the Tizen::Base::ByteBuffer instance containing the generated QR code image
* @param[in] message The text to encode to QR code image
- * @param[in] mode The input text encoding format (QR_MODE_ALPHANUMERIC, QR_MODE_BYTE, QR_MODE_UTF8)
+ * @param[in] mode The input text encoding format (QR_CODE_MODE_ALPHANUMERIC, QR_CODE_MODE_BYTE, QR_CODE_MODE_UTF8)
* @param[in] error_level The QR code error correction level
- * @param[in] compatibility The compatibility mode with zxing library for UTF-8 codes mode when mode is selected with QR_MODE_UTF8
+ * @param[in] compatibility The compatibility mode with zxing library for UTF-8 codes mode when mode is selected with QR_CODE_MODE_UTF8
* @param[out] width The width of the generated QR code image
* @param[out] height The height of the generated QR code image
* @exception E_SUCCESS The method is successful.
* The following example demonstrates how to use the %QrCodeRecognizer class.
*
* @code
- *
- * // Initializes recognition engine
- *
- * void
- * Tracker::Initialize()
- *
+ * #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
+ * {
+ * 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:
+ * QrCodeRecognizer* __pQrRecognizer;
+ * };
+ *
+ * result
+ * MyClass::Initialize(void)
* {
- * __pQrRecognizer = new Tizen::Uix::Vision::QrCodeRecognizer();
- * __pQrRecognizer->Construct();
- * __pQrRecognizer->SetFrameSize(CAMERA_WIDTH, CAMERA_HEIGHT);
+ * result r;
+ *
+ * // Creates and initializes recognition engine
+ * __pQrRecognizer = new Tizen::Uix::Vision::QrCodeRecognizer();
+ * r = __pQrRecognizer->Construct();
+ *
+ * //Image size must be same as camera preview size
+ * r = __pQrRecognizer->SetImageSize(640, 480);
+ *
+ * return r;
* }
- *
+ *
* // 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
- * __pQrRecognizer->ProcessFrame(previewedData);
- *
- * // Loops through all recognized QRs
- * for (int i = 0; i < __pQrRecognizer->GetRecognizedObjectCount(); i++)
- * {
- *
- * const Tizen::Uix::Vision::QrCodeObject *o = __pQrRecognizer->GetQrCodeObject(i);
- * Tizen::Base::String qrText = o->GetText();
- *
- * }
- * }
+ * // Processing of the camera image follows
+ * __pQrRecognizer->ProcessImage(previewedData);
+ *
+ * // Loops through all recognized QRs
+ * for (int i = 0; i < __pQrRecognizer->GetRecognizedObjectCount(); i++)
+ * {
+ * const QrCodeObject *o = __pQrRecognizer->GetRecognizedObject(i);
+ * String qrText = o->GetText();
+ * }
* }
*
* @endcode