fix(*):fix Matrix-norm() & remove Eigen

This commit is contained in:
Messier
2019-09-04 14:01:28 +08:00
parent 08b3ccb401
commit d0fbd5b1cd
7 changed files with 103 additions and 600 deletions

View File

@@ -16,7 +16,6 @@
#include <vector>
#include <memory>
#include "eigen3/Eigen/Dense"
#include "Ctain/CtainBase.h"
#include <opencv2/core/core.hpp>
@@ -28,12 +27,10 @@ namespace models {
class Camera {
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
enum ModelType { KANNALA_BRANDT, MEI, PINHOLE, SCARAMUZZA };
class Parameters {
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
explicit Parameters(ModelType modelType);
Parameters(
@@ -72,39 +69,16 @@ class Camera {
const std::vector<std::vector<cv::Point3f> > &objectPoints,
const std::vector<std::vector<cv::Point2f> > &imagePoints) = 0;
// subEigen
virtual void estimateIntrinsics2(
const cv::Size &boardSize,
const std::vector<std::vector<cv::Point3f> > &objectPoints,
const std::vector<std::vector<cv::Point2f> > &imagePoints) = 0;
virtual void estimateExtrinsics(
const std::vector<cv::Point3f> &objectPoints,
const std::vector<cv::Point2f> &imagePoints,
cv::Mat &rvec, cv::Mat &tvec) const; // NOLINT
virtual void estimateExtrinsics2(
const std::vector<cv::Point3f> &objectPoints,
const std::vector<cv::Point2f> &imagePoints,
cv::Mat &rvec, cv::Mat &tvec) const; // NOLINT
// Lift points from the image plane to the projective space
virtual void liftProjective(
const Eigen::Vector2d &p, Eigen::Vector3d &P) const = 0; // NOLINT
// %output P
//subEigen
// Lift points from the image plane to the projective space
virtual void liftProjective(
const Ctain::Vector2d &p, Ctain::Vector3d &P) const = 0; // NOLINT
// %output P
// Projects 3D points to the image plane (Pi function)
virtual void spaceToPlane(
const Eigen::Vector3d &P, Eigen::Vector2d &p) const = 0; // NOLINT
// %output p
//subEigen
// Projects 3D points to the image plane (Pi function)
virtual void spaceToPlane(
const Ctain::Vector3d &P, Ctain::Vector2d &p) const = 0; // NOLINT
@@ -139,11 +113,7 @@ class Camera {
* \return euclidean distance in the plane
*/
double reprojectionDist(
const Eigen::Vector3d &P1, const Eigen::Vector3d &P2) const;
//subEigen
double reprojectionDist(
const Ctain::Vector3d &P1, const Ctain::Vector2d &P2) const;
const Ctain::Vector3d &P1, const Ctain::Vector3d &P2) const;
double reprojectionError(
const std::vector<std::vector<cv::Point3f> > &objectPoints,
@@ -151,26 +121,13 @@ class Camera {
const std::vector<cv::Mat> &rvecs, const std::vector<cv::Mat> &tvecs,
cv::OutputArray perViewErrors = cv::noArray()) const;
double reprojectionError(
const Eigen::Vector3d &P, const Eigen::Quaterniond &camera_q,
const Eigen::Vector3d &camera_t, const Eigen::Vector2d &observed_p) const;
//subEigen
double reprojectionError(
const Ctain::Vector3d &P, const Ctain::Quaterniond &camera_q,
const Ctain::Vector3d &camera_t, const Ctain::Vector2d &observed_p) const;
void projectPoints(
const std::vector<cv::Point3f> &objectPoints, const cv::Mat &rvec,
const cv::Mat &tvec, std::vector<cv::Point2f> &imagePoints) const; // NOLINT
//subEigen
void projectPoints2(
const std::vector<cv::Point3f> &objectPoints, const cv::Mat &rvec,
const cv::Mat &tvec, std::vector<cv::Point2f> &imagePoints) const; // NOLINT
const cv::Mat &tvec, std::vector<cv::Point2f> &imagePoints) const;
protected:
cv::Mat m_mask;
};