ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV's imread will load images as Mat. Unlike IplImage* the Mat object will automatically be released, once it goes out of the scope in which it was declared.

That being said using,

cv::Mat src = cv::imread('xyz.jpg', CV_LOAD_IMAGE_COLOR); src.release();

will also release the memory.