Domanda

I have been trying to calibrate my camera with OpenCV2 for a while now. I have searched all over the internet (especially the documentation) for some existing codes, which can give me the answer to my simple question, but have found nothing. It might be useful for the others !

I've followed this tutorial to generate a .xml file with all the stuff for the undistort function (here it is).

My questions are how should I use undistort(...) :

  • What matrix correspond to wich argument of undistort ?

  • Do I have to call undistort at each new frame (object : Mat) or there is a method in C++ in order to do it once on the camera (object : VideoCapture) ?

  • Is there any tool or OpenCV methods wich take .xml maxtrix and do it for us ?

PS: When we'll manage to do it, I'll upload some code here for the community, if such tool doesn't already exist.

È stato utile?

Soluzione

Answers inline:

  • What matrix correspond to wich argument of undistort ?
    • Match the names: Camera_Matrix in the XML is cameraMatrix in undistort, Distortion_Coefficients is distCoeffs k1, k2, p1, p2, k3
  • Do I have to call undistort at each new frame (object : Mat) or there is a method in C++ in order to do it once on the camera (object : VideoCapture) ?
    • AFAIK yes, there is not a way to push the undistortion into the camera's DSP
  • Is there any tool or OpenCV methods wich take .xml maxtrix and do it for us ?
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top