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:
@@ -42,7 +42,6 @@
|
||||
|
||||
#include "precomp.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
namespace {
|
||||
@@ -79,8 +78,8 @@ void focalsFromHomography(const Mat& H, double &f0, double &f1, bool &f0_ok, boo
|
||||
v1 = -(h[0] * h[1] + h[3] * h[4]) / d1;
|
||||
v2 = (h[0] * h[0] + h[3] * h[3] - h[1] * h[1] - h[4] * h[4]) / d2;
|
||||
if (v1 < v2) std::swap(v1, v2);
|
||||
if (v1 > 0 && v2 > 0) f1 = sqrt(std::abs(d1) > std::abs(d2) ? v1 : v2);
|
||||
else if (v1 > 0) f1 = sqrt(v1);
|
||||
if (v1 > 0 && v2 > 0) f1 = std::sqrt(std::abs(d1) > std::abs(d2) ? v1 : v2);
|
||||
else if (v1 > 0) f1 = std::sqrt(v1);
|
||||
else f1_ok = false;
|
||||
|
||||
f0_ok = true;
|
||||
@@ -89,19 +88,19 @@ void focalsFromHomography(const Mat& H, double &f0, double &f1, bool &f0_ok, boo
|
||||
v1 = -h[2] * h[5] / d1;
|
||||
v2 = (h[5] * h[5] - h[2] * h[2]) / d2;
|
||||
if (v1 < v2) std::swap(v1, v2);
|
||||
if (v1 > 0 && v2 > 0) f0 = sqrt(std::abs(d1) > std::abs(d2) ? v1 : v2);
|
||||
else if (v1 > 0) f0 = sqrt(v1);
|
||||
if (v1 > 0 && v2 > 0) f0 = std::sqrt(std::abs(d1) > std::abs(d2) ? v1 : v2);
|
||||
else if (v1 > 0) f0 = std::sqrt(v1);
|
||||
else f0_ok = false;
|
||||
}
|
||||
|
||||
|
||||
void estimateFocal(const vector<ImageFeatures> &features, const vector<MatchesInfo> &pairwise_matches,
|
||||
vector<double> &focals)
|
||||
void estimateFocal(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,
|
||||
std::vector<double> &focals)
|
||||
{
|
||||
const int num_images = static_cast<int>(features.size());
|
||||
focals.resize(num_images);
|
||||
|
||||
vector<double> all_focals;
|
||||
std::vector<double> all_focals;
|
||||
|
||||
for (int i = 0; i < num_images; ++i)
|
||||
{
|
||||
@@ -114,7 +113,7 @@ void estimateFocal(const vector<ImageFeatures> &features, const vector<MatchesIn
|
||||
bool f0ok, f1ok;
|
||||
focalsFromHomography(m.H, f0, f1, f0ok, f1ok);
|
||||
if (f0ok && f1ok)
|
||||
all_focals.push_back(sqrt(f0 * f1));
|
||||
all_focals.push_back(std::sqrt(f0 * f1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,16 +142,16 @@ void estimateFocal(const vector<ImageFeatures> &features, const vector<MatchesIn
|
||||
}
|
||||
|
||||
|
||||
bool calibrateRotatingCamera(const vector<Mat> &Hs, Mat &K)
|
||||
bool calibrateRotatingCamera(const std::vector<Mat> &Hs, Mat &K)
|
||||
{
|
||||
int m = static_cast<int>(Hs.size());
|
||||
CV_Assert(m >= 1);
|
||||
|
||||
vector<Mat> Hs_(m);
|
||||
std::vector<Mat> Hs_(m);
|
||||
for (int i = 0; i < m; ++i)
|
||||
{
|
||||
CV_Assert(Hs[i].size() == Size(3, 3) && Hs[i].type() == CV_64F);
|
||||
Hs_[i] = Hs[i] / pow(determinant(Hs[i]), 1./3.);
|
||||
Hs_[i] = Hs[i] / std::pow(determinant(Hs[i]), 1./3.);
|
||||
}
|
||||
|
||||
const int idx_map[3][3] = {{0, 1, 2}, {1, 3, 4}, {2, 4, 5}};
|
||||
|
||||
Reference in New Issue
Block a user