mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
fixed more "shadow" warnings
This commit is contained in:
parent
cd81a13d8b
commit
5d06788305
@ -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)
|
||||
{
|
||||
int trainIdx = *trainIdx_ptr;
|
||||
int imgIdx = *imgIdx_ptr;
|
||||
float distance = *distance_ptr;
|
||||
int _trainIdx = *trainIdx_ptr;
|
||||
int _imgIdx = *imgIdx_ptr;
|
||||
float _distance = *distance_ptr;
|
||||
|
||||
DMatch m(queryIdx, trainIdx, imgIdx, distance);
|
||||
DMatch m(queryIdx, _trainIdx, _imgIdx, _distance);
|
||||
|
||||
curMatches.push_back(m);
|
||||
}
|
||||
|
@ -98,17 +98,17 @@ namespace cv { namespace gpu { namespace device
|
||||
|
||||
using namespace ::cv::gpu::device;
|
||||
|
||||
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)
|
||||
: win_size(win_size),
|
||||
block_size(block_size),
|
||||
block_stride(block_stride),
|
||||
cell_size(cell_size),
|
||||
nbins(nbins),
|
||||
win_sigma(win_sigma),
|
||||
threshold_L2hys(threshold_L2hys),
|
||||
gamma_correction(gamma_correction),
|
||||
nlevels(nlevels)
|
||||
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_)
|
||||
: win_size(win_size_),
|
||||
block_size(block_size_),
|
||||
block_stride(block_stride_),
|
||||
cell_size(cell_size_),
|
||||
nbins(nbins_),
|
||||
win_sigma(win_sigma_),
|
||||
threshold_L2hys(threshold_L2hys_),
|
||||
gamma_correction(gamma_correction_),
|
||||
nlevels(nlevels_)
|
||||
{
|
||||
CV_Assert((win_size.width - block_size.width ) % block_stride.width == 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;
|
||||
}
|
||||
|
||||
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();
|
||||
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 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;
|
||||
for (size_t k = 0; k < block_hist_size; ++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));
|
||||
|
||||
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());
|
||||
}
|
||||
@ -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);
|
||||
|
||||
// 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 = getBuffer(img.size(), CV_8UC2, qangle_buf);
|
||||
_qangle = getBuffer(img.size(), CV_8UC2, qangle_buf);
|
||||
|
||||
float angleScale = (float)(nbins / CV_PI);
|
||||
switch (img.type())
|
||||
{
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -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++)
|
||||
{
|
||||
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())
|
||||
|
@ -78,7 +78,7 @@ template <typename T>
|
||||
struct 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 next;
|
||||
T val;
|
||||
@ -110,7 +110,7 @@ private:
|
||||
struct 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
|
||||
{
|
||||
return dr + dsp < other.dr + other.dsp;
|
||||
@ -123,8 +123,8 @@ struct SegmLinkVal
|
||||
struct SegmLink
|
||||
{
|
||||
SegmLink() {}
|
||||
SegmLink(int from, int to, const SegmLinkVal& val)
|
||||
: from(from), to(to), val(val) {}
|
||||
SegmLink(int from_, int to_, const SegmLinkVal& val_)
|
||||
: from(from_), to(to_), val(val_) {}
|
||||
bool operator <(const SegmLink& other) const
|
||||
{
|
||||
return val < other.val;
|
||||
@ -182,10 +182,10 @@ inline int DjSets::merge(int set1, int set2)
|
||||
|
||||
|
||||
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->nume_max = nume_max;
|
||||
this->numv = numv_;
|
||||
this->nume_max = nume_max_;
|
||||
nume = 0;
|
||||
}
|
||||
|
||||
|
@ -171,8 +171,8 @@ static void csbp_operator(StereoConstantSpaceBP& rthis, GpuMat& mbuf, GpuMat& te
|
||||
{
|
||||
cols_pyr[i] = cols_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;
|
||||
@ -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 *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);
|
||||
assert(buf_ptrs[r]->cols == cols && buf_ptrs[r]->rows == rows * rthis.nr_plane);
|
||||
*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);
|
||||
}
|
||||
};
|
||||
|
||||
size_t elem_step = mbuf.step / sizeof(T);
|
||||
size_t elem_step = mbuf.step / sizeof(T);
|
||||
|
||||
Size temp_size = data_cost.size();
|
||||
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"
|
||||
};
|
||||
|
||||
FormatInfo format = this->format();
|
||||
FormatInfo _format = this->format();
|
||||
|
||||
st << "Frame Size : " << format.width << "x" << format.height << std::endl;
|
||||
st << "Codec : " << (format.codec <= H264_MVC ? codecs[format.codec] : "Uncompressed YUV") << std::endl;
|
||||
st << "Chroma Format : " << chromas[format.chromaFormat] << 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 << "Chroma Format : " << chromas[_format.chromaFormat] << std::endl;
|
||||
}
|
||||
|
||||
#endif // HAVE_CUDA
|
||||
|
Loading…
Reference in New Issue
Block a user