#include#include int main() { cv::Mat img = cv::imread("image.jpg"); // use img for processing img.release(); // release memory return 0; }
#includeIn this example, we create an array of 3 Mat objects and load 3 different image files into them. We then use the images for some processing and release the memory for all 3 images using the Mat::release function. This code also uses the OpenCV library. Based on the use of the OpenCV library, it can be concluded that the package/library for these examples is OpenCV.#include int main() { cv::Mat imgs[3]; for(int i=0; i<3; i++) { imgs[i] = cv::imread("image"+i+".jpg"); // use imgs[i] for processing } cv::Mat::release(&imgs, 3); // release memory for all 3 images return 0; }