OpenCV中文网站

 找回密码
 立即注册
搜索
热搜: 安装 配置
查看: 4202|回复: 2

显示XML格式文件内容时出错

[复制链接]
发表于 2010-6-23 09:59:39 | 显示全部楼层 |阅读模式
在调试《learning opencv》的例3_19
时,编译成功,但是执行时,出现下面的异常:
Example3_19.exe 中的 0x75119617 处最可能的异常: Microsoft C++ 异常: 内存位置 0x0026cec0 处的 cv::Exception。
Example3_19.exe 中的 0x75119617 处未处理的异常: Microsoft C++ 异常: 内存位置 0x0026cec0 处的 cv::Exception。
程序“[3540] Example3_19.exe: 本机”已退出,返回值为 -1073741510 (0xc000013a)。

如何解决?

例题的源代码:
  1. #include "stdafx.h"
  2. #include "cv.h"
  3. #include "highgui.h"
  4. int _tmain(int argc, _TCHAR* argv[])
  5. {
  6.         CvFileStorage* fs=cvOpenFileStorage("cfg.xml",0,CV_STORAGE_READ);
  7.         int frame_count=cvReadIntByName(fs,0,"frame_count",5);
  8.         CvSeq* s=cvGetFileNodeByName(fs,0,"frame_size")->data.seq;
  9.         int frame_width=cvReadInt((CvFileNode*)cvGetSeqElem(s,0));
  10.         int frame_height=cvReadInt((CvFileNode*)cvGetSeqElem(s,1));
  11.         CvMat* color_cvt_matrix=(CvMat*)cvReadByName(fs,0,"color_cvt_matrix");
  12.         cvReleaseFileStorage(&fs);
  13.         return 0;
  14. }
复制代码

cfg.xml文件 我放在当前例子文件目录下。
cfg.xml的内容如下:
  1. <?xml version=&quot;2.0&quot;?>
  2. <opencv_storage>
  3. <frame_count>10</frame_count>
  4. <frame_size>320 200</frame_size>
  5. <color_cvt_matrix type_id=&quot;open_cv_matrix>
  6. <rows>3</rows>
  7. <cols>3</cols>
  8. <dt>f</dt>
  9. <data>...</data>
  10. </color_cvt_matrix>
  11. </opencv_storage>
复制代码
回复

使用道具 举报

发表于 2011-5-20 13:30:08 | 显示全部楼层

显示XML格式文件内容时出错

怎么解决呀。
回复 支持 反对

使用道具 举报

发表于 2011-7-22 14:14:53 | 显示全部楼层

显示XML格式文件内容时出错

找下源码,一般可能是数据类型或者是数据结构不匹配~~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|OpenCV中文网站

GMT+8, 2024-4-27 23:38 , Processed in 0.009392 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表