refactored stitching module
This commit is contained in:
@@ -42,11 +42,24 @@
|
||||
#include "precomp.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
namespace cv
|
||||
namespace
|
||||
{
|
||||
template<typename _Tp> static inline bool
|
||||
decomposeCholesky(_Tp* A, size_t astep, int m)
|
||||
{
|
||||
if (!Cholesky(A, astep, m, 0, 0, 0))
|
||||
return false;
|
||||
astep /= sizeof(A[0]);
|
||||
for (int i = 0; i < m; ++i)
|
||||
A[i*astep + i] = (_Tp)(1./A[i*astep + i]);
|
||||
return true;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void focalsFromHomography(const Mat& H, double &f0, double &f1, bool &f0_ok, bool &f1_ok)
|
||||
|
||||
void cv::focalsFromHomography(const Mat& H, double &f0, double &f1, bool &f0_ok, bool &f1_ok)
|
||||
{
|
||||
CV_Assert(H.type() == CV_64F && H.size() == Size(3, 3));
|
||||
|
||||
@@ -77,8 +90,8 @@ void focalsFromHomography(const Mat& H, double &f0, double &f1, bool &f0_ok, boo
|
||||
}
|
||||
|
||||
|
||||
void estimateFocal(const vector<ImageFeatures> &features, const vector<MatchesInfo> &pairwise_matches,
|
||||
vector<double> &focals)
|
||||
void cv::estimateFocal(const vector<ImageFeatures> &features, const vector<MatchesInfo> &pairwise_matches,
|
||||
vector<double> &focals)
|
||||
{
|
||||
const int num_images = static_cast<int>(features.size());
|
||||
focals.resize(num_images);
|
||||
@@ -118,22 +131,7 @@ void estimateFocal(const vector<ImageFeatures> &features, const vector<MatchesIn
|
||||
}
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
template<typename _Tp> static inline bool
|
||||
decomposeCholesky(_Tp* A, size_t astep, int m)
|
||||
{
|
||||
if (!Cholesky(A, astep, m, 0, 0, 0))
|
||||
return false;
|
||||
astep /= sizeof(A[0]);
|
||||
for (int i = 0; i < m; ++i)
|
||||
A[i*astep + i] = (_Tp)(1./A[i*astep + i]);
|
||||
return true;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
bool calibrateRotatingCamera(const vector<Mat> &Hs, Mat &K)
|
||||
bool cv::calibrateRotatingCamera(const vector<Mat> &Hs, Mat &K)
|
||||
{
|
||||
int m = static_cast<int>(Hs.size());
|
||||
CV_Assert(m >= 1);
|
||||
@@ -183,5 +181,3 @@ bool calibrateRotatingCamera(const vector<Mat> &Hs, Mat &K)
|
||||
K = W.t();
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace cv
|
||||
|
||||
Reference in New Issue
Block a user