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]);
精彩评论