opencv 遍历文件夹里面图像--实现
来源:互联网 发布:淘宝产品拍摄教程 编辑:程序博客网 时间:2024/05/07 16:56
思路来自http://blog.csdn.net/watkinsong/article/details/9227439,后来,我自己用VS2012+Opencv2.4.8实现了一下,只是没有显示图像。后来,稍微修改了一下,可以显示图像喽,这样就可以批处理指定目录文件夹里面的图像了。
1.head.h头文件
#ifndef _HEAD_H_#define _HEAD_H_//OpencvDirTraverse.cpp : Defines the entry point for the console application.#define _CRT_SECURE_NO_DEPRECATE#include <cstdio>#include <vector>#include <iostream>#include <fstream>#include <cstring>#include <cstdlib>#include <cmath>#include <algorithm>#include "opencv\cv.h"#include "opencv2\core\core.hpp"#include "opencv2\highgui\highgui.hpp"#include "opencv2\imgproc\imgproc.hpp"#include "opencv2\contrib\contrib.hpp"using namespace std;using namespace cv;#endif // !_HEAD_H_
#include "head.h"int main(int argc, char * argv[]){string dir_path = "D:/Test/";Directory dir;vector<string> fileNames = dir.GetListFiles(dir_path, "*.jpg", false);for(int i = 0; i < fileNames.size(); i++){string fileName = fileNames[i];string fileFullName = dir_path + fileName;cout<<"file name:"<<fileName<<endl;cout<<"file paht:"<<fileFullName<<endl<<endl;//Image processingMat pScr;pScr=imread(fileFullName,1); //以文件名命名窗口 imshow(fileName,pScr);waitKey(1000);}//system("pause");return EXIT_SUCCESS;}
0 0
- opencv 遍历文件夹里面图像--实现
- opencv 遍历文件夹里面图像--实现
- Opencv打开一个文件夹里面图像
- OpenCV遍历文件夹中所有图像
- OpenCV实现遍历文件夹下所有文件
- OpenCV实现遍历文件夹下所有文件
- php遍历某个文件夹以及遍历里面的所有文件夹代码实现
- matlab 遍历图像文件夹
- OPENCV图像遍历方法
- opencv遍历图像
- opencv 图像的遍历
- opencv的图像遍历
- OpenCV图像的遍历
- OpenCV中遍历图像
- opencv里面图像通道问题
- 基于OpenCV的文件夹遍历
- opencv之高效遍历图像
- opencv GPU 简单遍历图像
- 细说C++中的new与delete
- [ M3 PN ] STM32F10XXX(Cortex-M3) MDK-RAM 点亮流水灯
- C#中折叠块的打开或关闭快捷键
- LeetCode Sqrt(x)
- FusionWidgets Bulb图
- opencv 遍历文件夹里面图像--实现
- BUPT OJ96 矩阵幂
- 20多岁的你
- ZOJ Monthly, March 2014
- 利用OCMock写单元测试
- app在线支持
- 骨骼动画原理
- MFC常规DLL的创建与使用实例
- SRS产品规划