How to read multiple images from a folder in open cv (using C)

后端 未结 2 1596
Happy的楠姐
Happy的楠姐 2021-01-17 03:17

I am new to open CV and C. How do i specify multiple images for the same kind of operation.

2条回答
  •  情歌与酒
    2021-01-17 03:53

    if your images are (sequentially) numbered, you could abuse a hidden feature with VideoCapture, just pass it a (format) string:

    VideoCapture cap("/my/folder/p%05d.jpg"); // would work with: "/my/folder/p00013.jpg", etc
    while( cap.isOpened() )
    {
        Mat img;
        cap.read(img);
        // process(img);
    }
    

提交回复
热议问题