简体   繁体   中英

I want to write some data into a .txt file using c++ / opencv

I want to save some information about every frame in a video to a .txt file.

The information could be like the current frame number, the position of the feature points etc,

I could only find ways to write it into a XML/YML file. Is it possible to write these into a .txt file? IF so, how ?

Thanks in advance!

you have to roll on your own implementation. The basic of c++ file streams are

#include <iostream>
#include <fstream>

using namespace std;

void writeSomething()
{
    ofstream outputfile;
    outputfile.open("data.txt");
    for (int i=0; i<10;i++)
        outputfile << i << endl;
}

Your question is not very clear, so you'd better edit it to be clear about what you exactly want to do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM