Commit 633b0e56 authored by Maksim Shabunin's avatar Maksim Shabunin

Fixed compilation warnings in samples:

- use per-module includes instead of "opencv.hpp"
- unused function warnings
- undefined macro warning
parent 8393d755
/* OpenCV Application Tracing support demo. */ /* OpenCV Application Tracing support demo. */
#include <iostream> #include <iostream>
#include <opencv2/opencv.hpp> #include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/core/utils/trace.hpp> #include <opencv2/core/utils/trace.hpp>
using namespace cv; using namespace cv;
......
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
#include <cstdio> #include <cstdio>
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include <opencv2/opencv.hpp> #include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace std; using namespace std;
using namespace cv; using namespace cv;
......
#include <opencv2/opencv.hpp> #include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/features2d.hpp>
#include <vector> #include <vector>
#include <map> #include <map>
#include <iostream> #include <iostream>
......
#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/core/opengl.hpp"
#include "opencv2/cvconfig.h"
#include <vector> #include <vector>
#include <map> #include <map>
......
#include <opencv2/opencv.hpp> #include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/features2d.hpp>
#include <opencv2/highgui.hpp>
#include <vector> #include <vector>
#include <iostream> #include <iostream>
......
#include <opencv2/opencv.hpp> #include "opencv2/core.hpp"
#include "opencv2/video/tracking.hpp" #include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp" #include "opencv2/highgui.hpp"
#include "opencv2/ml.hpp"
using namespace cv; using namespace cv;
using namespace cv::ml; using namespace cv::ml;
......
#include <opencv2/opencv.hpp> #include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/ml.hpp>
using namespace cv; using namespace cv;
......
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
* @author OpenCV team * @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); void show_wait_destroy(const char* winname, cv::Mat img);
......
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
* @author OpenCV Team * @author OpenCV Team
*/ */
#include <opencv2/opencv.hpp> #include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <iostream> #include <iostream>
using namespace std; using namespace std;
......
...@@ -245,11 +245,6 @@ static inline void read(const FileNode& node, Settings& x, const Settings& defau ...@@ -245,11 +245,6 @@ static inline void read(const FileNode& node, Settings& x, const Settings& defau
x.read(node); x.read(node);
} }
static inline void write(FileStorage& fs, const String&, const Settings& s )
{
s.write(fs);
}
enum { DETECTION = 0, CAPTURING = 1, CALIBRATED = 2 }; enum { DETECTION = 0, CAPTURING = 1, CALIBRATED = 2 };
bool runCalibrationAndSave(Settings& s, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, bool runCalibrationAndSave(Settings& s, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <opencv2/core/core.hpp> #include <opencv2/core.hpp>
#include "Utils.h" #include "Utils.h"
using namespace std; using namespace std;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#define MODELREGISTRATION_H_ #define MODELREGISTRATION_H_
#include <iostream> #include <iostream>
#include <opencv2/core/core.hpp> #include <opencv2/core.hpp>
class ModelRegistration class ModelRegistration
{ {
......
#include <opencv2/features2d.hpp> #include <opencv2/features2d.hpp>
#include <opencv2/videoio.hpp> #include <opencv2/videoio.hpp>
#include <opencv2/opencv.hpp> #include <opencv2/imgproc.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/highgui.hpp> //for imshow #include <opencv2/highgui.hpp> //for imshow
#include <vector> #include <vector>
#include <iostream> #include <iostream>
......
#include <iostream> #include <iostream>
#include <opencv2/opencv_modules.hpp> #include <opencv2/opencv_modules.hpp>
#ifdef HAVE_OPENCV_ARUCO #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> #include <opencv2/aruco.hpp>
using namespace std; using namespace std;
......
#include <iostream> #include <iostream>
#include <opencv2/opencv_modules.hpp> #include <opencv2/opencv_modules.hpp>
#ifdef HAVE_OPENCV_ARUCO #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> #include <opencv2/aruco.hpp>
using namespace std; using namespace std;
......
#include <iostream> #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 std;
using namespace cv; using namespace cv;
......
#include <iostream> #include <iostream>
#include <opencv2/opencv_modules.hpp> #include <opencv2/opencv_modules.hpp>
#ifdef HAVE_OPENCV_ARUCO #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> #include <opencv2/aruco.hpp>
using namespace std; using namespace std;
...@@ -17,32 +20,6 @@ Scalar randomColor( RNG& rng ) ...@@ -17,32 +20,6 @@ Scalar randomColor( RNG& rng )
return Scalar( icolor & 255, (icolor >> 8) & 255, (icolor >> 16) & 255 ); 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) void perspectiveCorrection(const string &img1Path, const string &img2Path, const Size &patternSize, RNG &rng)
{ {
Mat img1 = imread(img1Path); Mat img1 = imread(img1Path);
......
#include <iostream> #include <iostream>
#include <opencv2/opencv_modules.hpp> #include <opencv2/opencv_modules.hpp>
#ifdef HAVE_OPENCV_ARUCO #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> #include <opencv2/aruco.hpp>
using namespace std; using namespace std;
......
#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 std;
using namespace cv; using namespace cv;
......
#include <opencv2/opencv.hpp> #include <opencv2/imgcodecs.hpp>
using namespace cv; using namespace cv;
using namespace std; using namespace std;
......
#include <opencv2/opencv.hpp> #include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <iostream> #include <iostream>
using namespace std; using namespace std;
...@@ -6,6 +8,8 @@ using namespace cv; ...@@ -6,6 +8,8 @@ using namespace cv;
#ifdef HAVE_OPENCV_VIZ #ifdef HAVE_OPENCV_VIZ
#include <opencv2/viz.hpp>
const String keys = const String keys =
"{Aide h usage ? help | | print this message }" "{Aide h usage ? help | | print this message }"
"{@arg1 | | Full path to color imag (3 channels)}" "{@arg1 | | Full path to color imag (3 channels)}"
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
#ifdef HAVE_OPENCV_XFEATURES2D #ifdef HAVE_OPENCV_XFEATURES2D
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/features2d.hpp> #include <opencv2/features2d.hpp>
#include <opencv2/xfeatures2d.hpp> #include <opencv2/xfeatures2d.hpp>
#include <opencv2/imgcodecs.hpp> #include <opencv2/imgcodecs.hpp>
#include <opencv2/opencv.hpp>
#include <vector> #include <vector>
// If you find this code useful, please add a reference to the following paper in your work: // If you find this code useful, please add a reference to the following paper in your work:
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
@date Aug 24, 2016 @date Aug 24, 2016
*/ */
#include <opencv2/opencv.hpp> #include <opencv2/core.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <iostream> #include <iostream>
#include <stdio.h> #include <stdio.h>
...@@ -49,4 +51,4 @@ int main(int, char**) ...@@ -49,4 +51,4 @@ int main(int, char**)
} }
// the camera will be deinitialized automatically in VideoCapture destructor // the camera will be deinitialized automatically in VideoCapture destructor
return 0; return 0;
} }
\ No newline at end of file
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
@date Aug 24, 2016 @date Aug 24, 2016
*/ */
#include <opencv2/opencv.hpp> #include <opencv2/core.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <iostream> #include <iostream>
#include <stdio.h> #include <stdio.h>
...@@ -62,4 +64,4 @@ int main(int, char**) ...@@ -62,4 +64,4 @@ int main(int, char**)
} }
// the videofile will be closed and released automatically in VideoWriter destructor // the videofile will be closed and released automatically in VideoWriter destructor
return 0; return 0;
} }
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS // eliminate build warning #define CL_USE_DEPRECATED_OPENCL_2_0_APIS // eliminate build warning
#if __APPLE__ #ifdef __APPLE__
#include <OpenCL/cl.h> #include <OpenCL/cl.h>
#else #else
#include <CL/cl.h> #include <CL/cl.h>
......
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