diff options
Diffstat (limited to 'mv_image/image/include/ImageRecognizer.h')
-rw-r--r-- | mv_image/image/include/ImageRecognizer.h | 121 |
1 files changed, 57 insertions, 64 deletions
diff --git a/mv_image/image/include/ImageRecognizer.h b/mv_image/image/include/ImageRecognizer.h index 8494e3aa..5117a279 100644 --- a/mv_image/image/include/ImageRecognizer.h +++ b/mv_image/image/include/ImageRecognizer.h @@ -28,86 +28,79 @@ * @brief This file contains functionality for image object recognition. */ -namespace MediaVision -{ -namespace Image -{ - +namespace MediaVision { +namespace Image { /** * @class ImageRecognizer * @brief This class contains functionality for image object recognition. * * @since_tizen 3.0 */ -class ImageRecognizer -{ +class ImageRecognizer { public: - - /** - * @brief @ref ImageRecognizer constructor based on scene image. - * - * @since_tizen 3.0 - * @param [in] sceneImage The scene in which image objects will be recognized - * @param [in] params Scene features extracting parameters - */ - ImageRecognizer(const cv::Mat& sceneImage, - const FeaturesExtractingParams& params); - - /** - * @brief @ref ImageRecognizer constructor based on thes scene @ref ImageObject. - * - * @since_tizen 3.0 - * @param [in] scene The scene for which the objects will be recognized by - * calling method recognize() - */ - ImageRecognizer(const ImageObject& scene); - - /** - * @brief @ref ImageRecognizer destructor. - * - * @since_tizen 3.0 - */ - virtual ~ImageRecognizer(); - - /** - * @brief Recognizes the @a target on the scene. - * - * @since_tizen 3.0 - * @param [in] target @ref ImageObject, which will be recognized - * @param [in] params Recognition parameters - * @param [out] contour The result contour of @a target object on the scene - * @return true if object is found on the scene, otherwise return false - */ - bool recognize( - const ImageObject& target, - const RecognitionParams& params, - std::vector<cv::Point2f>& contour) const; + /** + * @brief @ref ImageRecognizer constructor based on scene image. + * + * @since_tizen 3.0 + * @param [in] sceneImage The scene in which image objects will be recognized + * @param [in] params Scene features extracting parameters + */ + ImageRecognizer(const cv::Mat& sceneImage, + const FeaturesExtractingParams& params); + + /** + * @brief @ref ImageRecognizer constructor based on thes scene @ref ImageObject. + * + * @since_tizen 3.0 + * @param [in] scene The scene for which the objects will be recognized by + * calling method recognize() + */ + ImageRecognizer(const ImageObject& scene); + + /** + * @brief @ref ImageRecognizer destructor. + * + * @since_tizen 3.0 + */ + virtual ~ImageRecognizer(); + + /** + * @brief Recognizes the @a target on the scene. + * + * @since_tizen 3.0 + * @param [in] target @ref ImageObject, which will be recognized + * @param [in] params Recognition parameters + * @param [out] contour The result contour of @a target object on the scene + * @return true if object is found on the scene, otherwise return false + */ + bool recognize( + const ImageObject& target, + const RecognitionParams& params, + std::vector<cv::Point2f>& contour) const; private: + ImageRecognizer(); - ImageRecognizer(); + bool findHomophraphyMatrix( + const ImageObject& target, + const RecognitionParams& params, + cv::Mat& homophraphyMatrix) const; - bool findHomophraphyMatrix( - const ImageObject& target, - const RecognitionParams& params, - cv::Mat& homophraphyMatrix) const; + size_t matchesSelection( + std::vector<cv::DMatch>& examples, + unsigned int filterAmount, unsigned int allowableError) const; - size_t matchesSelection( - std::vector<cv::DMatch>& examples, - unsigned int filterAmount, unsigned int allowableError) const; + float computeLinearSupportElement( + const std::vector<cv::DMatch>& examples, + int requiredNumber, int leftLimit, int rightLimit) const; - float computeLinearSupportElement( - const std::vector<cv::DMatch>& examples, - int requiredNumber, int leftLimit, int rightLimit) const; - - static bool isPossibleQuadrangleCorners( - const cv::Point2f corners[NumberOfQuadrangleCorners]); + static bool isPossibleQuadrangleCorners( + const cv::Point2f corners[NumberOfQuadrangleCorners]); private: + ImageObject m_scene; - ImageObject m_scene; - - cv::BFMatcher m_matcher; + cv::BFMatcher m_matcher; }; } /* Image */ |