const float* distance_ptr = distance.ptr<float>();\r
for (int queryIdx = 0; queryIdx < nQuery; ++queryIdx, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)\r
{\r
- int trainIdx = *trainIdx_ptr;\r
+ int _trainIdx = *trainIdx_ptr;\r
\r
- if (trainIdx == -1)\r
+ if (_trainIdx == -1)\r
continue;\r
\r
- int imgIdx = *imgIdx_ptr;\r
+ int _imgIdx = *imgIdx_ptr;\r
\r
- float distance = *distance_ptr;\r
+ float _distance = *distance_ptr;\r
\r
- DMatch m(queryIdx, trainIdx, imgIdx, distance);\r
+ DMatch m(queryIdx, _trainIdx, _imgIdx, _distance);\r
\r
matches.push_back(m);\r
}\r
\r
for (int i = 0; i < k; ++i, ++trainIdx_ptr, ++distance_ptr)\r
{\r
- int trainIdx = *trainIdx_ptr;\r
+ int _trainIdx = *trainIdx_ptr;\r
\r
- if (trainIdx != -1)\r
+ if (_trainIdx != -1)\r
{\r
- float distance = *distance_ptr;\r
+ float _distance = *distance_ptr;\r
\r
- DMatch m(queryIdx, trainIdx, 0, distance);\r
+ DMatch m(queryIdx, _trainIdx, 0, _distance);\r
\r
curMatches.push_back(m);\r
}\r
\r
for (int i = 0; i < 2; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)\r
{\r
- int trainIdx = *trainIdx_ptr;\r
+ int _trainIdx = *trainIdx_ptr;\r
\r
- if (trainIdx != -1)\r
+ if (_trainIdx != -1)\r
{\r
- int imgIdx = *imgIdx_ptr;\r
+ int _imgIdx = *imgIdx_ptr;\r
\r
- float distance = *distance_ptr;\r
+ float _distance = *distance_ptr;\r
\r
- DMatch m(queryIdx, trainIdx, imgIdx, distance);\r
+ DMatch m(queryIdx, _trainIdx, _imgIdx, _distance);\r
\r
curMatches.push_back(m);\r
}\r
const int* trainIdx_ptr = trainIdx.ptr<int>(queryIdx);\r
const float* distance_ptr = distance.ptr<float>(queryIdx);\r
\r
- const int nMatches = std::min(nMatches_ptr[queryIdx], trainIdx.cols);\r
+ const int nMatched = std::min(nMatches_ptr[queryIdx], trainIdx.cols);\r
\r
- if (nMatches == 0)\r
+ if (nMatched == 0)\r
{\r
if (!compactResult)\r
matches.push_back(vector<DMatch>());\r
continue;\r
}\r
\r
- matches.push_back(vector<DMatch>(nMatches));\r
+ matches.push_back(vector<DMatch>(nMatched));\r
vector<DMatch>& curMatches = matches.back();\r
\r
- for (int i = 0; i < nMatches; ++i, ++trainIdx_ptr, ++distance_ptr)\r
+ for (int i = 0; i < nMatched; ++i, ++trainIdx_ptr, ++distance_ptr)\r
{\r
- int trainIdx = *trainIdx_ptr;\r
+ int _trainIdx = *trainIdx_ptr;\r
\r
- float distance = *distance_ptr;\r
+ float _distance = *distance_ptr;\r
\r
- DMatch m(queryIdx, trainIdx, 0, distance);\r
+ DMatch m(queryIdx, _trainIdx, 0, _distance);\r
\r
curMatches[i] = m;\r
}\r
const int* imgIdx_ptr = imgIdx.ptr<int>(queryIdx);\r
const float* distance_ptr = distance.ptr<float>(queryIdx);\r
\r
- const int nMatches = std::min(nMatches_ptr[queryIdx], trainIdx.cols);\r
+ const int nMatched = std::min(nMatches_ptr[queryIdx], trainIdx.cols);\r
\r
- if (nMatches == 0)\r
+ if (nMatched == 0)\r
{\r
if (!compactResult)\r
matches.push_back(vector<DMatch>());\r
\r
matches.push_back(vector<DMatch>());\r
vector<DMatch>& curMatches = matches.back();\r
- curMatches.reserve(nMatches);\r
+ curMatches.reserve(nMatched);\r
\r
- for (int i = 0; i < nMatches; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)\r
+ for (int i = 0; i < nMatched; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)\r
{\r
int _trainIdx = *trainIdx_ptr;\r
int _imgIdx = *imgIdx_ptr;\r
{\r
release();\r
\r
- cudaVideoCodec codec = static_cast<cudaVideoCodec>(videoFormat.codec);\r
- cudaVideoChromaFormat chromaFormat = static_cast<cudaVideoChromaFormat>(videoFormat.chromaFormat);\r
+ cudaVideoCodec _codec = static_cast<cudaVideoCodec>(videoFormat.codec);\r
+ cudaVideoChromaFormat _chromaFormat = static_cast<cudaVideoChromaFormat>(videoFormat.chromaFormat);\r
\r
- cudaVideoCreateFlags videoCreateFlags = (codec == cudaVideoCodec_JPEG || codec == cudaVideoCodec_MPEG2) ?\r
+ cudaVideoCreateFlags videoCreateFlags = (_codec == cudaVideoCodec_JPEG || _codec == cudaVideoCodec_MPEG2) ?\r
cudaVideoCreate_PreferCUDA :\r
cudaVideoCreate_PreferCUVID;\r
\r
// Validate video format. These are the currently supported formats via NVCUVID\r
- CV_Assert(cudaVideoCodec_MPEG1 == codec ||\r
- cudaVideoCodec_MPEG2 == codec ||\r
- cudaVideoCodec_MPEG4 == codec ||\r
- cudaVideoCodec_VC1 == codec ||\r
- cudaVideoCodec_H264 == codec ||\r
- cudaVideoCodec_JPEG == codec ||\r
- cudaVideoCodec_YUV420== codec ||\r
- cudaVideoCodec_YV12 == codec ||\r
- cudaVideoCodec_NV12 == codec ||\r
- cudaVideoCodec_YUYV == codec ||\r
- cudaVideoCodec_UYVY == codec );\r
-\r
- CV_Assert(cudaVideoChromaFormat_Monochrome == chromaFormat ||\r
- cudaVideoChromaFormat_420 == chromaFormat ||\r
- cudaVideoChromaFormat_422 == chromaFormat ||\r
- cudaVideoChromaFormat_444 == chromaFormat);\r
+ CV_Assert(cudaVideoCodec_MPEG1 == _codec ||\r
+ cudaVideoCodec_MPEG2 == _codec ||\r
+ cudaVideoCodec_MPEG4 == _codec ||\r
+ cudaVideoCodec_VC1 == _codec ||\r
+ cudaVideoCodec_H264 == _codec ||\r
+ cudaVideoCodec_JPEG == _codec ||\r
+ cudaVideoCodec_YUV420== _codec ||\r
+ cudaVideoCodec_YV12 == _codec ||\r
+ cudaVideoCodec_NV12 == _codec ||\r
+ cudaVideoCodec_YUYV == _codec ||\r
+ cudaVideoCodec_UYVY == _codec );\r
+\r
+ CV_Assert(cudaVideoChromaFormat_Monochrome == _chromaFormat ||\r
+ cudaVideoChromaFormat_420 == _chromaFormat ||\r
+ cudaVideoChromaFormat_422 == _chromaFormat ||\r
+ cudaVideoChromaFormat_444 == _chromaFormat);\r
\r
// Fill the decoder-create-info struct from the given video-format struct.\r
std::memset(&createInfo_, 0, sizeof(CUVIDDECODECREATEINFO));\r
\r
// Create video decoder\r
- createInfo_.CodecType = codec;\r
+ createInfo_.CodecType = _codec;\r
createInfo_.ulWidth = videoFormat.width;\r
createInfo_.ulHeight = videoFormat.height;\r
createInfo_.ulNumDecodeSurfaces = FrameQueue::MaximumSize;\r
while (createInfo_.ulNumDecodeSurfaces * videoFormat.width * videoFormat.height > 16 * 1024 * 1024)\r
createInfo_.ulNumDecodeSurfaces--;\r
\r
- createInfo_.ChromaFormat = chromaFormat;\r
+ createInfo_.ChromaFormat = _chromaFormat;\r
createInfo_.OutputFormat = cudaVideoSurfaceFormat_NV12;\r
createInfo_.DeinterlaceMode = cudaVideoDeinterlaceMode_Adaptive;\r
\r