Louis
Louis

Reputation: 1305

Create an array of IPlImage in OpenCV?

I am very new to OpenCV and I have the following question:

I understand that I can create an image using:

IplImage  *img

What i want is making a database of images. For example:

img[0]: will have image 1,
img[1]: will have image 2,
img[2]: will have image 3,
 etc...

How can i do such a thing ?

Upvotes: 1

Views: 3625

Answers (1)

M'vy
M'vy

Reputation: 5774

One IplImage is use for one image. So you can create a IplImage *img = NULL then allocate or fill it with different sources of images with for example:

img[0] = cvLoadImage(...);

Do not forget to release your images:

cvReleaseImage(img[0] );

You can see the documenation here and some example here

Upvotes: 2

Related Questions