class mrpt::vision::pnp::p3p

Chandra Mangipudi

11/08/16

#include </home/jlblanco/mrpt/libs/vision/src/pnp/p3p.h>

class p3p
{
public:
    // construction

    p3p(double fx, double fy, double cx, double cy);
    p3p(Eigen::MatrixXd cam_intrinsic);
    p3p(cv::Mat cameraMatrix);

    //
methods

    bool solve(cv::Mat& R, cv::Mat& tvec, const cv::Mat& opoints, const cv::Mat& ipoints);

    bool solve(
        Eigen::Ref<Eigen::Matrix3d> R,
        Eigen::Ref<Eigen::Vector3d> t,
        Eigen::MatrixXd obj_pts,
        Eigen::MatrixXd img_pts
        );

    int solve(
        double R [4][3][3],
        double t [4][3],
        double mu0,
        double mv0,
        double X0,
        double Y0,
        double Z0,
        double mu1,
        double mv1,
        double X1,
        double Y1,
        double Z1,
        double mu2,
        double mv2,
        double X2,
        double Y2,
        double Z2
        );

    bool solve(
        double R [3][3],
        double t [3],
        double mu0,
        double mv0,
        double X0,
        double Y0,
        double Z0,
        double mu1,
        double mv1,
        double X1,
        double Y1,
        double Z1,
        double mu2,
        double mv2,
        double X2,
        double Y2,
        double Z2,
        double mu3,
        double mv3,
        double X3,
        double Y3,
        double Z3
        );
};

Construction

p3p(double fx, double fy, double cx, double cy)

Constructor for p3p class using C.

p3p(Eigen::MatrixXd cam_intrinsic)

Constructor using Eigen matrix.

p3p(cv::Mat cameraMatrix)

Constructor using OpenCV matrix.

Methods

bool solve(
    cv::Mat& R,
    cv::Mat& tvec,
    const cv::Mat& opoints,
    const cv::Mat& ipoints
    )

Function to compute pose by P3P using OpenCV.

Parameters:

R

Rotation Matrix

tvec

Translation Vector

opoints

Object points

ipoints

Image points

Returns:

Success flag

int solve(
    double R [4][3][3],
    double t [4][3],
    double mu0,
    double mv0,
    double X0,
    double Y0,
    double Z0,
    double mu1,
    double mv1,
    double X1,
    double Y1,
    double Z1,
    double mu2,
    double mv2,
    double X2,
    double Y2,
    double Z2
    )

Function to compute pose from 3 points using C function.

Parameters:

R

Rotation Matrix

t

Translation Vector

mu0

x- coordinate of image point 1

mv0

y- coordinate of image point 1

X0

X- coordinate of object point 1

Y0

Y- coordinate of object point 1

Z0

Z- coordinate of object point 1

mu1

x- coordinate of image point 2

mv1

y- coordinate of image point 2

X1

X- coordinate of object point 2

Y1

Y- coordinate of object point 2

Z1

Z- coordinate of object point 2

mu2

x- coordinate of image point 3

mv2

y- coordinate of image point 3

X2

X- coordinate of object point 3

Y2

Y- coordinate of object point 3

Z2

Z- coordinate of object point 3

Returns:

Success flag

bool solve(
    double R [3][3],
    double t [3],
    double mu0,
    double mv0,
    double X0,
    double Y0,
    double Z0,
    double mu1,
    double mv1,
    double X1,
    double Y1,
    double Z1,
    double mu2,
    double mv2,
    double X2,
    double Y2,
    double Z2,
    double mu3,
    double mv3,
    double X3,
    double Y3,
    double Z3
    )

Function to compute pose from 4 points using C function.

Parameters:

R

Rotation Matrix

t

Translation Vector

mu0

x- coordinate of image point 1

mv0

y- coordinate of image point 1

X0

X- coordinate of object point 1

Y0

Y- coordinate of object point 1

Z0

Z- coordinate of object point 1

mu1

x- coordinate of image point 2

mv1

y- coordinate of image point 2

X1

X- coordinate of object point 2

Y1

Y- coordinate of object point 2

Z1

Z- coordinate of object point 2

mu2

x- coordinate of image point 3

mv2

y- coordinate of image point 3

X2

X- coordinate of object point 3

Y2

Y- coordinate of object point 3

Z2

Z- coordinate of object point 3

mu3

x- coordinate of image point 4

mv3

y- coordinate of image point 4

X3

X- coordinate of object point 4

Y3

Y- coordinate of object point 4

Z3

Z- coordinate of object point 4

Returns: