使用 cv::fileStorage 保存双变量 [英] saving a double variable with cv::fileStorage

查看:78
本文介绍了使用 cv::fileStorage 保存双变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行相机校准的校准程序.我想将校准结果保存在 YML 文件中,该文件可以正常工作,除非我尝试保存 重新投影错误,这是我所做的双值:

I have a calibration program that run the camera calibration. I want to save the result of the calibration in a YML file which works without any problem except when I try to save the reprojection error which is a double value here what I did:

cv::FileStorage fs= cv::FileStorage("calibration_result.yml",cv::FileStorage::WRITE); /*creating the storage file for the calibration results */

.......................................................


this->fs << "the camera matrix is "<<this->cameraMatrix;
.....................................................................
        this->fs<< "the number of used frames is "<<this->actualnumberOfFrames;
        ///this->fs<< " the reprojection error " << this->reprojectionError;   when I activate this line the storage stops at the **actualnumberOfFrames**
        this->fs<<"the used resolution is " << this->theFrameSIZE;
        this->fs << "used flags in the calirbation function" << this->flagsName;
        this->fs<<"the distortion Coefficients are "<< this->distortionCoeff;
        this->fs<<"the rotation vector is "<< this->rvec;
        this->fs <<"the tangiantiale vector" << this->tvecs;
......................................................

我仔细检查了变量值,没问题,我真的找到了结果文件中的值!

I double checked the variable value it's fine and I really ned the value in the result file !

知道如何解决这个问题吗?提前感谢您的帮助!

any Idea how I may solve this ? thanks in advance for any help !

推荐答案

您是否尝试过删除姓名开头的空格?

Have you tried deleting the whitespace at the start of your name?

来自:

this->fs<< " the reprojection error " << this->reprojectionError;   

致:

this->fs<< "the reprojection error " << this->reprojectionError;

这篇关于使用 cv::fileStorage 保存双变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆