/************************************************************************ Copyright (C) 2015-2020. File name:Author:Greenapple qq:361348440 EMail: [email protected] Version: V1.0 date:2015/3/15 description:stl vector usage Others: no modification:1.vector<vect Or<int>> 2. Dimension reaches 3 Dimension 1. 2015/3/15: First written and completed. /#include <iostream> #include < vector> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/ imgproc/imgproc.hpp>using namespace Std;const int Total_num=4;const int DIM=3;VECTOR<VECTOR<INT>>VEC_ Pt;void readdata3dims () {freopen ("Input_3.txt", "R", stdin); for (int i=0;i<total_num;++i) {//int *temp=new int [DIM] ;//int temp[dim];vector<int> vec_temp;for (int j=0;j<dim;++j) {int Tmp;cin>>tmp;vec_temp.push_back ( TMP);//cout<<vec_temp[j]<< "";} Cout<<endl;vec_pt.push_back (vec_temp);} Fclose (stdin);} int main () {readdata3dims (); int vec_size=static_cast<int> (Vec_pt.size ());cv::mat_<float> Vec (Vec_size, DIM); Vec.setto (0); for (int y=0;y<vec.rows;++y) {for (int x=0;x<vec.cols;++x) {vector<int> vec_tmp;vec_tmp =vec_pt[y];vec (y,x) =vec_tmp[x];} Show vec;for (int y=0;y<vec.rows;++y) {for (int x=0;x<vec.cols;++x) {Cout<<vec (y,x) << "";} Cout<<endl;} return 0;}
Vector<vector<int>>