Reputation: 45
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++.
Upvotes: 2
Views: 140
Reputation: 616
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
}
Upvotes: 6
Reputation: 548
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 ...
}
Upvotes: 1