mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Remove all using directives for STL namespace and members
Made all STL usages explicit to be able automatically find all usages of particular class or function.
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
static void help()
|
||||
{
|
||||
printf( "This program shows the use of the \"fern\" plannar PlanarObjectDetector point\n"
|
||||
|
||||
@@ -26,6 +26,7 @@ static void help()
|
||||
printf("For example: ./one_way_sample . ../c/scene_l.bmp ../c/scene_r.bmp\n");
|
||||
}
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
Mat DrawCorrespondences(const Mat& img1, const vector<KeyPoint>& features1, const Mat& img2,
|
||||
|
||||
@@ -150,7 +150,7 @@ int main()
|
||||
|
||||
|
||||
ChessBoardGenerator::ChessBoardGenerator(const Size& _patternSize) : sensorWidth(32), sensorHeight(24),
|
||||
squareEdgePointsNum(200), min_cos(sqrt(2.f)*0.5f), cov(0.5),
|
||||
squareEdgePointsNum(200), min_cos(std::sqrt(2.f)*0.5f), cov(0.5),
|
||||
patternSize(_patternSize), rendererResolutionMultiplier(4), tvec(Mat::zeros(1, 3, CV_32F))
|
||||
{
|
||||
Rodrigues(Mat::eye(3, 3, CV_32F), rvec);
|
||||
@@ -275,7 +275,7 @@ Mat cv::ChessBoardGenerator::generageChessBoard(const Mat& bg, const Mat& camMat
|
||||
|
||||
Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs, vector<Point2f>& corners) const
|
||||
{
|
||||
cov = min(cov, 0.8);
|
||||
cov = std::min(cov, 0.8);
|
||||
double fovx, fovy, focalLen;
|
||||
Point2d principalPoint;
|
||||
double aspect;
|
||||
@@ -296,7 +296,7 @@ Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const
|
||||
Point3f pb1, pb2;
|
||||
generateBasis(pb1, pb2);
|
||||
|
||||
float cbHalfWidth = static_cast<float>(norm(p) * sin( min(fovx, fovy) * 0.5 * CV_PI / 180));
|
||||
float cbHalfWidth = static_cast<float>(norm(p) * sin( std::min(fovx, fovy) * 0.5 * CV_PI / 180));
|
||||
float cbHalfHeight = cbHalfWidth * patternSize.height / patternSize.width;
|
||||
|
||||
vector<Point3f> pts3d(4);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
int maskSize0 = CV_DIST_MASK_5;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
static void help()
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/nonfree/nonfree.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
static void help()
|
||||
|
||||
@@ -57,7 +57,7 @@ static void readTrainFilenames( const string& filename, string& dirName, vector<
|
||||
|
||||
size_t pos = filename.rfind('\\');
|
||||
char dlmtr = '\\';
|
||||
if (pos == String::npos)
|
||||
if (pos == string::npos)
|
||||
{
|
||||
pos = filename.rfind('/');
|
||||
dlmtr = '/';
|
||||
|
||||
@@ -25,14 +25,14 @@ int main(int, char* [])
|
||||
curr.convertTo(curr64f, CV_64F);
|
||||
|
||||
Point2d shift = phaseCorrelate(prev64f, curr64f, hann);
|
||||
double radius = cv::sqrt(shift.x*shift.x + shift.y*shift.y);
|
||||
double radius = std::sqrt(shift.x*shift.x + shift.y*shift.y);
|
||||
|
||||
if(radius > 5)
|
||||
{
|
||||
// draw a circle and line indicating the shift direction...
|
||||
Point center(curr.cols >> 1, curr.rows >> 1);
|
||||
cv::circle(frame, center, (int)radius, cv::Scalar(0, 255, 0), 3, CV_AA);
|
||||
cv::line(frame, center, Point(center.x + (int)shift.x, center.y + (int)shift.y), cv::Scalar(0, 255, 0), 3, CV_AA);
|
||||
circle(frame, center, (int)radius, Scalar(0, 255, 0), 3, CV_AA);
|
||||
line(frame, center, Point(center.x + (int)shift.x, center.y + (int)shift.y), Scalar(0, 255, 0), 3, CV_AA);
|
||||
}
|
||||
|
||||
imshow("phase shift", frame);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
static void help()
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
const char* helphelp =
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/nonfree/features2d.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
void readme();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/nonfree/features2d.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
void readme();
|
||||
|
||||
@@ -18,8 +18,8 @@ void detectAndDisplay( Mat frame );
|
||||
|
||||
/** Global variables */
|
||||
//-- Note, either copy these two files from opencv/data/haarscascades to your current folder, or change these locations
|
||||
String face_cascade_name = "haarcascade_frontalface_alt.xml";
|
||||
String eyes_cascade_name = "haarcascade_eye_tree_eyeglasses.xml";
|
||||
string face_cascade_name = "haarcascade_frontalface_alt.xml";
|
||||
string eyes_cascade_name = "haarcascade_eye_tree_eyeglasses.xml";
|
||||
CascadeClassifier face_cascade;
|
||||
CascadeClassifier eyes_cascade;
|
||||
string window_name = "Capture - Face detection";
|
||||
|
||||
@@ -17,8 +17,8 @@ using namespace cv;
|
||||
void detectAndDisplay( Mat frame );
|
||||
|
||||
/** Global variables */
|
||||
String face_cascade_name = "lbpcascade_frontalface.xml";
|
||||
String eyes_cascade_name = "haarcascade_eye_tree_eyeglasses.xml";
|
||||
string face_cascade_name = "lbpcascade_frontalface.xml";
|
||||
string eyes_cascade_name = "haarcascade_eye_tree_eyeglasses.xml";
|
||||
CascadeClassifier face_cascade;
|
||||
CascadeClassifier eyes_cascade;
|
||||
string window_name = "Capture - Face detection";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
#include <cctype>
|
||||
|
||||
#include "cvconfig.h"
|
||||
#include "opencv2/core/core.hpp"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
using namespace cv::gpu;
|
||||
|
||||
|
||||
@@ -28,17 +28,17 @@ void detectAndDraw( Mat& img,
|
||||
cv::ocl::OclCascadeClassifier& cascade, CascadeClassifier& nestedCascade,
|
||||
double scale);
|
||||
|
||||
String cascadeName = "../../../data/haarcascades/haarcascade_frontalface_alt.xml";
|
||||
string cascadeName = "../../../data/haarcascades/haarcascade_frontalface_alt.xml";
|
||||
|
||||
int main( int argc, const char** argv )
|
||||
{
|
||||
CvCapture* capture = 0;
|
||||
Mat frame, frameCopy, image;
|
||||
const String scaleOpt = "--scale=";
|
||||
const string scaleOpt = "--scale=";
|
||||
size_t scaleOptLen = scaleOpt.length();
|
||||
const String cascadeOpt = "--cascade=";
|
||||
const string cascadeOpt = "--cascade=";
|
||||
size_t cascadeOptLen = cascadeOpt.length();
|
||||
String inputName;
|
||||
string inputName;
|
||||
|
||||
help();
|
||||
cv::ocl::OclCascadeClassifier cascade;
|
||||
|
||||
Reference in New Issue
Block a user