C++遍历统计某个文件夹及其子文件夹下所有图像和像素的个数

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#define BLOCK_SIZE 1024
#define MAX_DIR_LEN 1024
#define BYTES_PER_PIXEL 3



unsigned long int get_pixels_dir(std::string cur_dir){
	std::string src_dir_str(cur_dir+"/src");
	std::cout<<"Image source: "<d_name, ".") == 0 || strcmp(img_ent->d_name, "..")==0)
			continue;
		else{
			img_cnt++;
			img_src_ent_str = src_dir_str + "/" + img_ent->d_name;
			img = cv::imread(img_src_ent_str, CV_LOAD_IMAGE_COLOR);
			if(img.empty())
				continue;
			total_pixel_cnt += img.total();
			img_src_ent_str.clear();
		}
	}
	std::cout<<"There are "<

你可能感兴趣的:(C++,linux运维,图像处理)