Path: blob/master/modules/features2d/src/hal_replacement.hpp
16337 views
/*M///////////////////////////////////////////////////////////////////////////////////////1//2// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.3//4// By downloading, copying, installing or using the software you agree to this license.5// If you do not agree to this license, do not download, install,6// copy or use the software.7//8//9// License Agreement10// For Open Source Computer Vision Library11//12// Copyright (C) 2017, Intel Corporation, all rights reserved.13// Third party copyrights are property of their respective owners.14//15// Redistribution and use in source and binary forms, with or without modification,16// are permitted provided that the following conditions are met:17//18// * Redistribution's of source code must retain the above copyright notice,19// this list of conditions and the following disclaimer.20//21// * Redistribution's in binary form must reproduce the above copyright notice,22// this list of conditions and the following disclaimer in the documentation23// and/or other materials provided with the distribution.24//25// * The name of the copyright holders may not be used to endorse or promote products26// derived from this software without specific prior written permission.27//28// This software is provided by the copyright holders and contributors "as is" and29// any express or implied warranties, including, but not limited to, the implied30// warranties of merchantability and fitness for a particular purpose are disclaimed.31// In no event shall the Intel Corporation or contributors be liable for any direct,32// indirect, incidental, special, exemplary, or consequential damages33// (including, but not limited to, procurement of substitute goods or services;34// loss of use, data, or profits; or business interruption) however caused35// and on any theory of liability, whether in contract, strict liability,36// or tort (including negligence or otherwise) arising in any way out of37// the use of this software, even if advised of the possibility of such damage.38//39//M*/4041#ifndef OPENCV_FEATURES2D_HAL_REPLACEMENT_HPP42#define OPENCV_FEATURES2D_HAL_REPLACEMENT_HPP4344#include "opencv2/core/hal/interface.h"4546#if defined __GNUC__47# pragma GCC diagnostic push48# pragma GCC diagnostic ignored "-Wunused-parameter"49#elif defined _MSC_VER50# pragma warning( push )51# pragma warning( disable: 4100 )52#endif5354//! @addtogroup features2d_hal_interface55//! @note Define your functions to override default implementations:56//! @code57//! #undef hal_add8u58//! #define hal_add8u my_add8u59//! @endcode60//! @{61/**62@brief Detects corners using the FAST algorithm, returns mask.63@param src_data,src_step Source image64@param dst_data,dst_step Destination mask65@param width,height Source image dimensions66@param type FAST type67*/68inline int hal_ni_FAST_dense(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, cv::FastFeatureDetector::DetectorType type) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }6970//! @cond IGNORED71#define cv_hal_FAST_dense hal_ni_FAST_dense72//! @endcond7374/**75@brief Non-maximum suppression for FAST_9_16.76@param src_data,src_step Source mask77@param dst_data,dst_step Destination mask after NMS78@param width,height Source mask dimensions79*/80inline int hal_ni_FAST_NMS(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }8182//! @cond IGNORED83#define cv_hal_FAST_NMS hal_ni_FAST_NMS84//! @endcond8586/**87@brief Detects corners using the FAST algorithm.88@param src_data,src_step Source image89@param width,height Source image dimensions90@param keypoints_data Pointer to keypoints91@param keypoints_count Count of keypoints92@param threshold Threshold for keypoint93@param nonmax_suppression Indicates if make nonmaxima suppression or not.94@param type FAST type95*/96inline int hal_ni_FAST(const uchar* src_data, size_t src_step, int width, int height, uchar* keypoints_data, size_t* keypoints_count, int threshold, bool nonmax_suppression, int /*cv::FastFeatureDetector::DetectorType*/ type) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }9798//! @cond IGNORED99#define cv_hal_FAST hal_ni_FAST100//! @endcond101102//! @}103104105#if defined __GNUC__106# pragma GCC diagnostic pop107#elif defined _MSC_VER108# pragma warning( pop )109#endif110111#include "custom_hal.hpp"112113//! @cond IGNORED114#define CALL_HAL_RET(name, fun, retval, ...) \115int res = __CV_EXPAND(fun(__VA_ARGS__, &retval)); \116if (res == CV_HAL_ERROR_OK) \117return retval; \118else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \119CV_Error_(cv::Error::StsInternal, \120("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res));121122123#define CALL_HAL(name, fun, ...) \124{ \125int res = __CV_EXPAND(fun(__VA_ARGS__)); \126if (res == CV_HAL_ERROR_OK) \127return; \128else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \129CV_Error_(cv::Error::StsInternal, \130("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res)); \131}132//! @endcond133134#endif135136137