1 | initial version |
no, please don't use new
with cv::Mat, or raw pointers at all. (they stopped doing so in c++ in the 90's)
cv::Mat is already a smartpointer around the pixels, so passing around pointers to that will for sure wreck the internal refounts, sooner or later
instead, please use a std::vector , like this:
vector<Mat> imgs(5); // allocate 5 (empty) Mats
for (int i=0; i<5; i++) // load 5 images
imgs=imread(format("my_%d.jpg", i));
2 | No.2 Revision |
no, please don't use new
with cv::Mat, or raw pointers at all. (they stopped doing so in c++ in the 90's)
cv::Mat is already a smartpointer around the pixels, so passing around pointers to that will for sure wreck the internal refounts, sooner or later
instead, please use a std::vector , like this:
vector<Mat> imgs(5); // allocate 5 (empty) Mats
for (int i=0; i<5; i++) // load 5 images
imgs=imread(format("my_%d.jpg", i));
// no need to release() the mat's, this will be done automatically
3 | No.3 Revision |
no, please don't use new
with cv::Mat, or raw pointers at all. (they stopped doing so in c++ in the 90's)all.
cv::Mat is already a smartpointer around the pixels, so passing around pointers to that will for sure wreck the internal refounts, sooner or later
instead, please use a std::vector , like this:
vector<Mat> imgs(5); // allocate 5 (empty) Mats
for (int i=0; i<5; i++) // load 5 images
imgs=imread(format("my_%d.jpg", i));
// no need to release() the mat's, this will be done automatically
4 | No.4 Revision |
no, please don't use new
with cv::Mat, or raw pointers at all.
cv::Mat is already a smartpointer around the pixels, so passing around pointers to that will for sure wreck the internal refounts, sooner or later
instead, please use a std::vector , like this:
vector<Mat> imgs(5); // allocate 5 (empty) Mats
for (int i=0; i<5; i++) // load 5 images
imgs=imread(format("my_%d.jpg", imgs[i] = imread(format("my_%d.jpg", i));
// no need to release() the mat's, this will be done automatically
5 | No.5 Revision |
no, please don't use new
with cv::Mat, or raw pointers at all.
cv::Mat is already a smartpointer around the pixels, so passing around pointers to that will for sure wreck the internal refounts, refcounts, sooner or later
instead, please use a std::vector , like this:
vector<Mat> imgs(5); // allocate 5 (empty) Mats
for (int i=0; i<5; i++) // load 5 images
imgs[i] = imread(format("my_%d.jpg", i));
// no need to release() the mat's, this will be done automatically