Ask Your Question

reading multiple images

asked 2014-05-20 23:29:35 -0500

ANPR gravatar image

hi I want to process 6 pictures called (0.jpg 1.jpg 2.jpg 3.jpg 4.jpg 5.jpg 6.jpg) can anyone help me to use imread or anything similar to do it

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-05-21 00:38:08 -0500

You can always load the images one by one manually:

//Assuming that the images live on the same directory where you executed your  OpenCV program
cv::Mat image_0 = cv::imread("0.jpg");
cv::Mat image_1 = cv::imread("1.jpg");
cv::Mat image_2 = cv::imread("2.jpg");
cv::Mat image_3 = cv::imread("3.jpg");
cv::Mat image_4 = cv::imread("4.jpg");
cv::Mat image_5 = cv::imread("5.jpg");
cv::Mat image_6 = cv::imread("6.jpg");

You chould check that image_*.empty() is not true (that means that the image has been loaded) and then do whatever you want with them.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2014-05-20 23:29:35 -0500

Seen: 289 times

Last updated: May 21 '14