mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 19:20:28 +08:00
more warning fixes for GCC
This commit is contained in:
parent
1521340152
commit
f17f4bda60
@ -420,16 +420,16 @@ void cv::gpu::BFMatcher_GPU::matchConvert(const Mat& trainIdx, const Mat& imgIdx
|
||||
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);
|
||||
}
|
||||
@ -558,13 +558,13 @@ void cv::gpu::BFMatcher_GPU::knnMatchConvert(const Mat& trainIdx, const Mat& dis
|
||||
|
||||
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);
|
||||
}
|
||||
@ -680,15 +680,15 @@ void cv::gpu::BFMatcher_GPU::knnMatch2Convert(const Mat& trainIdx, const Mat& im
|
||||
|
||||
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);
|
||||
}
|
||||
@ -868,25 +868,25 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
|
||||
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;
|
||||
}
|
||||
@ -1009,9 +1009,9 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
|
||||
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>());
|
||||
@ -1020,9 +1020,9 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
|
||||
|
||||
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;
|
||||
|
@ -315,7 +315,7 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
|
||||
double scale = 1.;
|
||||
int levels = 0;
|
||||
|
||||
for (levels = 0; levels < conf_out.size(); levels++)
|
||||
for (levels = 0; levels < (int)conf_out.size(); levels++)
|
||||
{
|
||||
scale = conf_out[levels].scale;
|
||||
level_scale.push_back(scale);
|
||||
@ -332,8 +332,8 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
|
||||
|
||||
for (size_t i = 0; i < level_scale.size(); i++)
|
||||
{
|
||||
double scale = level_scale[i];
|
||||
Size sz(cvRound(img.cols / scale), cvRound(img.rows / scale));
|
||||
double _scale = level_scale[i];
|
||||
Size sz(cvRound(img.cols / _scale), cvRound(img.rows / _scale));
|
||||
GpuMat smaller_img;
|
||||
|
||||
if (sz == img.size())
|
||||
|
@ -49,36 +49,36 @@ void cv::gpu::detail::VideoDecoder::create(const VideoReader_GPU::FormatInfo& vi
|
||||
{
|
||||
release();
|
||||
|
||||
cudaVideoCodec codec = static_cast<cudaVideoCodec>(videoFormat.codec);
|
||||
cudaVideoChromaFormat chromaFormat = static_cast<cudaVideoChromaFormat>(videoFormat.chromaFormat);
|
||||
cudaVideoCodec _codec = static_cast<cudaVideoCodec>(videoFormat.codec);
|
||||
cudaVideoChromaFormat _chromaFormat = static_cast<cudaVideoChromaFormat>(videoFormat.chromaFormat);
|
||||
|
||||
cudaVideoCreateFlags videoCreateFlags = (codec == cudaVideoCodec_JPEG || codec == cudaVideoCodec_MPEG2) ?
|
||||
cudaVideoCreateFlags videoCreateFlags = (_codec == cudaVideoCodec_JPEG || _codec == cudaVideoCodec_MPEG2) ?
|
||||
cudaVideoCreate_PreferCUDA :
|
||||
cudaVideoCreate_PreferCUVID;
|
||||
|
||||
// Validate video format. These are the currently supported formats via NVCUVID
|
||||
CV_Assert(cudaVideoCodec_MPEG1 == codec ||
|
||||
cudaVideoCodec_MPEG2 == codec ||
|
||||
cudaVideoCodec_MPEG4 == codec ||
|
||||
cudaVideoCodec_VC1 == codec ||
|
||||
cudaVideoCodec_H264 == codec ||
|
||||
cudaVideoCodec_JPEG == codec ||
|
||||
cudaVideoCodec_YUV420== codec ||
|
||||
cudaVideoCodec_YV12 == codec ||
|
||||
cudaVideoCodec_NV12 == codec ||
|
||||
cudaVideoCodec_YUYV == codec ||
|
||||
cudaVideoCodec_UYVY == codec );
|
||||
CV_Assert(cudaVideoCodec_MPEG1 == _codec ||
|
||||
cudaVideoCodec_MPEG2 == _codec ||
|
||||
cudaVideoCodec_MPEG4 == _codec ||
|
||||
cudaVideoCodec_VC1 == _codec ||
|
||||
cudaVideoCodec_H264 == _codec ||
|
||||
cudaVideoCodec_JPEG == _codec ||
|
||||
cudaVideoCodec_YUV420== _codec ||
|
||||
cudaVideoCodec_YV12 == _codec ||
|
||||
cudaVideoCodec_NV12 == _codec ||
|
||||
cudaVideoCodec_YUYV == _codec ||
|
||||
cudaVideoCodec_UYVY == _codec );
|
||||
|
||||
CV_Assert(cudaVideoChromaFormat_Monochrome == chromaFormat ||
|
||||
cudaVideoChromaFormat_420 == chromaFormat ||
|
||||
cudaVideoChromaFormat_422 == chromaFormat ||
|
||||
cudaVideoChromaFormat_444 == chromaFormat);
|
||||
CV_Assert(cudaVideoChromaFormat_Monochrome == _chromaFormat ||
|
||||
cudaVideoChromaFormat_420 == _chromaFormat ||
|
||||
cudaVideoChromaFormat_422 == _chromaFormat ||
|
||||
cudaVideoChromaFormat_444 == _chromaFormat);
|
||||
|
||||
// Fill the decoder-create-info struct from the given video-format struct.
|
||||
std::memset(&createInfo_, 0, sizeof(CUVIDDECODECREATEINFO));
|
||||
|
||||
// Create video decoder
|
||||
createInfo_.CodecType = codec;
|
||||
createInfo_.CodecType = _codec;
|
||||
createInfo_.ulWidth = videoFormat.width;
|
||||
createInfo_.ulHeight = videoFormat.height;
|
||||
createInfo_.ulNumDecodeSurfaces = FrameQueue::MaximumSize;
|
||||
@ -87,7 +87,7 @@ void cv::gpu::detail::VideoDecoder::create(const VideoReader_GPU::FormatInfo& vi
|
||||
while (createInfo_.ulNumDecodeSurfaces * videoFormat.width * videoFormat.height > 16 * 1024 * 1024)
|
||||
createInfo_.ulNumDecodeSurfaces--;
|
||||
|
||||
createInfo_.ChromaFormat = chromaFormat;
|
||||
createInfo_.ChromaFormat = _chromaFormat;
|
||||
createInfo_.OutputFormat = cudaVideoSurfaceFormat_NV12;
|
||||
createInfo_.DeinterlaceMode = cudaVideoDeinterlaceMode_Adaptive;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user