Fix build error on linux.

pull/807/head
peng xiao 12 years ago
parent 6eefd276cf
commit c9d8eb7a84
  1. 29
      modules/ocl/src/brute_force_matcher.cpp

@ -542,14 +542,13 @@ void cv::ocl::BruteForceMatcher_OCL_base::matchSingle(const oclMat &query, const
// match1 doesn't support signed char type, match2 only support float, hamming support uchar, ushort and int // match1 doesn't support signed char type, match2 only support float, hamming support uchar, ushort and int
int callType = query.depth(); int callType = query.depth();
char cvFuncName[] = "singleMatch";
if (callType != 5) if (callType != 5)
CV_ERROR(CV_UNSUPPORTED_FORMAT_ERR, "BruteForceMatch OpenCL only support float type query!\n"); CV_Error(CV_UNSUPPORTED_FORMAT_ERR, "BruteForceMatch OpenCL only support float type query!\n");
if ((distType == 0 && callType == 1 ) || (distType == 1 && callType != 5) || (distType == 2 && (callType != 0 if ((distType == 0 && callType == 1 ) || (distType == 1 && callType != 5) || (distType == 2 && (callType != 0
|| callType != 2 || callType != 4))) || callType != 2 || callType != 4)))
{ {
CV_ERROR(CV_UNSUPPORTED_DEPTH_ERR, "BruteForceMatch OpenCL only support float type query!\n"); CV_Error(CV_UNSUPPORTED_DEPTH_ERR, "BruteForceMatch OpenCL only support float type query!\n");
} }
CV_Assert(query.channels() == 1 && query.depth() < CV_64F); CV_Assert(query.channels() == 1 && query.depth() < CV_64F);
@ -559,7 +558,7 @@ void cv::ocl::BruteForceMatcher_OCL_base::matchSingle(const oclMat &query, const
ensureSizeIsEnough(1, query.rows, CV_32F, distance); ensureSizeIsEnough(1, query.rows, CV_32F, distance);
matchDispatcher(query, train, mask, trainIdx, distance, distType); matchDispatcher(query, train, mask, trainIdx, distance, distType);
exit:
return; return;
} }
@ -664,14 +663,13 @@ void cv::ocl::BruteForceMatcher_OCL_base::matchCollection(const oclMat &query, c
// match1 doesn't support signed char type, match2 only support float, hamming support uchar, ushort and int // match1 doesn't support signed char type, match2 only support float, hamming support uchar, ushort and int
int callType = query.depth(); int callType = query.depth();
char cvFuncName[] = "matchCollection";
if (callType != 5) if (callType != 5)
CV_ERROR(CV_UNSUPPORTED_FORMAT_ERR, "BruteForceMatch OpenCL only support float type query!\n"); CV_Error(CV_UNSUPPORTED_FORMAT_ERR, "BruteForceMatch OpenCL only support float type query!\n");
if ((distType == 0 && callType == 1 ) || (distType == 1 && callType != 5) || (distType == 2 && (callType != 0 if ((distType == 0 && callType == 1 ) || (distType == 1 && callType != 5) || (distType == 2 && (callType != 0
|| callType != 2 || callType != 4))) || callType != 2 || callType != 4)))
{ {
CV_ERROR(CV_UNSUPPORTED_DEPTH_ERR, "BruteForceMatch OpenCL only support float type query!\n"); CV_Error(CV_UNSUPPORTED_DEPTH_ERR, "BruteForceMatch OpenCL only support float type query!\n");
} }
CV_Assert(query.channels() == 1 && query.depth() < CV_64F); CV_Assert(query.channels() == 1 && query.depth() < CV_64F);
@ -684,7 +682,7 @@ void cv::ocl::BruteForceMatcher_OCL_base::matchCollection(const oclMat &query, c
matchDispatcher(query, (const oclMat *)trainCollection.ptr(), trainCollection.cols, masks, trainIdx, imgIdx, distance, distType); matchDispatcher(query, (const oclMat *)trainCollection.ptr(), trainCollection.cols, masks, trainIdx, imgIdx, distance, distType);
exit:
return; return;
} }
@ -757,14 +755,13 @@ void cv::ocl::BruteForceMatcher_OCL_base::knnMatchSingle(const oclMat &query, co
// match1 doesn't support signed char type, match2 only support float, hamming support uchar, ushort and int // match1 doesn't support signed char type, match2 only support float, hamming support uchar, ushort and int
int callType = query.depth(); int callType = query.depth();
char cvFuncName[] = "knnMatchSingle";
if (callType != 5) if (callType != 5)
CV_ERROR(CV_UNSUPPORTED_FORMAT_ERR, "BruteForceMatch OpenCL only support float type query!\n"); CV_Error(CV_UNSUPPORTED_FORMAT_ERR, "BruteForceMatch OpenCL only support float type query!\n");
if ((distType == 0 && callType == 1 ) || (distType == 1 && callType != 5) || (distType == 2 && (callType != 0 if ((distType == 0 && callType == 1 ) || (distType == 1 && callType != 5) || (distType == 2 && (callType != 0
|| callType != 2 || callType != 4))) || callType != 2 || callType != 4)))
{ {
CV_ERROR(CV_UNSUPPORTED_DEPTH_ERR, "BruteForceMatch OpenCL only support float type query!\n"); CV_Error(CV_UNSUPPORTED_DEPTH_ERR, "BruteForceMatch OpenCL only support float type query!\n");
} }
CV_Assert(query.channels() == 1 && query.depth() < CV_64F); CV_Assert(query.channels() == 1 && query.depth() < CV_64F);
@ -788,7 +785,7 @@ void cv::ocl::BruteForceMatcher_OCL_base::knnMatchSingle(const oclMat &query, co
trainIdx.setTo(Scalar::all(-1)); trainIdx.setTo(Scalar::all(-1));
kmatchDispatcher(query, train, k, mask, trainIdx, distance, allDist, distType); kmatchDispatcher(query, train, k, mask, trainIdx, distance, allDist, distType);
exit:
return; return;
} }
@ -1035,14 +1032,14 @@ void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchSingle(const oclMat &query,
// match1 doesn't support signed char type, match2 only support float, hamming support uchar, ushort and int // match1 doesn't support signed char type, match2 only support float, hamming support uchar, ushort and int
int callType = query.depth(); int callType = query.depth();
char cvFuncName[] = "radiusMatchSingle";
if (callType != 5) if (callType != 5)
CV_ERROR(CV_UNSUPPORTED_FORMAT_ERR, "BruteForceMatch OpenCL only support float type query!\n"); CV_Error(CV_UNSUPPORTED_FORMAT_ERR, "BruteForceMatch OpenCL only support float type query!\n");
if ((distType == 0 && callType == 1 ) || (distType == 1 && callType != 5) || (distType == 2 && (callType != 0 if ((distType == 0 && callType == 1 ) || (distType == 1 && callType != 5) || (distType == 2 && (callType != 0
|| callType != 2 || callType != 4))) || callType != 2 || callType != 4)))
{ {
CV_ERROR(CV_UNSUPPORTED_DEPTH_ERR, "BruteForceMatch OpenCL only support float type query!\n"); CV_Error(CV_UNSUPPORTED_DEPTH_ERR, "BruteForceMatch OpenCL only support float type query!\n");
} }
const int nQuery = query.rows; const int nQuery = query.rows;
@ -1062,7 +1059,7 @@ void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchSingle(const oclMat &query,
nMatches.setTo(Scalar::all(0)); nMatches.setTo(Scalar::all(0));
matchDispatcher(query, train, maxDistance, mask, trainIdx, distance, nMatches, distType); matchDispatcher(query, train, maxDistance, mask, trainIdx, distance, nMatches, distType);
exit:
return; return;
} }

Loading…
Cancel
Save