2

I have a series of images with names like "alpha-beta-0", "alpha-beta-1",......."alpha-beta-20". I have to read these images and give output as one image after process them.

How can I do that in OpenCV and C++.

2 Answers 2

6

You can use universal cv::VideoCapture class that is able to load regularly named images as a video sequence (see docs).

cv::VideoCapture cap("alpha-beta-%d");
cv::Mat img;
while (cap.read(img)) {
    // process image
}
Sign up to request clarification or add additional context in comments.

Comments

1

You need to write some codes like this:

for(int i = 0; i <= 20 ; i++)
{
     std::stringstream str;
     str << "alpha-beta" << i;
     cv::Mat img = cv::imread(str.str());
     ////  process and show output ...
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.