Fixed compilation warnings in samples:

- use per-module includes instead of "opencv.hpp"
- unused function warnings
- undefined macro warning
pull/10818/head
Maksim Shabunin 7 years ago
parent 8393d755f6
commit 633b0e56a5
  1. 4
      samples/cpp/application_trace.cpp
  2. 4
      samples/cpp/autofocus.cpp
  3. 5
      samples/cpp/detect_blob.cpp
  4. 6
      samples/cpp/detect_mser.cpp
  5. 5
      samples/cpp/matchmethod_orb_akaze_brisk.cpp
  6. 7
      samples/cpp/train_svmsgd.cpp
  7. 5
      samples/cpp/travelsalesman.cpp
  8. 5
      samples/cpp/tutorial_code/ImgProc/morph_lines_detection/Morphology_3.cpp
  9. 4
      samples/cpp/tutorial_code/ImgTrans/imageSegmentation.cpp
  10. 5
      samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp
  11. 2
      samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.h
  12. 2
      samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/ModelRegistration.h
  13. 3
      samples/cpp/tutorial_code/features2D/AKAZE_tracking/planar_tracking.cpp
  14. 5
      samples/cpp/tutorial_code/features2D/Homography/decompose_homography.cpp
  15. 5
      samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp
  16. 5
      samples/cpp/tutorial_code/features2D/Homography/panorama_stitching_rotating_camera.cpp
  17. 31
      samples/cpp/tutorial_code/features2D/Homography/perspective_correction.cpp
  18. 5
      samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp
  19. 5
      samples/cpp/tutorial_code/snippets/core_various.cpp
  20. 2
      samples/cpp/tutorial_code/snippets/imgcodecs_imwrite.cpp
  21. 6
      samples/cpp/tutorial_code/viz/histo3D.cpp
  22. 4
      samples/cpp/tutorial_code/xfeatures2D/LATCH_match.cpp
  23. 6
      samples/cpp/videocapture_basic.cpp
  24. 6
      samples/cpp/videowriter_basic.cpp
  25. 2
      samples/opencl/opencl-opencv-interop.cpp

@ -1,7 +1,9 @@
/* OpenCV Application Tracing support demo. */
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/core/utils/trace.hpp>
using namespace cv;

@ -28,7 +28,9 @@
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
using namespace cv;

@ -1,4 +1,7 @@
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/features2d.hpp>
#include <vector>
#include <map>
#include <iostream>

@ -1,6 +1,8 @@
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/features2d.hpp>
#include "opencv2/core/opengl.hpp"
#include "opencv2/cvconfig.h"
#include <vector>
#include <map>

@ -1,4 +1,7 @@
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/features2d.hpp>
#include <opencv2/highgui.hpp>
#include <vector>
#include <iostream>

@ -1,7 +1,8 @@
#include <opencv2/opencv.hpp>
#include "opencv2/core.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/ml.hpp"
using namespace cv;
using namespace cv::ml;

@ -1,4 +1,7 @@
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/ml.hpp>
using namespace cv;

@ -4,7 +4,10 @@
* @author OpenCV team
*/
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
void show_wait_destroy(const char* winname, cv::Mat img);

@ -4,7 +4,9 @@
* @author OpenCV Team
*/
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
using namespace std;

@ -245,11 +245,6 @@ static inline void read(const FileNode& node, Settings& x, const Settings& defau
x.read(node);
}
static inline void write(FileStorage& fs, const String&, const Settings& s )
{
s.write(fs);
}
enum { DETECTION = 0, CAPTURING = 1, CALIBRATED = 2 };
bool runCalibrationAndSave(Settings& s, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs,

@ -3,7 +3,7 @@
#include <iostream>
#include <fstream>
#include <opencv2/core/core.hpp>
#include <opencv2/core.hpp>
#include "Utils.h"
using namespace std;

@ -9,7 +9,7 @@
#define MODELREGISTRATION_H_
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/core.hpp>
class ModelRegistration
{

@ -1,6 +1,7 @@
#include <opencv2/features2d.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/highgui.hpp> //for imshow
#include <vector>
#include <iostream>

@ -1,7 +1,10 @@
#include <iostream>
#include <opencv2/opencv_modules.hpp>
#ifdef HAVE_OPENCV_ARUCO
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/aruco.hpp>
using namespace std;

@ -1,7 +1,10 @@
#include <iostream>
#include <opencv2/opencv_modules.hpp>
#ifdef HAVE_OPENCV_ARUCO
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/aruco.hpp>
using namespace std;

@ -1,5 +1,8 @@
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/stitching.hpp>
using namespace std;
using namespace cv;

@ -1,7 +1,10 @@
#include <iostream>
#include <opencv2/opencv_modules.hpp>
#ifdef HAVE_OPENCV_ARUCO
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/aruco.hpp>
using namespace std;
@ -17,32 +20,6 @@ Scalar randomColor( RNG& rng )
return Scalar( icolor & 255, (icolor >> 8) & 255, (icolor >> 16) & 255 );
}
void calcChessboardCorners(Size boardSize, float squareSize, vector<Point3f>& corners, Pattern patternType = CHESSBOARD)
{
corners.resize(0);
switch (patternType)
{
case CHESSBOARD:
case CIRCLES_GRID:
for( int i = 0; i < boardSize.height; i++ )
for( int j = 0; j < boardSize.width; j++ )
corners.push_back(Point3f(float(j*squareSize),
float(i*squareSize), 0));
break;
case ASYMMETRIC_CIRCLES_GRID:
for( int i = 0; i < boardSize.height; i++ )
for( int j = 0; j < boardSize.width; j++ )
corners.push_back(Point3f(float((2*j + i % 2)*squareSize),
float(i*squareSize), 0));
break;
default:
CV_Error(Error::StsBadArg, "Unknown pattern type\n");
}
}
void perspectiveCorrection(const string &img1Path, const string &img2Path, const Size &patternSize, RNG &rng)
{
Mat img1 = imread(img1Path);

@ -1,7 +1,10 @@
#include <iostream>
#include <opencv2/opencv_modules.hpp>
#ifdef HAVE_OPENCV_ARUCO
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/aruco.hpp>
using namespace std;

@ -1,4 +1,7 @@
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/features2d.hpp>
using namespace std;
using namespace cv;

@ -1,4 +1,4 @@
#include <opencv2/opencv.hpp>
#include <opencv2/imgcodecs.hpp>
using namespace cv;
using namespace std;

@ -1,4 +1,6 @@
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
using namespace std;
@ -6,6 +8,8 @@ using namespace cv;
#ifdef HAVE_OPENCV_VIZ
#include <opencv2/viz.hpp>
const String keys =
"{Aide h usage ? help | | print this message }"
"{@arg1 | | Full path to color imag (3 channels)}"

@ -4,10 +4,12 @@
#ifdef HAVE_OPENCV_XFEATURES2D
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/features2d.hpp>
#include <opencv2/xfeatures2d.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/opencv.hpp>
#include <vector>
// If you find this code useful, please add a reference to the following paper in your work:

@ -5,7 +5,9 @@
@date Aug 24, 2016
*/
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <stdio.h>
@ -49,4 +51,4 @@ int main(int, char**)
}
// the camera will be deinitialized automatically in VideoCapture destructor
return 0;
}
}

@ -5,7 +5,9 @@
@date Aug 24, 2016
*/
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <stdio.h>
@ -62,4 +64,4 @@ int main(int, char**)
}
// the videofile will be closed and released automatically in VideoWriter destructor
return 0;
}
}

@ -16,7 +16,7 @@
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS // eliminate build warning
#if __APPLE__
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>

Loading…
Cancel
Save