I have created a program reading images in the sequence. Here is my code:

asked 2017-08-28 07:31:00 -0600

salman gravatar image
  int main(int argc, char** argv) {

cv::namedWindow("Example3", cv::WINDOW_AUTOSIZE);
cv::VideoCapture cap;
cap.open(string("F:/8TH SEMESTER/trial/%05d.ppm"));
//"F:/8TH SEMESTER/Traffic Sign Dectection/GTSDB/FullIJCNN2013/FullIJCNN2013/01/%05d.ppm"
cv::Mat frame;
for (;;) {
    cap >> frame;
    if (frame.empty()) break;             // Ran out of film
    cv::imshow("Example3", frame);
    if (cv::waitKey(2000) >= 0) break;
}

return 0;

}

data set of images link:

http://salman2004.imgur.com/all/

when i run my program it read only first image and then give error. Can any body help ?I also try glob function but with glob function it read images one by one but the problem is that it can display image on previous image.For example if 1st image is display and then 2nd so it display it but some portion of 1st image is show.

edit retag flag offensive close merge delete

Comments

all images must be same size

sturkmen gravatar imagesturkmen ( 2017-08-28 07:33:26 -0600 )edit

how can i check my image size. if you mean pixel and depth etc then help me. i have no idea that can i fix it @sturkmen

salman gravatar imagesalman ( 2017-08-28 10:17:31 -0600 )edit

provide the code you tried with glob(). i think it is correct way

"For example if 1st image is display and then 2nd so it display it but some portion of 1st image is show." this is easy to solve if i see your code.

sturkmen gravatar imagesturkmen ( 2017-08-28 10:33:15 -0600 )edit