Skip to content

Commit

Permalink
3.4: -Wunused-but-set-variable warnings fix after XCode update with c…
Browse files Browse the repository at this point in the history
…lang
  • Loading branch information
asmorkalov committed Feb 6, 2023
1 parent f18f127 commit 2abfef7
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 31 deletions.
7 changes: 0 additions & 7 deletions modules/ccalib/src/ccalib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,23 +247,16 @@ void CustomPattern::check_matches(vector<Point2f>& matched, const vector<Point2f
perspectiveTransform(pattern, proj, H);

int deleted = 0;
double error_sum = 0;
double error_sum_filtered = 0;
for (uint i = 0; i < proj.size(); ++i)
{
double error = norm(matched[i] - proj[i]);
error_sum += error;
if (error >= MAX_PROJ_ERROR_PX)
{
deleteStdVecElem(good, i);
deleteStdVecElem(matched, i);
deleteStdVecElem(pattern_3d, i);
++deleted;
}
else
{
error_sum_filtered += error;
}
}
}

Expand Down
6 changes: 0 additions & 6 deletions modules/line_descriptor/src/binary_descriptor_matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,6 @@ void BinaryDescriptorMatcher::Mihasher::query( UINT32* results, UINT32* numres,

/* counting everything retrieved (duplicates are counted multiple times)
number of lookups (and xors) */
UINT32 nl = 0;

UINT32 nd = 0;
UINT32 *arr;
int size = 0;
UINT32 index;
Expand All @@ -672,8 +669,6 @@ void BinaryDescriptorMatcher::Mihasher::query( UINT32* results, UINT32* numres,
else
curb = b - 1;
UINT64 chunksk = chunks[k];
/* number of bit-strings with s number of 1s */
nl += xornum[s + 1] - xornum[s];

/* the bit-string with s number of 1s */
UINT64 bitstr = 0;
Expand Down Expand Up @@ -706,7 +701,6 @@ void BinaryDescriptorMatcher::Mihasher::query( UINT32* results, UINT32* numres,
arr = H[k].query( chunksk ^ bitstr, &size ); // lookup
if( size )
{ /* the corresponding bucket is not empty */
nd += size;
for ( int c = 0; c < size; c++ )
{
index = arr[c];
Expand Down
8 changes: 0 additions & 8 deletions modules/stereo/src/stereo_binary_bm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,6 @@ namespace cv

Mat left = preFilteredImg0, right = preFilteredImg1;

int ndisp = params.numDisparities;

int wsz = params.kernelSize;
int bufSize0 = (int)((ndisp + 2)*sizeof(int));
bufSize0 += (int)((height + wsz + 2)*ndisp*sizeof(int));
bufSize0 += (int)((height + wsz + 2)*sizeof(int));
bufSize0 += (int)((height + wsz + 2)*ndisp*(wsz + 2)*sizeof(uchar) + 256);

int bufSize1 = (int)((width + params.preFilterSize + 2) * sizeof(int) + 256);
if(params.usePrefilter == true)
{
Expand Down
5 changes: 0 additions & 5 deletions modules/structured_light/src/graycodepattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,6 @@ bool GrayCodePattern_Impl::decode( const std::vector< std::vector<Mat> >& patter
Mat& disparityMap_ = *( Mat* ) disparityMap.getObj();
disparityMap_ = Mat( cam_height, cam_width, CV_64F, double( 0 ) );

double number_of_pixels_cam1 = 0;
double number_of_pixels_cam2 = 0;

for( int i = 0; i < params.width; i++ )
{
for( int j = 0; j < params.height; j++ )
Expand All @@ -278,8 +275,6 @@ bool GrayCodePattern_Impl::decode( const std::vector< std::vector<Mat> >& patter
double sump1x = 0;
double sump2x = 0;

number_of_pixels_cam1 += cam1Pixs.size();
number_of_pixels_cam2 += cam2Pixs.size();
for( int c1 = 0; c1 < (int) cam1Pixs.size(); c1++ )
{
p1 = cam1Pixs[c1];
Expand Down
2 changes: 0 additions & 2 deletions modules/tracking/src/multiTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ namespace cv
Mat tmp;
int dx = initSize.width / 10, dy = initSize.height / 10;
Size2d size = img.size();
double scale = 1.0;
int npos = 0, nneg = 0;
double maxSc = -5.0;
Rect2d maxScRect;
Expand Down Expand Up @@ -335,7 +334,6 @@ namespace cv
scaleID++;
size.width /= tld::SCALE_STEP;
size.height /= tld::SCALE_STEP;
scale *= tld::SCALE_STEP;
resize(img, tmp, size, 0, 0, tld::DOWNSCALE_MODE);
resized_imgs.push_back(tmp);
GaussianBlur(resized_imgs[scaleID], tmp, tld::GaussBlurKernelSize, 0.0f);
Expand Down
2 changes: 0 additions & 2 deletions modules/tracking/src/tldDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ namespace cv
Mat tmp;
int dx = initSize.width / 10, dy = initSize.height / 10;
Size2d size = img.size();
double scale = 1.0;
int npos = 0, nneg = 0;
double maxSc = -5.0;
Rect2d maxScRect;
Expand Down Expand Up @@ -398,7 +397,6 @@ namespace cv
scaleID++;
size.width /= SCALE_STEP;
size.height /= SCALE_STEP;
scale *= SCALE_STEP;
resize(img, tmp, size, 0, 0, DOWNSCALE_MODE);
resized_imgs.push_back(tmp);
GaussianBlur(resized_imgs[scaleID], tmp, GaussBlurKernelSize, 0.0f);
Expand Down
2 changes: 1 addition & 1 deletion modules/ximgproc/src/brightedges.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ namespace cv
iedge.ptr(row + 1)[col + 2] +
iedge.ptr(row - 1)[col + 2];
if (line < weight) lines += 1;
if (line == 1) return 0;
if (lines == 1) return 0;
// Compute surrounding pixels for dark zone
int surround = iedge.ptr(row - 1)[col - 1] +
iedge.ptr(row - 1)[col] +
Expand Down

0 comments on commit 2abfef7

Please sign in to comment.