When I setting a cv::Mat object with large width and height, the code would run exception... or print "bgModel.size != tsize." And when I lower width or height, print "bgModel.size == tsize." It seems that cv::Mat has a size limitation. Is there any method that can modify limitations?
software info. : windows 10 OS, Visual Studio 2015, OpenCV 2.4.13.5 hardware info. : i7-9700 CPU, 64GB Ram.
The C++ Code below:
int main()
{
int nWidth = 13529;
int nHeight = 10198;
unsigned long long int tSize = static_cast<long long int>(nWidth)*static_cast<long long int>(nHeight)*static_cast<long long int>(25);
try
{
cv::Mat bgModel;
bgModel.create(1, nHeight*nWidth*25, CV_32F);
if (bgModel.cols*bgModel.rows == tSize)
{
cout << "bgModel.size == tsize" << endl;
}
else
{
cout << "bgModel.size != tsize" << endl;
}
bgModel.release();
}
catch (...)
{
cout << "thrown exception...." << endl;
}
return 0;
}