Working in OpenCV 4.5, C++, Visual Studio 2017, MFC, Windows 10
I am pre-processing video frames and storing them to a std::queue for later use. The bigger the queue is allowed to be the more efficient my program will be.
My question is how much memory is being taken up by this queue. I have read that a good way to measure the size in bytes of a Mat is using the formula
size_t sizeInBytes = mat.step[0] * mat.rows;
Using that formula on a Mat that has 1080 rows, 1920 columns, and 3 channels I get a value of 6220800 bytes (5.9 MB). If I multiply that by the 200 frames that I have stored in the queue on my test machine I end up with 1186.52 GB. That does not sound right. My machine has 32 GB RAM. Is the std::queue being written to hard drive? Or am I wrong in how I calculated the size in bytes of a Mat?
Ed