Skip to content

Commit

Permalink
fixed defects from Xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Feb 25, 2014
1 parent 32eb38e commit ce0557e
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 29 deletions.
1 change: 1 addition & 0 deletions modules/calib3d/src/circlesgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ void CirclesGridClusterFinder::findCorners(const std::vector<cv::Point2f> &hull2

void CirclesGridClusterFinder::findOutsideCorners(const std::vector<cv::Point2f> &corners, std::vector<cv::Point2f> &outsideCorners)
{
CV_Assert(!corners.empty());
outsideCorners.clear();
//find two pairs of the most nearest corners
int i, j, n = (int)corners.size();
Expand Down
2 changes: 1 addition & 1 deletion modules/calib3d/test/test_chesscorners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename )

if (count != 0)
sum_error /= count;
ts->printf(cvtest::TS::LOG, "Average error is %f\n", sum_error);
ts->printf(cvtest::TS::LOG, "Average error is %f (%d patterns have been found)\n", sum_error, count);
}

double calcErrorMinError(const Size& cornSz, const vector<Point2f>& corners_found, const vector<Point2f>& corners_generated)
Expand Down
3 changes: 2 additions & 1 deletion modules/core/src/copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ Mat& Mat::operator = (const Scalar& s)

Mat& Mat::setTo(InputArray _value, InputArray _mask)
{
if( !data )
if( empty() )
return *this;

Mat value = _value.getMat(), mask = _mask.getMat();
Expand Down Expand Up @@ -632,6 +632,7 @@ int cv::borderInterpolate( int p, int len, int borderType )
}
else if( borderType == BORDER_WRAP )
{
CV_Assert(len > 0);
if( p < 0 )
p -= ((p-len+1)/len)*len;
if( p >= len )
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ String format( const char* fmt, ... )
String s(len, '\0');
va_start(va, fmt);
len = vsnprintf((char*)s.c_str(), len + 1, fmt, va);
(void)len;
va_end(va);
return s;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/imgproc/src/accum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ static bool ocl_accumulate( InputArray _src, InputArray _src2, InputOutputArray
argidx = k.set(argidx, alpha);
}
if (haveMask)
argidx = k.set(argidx, maskarg);
k.set(argidx, maskarg);

size_t globalsize[2] = { src.cols, src.rows };
return k.run(2, globalsize, NULL, false);
Expand Down
12 changes: 4 additions & 8 deletions modules/imgproc/src/clahe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ namespace clahe
idx = k.set(idx, tile_size);
idx = k.set(idx, tilesX);
idx = k.set(idx, clipLimit);
idx = k.set(idx, lutScale);
k.set(idx, lutScale);

if (!k.run(2, globalThreads, localThreads, false))
return false;
return true;
return k.run(2, globalThreads, localThreads, false);
}

static bool transform(cv::InputArray _src, cv::OutputArray _dst, cv::InputArray _lut,
Expand Down Expand Up @@ -118,11 +116,9 @@ namespace clahe
idx = k.set(idx, src.rows);
idx = k.set(idx, tile_size);
idx = k.set(idx, tilesX);
idx = k.set(idx, tilesY);
k.set(idx, tilesY);

if (!k.run(2, globalThreads, localThreads, false))
return false;
return true;
return k.run(2, globalThreads, localThreads, false);
}
}

Expand Down
3 changes: 1 addition & 2 deletions modules/objdetect/src/erfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void ERFilterNM::er_tree_extract( InputArray image )
push_new_component = false;

// explore the (remaining) edges to the neighbors to the current pixel
for (current_edge = current_edge; current_edge < 4; current_edge++)
for ( ; current_edge < 4; current_edge++)
{

int neighbour_pixel = current_pixel;
Expand Down Expand Up @@ -1949,7 +1949,6 @@ class dissimilarity {
double (dissimilarity::*distfn) (const int_fast32_t, const int_fast32_t) const;

auto_array_ptr<double> precomputed;
double * precomputed2;

double * V;
const double * V_data;
Expand Down
6 changes: 4 additions & 2 deletions modules/objdetect/test/test_cascadeandhog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ class HOGDescriptorTester :
Size winStride = Size(), Size padding = Size(),
const vector<Point>& locations = vector<Point>()) const;

virtual void compute(const Mat& img, vector<float>& descriptors,
virtual void compute(InputArray img, vector<float>& descriptors,
Size winStride = Size(), Size padding = Size(),
const vector<Point>& locations = vector<Point>()) const;

Expand Down Expand Up @@ -1107,9 +1107,11 @@ void HOGDescriptorTester::detect(const Mat& img, vector<Point>& hits, double hit
detect(img, hits, weightsV, hitThreshold, winStride, padding, locations);
}

void HOGDescriptorTester::compute(const Mat& img, vector<float>& descriptors,
void HOGDescriptorTester::compute(InputArray _img, vector<float>& descriptors,
Size winStride, Size padding, const vector<Point>& locations) const
{
Mat img = _img.getMat();

if( winStride == Size() )
winStride = cellSize;
Size cacheStride(gcd(winStride.width, blockStride.width),
Expand Down
1 change: 0 additions & 1 deletion modules/shape/src/scd_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class SCDMatcher

private:
float minMatchCost;
float betaAdditional;
protected:
void buildCostMatrix(const cv::Mat& descriptors1, const cv::Mat& descriptors2,
cv::Mat& costMatrix, cv::Ptr<cv::HistogramCostExtractor>& comparer) const;
Expand Down
4 changes: 2 additions & 2 deletions modules/video/src/bgfg_gaussmix2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ bool BackgroundSubtractorMOG2Impl::ocl_apply(InputArray _image, OutputArray _fgm
idxArg = kernel_apply.set(idxArg, varMax);
idxArg = kernel_apply.set(idxArg, fVarInit);
idxArg = kernel_apply.set(idxArg, fTau);
idxArg = kernel_apply.set(idxArg, nShadowDetection);
kernel_apply.set(idxArg, nShadowDetection);

size_t globalsize[] = {frame.cols, frame.rows, 1};

Expand All @@ -805,7 +805,7 @@ bool BackgroundSubtractorMOG2Impl::ocl_getBackgroundImage(OutputArray _backgroun
idxArg = kernel_getBg.set(idxArg, ocl::KernelArg::ReadOnlyNoSize(u_weight));
idxArg = kernel_getBg.set(idxArg, ocl::KernelArg::ReadOnlyNoSize(u_mean));
idxArg = kernel_getBg.set(idxArg, ocl::KernelArg::WriteOnlyNoSize(dst));
idxArg = kernel_getBg.set(idxArg, backgroundRatio);
kernel_getBg.set(idxArg, backgroundRatio);

size_t globalsize[2] = {u_bgmodelUsedModes.cols, u_bgmodelUsedModes.rows};

Expand Down
17 changes: 6 additions & 11 deletions modules/video/src/optflowgf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ class FarnebackOpticalFlow
idxArg = kernel.set(idxArg, dst.cols);
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(m_gKer));
idxArg = kernel.set(idxArg, (int)ksizeHalf);
idxArg = kernel.set(idxArg, (void *)NULL, smem_size);
kernel.set(idxArg, (void *)NULL, smem_size);
return kernel.run(2, globalsize, localsize, false);
}
bool gaussianBlur5Ocl(const UMat &src, int ksizeHalf, UMat &dst)
Expand All @@ -883,7 +883,7 @@ class FarnebackOpticalFlow
idxArg = kernel.set(idxArg, src.cols);
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(m_gKer));
idxArg = kernel.set(idxArg, (int)ksizeHalf);
idxArg = kernel.set(idxArg, (void *)NULL, smem_size);
kernel.set(idxArg, (void *)NULL, smem_size);
return kernel.run(2, globalsize, localsize, false);
}
bool polynomialExpansionOcl(const UMat &src, UMat &dst)
Expand Down Expand Up @@ -919,12 +919,7 @@ class FarnebackOpticalFlow
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(m_xg));
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(m_xxg));
idxArg = kernel.set(idxArg, (void *)NULL, smem_size);
#if 0
if (useDouble)
idxArg = kernel.set(idxArg, (void *)m_igd, 4 * sizeof(double));
else
#endif
idxArg = kernel.set(idxArg, (void *)m_ig, 4 * sizeof(float));
kernel.set(idxArg, (void *)m_ig, 4 * sizeof(float));
return kernel.run(2, globalsize, localsize, false);
}
bool boxFilter5Ocl(const UMat &src, int ksizeHalf, UMat &dst)
Expand All @@ -951,7 +946,7 @@ class FarnebackOpticalFlow
idxArg = kernel.set(idxArg, height);
idxArg = kernel.set(idxArg, src.cols);
idxArg = kernel.set(idxArg, (int)ksizeHalf);
idxArg = kernel.set(idxArg, (void *)NULL, smem_size);
kernel.set(idxArg, (void *)NULL, smem_size);
return kernel.run(2, globalsize, localsize, false);
}

Expand All @@ -976,7 +971,7 @@ class FarnebackOpticalFlow
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(flowy));
idxArg = kernel.set(idxArg, (int)(flowy.step / flowy.elemSize()));
idxArg = kernel.set(idxArg, (int)flowy.rows);
idxArg = kernel.set(idxArg, (int)flowy.cols);
kernel.set(idxArg, (int)flowy.cols);
return kernel.run(2, globalsize, localsize, false);
}
bool updateMatricesOcl(const UMat &flowx, const UMat &flowy, const UMat &R0, const UMat &R1, UMat &M)
Expand Down Expand Up @@ -1004,7 +999,7 @@ class FarnebackOpticalFlow
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(R1));
idxArg = kernel.set(idxArg, (int)(R1.step / R1.elemSize()));
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrWriteOnly(M));
idxArg = kernel.set(idxArg, (int)(M.step / M.elemSize()));
kernel.set(idxArg, (int)(M.step / M.elemSize()));
return kernel.run(2, globalsize, localsize, false);
}

Expand Down

0 comments on commit ce0557e

Please sign in to comment.