如何阅读他们有范围名称的一些图片! [英] How can I read some pictures that they have in-range name!

查看:74
本文介绍了如何阅读他们有范围名称的一些图片!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我不知道可以问我的问题是真的,然后我问一个例子。我有一个文件,里面有6000张图片。图片的名称有一个前缀,然后是每个图像的编号{bn00000,bn00001,bn00002,....,bn5999}。



我怎么写一个OpenCV函数分别读取所有这些函数?

实际上我想读取第一个图像(bn00000),对它做一些工作并保存结果,然后加载下一个图像并继续相同方式。



我做了这段代码:

Hi I don't know could ask my question true, then I ask with an example. I have a file that has 6000 pictures within. The name of the pics has a prefix and then the number of each image {bn00000, bn00001, bn00002, ...., bn5999}.

How can I write a function with OpenCV to read all of them respectively?
In fact I want to read image number one(bn00000), do some works on it and save the results, then load next image and continue as same way.

I did this code:

    for(int i=00000; i<05999; i++)
{

string s1="/home/chris/6000_dataset/bn";
string s2=".bmp";
int numm=i;
o<<s1<<numm<<s2;
string s=o.str();
img=imread("s", CV_LOAD_IMAGE_GRAYSCALE);
}





但我有一个模棱两可的错误!下一个问题是我不知道如何从00000迭代到05999?



But I got an ambiguous error! The next problem is that I don't know how can I iterate from 00000 to 05999?

推荐答案

检查出来:用opencv读取图像序列 [ ^ ]


这篇关于如何阅读他们有范围名称的一些图片!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆