LoginSignup
2
1

More than 5 years have passed since last update.

OpenCV3のformatでMATLAB向けの出力をする

Posted at

こちらの記事のようにOpenCV3からformatがMATLABに対応したらしいのですが,FMT_MATLABを指定するとMATLABでは読めない形式で吐きます.

そのうち修正されるでしょうが,次のように書くととりあえずMATLABで読める形式で出力できます.

cv::Mat matrix = cv::Mat::eye(3, 3, CV_64F);
std::ofstream ofs("save.m");
ofs << "matrix = " << cv::format(matrix, cv::Formatter::FMT_DEFAULT) << ";" << std::endl << std::endl;
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1