move tegra namespace out of cv to prevent conflicts

This commit is contained in:
Vladislav Vinogradov 2015-02-27 12:52:11 +03:00
parent d696fac8b8
commit cda6fed41f
22 changed files with 48 additions and 45 deletions

View File

@ -69,7 +69,7 @@ void drawPoints(const std::vector<Point2f> &points, Mat &outImage, int radius =
void CirclesGridClusterFinder::hierarchicalClustering(const std::vector<Point2f> &points, const Size &patternSz, std::vector<Point2f> &patternPoints) void CirclesGridClusterFinder::hierarchicalClustering(const std::vector<Point2f> &points, const Size &patternSz, std::vector<Point2f> &patternPoints)
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(cv::tegra::useTegra() && tegra::hierarchicalClustering(points, patternSz, patternPoints)) if(tegra::useTegra() && tegra::hierarchicalClustering(points, patternSz, patternPoints))
return; return;
#endif #endif
int j, n = (int)points.size(); int j, n = (int)points.size();

View File

@ -270,7 +270,7 @@ typedef enum CvStatus
CvStatus; CvStatus;
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
namespace cv { namespace tegra { namespace tegra {
CV_EXPORTS bool useTegra(); CV_EXPORTS bool useTegra();
CV_EXPORTS void setUseTegra(bool flag); CV_EXPORTS void setUseTegra(bool flag);

View File

@ -2256,7 +2256,7 @@ void cv::subtract( InputArray _src1, InputArray _src2, OutputArray _dst,
InputArray mask, int dtype ) InputArray mask, int dtype )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra()) if (tegra::useTegra())
{ {
int kind1 = _src1.kind(), kind2 = _src2.kind(); int kind1 = _src1.kind(), kind2 = _src2.kind();
Mat src1 = _src1.getMat(), src2 = _src2.getMat(); Mat src1 = _src1.getMat(), src2 = _src2.getMat();

View File

@ -127,7 +127,7 @@ static void FastAtan2_32f(const float *Y, const float *X, float *angle, int len,
float scale = angleInDegrees ? 1 : (float)(CV_PI/180); float scale = angleInDegrees ? 1 : (float)(CV_PI/180);
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::FastAtan2_32f(Y, X, angle, len, scale)) if (tegra::useTegra() && tegra::FastAtan2_32f(Y, X, angle, len, scale))
return; return;
#endif #endif

View File

@ -1257,13 +1257,15 @@ void setUseIPP(bool flag)
} // namespace ipp } // namespace ipp
} // namespace cv
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
namespace tegra { namespace tegra {
bool useTegra() bool useTegra()
{ {
CoreTLSData* data = getCoreTlsData().get(); cv::CoreTLSData* data = cv::getCoreTlsData().get();
if (data->useTegra < 0) if (data->useTegra < 0)
{ {
@ -1279,7 +1281,7 @@ bool useTegra()
void setUseTegra(bool flag) void setUseTegra(bool flag)
{ {
CoreTLSData* data = getCoreTlsData().get(); cv::CoreTLSData* data = cv::getCoreTlsData().get();
data->useTegra = flag; data->useTegra = flag;
} }
@ -1287,12 +1289,14 @@ void setUseTegra(bool flag)
#endif #endif
namespace cv {
void setOptimizations(bool enabled) void setOptimizations(bool enabled)
{ {
cv::ipp::setUseIPP(enabled); ipp::setUseIPP(enabled);
cv::ocl::setUseOpenCL(enabled); ocl::setUseOpenCL(enabled);
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
cv::tegra::setUseTegra(enabled); ::tegra::setUseTegra(enabled);
#endif #endif
} }

View File

@ -346,7 +346,7 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
break; break;
case FastFeatureDetector::TYPE_9_16: case FastFeatureDetector::TYPE_9_16:
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(cv::tegra::useTegra() && tegra::FAST(_img, keypoints, threshold, nonmax_suppression)) if(tegra::useTegra() && tegra::FAST(_img, keypoints, threshold, nonmax_suppression))
break; break;
#endif #endif
FAST_t<16>(_img, keypoints, threshold, nonmax_suppression); FAST_t<16>(_img, keypoints, threshold, nonmax_suppression);

View File

@ -261,7 +261,7 @@ void cv::Canny( InputArray _src, OutputArray _dst,
Mat src = _src.getMat(), dst = _dst.getMat(); Mat src = _src.getMat(), dst = _dst.getMat();
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::canny(src, dst, low_thresh, high_thresh, aperture_size, L2gradient)) if (tegra::useTegra() && tegra::canny(src, dst, low_thresh, high_thresh, aperture_size, L2gradient))
return; return;
#endif #endif

View File

@ -6128,7 +6128,7 @@ struct YUV420sp2RGB888Invoker : ParallelLoopBody
const uchar* y1 = my1 + rangeBegin * stride, *uv = muv + rangeBegin * stride / 2; const uchar* y1 = my1 + rangeBegin * stride, *uv = muv + rangeBegin * stride / 2;
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(cv::tegra::useTegra() && tegra::cvtYUV4202RGB(bIdx, uIdx, 3, y1, uv, stride, dst->ptr<uchar>(rangeBegin), dst->step, rangeEnd - rangeBegin, dst->cols)) if(tegra::useTegra() && tegra::cvtYUV4202RGB(bIdx, uIdx, 3, y1, uv, stride, dst->ptr<uchar>(rangeBegin), dst->step, rangeEnd - rangeBegin, dst->cols))
return; return;
#endif #endif
@ -6197,7 +6197,7 @@ struct YUV420sp2RGBA8888Invoker : ParallelLoopBody
const uchar* y1 = my1 + rangeBegin * stride, *uv = muv + rangeBegin * stride / 2; const uchar* y1 = my1 + rangeBegin * stride, *uv = muv + rangeBegin * stride / 2;
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(cv::tegra::useTegra() && tegra::cvtYUV4202RGB(bIdx, uIdx, 4, y1, uv, stride, dst->ptr<uchar>(rangeBegin), dst->step, rangeEnd - rangeBegin, dst->cols)) if(tegra::useTegra() && tegra::cvtYUV4202RGB(bIdx, uIdx, 4, y1, uv, stride, dst->ptr<uchar>(rangeBegin), dst->step, rangeEnd - rangeBegin, dst->cols))
return; return;
#endif #endif
@ -7418,7 +7418,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
if( depth == CV_8U ) if( depth == CV_8U )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(cv::tegra::useTegra() && tegra::cvtBGR2RGB(src, dst, bidx)) if(tegra::useTegra() && tegra::cvtBGR2RGB(src, dst, bidx))
break; break;
#endif #endif
CvtColorLoop(src, dst, RGB2RGB<uchar>(scn, dcn, bidx)); CvtColorLoop(src, dst, RGB2RGB<uchar>(scn, dcn, bidx));
@ -7486,7 +7486,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(code == CV_BGR2BGR565 || code == CV_BGRA2BGR565 || code == CV_RGB2BGR565 || code == CV_RGBA2BGR565) if(code == CV_BGR2BGR565 || code == CV_BGRA2BGR565 || code == CV_RGB2BGR565 || code == CV_RGBA2BGR565)
if(cv::tegra::useTegra() && tegra::cvtRGB2RGB565(src, dst, code == CV_RGB2BGR565 || code == CV_RGBA2BGR565 ? 0 : 2)) if(tegra::useTegra() && tegra::cvtRGB2RGB565(src, dst, code == CV_RGB2BGR565 || code == CV_RGBA2BGR565 ? 0 : 2))
break; break;
#endif #endif
@ -7612,7 +7612,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
if( depth == CV_8U ) if( depth == CV_8U )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(cv::tegra::useTegra() && tegra::cvtRGB2Gray(src, dst, bidx)) if(tegra::useTegra() && tegra::cvtRGB2Gray(src, dst, bidx))
break; break;
#endif #endif
CvtColorLoop(src, dst, RGB2Gray<uchar>(scn, bidx, 0)); CvtColorLoop(src, dst, RGB2Gray<uchar>(scn, bidx, 0));
@ -7665,7 +7665,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
if( depth == CV_8U ) if( depth == CV_8U )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(cv::tegra::useTegra() && tegra::cvtGray2RGB(src, dst)) if(tegra::useTegra() && tegra::cvtGray2RGB(src, dst))
break; break;
#endif #endif
CvtColorLoop(src, dst, Gray2RGB<uchar>(dcn)); CvtColorLoop(src, dst, Gray2RGB<uchar>(dcn));
@ -7745,7 +7745,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
if( depth == CV_8U ) if( depth == CV_8U )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if((code == CV_RGB2YCrCb || code == CV_BGR2YCrCb) && cv::tegra::useTegra() && tegra::cvtRGB2YCrCb(src, dst, bidx)) if((code == CV_RGB2YCrCb || code == CV_BGR2YCrCb) && tegra::useTegra() && tegra::cvtRGB2YCrCb(src, dst, bidx))
break; break;
#endif #endif
CvtColorLoop(src, dst, RGB2YCrCb_i<uchar>(scn, bidx, coeffs_i)); CvtColorLoop(src, dst, RGB2YCrCb_i<uchar>(scn, bidx, coeffs_i));
@ -8039,7 +8039,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
code == CV_BGR2HSV_FULL || code == CV_RGB2HSV_FULL ) code == CV_BGR2HSV_FULL || code == CV_RGB2HSV_FULL )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(cv::tegra::useTegra() && tegra::cvtRGB2HSV(src, dst, bidx, hrange)) if(tegra::useTegra() && tegra::cvtRGB2HSV(src, dst, bidx, hrange))
break; break;
#endif #endif
if( depth == CV_8U ) if( depth == CV_8U )

View File

@ -269,7 +269,7 @@ cornerEigenValsVecs( const Mat& src, Mat& eigenv, int block_size,
int borderType=BORDER_DEFAULT ) int borderType=BORDER_DEFAULT )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::cornerEigenValsVecs(src, eigenv, block_size, aperture_size, op_type, k, borderType)) if (tegra::useTegra() && tegra::cornerEigenValsVecs(src, eigenv, block_size, aperture_size, op_type, k, borderType))
return; return;
#endif #endif
#if CV_SSE2 #if CV_SSE2

View File

@ -562,7 +562,7 @@ void cv::Sobel( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy,
_dst.create( _src.size(), dtype ); _dst.create( _src.size(), dtype );
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && scale == 1.0 && delta == 0) if (tegra::useTegra() && scale == 1.0 && delta == 0)
{ {
Mat src = _src.getMat(), dst = _dst.getMat(); Mat src = _src.getMat(), dst = _dst.getMat();
if (ksize == 3 && tegra::sobel3x3(src, dst, dx, dy, borderType)) if (ksize == 3 && tegra::sobel3x3(src, dst, dx, dy, borderType))
@ -620,7 +620,7 @@ void cv::Scharr( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy,
_dst.create( _src.size(), dtype ); _dst.create( _src.size(), dtype );
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && scale == 1.0 && delta == 0) if (tegra::useTegra() && scale == 1.0 && delta == 0)
{ {
Mat src = _src.getMat(), dst = _dst.getMat(); Mat src = _src.getMat(), dst = _dst.getMat();
if (tegra::scharr(src, dst, dx, dy, borderType)) if (tegra::scharr(src, dst, dx, dy, borderType))
@ -873,7 +873,7 @@ void cv::Laplacian( InputArray _src, OutputArray _dst, int ddepth, int ksize,
#endif #endif
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && scale == 1.0 && delta == 0) if (tegra::useTegra() && scale == 1.0 && delta == 0)
{ {
Mat src = _src.getMat(), dst = _dst.getMat(); Mat src = _src.getMat(), dst = _dst.getMat();
if (ksize == 1 && tegra::laplace1(src, dst, borderType)) if (ksize == 1 && tegra::laplace1(src, dst, borderType))

View File

@ -4659,7 +4659,7 @@ void cv::filter2D( InputArray _src, OutputArray _dst, int ddepth,
#endif #endif
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if( cv::tegra::useTegra() && tegra::filter2D(src, dst, kernel, anchor, delta, borderType) ) if( tegra::useTegra() && tegra::filter2D(src, dst, kernel, anchor, delta, borderType) )
return; return;
#endif #endif

View File

@ -3227,7 +3227,7 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
Mat dst = _dst.getMat(); Mat dst = _dst.getMat();
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::resize(src, dst, (float)inv_scale_x, (float)inv_scale_y, interpolation)) if (tegra::useTegra() && tegra::resize(src, dst, (float)inv_scale_x, (float)inv_scale_y, interpolation))
return; return;
#endif #endif
@ -5572,7 +5572,7 @@ void cv::warpAffine( InputArray _src, OutputArray _dst,
M0.convertTo(matM, matM.type()); M0.convertTo(matM, matM.type());
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if( cv::tegra::useTegra() && tegra::warpAffine(src, dst, M, flags, borderType, borderValue) ) if( tegra::useTegra() && tegra::warpAffine(src, dst, M, flags, borderType, borderValue) )
return; return;
#endif #endif
@ -6098,7 +6098,7 @@ void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0,
M0.convertTo(matM, matM.type()); M0.convertTo(matM, matM.type());
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if( cv::tegra::useTegra() && tegra::warpPerspective(src, dst, M, flags, borderType, borderValue) ) if( tegra::useTegra() && tegra::warpPerspective(src, dst, M, flags, borderType, borderValue) )
return; return;
#endif #endif

View File

@ -1180,7 +1180,7 @@ void cv::pyrDown( InputArray _src, OutputArray _dst, const Size& _dsz, int borde
int depth = src.depth(); int depth = src.depth();
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(borderType == BORDER_DEFAULT && cv::tegra::useTegra() && tegra::pyrDown(src, dst)) if(borderType == BORDER_DEFAULT && tegra::useTegra() && tegra::pyrDown(src, dst))
return; return;
#endif #endif
@ -1257,7 +1257,7 @@ void cv::pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int borderT
int depth = src.depth(); int depth = src.depth();
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(borderType == BORDER_DEFAULT && cv::tegra::useTegra() && tegra::pyrUp(src, dst)) if(borderType == BORDER_DEFAULT && tegra::useTegra() && tegra::pyrUp(src, dst))
return; return;
#endif #endif

View File

@ -1324,7 +1324,7 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
ksize.width = 1; ksize.width = 1;
} }
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if ( cv::tegra::useTegra() && tegra::box(src, dst, ksize, anchor, normalize, borderType) ) if ( tegra::useTegra() && tegra::box(src, dst, ksize, anchor, normalize, borderType) )
return; return;
#endif #endif
@ -1650,7 +1650,7 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
Mat src = _src.getMat(); Mat src = _src.getMat();
Mat dst = _dst.getMat(); Mat dst = _dst.getMat();
if(sigma1 == 0 && sigma2 == 0 && cv::tegra::useTegra() && tegra::gaussian(src, dst, ksize, borderType)) if(sigma1 == 0 && sigma2 == 0 && tegra::useTegra() && tegra::gaussian(src, dst, ksize, borderType))
return; return;
#endif #endif
@ -2698,7 +2698,7 @@ void cv::medianBlur( InputArray _src0, OutputArray _dst, int ksize )
#endif #endif
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::medianBlur(src0, dst, ksize)) if (tegra::useTegra() && tegra::medianBlur(src0, dst, ksize))
return; return;
#endif #endif

View File

@ -933,7 +933,7 @@ void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result,
Mat result = _result.getMat(); Mat result = _result.getMat();
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::matchTemplate(img, templ, result, method)) if (tegra::useTegra() && tegra::matchTemplate(img, templ, result, method))
return; return;
#endif #endif

View File

@ -64,7 +64,7 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
} }
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::thresh_8u(_src, _dst, roi.width, roi.height, thresh, maxval, type)) if (tegra::useTegra() && tegra::thresh_8u(_src, _dst, roi.width, roi.height, thresh, maxval, type))
return; return;
#endif #endif
@ -408,7 +408,7 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
} }
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::thresh_16s(_src, _dst, roi.width, roi.height, thresh, maxval, type)) if (tegra::useTegra() && tegra::thresh_16s(_src, _dst, roi.width, roi.height, thresh, maxval, type))
return; return;
#endif #endif
@ -676,7 +676,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
} }
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::thresh_32f(_src, _dst, roi.width, roi.height, thresh, maxval, type)) if (tegra::useTegra() && tegra::thresh_32f(_src, _dst, roi.width, roi.height, thresh, maxval, type))
return; return;
#endif #endif

View File

@ -937,11 +937,10 @@ Ptr<CascadeClassifierImpl::MaskGenerator> CascadeClassifierImpl::getMaskGenerato
Ptr<BaseCascadeClassifier::MaskGenerator> createFaceDetectionMaskGenerator() Ptr<BaseCascadeClassifier::MaskGenerator> createFaceDetectionMaskGenerator()
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra()) if (tegra::useTegra())
return tegra::getCascadeClassifierMaskGenerator(); return tegra::getCascadeClassifierMaskGenerator();
#else
return Ptr<BaseCascadeClassifier::MaskGenerator>();
#endif #endif
return Ptr<BaseCascadeClassifier::MaskGenerator>();
} }
class CascadeClassifierInvoker : public ParallelLoopBody class CascadeClassifierInvoker : public ParallelLoopBody

View File

@ -58,7 +58,7 @@ void cv::fastNlMeansDenoising( InputArray _src, OutputArray _dst, float h,
Mat dst = _dst.getMat(); Mat dst = _dst.getMat();
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(cv::tegra::useTegra() && tegra::fastNlMeansDenoising(src, dst, h, templateWindowSize, searchWindowSize)) if(tegra::useTegra() && tegra::fastNlMeansDenoising(src, dst, h, templateWindowSize, searchWindowSize))
return; return;
#endif #endif

View File

@ -481,7 +481,7 @@ void normalizeUsingWeightMap(InputArray _weight, InputOutputArray _src)
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
src = _src.getMat(); src = _src.getMat();
weight = _weight.getMat(); weight = _weight.getMat();
if(cv::tegra::useTegra() && tegra::normalizeUsingWeightMap(weight, src)) if(tegra::useTegra() && tegra::normalizeUsingWeightMap(weight, src))
return; return;
#endif #endif
@ -552,7 +552,7 @@ void createLaplacePyr(InputArray img, int num_levels, std::vector<UMat> &pyr)
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
cv::Mat imgMat = img.getMat(); cv::Mat imgMat = img.getMat();
if(cv::tegra::useTegra() && tegra::createLaplacePyr(imgMat, num_levels, pyr)) if(tegra::useTegra() && tegra::createLaplacePyr(imgMat, num_levels, pyr))
return; return;
#endif #endif

View File

@ -148,7 +148,7 @@ void CpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &feat
CV_Assert(features2.descriptors.depth() == CV_8U || features2.descriptors.depth() == CV_32F); CV_Assert(features2.descriptors.depth() == CV_8U || features2.descriptors.depth() == CV_32F);
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::match2nearest(features1, features2, matches_info, match_conf_)) if (tegra::useTegra() && tegra::match2nearest(features1, features2, matches_info, match_conf_))
return; return;
#endif #endif

View File

@ -3068,7 +3068,7 @@ void printVersionInfo(bool useStdOut)
if (useStdOut) std::cout << "CPU features: " << cpu_features << std::endl; if (useStdOut) std::cout << "CPU features: " << cpu_features << std::endl;
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
const char * tegra_optimization = cv::tegra::useTegra() && tegra::isDeviceSupported() ? "enabled" : "disabled"; const char * tegra_optimization = tegra::useTegra() && tegra::isDeviceSupported() ? "enabled" : "disabled";
::testing::Test::RecordProperty("cv_tegra_optimization", tegra_optimization); ::testing::Test::RecordProperty("cv_tegra_optimization", tegra_optimization);
if (useStdOut) std::cout << "Tegra optimization: " << tegra_optimization << std::endl; if (useStdOut) std::cout << "Tegra optimization: " << tegra_optimization << std::endl;
#endif #endif

View File

@ -58,7 +58,7 @@ static void calcSharrDeriv(const cv::Mat& src, cv::Mat& dst)
dst.create(rows, cols, CV_MAKETYPE(DataType<deriv_type>::depth, cn*2)); dst.create(rows, cols, CV_MAKETYPE(DataType<deriv_type>::depth, cn*2));
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (cv::tegra::useTegra() && tegra::calcSharrDeriv(src, dst)) if (tegra::useTegra() && tegra::calcSharrDeriv(src, dst))
return; return;
#endif #endif