开发者

store images in an array

开发者 https://www.devze.com 2023-02-19 08:18 出处:网络
I need to store images(I cropped them 开发者_开发百科in a for loop,after every crop,I want to store in an array) into an array of images. How could I do that in OpenCV?std::vector<IplImage*> vec

I need to store images(I cropped them 开发者_开发百科in a for loop,after every crop,I want to store in an array) into an array of images. How could I do that in OpenCV?


std::vector<IplImage*> vec_images;

IplImage* frame = cvQueryFrame(capture); // Acquiring a new image
// Cropping or whatever

vec_images.push_bask(frame);

Don't forget to deallocate these frames when you don't need them anymore:

for (int i = 0; i < vec_images.size(); i++)
  cvReleaseImage(&vec_images[i]);
0

精彩评论

暂无评论...
验证码 换一张
取 消