mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 09:25:45 +08: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:
parent
8393d755f6
commit
633b0e56a5
@ -1,7 +1,9 @@
|
|||||||
/* 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 @@
|
|||||||
#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;
|
||||||
|
@ -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 <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <iostream>
|
#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/core/opengl.hpp"
|
||||||
#include "opencv2/cvconfig.h"
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#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 <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#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;
|
||||||
|
@ -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;
|
using namespace cv;
|
||||||
|
|
||||||
|
@ -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 @@
|
|||||||
* @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
|
|||||||
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 @@
|
|||||||
|
|
||||||
#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 @@
|
|||||||
#define MODELREGISTRATION_H_
|
#define MODELREGISTRATION_H_
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <opencv2/core/core.hpp>
|
#include <opencv2/core.hpp>
|
||||||
|
|
||||||
class ModelRegistration
|
class ModelRegistration
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#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>
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#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;
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#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;
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#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;
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#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 )
|
|||||||
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);
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#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;
|
||||||
|
@ -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 std;
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/imgcodecs.hpp>
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
using namespace std;
|
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>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -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 @@
|
|||||||
|
|
||||||
#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 @@
|
|||||||
@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>
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user