1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-25 13:23:02 +04:00

Fixed compilation warnings in samples:

- use per-module includes instead of "opencv.hpp"
- unused function warnings
- undefined macro warning
This commit is contained in:
Maksim Shabunin
2018-02-09 13:24:18 +03:00
parent 8393d755f6
commit 633b0e56a5
25 changed files with 79 additions and 60 deletions
@@ -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;
+5 -1
View File
@@ -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: