#include<opencv2/opencv.hpp> #include<iostream> #include <vector> int main(int argc, char** argv) { cv::Mat src = (cv::Mat_<double>(4, 3) << 2, -10, 5, -11, 10, 20, 30, 88, 1,11,22,33); std::cerr << src << std::endl<< std::endl; cv::Mat dst; cv::transpose(src, dst); //转置 std::cerr << dst << std::endl << std::endl; cv::waitKey(0); return 0; }