最近学习opencv,敲了一下《opencv3入门经典》的一个程序,程序如下:
#include "stdafx.h"
#include "opencv2/opencv.hpp"
#include <iostream>
#include <time.h>
using namespace cv;
using namespace std;
int main()
{
FileStorage fs("test.yaml", FileStorage::WRITE);
fs << "frameCount" << 5;
time_t rawtime;
time(&rawtime);
fs << "calibrationDate" << asctime(localtime(&rawtime));
Mat cameraMatrix = (Mat_<double>(3, 3) << 1000, 0, 320, 0, 1000, 240, 0, 0, 1);
Mat distCeoffs = (Mat_<double>(5, 1) << 0.1, 0.01, -0.001, 0, 0);
fs << "cameraMatrix" << cameraMatrix << "distCoeffs" << distCeoffs;
fs << "features" << "[";
for (int i = 0; i < 3; i++)
{
int x = rand()