fixes for gpu module:
- fixed printCudaDeviceInfo for new CC - fixed some compilation errors and warnings - removed unset command from CMake script - removed unused std imports
This commit is contained in:
@@ -268,14 +268,14 @@ void cv::gpu::BruteForceMatcher_GPU_base::matchConvert(const Mat& trainIdx, cons
|
||||
const float* distance_ptr = distance.ptr<float>();
|
||||
for (int queryIdx = 0; queryIdx < nQuery; ++queryIdx, ++trainIdx_ptr, ++distance_ptr)
|
||||
{
|
||||
int _trainIdx = *trainIdx_ptr;
|
||||
int train_idx = *trainIdx_ptr;
|
||||
|
||||
if (_trainIdx == -1)
|
||||
if (train_idx == -1)
|
||||
continue;
|
||||
|
||||
float _distance = *distance_ptr;
|
||||
float distance_local = *distance_ptr;
|
||||
|
||||
DMatch m(queryIdx, _trainIdx, 0, _distance);
|
||||
DMatch m(queryIdx, train_idx, 0, distance_local);
|
||||
|
||||
matches.push_back(m);
|
||||
}
|
||||
@@ -413,16 +413,16 @@ void cv::gpu::BruteForceMatcher_GPU_base::matchConvert(const Mat& trainIdx, cons
|
||||
const float* distance_ptr = distance.ptr<float>();
|
||||
for (int queryIdx = 0; queryIdx < nQuery; ++queryIdx, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)
|
||||
{
|
||||
int trainIdx = *trainIdx_ptr;
|
||||
int _trainIdx = *trainIdx_ptr;
|
||||
|
||||
if (trainIdx == -1)
|
||||
if (_trainIdx == -1)
|
||||
continue;
|
||||
|
||||
int imgIdx = *imgIdx_ptr;
|
||||
int _imgIdx = *imgIdx_ptr;
|
||||
|
||||
float distance = *distance_ptr;
|
||||
float _distance = *distance_ptr;
|
||||
|
||||
DMatch m(queryIdx, trainIdx, imgIdx, distance);
|
||||
DMatch m(queryIdx, _trainIdx, _imgIdx, _distance);
|
||||
|
||||
matches.push_back(m);
|
||||
}
|
||||
@@ -548,13 +548,13 @@ void cv::gpu::BruteForceMatcher_GPU_base::knnMatchConvert(const Mat& trainIdx, c
|
||||
|
||||
for (int i = 0; i < k; ++i, ++trainIdx_ptr, ++distance_ptr)
|
||||
{
|
||||
int trainIdx = *trainIdx_ptr;
|
||||
int _trainIdx = *trainIdx_ptr;
|
||||
|
||||
if (trainIdx != -1)
|
||||
if (_trainIdx != -1)
|
||||
{
|
||||
float distance = *distance_ptr;
|
||||
float _distance = *distance_ptr;
|
||||
|
||||
DMatch m(queryIdx, trainIdx, 0, distance);
|
||||
DMatch m(queryIdx, _trainIdx, 0, _distance);
|
||||
|
||||
curMatches.push_back(m);
|
||||
}
|
||||
@@ -667,15 +667,15 @@ void cv::gpu::BruteForceMatcher_GPU_base::knnMatch2Convert(const Mat& trainIdx,
|
||||
|
||||
for (int i = 0; i < 2; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)
|
||||
{
|
||||
int trainIdx = *trainIdx_ptr;
|
||||
int _trainIdx = *trainIdx_ptr;
|
||||
|
||||
if (trainIdx != -1)
|
||||
if (_trainIdx != -1)
|
||||
{
|
||||
int imgIdx = *imgIdx_ptr;
|
||||
int _imgIdx = *imgIdx_ptr;
|
||||
|
||||
float distance = *distance_ptr;
|
||||
float _distance = *distance_ptr;
|
||||
|
||||
DMatch m(queryIdx, trainIdx, imgIdx, distance);
|
||||
DMatch m(queryIdx, _trainIdx, _imgIdx, _distance);
|
||||
|
||||
curMatches.push_back(m);
|
||||
}
|
||||
@@ -852,25 +852,25 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatchConvert(const Mat& trainIdx
|
||||
const int* trainIdx_ptr = trainIdx.ptr<int>(queryIdx);
|
||||
const float* distance_ptr = distance.ptr<float>(queryIdx);
|
||||
|
||||
const int nMatches = std::min(nMatches_ptr[queryIdx], trainIdx.cols);
|
||||
const int nMatched = std::min(nMatches_ptr[queryIdx], trainIdx.cols);
|
||||
|
||||
if (nMatches == 0)
|
||||
if (nMatched == 0)
|
||||
{
|
||||
if (!compactResult)
|
||||
matches.push_back(vector<DMatch>());
|
||||
continue;
|
||||
}
|
||||
|
||||
matches.push_back(vector<DMatch>(nMatches));
|
||||
matches.push_back(vector<DMatch>(nMatched));
|
||||
vector<DMatch>& curMatches = matches.back();
|
||||
|
||||
for (int i = 0; i < nMatches; ++i, ++trainIdx_ptr, ++distance_ptr)
|
||||
for (int i = 0; i < nMatched; ++i, ++trainIdx_ptr, ++distance_ptr)
|
||||
{
|
||||
int trainIdx = *trainIdx_ptr;
|
||||
int _trainIdx = *trainIdx_ptr;
|
||||
|
||||
float distance = *distance_ptr;
|
||||
float _distance = *distance_ptr;
|
||||
|
||||
DMatch m(queryIdx, trainIdx, 0, distance);
|
||||
DMatch m(queryIdx, _trainIdx, 0, _distance);
|
||||
|
||||
curMatches[i] = m;
|
||||
}
|
||||
@@ -990,9 +990,9 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatchConvert(const Mat& trainIdx
|
||||
const int* imgIdx_ptr = imgIdx.ptr<int>(queryIdx);
|
||||
const float* distance_ptr = distance.ptr<float>(queryIdx);
|
||||
|
||||
const int nMatches = std::min(nMatches_ptr[queryIdx], trainIdx.cols);
|
||||
const int nMatched = std::min(nMatches_ptr[queryIdx], trainIdx.cols);
|
||||
|
||||
if (nMatches == 0)
|
||||
if (nMatched == 0)
|
||||
{
|
||||
if (!compactResult)
|
||||
matches.push_back(vector<DMatch>());
|
||||
@@ -1001,9 +1001,9 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatchConvert(const Mat& trainIdx
|
||||
|
||||
matches.push_back(vector<DMatch>());
|
||||
vector<DMatch>& curMatches = matches.back();
|
||||
curMatches.reserve(nMatches);
|
||||
curMatches.reserve(nMatched);
|
||||
|
||||
for (int i = 0; i < nMatches; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)
|
||||
for (int i = 0; i < nMatched; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)
|
||||
{
|
||||
int _trainIdx = *trainIdx_ptr;
|
||||
int _imgIdx = *imgIdx_ptr;
|
||||
|
Reference in New Issue
Block a user