Ask Your Question
0

‘calibrateCamera’ is not a member of ‘cv’

asked Apr 15 '13

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!!!

Preview: (hide)

2 answers

Sort by » oldest newest most voted
1

answered Apr 15 '13

berak gravatar image

you might be missing the header:

#include "opencv2/calib3d/calib3d.hpp"
Preview: (hide)

Comments

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

StevenPuttemans gravatar imageStevenPuttemans (Apr 15 '13)edit
2

answered Apr 15 '13

updated Apr 15 '13

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

Preview: (hide)

Question Tools

Stats

Asked: Apr 15 '13

Seen: 2,310 times

Last updated: Apr 15 '13