calibrateCamera cameraMatrix and distCoeff inputs

asked 2018-05-17 08:21:33 -0500

ekuusi gravatar image

I'm trying to get started with OpenCV on my Node.js & Express backend using opencv4nodejs. It works, but I ran into issues with calibrateCamera. In the tutorial done in python, calibrateCamera is used by giving the inputs:

cv2.calibrateCamera(objpoints, imgpoints, gray.shape[::-1],None,None)

I've followed the tutorial and have my objpoints Point3 array, and imgpoints Point2 array, both of the same size as they should, as the third paramter I'm giving Size(756,1008) as per my image sizes. The problem comes in figuring out what to put in as calibrateMatrix and distCoeff, as they're required parameters and trying to put in null on them doesn't work.

Does anyone have experience with opencv4nodejs? Another related issue is that I'm not getting any error messages if I have faulty inputs, code execution just stops. Solving that would probably help a lot in figuring out what's going wrong with my efforts here.

Thanks for any help!

edit retag flag offensive close merge delete


Does anyone have experience with opencv4nodejs?

no, sorry. unsupported, 3rd party wrappers are entirely off-topc here.

we can try to help you with your cv2 problem, though. (but i think, you'll have to explain that better)

berak gravatar imageberak ( 2018-05-17 08:29:41 -0500 )edit

"what to put in as calibrateMatrix and distCoeff, as they're required parameters" -- no, those are the results.

please have a look at the tutorial

berak gravatar imageberak ( 2018-05-17 08:39:08 -0500 )edit

Thanks for the quick replies! I'll switch to running Python through a child process so I'll use a supported version. In case I can't troubleshoot this there I'll come back with more questions.

Thanks again!

ekuusi gravatar imageekuusi ( 2018-05-18 05:15:04 -0500 )edit