halcon学习笔记——(1)遍历文件夹与文件选择
2014-04-02 15:46
316 查看
1)遍历文件夹:
list_files( : : Directory, Options : Files)
Directory:目录(文件夹路径)
Options:选项
Files:文件(文件的路径)
2)文件格式筛选
tuple_regexp_select( : : Data, Expression : Selection)
Data:被选择的文件路径数组
Expression:文件格式的筛选规则
Selection:选择出的文件路径数组
示例:
list_files( : : Directory, Options : Files)
Directory:目录(文件夹路径)
Options:选项
'files' | 指定搜索的格式为文件 |
'directories' | 指定搜索的格式为文件夹 |
'recursive' | 指定可以遍历子文件夹下的文件 |
'follow_links' | |
'max_depth 5' | 指定遍历的深度 |
'max_files 1000' | 指定遍历的最大文件数目 |
Files:文件(文件的路径)
2)文件格式筛选
tuple_regexp_select( : : Data, Expression : Selection)
Data:被选择的文件路径数组
Expression:文件格式的筛选规则
//. | 转义 . |
(bmp|JPG) | 筛选的文件格式 |
'ignore_case' | 忽略大小写 |
Selection:选择出的文件路径数组
示例:
1: * 遍历文件夹D:/资料库/Downloads
2: list_files ('D:/资料库/Downloads', ['files','follow_links'], ImageFiles)
3:
4: * 筛选bmp或jpg格式的文件
5: tuple_regexp_select (ImageFiles, ['\\.(bmp|jpg)$','ignore_case'], ImageFiles)
6:
7: * 依次读取图片
8: for Index := 0 to |ImageFiles| - 1 by 1
9: read_image (Image, ImageFiles[Index])
10:
11: endfor
相关文章推荐
- 无线连接提示"检测到无线网络"但打开无线列表显示"区域中找不到无线网络" 解决办法
- cas iframe 问题
- java 数据库表反向生成相应的java类
- MySQL性能优化的最佳20+条经验
- ZOJ 1003 Crashing Balloon
- 编译自定义pypy解释器,独立运行pyc
- 关闭TCP连接的学问
- oracle Rownum和row_number() over()的使用
- MFC中查找替换对话框CFindReplaceDialog类
- LeetCode---Combinations
- hadoop 、hive 的一些使用经验。
- OpenCL使用CL_MEM_USE_HOST_PTR存储器对象属性与存储器映射
- 今天分享8个可以帮助你360度旋转显示图片的jQuery插件
- 10 个 jQuery 的360 度图片展示插件
- html编辑器汇总
- velocity例子
- Tomcat 配置 cas 例子
- 秋季是恋爱的季节
- oschina.net nginx配置
- oachina.net 数据库配置