fixed more "shadow" warnings

pull/2/head
Marina Kolpakova 13 years ago
parent cd81a13d8b
commit 5d06788305
  1. 8
      modules/gpu/src/brute_force_matcher.cpp
  2. 44
      modules/gpu/src/hog.cpp
  3. 14
      modules/gpu/src/mssegmentation.cpp
  4. 12
      modules/gpu/src/stereocsbp.cpp
  5. 8
      modules/gpu/src/video_reader.cpp

@ -1024,11 +1024,11 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
for (int i = 0; i < nMatches; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr) for (int i = 0; i < nMatches; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)
{ {
int trainIdx = *trainIdx_ptr; int _trainIdx = *trainIdx_ptr;
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);
} }

@ -98,17 +98,17 @@ namespace cv { namespace gpu { namespace device
using namespace ::cv::gpu::device; using namespace ::cv::gpu::device;
cv::gpu::HOGDescriptor::HOGDescriptor(Size win_size, Size block_size, Size block_stride, Size cell_size, cv::gpu::HOGDescriptor::HOGDescriptor(Size win_size_, Size block_size_, Size block_stride_, Size cell_size_,
int nbins, double win_sigma, double threshold_L2hys, bool gamma_correction, int nlevels) int nbins_, double win_sigma_, double threshold_L2hys_, bool gamma_correction_, int nlevels_)
: win_size(win_size), : win_size(win_size_),
block_size(block_size), block_size(block_size_),
block_stride(block_stride), block_stride(block_stride_),
cell_size(cell_size), cell_size(cell_size_),
nbins(nbins), nbins(nbins_),
win_sigma(win_sigma), win_sigma(win_sigma_),
threshold_L2hys(threshold_L2hys), threshold_L2hys(threshold_L2hys_),
gamma_correction(gamma_correction), gamma_correction(gamma_correction_),
nlevels(nlevels) nlevels(nlevels_)
{ {
CV_Assert((win_size.width - block_size.width ) % block_stride.width == 0 && CV_Assert((win_size.width - block_size.width ) % block_stride.width == 0 &&
(win_size.height - block_size.height) % block_stride.height == 0); (win_size.height - block_size.height) % block_stride.height == 0);
@ -149,9 +149,9 @@ bool cv::gpu::HOGDescriptor::checkDetectorSize() const
return detector_size == 0 || detector_size == descriptor_size || detector_size == descriptor_size + 1; return detector_size == 0 || detector_size == descriptor_size || detector_size == descriptor_size + 1;
} }
void cv::gpu::HOGDescriptor::setSVMDetector(const vector<float>& detector) void cv::gpu::HOGDescriptor::setSVMDetector(const vector<float>& _detector)
{ {
std::vector<float> detector_reordered(detector.size()); std::vector<float> detector_reordered(_detector.size());
size_t block_hist_size = getBlockHistogramSize(); size_t block_hist_size = getBlockHistogramSize();
cv::Size blocks_per_img = numPartsWithin(win_size, block_size, block_stride); cv::Size blocks_per_img = numPartsWithin(win_size, block_size, block_stride);
@ -159,7 +159,7 @@ void cv::gpu::HOGDescriptor::setSVMDetector(const vector<float>& detector)
for (int i = 0; i < blocks_per_img.height; ++i) for (int i = 0; i < blocks_per_img.height; ++i)
for (int j = 0; j < blocks_per_img.width; ++j) for (int j = 0; j < blocks_per_img.width; ++j)
{ {
const float* src = &detector[0] + (j * blocks_per_img.height + i) * block_hist_size; const float* src = &_detector[0] + (j * blocks_per_img.height + i) * block_hist_size;
float* dst = &detector_reordered[0] + (i * blocks_per_img.width + j) * block_hist_size; float* dst = &detector_reordered[0] + (i * blocks_per_img.width + j) * block_hist_size;
for (size_t k = 0; k < block_hist_size; ++k) for (size_t k = 0; k < block_hist_size; ++k)
dst[k] = src[k]; dst[k] = src[k];
@ -168,7 +168,7 @@ void cv::gpu::HOGDescriptor::setSVMDetector(const vector<float>& detector)
this->detector.upload(Mat(detector_reordered).reshape(1, 1)); this->detector.upload(Mat(detector_reordered).reshape(1, 1));
size_t descriptor_size = getDescriptorSize(); size_t descriptor_size = getDescriptorSize();
free_coef = detector.size() > descriptor_size ? detector[descriptor_size] : 0; free_coef = _detector.size() > descriptor_size ? _detector[descriptor_size] : 0;
CV_Assert(checkDetectorSize()); CV_Assert(checkDetectorSize());
} }
@ -190,24 +190,24 @@ cv::gpu::GpuMat cv::gpu::HOGDescriptor::getBuffer(int rows, int cols, int type,
} }
void cv::gpu::HOGDescriptor::computeGradient(const GpuMat& img, GpuMat& grad, GpuMat& qangle) void cv::gpu::HOGDescriptor::computeGradient(const GpuMat& img, GpuMat& _grad, GpuMat& _qangle)
{ {
CV_Assert(img.type() == CV_8UC1 || img.type() == CV_8UC4); CV_Assert(img.type() == CV_8UC1 || img.type() == CV_8UC4);
// grad.create(img.size(), CV_32FC2); // grad.create(img.size(), CV_32FC2);
grad = getBuffer(img.size(), CV_32FC2, grad_buf); _grad = getBuffer(img.size(), CV_32FC2, grad_buf);
// qangle.create(img.size(), CV_8UC2); // qangle.create(img.size(), CV_8UC2);
qangle = getBuffer(img.size(), CV_8UC2, qangle_buf); _qangle = getBuffer(img.size(), CV_8UC2, qangle_buf);
float angleScale = (float)(nbins / CV_PI); float angleScale = (float)(nbins / CV_PI);
switch (img.type()) switch (img.type())
{ {
case CV_8UC1: case CV_8UC1:
hog::compute_gradients_8UC1(nbins, img.rows, img.cols, img, angleScale, grad, qangle, gamma_correction); hog::compute_gradients_8UC1(nbins, img.rows, img.cols, img, angleScale, _grad, _qangle, gamma_correction);
break; break;
case CV_8UC4: case CV_8UC4:
hog::compute_gradients_8UC4(nbins, img.rows, img.cols, img, angleScale, grad, qangle, gamma_correction); hog::compute_gradients_8UC4(nbins, img.rows, img.cols, img, angleScale, _grad, _qangle, gamma_correction);
break; break;
} }
} }
@ -323,8 +323,8 @@ void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat& img, vector<Rect>& f
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())

@ -78,7 +78,7 @@ template <typename T>
struct GraphEdge struct GraphEdge
{ {
GraphEdge() {} GraphEdge() {}
GraphEdge(int to, int next, const T& val) : to(to), next(next), val(val) {} GraphEdge(int to_, int next_, const T& val_) : to(to_), next(next_), val(val_) {}
int to; int to;
int next; int next;
T val; T val;
@ -110,7 +110,7 @@ private:
struct SegmLinkVal struct SegmLinkVal
{ {
SegmLinkVal() {} SegmLinkVal() {}
SegmLinkVal(int dr, int dsp) : dr(dr), dsp(dsp) {} SegmLinkVal(int dr_, int dsp_) : dr(dr_), dsp(dsp_) {}
bool operator <(const SegmLinkVal& other) const bool operator <(const SegmLinkVal& other) const
{ {
return dr + dsp < other.dr + other.dsp; return dr + dsp < other.dr + other.dsp;
@ -123,8 +123,8 @@ struct SegmLinkVal
struct SegmLink struct SegmLink
{ {
SegmLink() {} SegmLink() {}
SegmLink(int from, int to, const SegmLinkVal& val) SegmLink(int from_, int to_, const SegmLinkVal& val_)
: from(from), to(to), val(val) {} : from(from_), to(to_), val(val_) {}
bool operator <(const SegmLink& other) const bool operator <(const SegmLink& other) const
{ {
return val < other.val; return val < other.val;
@ -182,10 +182,10 @@ inline int DjSets::merge(int set1, int set2)
template <typename T> template <typename T>
Graph<T>::Graph(int numv, int nume_max) : start(numv, -1), edges(nume_max) Graph<T>::Graph(int numv_, int nume_max_) : start(numv_, -1), edges(nume_max_)
{ {
this->numv = numv; this->numv = numv_;
this->nume_max = nume_max; this->nume_max = nume_max_;
nume = 0; nume = 0;
} }

@ -171,8 +171,8 @@ static void csbp_operator(StereoConstantSpaceBP& rthis, GpuMat& mbuf, GpuMat& te
{ {
cols_pyr[i] = cols_pyr[i-1] / 2; cols_pyr[i] = cols_pyr[i-1] / 2;
rows_pyr[i] = rows_pyr[i-1] / 2; rows_pyr[i] = rows_pyr[i-1] / 2;
nr_plane_pyr[i] = nr_plane_pyr[i-1] * 2; nr_plane_pyr[i] = nr_plane_pyr[i-1] * 2;
} }
GpuMat u[2], d[2], l[2], r[2], disp_selected_pyr[2], data_cost, data_cost_selected; GpuMat u[2], d[2], l[2], r[2], disp_selected_pyr[2], data_cost, data_cost_selected;
@ -193,14 +193,14 @@ static void csbp_operator(StereoConstantSpaceBP& rthis, GpuMat& mbuf, GpuMat& te
GpuMat sub2 = sub1.rowRange((k+0)*sub1.rows/2, (k+1)*sub1.rows/2); GpuMat sub2 = sub1.rowRange((k+0)*sub1.rows/2, (k+1)*sub1.rows/2);
GpuMat *buf_ptrs[] = { &u[k], &d[k], &l[k], &r[k], &disp_selected_pyr[k] }; GpuMat *buf_ptrs[] = { &u[k], &d[k], &l[k], &r[k], &disp_selected_pyr[k] };
for(int r = 0; r < 5; ++r) for(int _r = 0; _r < 5; ++_r)
{ {
*buf_ptrs[r] = sub2.rowRange(r * sub2.rows/5, (r+1) * sub2.rows/5); *buf_ptrs[_r] = sub2.rowRange(_r * sub2.rows/5, (_r+1) * sub2.rows/5);
assert(buf_ptrs[r]->cols == cols && buf_ptrs[r]->rows == rows * rthis.nr_plane); assert(buf_ptrs[_r]->cols == cols && buf_ptrs[_r]->rows == rows * rthis.nr_plane);
} }
}; };
size_t elem_step = mbuf.step / sizeof(T); size_t elem_step = mbuf.step / sizeof(T);
Size temp_size = data_cost.size(); Size temp_size = data_cost.size();
if ((size_t)temp_size.area() < elem_step * rows_pyr[levels - 1] * rthis.ndisp) if ((size_t)temp_size.area() < elem_step * rows_pyr[levels - 1] * rthis.ndisp)

@ -391,11 +391,11 @@ void cv::gpu::VideoReader_GPU::dumpFormat(std::ostream& st)
"YUV444" "YUV444"
}; };
FormatInfo format = this->format(); FormatInfo _format = this->format();
st << "Frame Size : " << format.width << "x" << format.height << std::endl; st << "Frame Size : " << _format.width << "x" << _format.height << std::endl;
st << "Codec : " << (format.codec <= H264_MVC ? codecs[format.codec] : "Uncompressed YUV") << std::endl; st << "Codec : " << (_format.codec <= H264_MVC ? codecs[_format.codec] : "Uncompressed YUV") << std::endl;
st << "Chroma Format : " << chromas[format.chromaFormat] << std::endl; st << "Chroma Format : " << chromas[_format.chromaFormat] << std::endl;
} }
#endif // HAVE_CUDA #endif // HAVE_CUDA

Loading…
Cancel
Save