#include <cv.h>
#include <highgui.h>
#include <iostream>
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
//定义文件夹的绝对路径
const char* dir_name = "/home/zhhangfuqiang/images/";
struct dirent * filename; // return value for readdir()DIR * dir; // return value for opendir()
//打开文件夹
cout<<"Successfully opened the dir !"<<endl;
/* 遍历文件夹中的所有文件 */
while( ( filename = readdir(dir) ) != NULL )
{
get rid of "." and ".."
if( strcmp( filename->d_name , "." ) &