more warning fixes for GCC

This commit is contained in:
marina.kolpakova 2012-08-20 03:26:53 +04:00
parent 1521340152
commit f17f4bda60
3 changed files with 48 additions and 48 deletions

View File

@ -420,16 +420,16 @@ void cv::gpu::BFMatcher_GPU::matchConvert(const Mat& trainIdx, const Mat& imgIdx
const float* distance_ptr = distance.ptr<float>(); const float* distance_ptr = distance.ptr<float>();
for (int queryIdx = 0; queryIdx < nQuery; ++queryIdx, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr) 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; 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); 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) 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); 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) 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); 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 int* trainIdx_ptr = trainIdx.ptr<int>(queryIdx);
const float* distance_ptr = distance.ptr<float>(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) if (!compactResult)
matches.push_back(vector<DMatch>()); matches.push_back(vector<DMatch>());
continue; continue;
} }
matches.push_back(vector<DMatch>(nMatches)); matches.push_back(vector<DMatch>(nMatched));
vector<DMatch>& curMatches = matches.back(); 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; 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 int* imgIdx_ptr = imgIdx.ptr<int>(queryIdx);
const float* distance_ptr = distance.ptr<float>(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) if (!compactResult)
matches.push_back(vector<DMatch>()); 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>()); matches.push_back(vector<DMatch>());
vector<DMatch>& curMatches = matches.back(); 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 _trainIdx = *trainIdx_ptr;
int _imgIdx = *imgIdx_ptr; int _imgIdx = *imgIdx_ptr;

View File

@ -315,7 +315,7 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
double scale = 1.; double scale = 1.;
int levels = 0; 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; scale = conf_out[levels].scale;
level_scale.push_back(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++) for (size_t i = 0; i < level_scale.size(); i++)
{ {
double scale = level_scale[i]; double _scale = level_scale[i];
Size sz(cvRound(img.cols / scale), cvRound(img.rows / scale)); Size sz(cvRound(img.cols / _scale), cvRound(img.rows / _scale));
GpuMat smaller_img; GpuMat smaller_img;
if (sz == img.size()) if (sz == img.size())

View File

@ -49,36 +49,36 @@ void cv::gpu::detail::VideoDecoder::create(const VideoReader_GPU::FormatInfo& vi
{ {
release(); release();
cudaVideoCodec codec = static_cast<cudaVideoCodec>(videoFormat.codec); cudaVideoCodec _codec = static_cast<cudaVideoCodec>(videoFormat.codec);
cudaVideoChromaFormat chromaFormat = static_cast<cudaVideoChromaFormat>(videoFormat.chromaFormat); 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_PreferCUDA :
cudaVideoCreate_PreferCUVID; cudaVideoCreate_PreferCUVID;
// Validate video format. These are the currently supported formats via NVCUVID // Validate video format. These are the currently supported formats via NVCUVID
CV_Assert(cudaVideoCodec_MPEG1 == codec || CV_Assert(cudaVideoCodec_MPEG1 == _codec ||
cudaVideoCodec_MPEG2 == codec || cudaVideoCodec_MPEG2 == _codec ||
cudaVideoCodec_MPEG4 == codec || cudaVideoCodec_MPEG4 == _codec ||
cudaVideoCodec_VC1 == codec || cudaVideoCodec_VC1 == _codec ||
cudaVideoCodec_H264 == codec || cudaVideoCodec_H264 == _codec ||
cudaVideoCodec_JPEG == codec || cudaVideoCodec_JPEG == _codec ||
cudaVideoCodec_YUV420== codec || cudaVideoCodec_YUV420== _codec ||
cudaVideoCodec_YV12 == codec || cudaVideoCodec_YV12 == _codec ||
cudaVideoCodec_NV12 == codec || cudaVideoCodec_NV12 == _codec ||
cudaVideoCodec_YUYV == codec || cudaVideoCodec_YUYV == _codec ||
cudaVideoCodec_UYVY == codec ); cudaVideoCodec_UYVY == _codec );
CV_Assert(cudaVideoChromaFormat_Monochrome == chromaFormat || CV_Assert(cudaVideoChromaFormat_Monochrome == _chromaFormat ||
cudaVideoChromaFormat_420 == chromaFormat || cudaVideoChromaFormat_420 == _chromaFormat ||
cudaVideoChromaFormat_422 == chromaFormat || cudaVideoChromaFormat_422 == _chromaFormat ||
cudaVideoChromaFormat_444 == chromaFormat); cudaVideoChromaFormat_444 == _chromaFormat);
// Fill the decoder-create-info struct from the given video-format struct. // Fill the decoder-create-info struct from the given video-format struct.
std::memset(&createInfo_, 0, sizeof(CUVIDDECODECREATEINFO)); std::memset(&createInfo_, 0, sizeof(CUVIDDECODECREATEINFO));
// Create video decoder // Create video decoder
createInfo_.CodecType = codec; createInfo_.CodecType = _codec;
createInfo_.ulWidth = videoFormat.width; createInfo_.ulWidth = videoFormat.width;
createInfo_.ulHeight = videoFormat.height; createInfo_.ulHeight = videoFormat.height;
createInfo_.ulNumDecodeSurfaces = FrameQueue::MaximumSize; 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) while (createInfo_.ulNumDecodeSurfaces * videoFormat.width * videoFormat.height > 16 * 1024 * 1024)
createInfo_.ulNumDecodeSurfaces--; createInfo_.ulNumDecodeSurfaces--;
createInfo_.ChromaFormat = chromaFormat; createInfo_.ChromaFormat = _chromaFormat;
createInfo_.OutputFormat = cudaVideoSurfaceFormat_NV12; createInfo_.OutputFormat = cudaVideoSurfaceFormat_NV12;
createInfo_.DeinterlaceMode = cudaVideoDeinterlaceMode_Adaptive; createInfo_.DeinterlaceMode = cudaVideoDeinterlaceMode_Adaptive;