Skip to main content

Posts

Showing posts with the label Mat operator

OpenCV : Mat class method

You can get your mat object information (dimmension, rows, cols, size ....) and resize, reshape, copy Mat object by using Mat class method. 1. Get Information of Mat object cout << "dimmension : " << mat7 . dims << endl; cout << "rows : " << mat7 . rows << endl; cout << "columns : " << mat7 . cols << endl; cout << "size : " << mat7 . size () << endl << endl; cout << "number of total elements: " << mat7 .total() << endl; cout << "type :" << mat7 .type() << endl; cout << "depth :" << mat7 .depth() << endl; cout << "channels :" << mat7 .channels() << endl; 2. Resize Mat object Mat_ <int> mat10( 2 , 4 ); mat10 << 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ; mat10 .resize( 1 ); // resize to one row mat10 .resize( 2 ); // resize to two rows mat10 .resize( ...