3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #ifndef IMAGERECOGNIZER_H_
19 #define IMAGERECOGNIZER_H_
21 #include "ImageRecognitionInfo.h"
25 class ImageFeatureManager;
35 ImageRecognizer(void);
36 ~ImageRecognizer(void);
39 /// \brief Enables single or multi tracking mode.
40 /// \param[in] useMultiTracking Specifies if multiple objects tracking must
41 /// be enabled. If 'false', enables single object tracking.
42 void setMultiTracking(bool useMultiTracking);
44 /// \brief Setup input video-frame width and height.
46 /// Must be called once before calling processFrame.
47 /// \param[in] width Frame width in pixels that is reported by
48 /// video-capture device.
49 /// \param[in] height Frame height in pixels that is reported by
50 /// video-capture device.
51 /// \return 'true' on success.
52 bool setImageSize(unsigned int width, unsigned int height);
54 /// \brief Setting scene transformation.
56 /// Default matrix is identity.
57 /// \param[in] left Left transformation matrix 4x4.
58 /// \param[in] right Right transformation matrix 4x4.
59 void setSceneTransform(const float* left, const float* right);
61 /// \brief Sets object database for tracking.
62 /// \param[in] imgFMan Pointer on DB manager.
63 /// \return 'true' on success.
64 bool setImageDatabase(const ImageFeatureManager* imgFMan);
66 /// \brief Process external buffer with captured frame image.
67 /// \param[in] frame Pointer to buffer with intensity (grayscale8) data.
68 /// Buffer size must not be less than it set with setFrameSize
70 /// \return -1 on any error and processing time in ms on success.
71 int processImage(const unsigned char* frame);
73 /// Updates information about objects on scene.
74 /// \return Pointer on first element of the array of structures that holds
75 /// information about scene objects.
76 const ImageRecognitionInfo* objectsBegin(void) const;
78 /// \return Pointer on the end of the array of structures that holds
79 /// information about scene objects.
80 const ImageRecognitionInfo* objectsEnd(void) const;
82 /// \return Total number of images in database.
83 unsigned int databaseSize(void) const;
86 ImageRecognizer(const ImageRecognizer&);
87 ImageRecognizer& operator=(const ImageRecognizer&);
90 class ImageRecognizerImpl;
91 ImageRecognizerImpl* d; ///< implementation bridge
95 #endif // IMAGERECOGNIZER_H_