Ask Your Question
0

‘calibrateCamera’ is not a member of ‘cv’

asked 2013-04-15 08:22:56 -0500

Israelcp gravatar image

hi everyone. i have a problem calling calibrateCamera() in a simple code that i tried.

   vector<vector <Point3f> > objectPoints;
   vector<vector <Point2f> > imagePoints;
   Mat cameraMatrix;
   Size imageSize(320, 240); 
   Mat distCoeffs;
   vector<Mat> rvecs,tvecs;

  double x = cv::calibrateCamera(objectPoints,
                imagePoints,
                imageSize,
                cameraMatrix,
                distCoeffs,
                rvecs,tvecs,
                0);

sadly i'm getting this response from the g++

fsd.cpp: In function ‘int main(int, char**)’: fsd.cpp:60:14: error: ‘calibrateCamera’ is not a member of ‘cv’

the cv:: is not needed because i typed in the head ‘using namespace cv;‘

so i tried to remove the ‘cv::‘ then i got

‘calibrateCamera’ was not declared in this scope

thanks in advance!!!

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
1

answered 2013-04-15 10:02:13 -0500

berak gravatar image

you might be missing the header:

#include "opencv2/calib3d/calib3d.hpp"
edit flag offensive delete link more

Comments

Exactly what I meant. Forgot to actually change the text when copying :) Adapted my answer.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-15 10:33:48 -0500 )edit
2

answered 2013-04-15 10:00:48 -0500

updated 2013-04-15 10:33:11 -0500

The function is declared into the calib3d library. Be sure to have done the followign things:

  • Include the calib3d dll file in the linker options of your project.
  • Add #include "opencv2/calib3d/calib3d.hpp" to the top of your project.

If this is all done, then the function should be recognized. Also know that this is included in the opencv2 interface, namely the C++ interface.

The C - style function is called cv.CalibrateCamera2

More information on : http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#calibratecamera

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-04-15 08:22:56 -0500

Seen: 511 times

Last updated: Apr 15 '13