C++ opencv Processing multiple images(批量处理图像)

今天,需要对文件夹下的图像进行批量处理,实现这部分功能。对文件夹下的图像进行批量处理,实现数据集的制作。本文通过特殊处理,加强数据集的局部有效信息,便于深度学习更好的训练识别。

  • Today, the need for the folder under the image batch processing, to achieve this part of the function.The image under the folder for batch processing, to achieve the production of data sets.In this paper, the local effective information of the data set is strengthened through special processing, so as to facilitate the deep learning and better training recognition.

CODE:

vector ReadImage(cv::String pattern)
{
	vector fn;
	glob(pattern, fn, false);
	vector images;
	size_t count = fn.size(); //number of png files in images folder
	for (size_t i = 0; i < count; i++)
	{
		images.emplace_back(cv::imread(fn[i]));
		cout << fn[i] << endl;
		//Rotate(imread(fn[i]),180.0, fn[i]);
		Pre_Table(imread(fn[i]),fn[i],5,5);
		//imshow("img", imread(fn[i]));
		waitKey(0);
	}
	return images;
}

CALL:

int _tmain(int argc, _TCHAR* argv[])
{

	#if 1 //批量处理图像
	cv::String pattern = "./title_time/table/*.png";
	vector img = ReadImage(pattern);
	#endif
}

C++ opencv Processing multiple images(批量处理图像)_第1张图片

 

 I hope I can help you,If you have any questions, please  comment on this blog or send me a private message. I will reply in my free time.

你可能感兴趣的:(CV,English,blog,C++)