c++opencvopencv-solvepnp

OpenCV Explanation solvenpn


Can anyone give me more explanation about the opencv function solvepnp()? The opencv documentation says

bool cv::solvePnP   (
        InputArray      objectPoints,
        InputArray      imagePoints,
        InputArray      cameraMatrix,
        InputArray      distCoeffs,
        OutputArray     rvec,
        OutputArray     tvec,
        bool            useExtrinsicGuess = false,
        int             flags = SOLVEPNP_ITERATIVE)

I'm wondering what the objectPoints, imagePoints and cameraMatrix are. I have once calibrated my camera and have a parameter xml file from it, can i use this?


Solution

  • It is used when you have for example a 3D model of an object and you have a view of it in the real world, it will give you an approximate position and orientation of the camera towards the object. For example:

    You can find the rest at this link