Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/128.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ OpenCV相机校准解析错误。如何解决?_C++_Opencv_Camera_Configuration Files_Camera Calibration - Fatal编程技术网

C++ OpenCV相机校准解析错误。如何解决?

C++ OpenCV相机校准解析错误。如何解决?,c++,opencv,camera,configuration-files,camera-calibration,C++,Opencv,Camera,Configuration Files,Camera Calibration,我在这个链接中使用了OpenCV的摄像机校准源代码 在配置文件中,可以选择使用摄像头作为输入、视频文件或图像列表。因此我选择摄像头。所以我尝试创建一个配置文件 这是我的XML配置文件 <?xml version="1.0"?> <opencv_storage> <Settings> <!-- Number of inner corners per a item row and column. (square, circle) --> <Boa

我在这个链接中使用了OpenCV的摄像机校准源代码

在配置文件中,可以选择使用摄像头作为输入、视频文件或图像列表。因此我选择摄像头。所以我尝试创建一个配置文件

这是我的XML配置文件

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

9
6.
50
“棋盘”
3.
0
100
25
1.
1.
1.
“out\u camera\u data.xml”
1.
1.
1.
摄像机Id是3。运行代码时,我遇到了以下错误:
OpenCV错误:icvxmlpassetag中的解析错误


我不明白是什么问题。是棋盘大小吗?我应该如何选择BoardSize\u宽度和BoardSize\u高度?

对不起,没有。我错过了结尾。修改了配置文件。但我没有收到其他错误:不存在输入:检测到无效输入。请更新问题以包含新错误。我假设您正在使用一些示例代码加载配置文件,因为您收到拼写可疑的错误消息,如“不存在输入”?我是否应该发布新问题?现在问题解决了。现在没有错误。“0”表示可以。但它打开图像视图,却什么也不做。图像视图都是灰色的。没有显示棋盘。问题是什么?这听起来像是个新问题。