Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Marker pose calculation with solvepnp

Hi,

I'm trying to get my rectangular marker pose via the solvepnp() function. It just needs to detect the marker pose, it doesn't need to place an object on top of it. Opencv gives the next information about this function:

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

I believe that the imagePoints array are the corners of my rectangular marker. And the cameraMatrix and distCoeffs have something to do with the camera parameters? I have already calibrated my camera with the openCV sample program, so I have a parameter xml file, can I do something with this? The rvec and tvec are offcours the rotation and translation vectors and via Rodrigez() I can get the pose of the marker. But for the objectPoints array, I have no idee. and don't know what I have to do with it.

Can someone help me with this?

Thanks!