Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

camera calibration:a lot of undefined reference error

Hey all!

I am trying to do the camera calibration, because i need a calibration file in XML or YML format. I have read the official "Camera calibration with OpenCV" tutorial, link: link text I tried to run the code in terminal with the following command: "gcc camera_calibration.cpp" I also tried to run it with the Geany IDE, but I got the following errors:

g++ -Wall -o "camera_calibration" "camera_calibration.cpp" (in directory: /home/mirind4/DiplomaMSC/OpenCV/opencv-2.4.10/samples/cpp/tutorial_code/calib3d/camera_calibration)
/tmp/ccodHJGb.o: In function `cv::operator<<(cv::FileStorage&, char const*)':
camera_calibration.cpp:(.text+0x43): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
/tmp/ccodHJGb.o: In function `cv::operator<<(cv::FileStorage&, char*)':
camera_calibration.cpp:(.text+0xdc): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
/tmp/ccodHJGb.o: In function `main':
camera_calibration.cpp:(.text+0x5aa): undefined reference to `cv::FileStorage::FileStorage(std::string const&, int, std::string const&)'
camera_calibration.cpp:(.text+0x5c8): undefined reference to `cv::FileStorage::isOpened() const'
camera_calibration.cpp:(.text+0x632): undefined reference to `cv::FileStorage::operator[](char const*) const'
camera_calibration.cpp:(.text+0x65a): undefined reference to `cv::FileStorage::release()'
camera_calibration.cpp:(.text+0x983): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
camera_calibration.cpp:(.text+0x99c): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
camera_calibration.cpp:(.text+0x9ba): undefined reference to `cv::flip(cv::_InputArray const&, cv::_OutputArray const&, int)'
camera_calibration.cpp:(.text+0xa35): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
camera_calibration.cpp:(.text+0xa57): undefined reference to `cv::findChessboardCorners(cv::_InputArray const&, cv::Size_<int>, cv::_OutputArray const&, int)'
camera_calibration.cpp:(.text+0xa71): undefined reference to `cv::SimpleBlobDetector::Params::Params()'
camera_calibration.cpp:(.text+0xa90): undefined reference to

To be honest, these errors are only about the 25% of total error messages, but I do not want to "spam" this post with them, because in my opinion the problem lies somewhere else....

Some Additional Informations:

My inVID.xml file:

<?xml version="1.0"?>
<opencv_storage>
<Settings>
  <!-- Number of inner corners per a item row and column. (square, circle) -->
  <BoardSize_Width> 9</BoardSize_Width>
  <BoardSize_Height>6</BoardSize_Height>

  <!-- The size of a square in some user defined metric system (pixel, millimeter)-->
  <Square_Size>25</Square_Size>

  <!-- The type of input used for camera calibration. One of: CHESSBOARD CIRCLES_GRID ASYMMETRIC_CIRCLES_GRID -->
  <Calibrate_Pattern>"CHESSBOARD"</Calibrate_Pattern>

  <!-- The input to use for calibration. 
        To use an input camera -> give the ID of the camera, like "1"
        To use an input video  -> give the path of the input video, like "/tmp/x.avi"
        To use an image list   -> give the path to the XML or YAML file containing the list of the images, like "/tmp/circles_list.xml"
        -->
  <Input>"images/CameraCalibraation/VID5/VID5.xml"</Input>
  <!--  If true (non-zero) we flip the input images around the horizontal axis.-->
  <Input_FlipAroundHorizontalAxis>0</Input_FlipAroundHorizontalAxis>

  <!-- Time delay between frames in case of camera. -->
  <Input_Delay>100</Input_Delay>    

  <!-- How many frames to use, for calibration. -->
  <Calibrate_NrOfFrameToUse>25</Calibrate_NrOfFrameToUse>
  <!-- Consider only fy as a free parameter, the ratio fx/fy stays the same as in the input cameraMatrix. 
       Use or not setting. 0 - False Non-Zero - True-->
  <Calibrate_FixAspectRatio> 1 </Calibrate_FixAspectRatio>
  <!-- If true (non-zero) tangential distortion coefficients  are set to zeros and stay zero.-->
  <Calibrate_AssumeZeroTangentialDistortion>1</Calibrate_AssumeZeroTangentialDistortion>
  <!-- If true (non-zero) the principal point is not changed during the global optimization.-->
  <Calibrate_FixPrincipalPointAtTheCenter> 1 </Calibrate_FixPrincipalPointAtTheCenter>

  <!-- The name of the output log file. -->
  <Write_outputFileName>"out_camera_data.xml"</Write_outputFileName>
  <!-- If true (non-zero) we write to the output file the feature points.-->
  <Write_DetectedFeaturePoints>1</Write_DetectedFeaturePoints>
  <!-- If true (non-zero) we write to the output file the extrinsic camera parameters.-->
  <Write_extrinsicParameters>1</Write_extrinsicParameters>
  <!-- If true (non-zero) we show after calibration the undistorted images.-->
  <Show_UndistortedImage>1</Show_UndistortedImage>

</Settings>
</opencv_storage>

And my vid.xml file:

<?xml version="1.0"?>
<opencv_storage>
<images>
images_log_c270/guvcview_image-2.jpg
images_log_c270/guvcview_image-3.jpg
images_log_c270/guvcview_image-4.jpg
images_log_c270/guvcview_image-5.jpg
images_log_c270/guvcview_image-6.jpg
images_log_c270/guvcview_image-7.jpg
images_log_c270/guvcview_image-8.jpg
images_log_c270/guvcview_image-9.jpg
images_log_c270/guvcview_image-10.jpg
images_log_c270/guvcview_image-11.jpg
images_log_c270/guvcview_image-12.jpg
images_log_c270/guvcview_image-13.jpg
</images>
</opencv_storage>

Could someone help me in this matter, please? I would appreciate it, Thanks in advance!

camera calibration:a lot of undefined reference error

Hey all!

I am trying to do the camera calibration, because i need a calibration file in XML or YML format. I have read the official "Camera calibration with OpenCV" tutorial, link: link text I tried to run the code in terminal with the following command: "gcc camera_calibration.cpp" I also tried to run it with the Geany IDE, but I got the following errors:

g++ -Wall -o "camera_calibration" "camera_calibration.cpp" (in directory: /home/mirind4/DiplomaMSC/OpenCV/opencv-2.4.10/samples/cpp/tutorial_code/calib3d/camera_calibration)
/tmp/ccodHJGb.o: In function `cv::operator<<(cv::FileStorage&, char const*)':
camera_calibration.cpp:(.text+0x43): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
/tmp/ccodHJGb.o: In function `cv::operator<<(cv::FileStorage&, char*)':
camera_calibration.cpp:(.text+0xdc): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
/tmp/ccodHJGb.o: In function `main':
camera_calibration.cpp:(.text+0x5aa): undefined reference to `cv::FileStorage::FileStorage(std::string const&, int, std::string const&)'
camera_calibration.cpp:(.text+0x5c8): undefined reference to `cv::FileStorage::isOpened() const'
camera_calibration.cpp:(.text+0x632): undefined reference to `cv::FileStorage::operator[](char const*) const'
camera_calibration.cpp:(.text+0x65a): undefined reference to `cv::FileStorage::release()'
camera_calibration.cpp:(.text+0x983): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
camera_calibration.cpp:(.text+0x99c): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
camera_calibration.cpp:(.text+0x9ba): undefined reference to `cv::flip(cv::_InputArray const&, cv::_OutputArray const&, int)'
camera_calibration.cpp:(.text+0xa35): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
camera_calibration.cpp:(.text+0xa57): undefined reference to `cv::findChessboardCorners(cv::_InputArray const&, cv::Size_<int>, cv::_OutputArray const&, int)'
camera_calibration.cpp:(.text+0xa71): undefined reference to `cv::SimpleBlobDetector::Params::Params()'
camera_calibration.cpp:(.text+0xa90): undefined reference to

To be honest, these errors are only about the 25% of total error messages, but I do not want to "spam" this post with them, because in my opinion the problem lies somewhere else....

Some Additional Informations:

My inVID.xml file:

<?xml version="1.0"?>
<opencv_storage>
<Settings>
  <!-- Number of inner corners per a item row and column. (square, circle) -->
  <BoardSize_Width> 9</BoardSize_Width>
  <BoardSize_Height>6</BoardSize_Height>

  <!-- The size of a square in some user defined metric system (pixel, millimeter)-->
  <Square_Size>25</Square_Size>

  <!-- The type of input used for camera calibration. One of: CHESSBOARD CIRCLES_GRID ASYMMETRIC_CIRCLES_GRID -->
  <Calibrate_Pattern>"CHESSBOARD"</Calibrate_Pattern>

  <!-- The input to use for calibration. 
        To use an input camera -> give the ID of the camera, like "1"
        To use an input video  -> give the path of the input video, like "/tmp/x.avi"
        To use an image list   -> give the path to the XML or YAML file containing the list of the images, like "/tmp/circles_list.xml"
        -->
  <Input>"images/CameraCalibraation/VID5/VID5.xml"</Input>
  <!--  If true (non-zero) we flip the input images around the horizontal axis.-->
  <Input_FlipAroundHorizontalAxis>0</Input_FlipAroundHorizontalAxis>

  <!-- Time delay between frames in case of camera. -->
  <Input_Delay>100</Input_Delay>    

  <!-- How many frames to use, for calibration. -->
  <Calibrate_NrOfFrameToUse>25</Calibrate_NrOfFrameToUse>
  <!-- Consider only fy as a free parameter, the ratio fx/fy stays the same as in the input cameraMatrix. 
       Use or not setting. 0 - False Non-Zero - True-->
  <Calibrate_FixAspectRatio> 1 </Calibrate_FixAspectRatio>
  <!-- If true (non-zero) tangential distortion coefficients  are set to zeros and stay zero.-->
  <Calibrate_AssumeZeroTangentialDistortion>1</Calibrate_AssumeZeroTangentialDistortion>
  <!-- If true (non-zero) the principal point is not changed during the global optimization.-->
  <Calibrate_FixPrincipalPointAtTheCenter> 1 </Calibrate_FixPrincipalPointAtTheCenter>

  <!-- The name of the output log file. -->
  <Write_outputFileName>"out_camera_data.xml"</Write_outputFileName>
  <!-- If true (non-zero) we write to the output file the feature points.-->
  <Write_DetectedFeaturePoints>1</Write_DetectedFeaturePoints>
  <!-- If true (non-zero) we write to the output file the extrinsic camera parameters.-->
  <Write_extrinsicParameters>1</Write_extrinsicParameters>
  <!-- If true (non-zero) we show after calibration the undistorted images.-->
  <Show_UndistortedImage>1</Show_UndistortedImage>

</Settings>
</opencv_storage>

And my vid.xml file:

<?xml version="1.0"?>
<opencv_storage>
<images>
images_log_c270/guvcview_image-2.jpg
images_log_c270/guvcview_image-3.jpg
images_log_c270/guvcview_image-4.jpg
images_log_c270/guvcview_image-5.jpg
images_log_c270/guvcview_image-6.jpg
images_log_c270/guvcview_image-7.jpg
images_log_c270/guvcview_image-8.jpg
images_log_c270/guvcview_image-9.jpg
images_log_c270/guvcview_image-10.jpg
images_log_c270/guvcview_image-11.jpg
images_log_c270/guvcview_image-12.jpg
images_log_c270/guvcview_image-13.jpg
</images>
</opencv_storage>

Could someone help me in this matter, please? I would appreciate it, Thanks in advance!

click to hide/show revision 3
retagged

updated 2015-04-10 08:08:00 -0600

berak gravatar image

camera calibration:a lot of undefined reference error

Hey all!

I am trying to do the camera calibration, because i need a calibration file in XML or YML format. I have read the official "Camera calibration with OpenCV" tutorial, link: link text I tried to run the code in terminal with the following command: "gcc camera_calibration.cpp" I also tried to run it with the Geany IDE, but I got the following errors:

g++ -Wall -o "camera_calibration" "camera_calibration.cpp" (in directory: /home/mirind4/DiplomaMSC/OpenCV/opencv-2.4.10/samples/cpp/tutorial_code/calib3d/camera_calibration)
/tmp/ccodHJGb.o: In function `cv::operator<<(cv::FileStorage&, char const*)':
camera_calibration.cpp:(.text+0x43): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
/tmp/ccodHJGb.o: In function `cv::operator<<(cv::FileStorage&, char*)':
camera_calibration.cpp:(.text+0xdc): undefined reference to `cv::operator<<(cv::FileStorage&, std::string const&)'
/tmp/ccodHJGb.o: In function `main':
camera_calibration.cpp:(.text+0x5aa): undefined reference to `cv::FileStorage::FileStorage(std::string const&, int, std::string const&)'
camera_calibration.cpp:(.text+0x5c8): undefined reference to `cv::FileStorage::isOpened() const'
camera_calibration.cpp:(.text+0x632): undefined reference to `cv::FileStorage::operator[](char const*) const'
camera_calibration.cpp:(.text+0x65a): undefined reference to `cv::FileStorage::release()'
camera_calibration.cpp:(.text+0x983): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
camera_calibration.cpp:(.text+0x99c): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
camera_calibration.cpp:(.text+0x9ba): undefined reference to `cv::flip(cv::_InputArray const&, cv::_OutputArray const&, int)'
camera_calibration.cpp:(.text+0xa35): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
camera_calibration.cpp:(.text+0xa57): undefined reference to `cv::findChessboardCorners(cv::_InputArray const&, cv::Size_<int>, cv::_OutputArray const&, int)'
camera_calibration.cpp:(.text+0xa71): undefined reference to `cv::SimpleBlobDetector::Params::Params()'
camera_calibration.cpp:(.text+0xa90): undefined reference to

To be honest, these errors are only about the 25% of total error messages, but I do not want to "spam" this post with them, because in my opinion the problem lies somewhere else....

Some Additional Informations:

My inVID.xml file:

<?xml version="1.0"?>
<opencv_storage>
<Settings>
  <!-- Number of inner corners per a item row and column. (square, circle) -->
  <BoardSize_Width> 9</BoardSize_Width>
  <BoardSize_Height>6</BoardSize_Height>

  <!-- The size of a square in some user defined metric system (pixel, millimeter)-->
  <Square_Size>25</Square_Size>

  <!-- The type of input used for camera calibration. One of: CHESSBOARD CIRCLES_GRID ASYMMETRIC_CIRCLES_GRID -->
  <Calibrate_Pattern>"CHESSBOARD"</Calibrate_Pattern>

  <!-- The input to use for calibration. 
        To use an input camera -> give the ID of the camera, like "1"
        To use an input video  -> give the path of the input video, like "/tmp/x.avi"
        To use an image list   -> give the path to the XML or YAML file containing the list of the images, like "/tmp/circles_list.xml"
        -->
  <Input>"images/CameraCalibraation/VID5/VID5.xml"</Input>
  <!--  If true (non-zero) we flip the input images around the horizontal axis.-->
  <Input_FlipAroundHorizontalAxis>0</Input_FlipAroundHorizontalAxis>

  <!-- Time delay between frames in case of camera. -->
  <Input_Delay>100</Input_Delay>    

  <!-- How many frames to use, for calibration. -->
  <Calibrate_NrOfFrameToUse>25</Calibrate_NrOfFrameToUse>
  <!-- Consider only fy as a free parameter, the ratio fx/fy stays the same as in the input cameraMatrix. 
       Use or not setting. 0 - False Non-Zero - True-->
  <Calibrate_FixAspectRatio> 1 </Calibrate_FixAspectRatio>
  <!-- If true (non-zero) tangential distortion coefficients  are set to zeros and stay zero.-->
  <Calibrate_AssumeZeroTangentialDistortion>1</Calibrate_AssumeZeroTangentialDistortion>
  <!-- If true (non-zero) the principal point is not changed during the global optimization.-->
  <Calibrate_FixPrincipalPointAtTheCenter> 1 </Calibrate_FixPrincipalPointAtTheCenter>

  <!-- The name of the output log file. -->
  <Write_outputFileName>"out_camera_data.xml"</Write_outputFileName>
  <!-- If true (non-zero) we write to the output file the feature points.-->
  <Write_DetectedFeaturePoints>1</Write_DetectedFeaturePoints>
  <!-- If true (non-zero) we write to the output file the extrinsic camera parameters.-->
  <Write_extrinsicParameters>1</Write_extrinsicParameters>
  <!-- If true (non-zero) we show after calibration the undistorted images.-->
  <Show_UndistortedImage>1</Show_UndistortedImage>

</Settings>
</opencv_storage>

And my vid.xml file:

<?xml version="1.0"?>
<opencv_storage>
<images>
images_log_c270/guvcview_image-2.jpg
images_log_c270/guvcview_image-3.jpg
images_log_c270/guvcview_image-4.jpg
images_log_c270/guvcview_image-5.jpg
images_log_c270/guvcview_image-6.jpg
images_log_c270/guvcview_image-7.jpg
images_log_c270/guvcview_image-8.jpg
images_log_c270/guvcview_image-9.jpg
images_log_c270/guvcview_image-10.jpg
images_log_c270/guvcview_image-11.jpg
images_log_c270/guvcview_image-12.jpg
images_log_c270/guvcview_image-13.jpg
</images>
</opencv_storage>

Could someone help me in this matter, please? I would appreciate it, Thanks in advance!