Ask Your Question
0

How to read images sequentially?

asked 2014-12-29 04:36:45 -0600

Mahavir gravatar image

Hello, I am trying to read images from folder ("C:\Users\MAHAVIR\Documents\Visual Studio 2010\Projects\Video_Watermarking\caption"). I have written 119 images to this folder and I want to read each image one by one.

When i tried by using VideoCapture I got following error

enter image description here
How to solve the problem?

edit retag flag offensive close merge delete

Comments

1

Are the names of the images a sequence of ascending order? (like img_00.jpg, img_01.jpg, img_02.jpg, ...) VideoCaptures reads sequences of images from folder but they have to be named in a coherent sequence.

Pedro Batista gravatar imagePedro Batista ( 2014-12-29 08:51:13 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-12-29 14:20:26 -0600

unxnut gravatar image

You have two options. Option 1 below is the easier one.

  1. Create a plain text file containing all the image names in your library. Read each image after picking up the name from the text file.
  2. Use boost library to find out the image names in the directory. Read those one by one.

In each of the above cases, I suggest using imread to read individual images. Of course, as suggested in the comment above, if your images are sequentially numbered, you should be able to generate the file names and read images using imread.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-12-29 04:36:45 -0600

Seen: 964 times

Last updated: Dec 29 '14