SCIK Ranger3得到了3D图像数据以二进制格式保存到了计算机中,将二进制文件读取成文本文件的格式,读取后数据有问题

计算机从相机中得到了两个文件
1.包含图像数据的二进制文件
2.用于描述二进制文件的 XML 文件

图片说明

其中xml文件内容如下:

图片说明

我将数据读出来,发现有些数据特别大,有些又特别小

图片说明

图片说明

请问需要怎么改进

代码如下:

#include<iostream>
#include <fstream>
#include <string>
#include<vector>
using namespace std;

void DataRead_CPPMode(string path);
int main()
{
    string path;//文件路径
    path = "img-0.dat";
    DataRead_CPPMode(path);
    system("pause");
    return 0;
}


/*
读二进制文件
path: 文件路径
*/
void DataRead_CPPMode(string path)
{
    //每次读取3个
    double pos_in[3];

    ifstream infile(path, ios::binary);
    if (!infile)
    {
        cout << "读取文件失败" << endl;
        return;
    }

    //写出
    ofstream outfile("dianyun.txt");
    if (!outfile)
    {
        cerr << "open error!" << endl;
        exit(1);
    }

    while (!infile.eof())
    {
        infile.read((char*)pos_in, 3 * sizeof(double));
        for (int i = 0; i < 3; i++)
        {
            cout << pos_in[i] << "\t";
            outfile << pos_in[i] << "\t";
        }
        cout << endl;
        outfile << endl;
    }

    infile.close();
    outfile.close();
}

https://blog.csdn.net/qq_33474442/article/details/90142325