6 #include <boost/format.hpp>
7 #include <opencv2/opencv.hpp>
12 std::stringstream& getStream();
15 template <
int n>
void vectorToStrStream(std::stringstream& ss,
const cv::Vec<double, n>& v)
18 (n == 2) ss << boost::format(
" %f, %f\n") % v(0) % v(1);
20 (n == 3) ss << boost::format(
" %f, %f, %f\n") % v(0) % v(1) % v(2);
23 template <
int n> std::string vectorToStr(
const cv::Vec<double, n>& v)
26 vectorToStrStream(ss, v);
30 template <
int n>
void writeVector(
const cv::Vec<double, n>& v)
32 vectorToStrStream(getStream(), v);
35 void matrixToStrStream(std::stringstream& ss,
const std::string& name, cv::InputArray m);
36 std::string matrixToStr(
const std::string& name, cv::InputArray m);
38 void writeMatrix(
const std::string& name,
const cv::Mat& m);