Size object type
Another template class that is very important and widely used in OpenCV is the template class for specifying the size of an image or rectangle—Size. This class adds two members, width and height, and the useful area() function. In the following sample, we can see a number of ways of using size:
Size s(100,100);
Mat img=Mat::zeros(s, CV_8UC1); // 100 by 100 single channel matrix
s.width= 200;
int area= s.area(); returns 100x200