Commit 79eb46dd authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #1452 from mshabunin:fix-gcc7-warnings

parents 6f07e2fc b16d9dbc
...@@ -53,7 +53,9 @@ int main(int argc, char* argv[]) ...@@ -53,7 +53,9 @@ int main(int argc, char* argv[])
bool useOCL = parser.has("ocl"); bool useOCL = parser.has("ocl");
cv::ocl::setUseOpenCL(useOCL); cv::ocl::setUseOpenCL(useOCL);
if(useOCL && !cv::ocl::useOpenCL()) if(useOCL && !cv::ocl::useOpenCL())
{
std::cout << "Failed to enable OpenCL\n"; std::cout << "Failed to enable OpenCL\n";
}
// declare the retina input buffer... that will be fed differently in regard of the input media // declare the retina input buffer... that will be fed differently in regard of the input media
cv::Mat inputFrame; cv::Mat inputFrame;
......
...@@ -91,7 +91,7 @@ namespace cv ...@@ -91,7 +91,7 @@ namespace cv
string TRACK_votImpl::numberToString(int number) string TRACK_votImpl::numberToString(int number)
{ {
string out; string out;
char numberStr[9]; char numberStr[20];
sprintf(numberStr, "%u", number); sprintf(numberStr, "%u", number);
for (unsigned int i = 0; i < 8 - strlen(numberStr); ++i) for (unsigned int i = 0; i < 8 - strlen(numberStr); ++i)
{ {
......
...@@ -53,9 +53,15 @@ TEST(Sfm_projection, homogeneousToEuclidean) ...@@ -53,9 +53,15 @@ TEST(Sfm_projection, homogeneousToEuclidean)
EXPECT_EQ((int) X.rows-1,(int) XEuclidean.rows ); EXPECT_EQ((int) X.rows-1,(int) XEuclidean.rows );
for(int y=0;y<X.rows-1;++y) for(int y=0;y<X.rows-1;++y)
{
for(int x=0;x<X.cols;++x) for(int x=0;x<X.cols;++x)
{
if (X(X.rows-1,x)!=0) if (X(X.rows-1,x)!=0)
{
EXPECT_LE( std::abs(X(y,x)/X(X.rows-1, x) - XEuclidean(y,x)), 1e-4 ); EXPECT_LE( std::abs(X(y,x)/X(X.rows-1, x) - XEuclidean(y,x)), 1e-4 );
}
}
}
} }
TEST(Sfm_projection, euclideanToHomogeneous) TEST(Sfm_projection, euclideanToHomogeneous)
......
...@@ -119,7 +119,7 @@ void er_show(vector<Mat> &channels, vector<vector<ERStat> > &regions) ...@@ -119,7 +119,7 @@ void er_show(vector<Mat> &channels, vector<vector<ERStat> > &regions)
Scalar(255),0,Scalar(er.level),Scalar(0),flags); Scalar(255),0,Scalar(er.level),Scalar(0),flags);
} }
} }
char buff[10]; char *buff_ptr = buff; char buff[20]; char *buff_ptr = buff;
sprintf(buff, "channel %d", c); sprintf(buff, "channel %d", c);
imshow(buff_ptr, dst); imshow(buff_ptr, dst);
} }
......
...@@ -440,8 +440,6 @@ namespace cv ...@@ -440,8 +440,6 @@ namespace cv
LabeledPatch labPatch; LabeledPatch labPatch;
double curScale = pow(SCALE_STEP, ensScaleIDs[i]); double curScale = pow(SCALE_STEP, ensScaleIDs[i]);
labPatch.rect = Rect2d(ensBuffer[i].x*curScale, ensBuffer[i].y*curScale, initSize.width * curScale, initSize.height * curScale); labPatch.rect = Rect2d(ensBuffer[i].x*curScale, ensBuffer[i].y*curScale, initSize.width * curScale, initSize.height * curScale);
labPatch.Sc = scValues[i];
//printf("max sc %f\n", labPatch.Sc);
const double srValue = srValues[i]; const double srValue = srValues[i];
const double scValue = scValues[i]; const double scValue = scValues[i];
......
...@@ -103,7 +103,6 @@ namespace cv ...@@ -103,7 +103,6 @@ namespace cv
{ {
Rect2d rect; Rect2d rect;
bool isObject, shouldBeIntegrated; bool isObject, shouldBeIntegrated;
double Sc;
}; };
bool detect(const Mat& img, const Mat& imgBlurred, Rect2d& res, std::vector<LabeledPatch>& patches, Size initSize); bool detect(const Mat& img, const Mat& imgBlurred, Rect2d& res, std::vector<LabeledPatch>& patches, Size initSize);
bool ocl_detect(const Mat& img, const Mat& imgBlurred, Rect2d& res, std::vector<LabeledPatch>& patches, Size initSize); bool ocl_detect(const Mat& img, const Mat& imgBlurred, Rect2d& res, std::vector<LabeledPatch>& patches, Size initSize);
......
...@@ -59,8 +59,8 @@ static void checkSimilarity(InputArray res, InputArray ref, double maxNormInf = ...@@ -59,8 +59,8 @@ static void checkSimilarity(InputArray res, InputArray ref, double maxNormInf =
double normInf = cvtest::norm(res, ref, NORM_INF); double normInf = cvtest::norm(res, ref, NORM_INF);
double normL2 = cvtest::norm(res, ref, NORM_L2) / res.total(); double normL2 = cvtest::norm(res, ref, NORM_L2) / res.total();
if (maxNormInf >= 0) EXPECT_LE(normInf, maxNormInf); if (maxNormInf >= 0) { EXPECT_LE(normInf, maxNormInf); }
if (maxNormL2 >= 0) EXPECT_LE(normL2, maxNormL2); if (maxNormL2 >= 0) { EXPECT_LE(normL2, maxNormL2); }
} }
TEST(AdaptiveManifoldTest, SplatSurfaceAccuracy) TEST(AdaptiveManifoldTest, SplatSurfaceAccuracy)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment