0

As a newbie I'm trying calculate pose of an planar object using OpenCV's solvePnP. Howeve, I see a weird output. The axes I draw always draws axes on the corner of my frame. To draw my axis I use:

drawFrameAxes(frame_copy, cameraMatrix, distanceCoeffisions, rvec, tvec, length); The output I get is as follows:

P.s. (X:red, Y: green, Z: blue)

output of my code output of my code_highlight

I don't have any depth information I am not sure if this is true but to obtain 3D points I use inliers and define the z coordinate as 0.

Points.push_back(Point3f(inliers[i].pt.x, inliers[i].pt.y, 0));

So what could be the problem, any resource pointers or suggestions is my guest.

Solved the problem

Solution : Fixed camera calibration and problem solved.

Thanks!

lexi
  • 46
  • 5
  • Where are the axis supposed to be drawn? Why is it a problem that they are located where they are? – Christopher Hamkins Oct 22 '21 at 13:17
  • It supposed to be on top of the hand-drawn chessboard. Yet I solved the problem, my camera calibration was faulty therefore axes drawn on to wrong place. After using correct calibration parameters it drawn on to correct place. – lexi Nov 05 '21 at 12:52

0 Answers0