OpenCV Camera Calibration Parsing Error. How to solve it?
Im using the camera calibration source code from OpenCV in this link (http://docs.opencv.org/2.4/doc/tutori...)
In the configuration file may choose to use camera as an input, a video file or an image list.So I choose camera. So I tried to create a configuration file. Here’s my xml configuration 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>50</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>3</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>
The camera Id is 3. When run the code I got this error: OpenCV Error: Parsing error <C:/Calibration/CameraCalibration/config1.xml<16>: Preliminary end of the stream> in icvXMLParseTag
I dont understand what is the problem . Is it the chesssboard size? How should I chose the BoardSize_Width and BoardSize_Height? Any help? Or is there any bug in the code. In the cameraCalibration code im using this to read the settings:
Settings s;
const string inputSettingsFile = argc > 1 ? argv[1] :"C:/Calibration/Clibration/CameraCalibration1/config1.xml";
FileStorage fs(inputSettingsFile, FileStorage::READ); // Read the settings
I try to solve this problem for two days and still stuck as Im new in Camera Calibration and never done it before. Would really appreciate the help . Thanks
please show the whole file. it complained about
Preliminary end of the stream
ok edit it. I show the whole file now. Please check
-<opencv_storage>
<-- the minus sign is real ?no. Its not real, I changed it. Now I got this: Inexistent input: Invalid input detected. But I can see my camera is working and showing that ID is 3
ok, different error now. but i get same problem.
Yes. Because didnt save the whole config file. When I use the whole file got that Inexistent input: Invalid input detected.. Any help???