批量处理图像

这篇博客介绍了如何使用C++批量处理一个文件夹内的所有图像,避免手动操作的繁琐。文中给出了代码示例,包括`stdafx.h`和`main.cpp`文件的关键部分,并提到了在处理字符串和文件名时可能遇到的问题以及解决方法。
摘要由CSDN通过智能技术生成

有很多时候,我们需要对一个文件夹内的所有图像进行处理,这时一张张的Ctrl+F5就让人太蛋疼了,所以就产生了图像批量处理。

不扯了,直接上代码:

stdafx.h:

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once
#pragma warning(disable: 4996)
#pragma warning(disable: 4819)
//#define WIN32_LEAN_AND_MEAN

#include <stdio.h>
#include <tchar.h>


main.cpp:

#include "stdafx.h"
#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include "windows.h"
#include <vector>
#include <string>
#include "iostream"
#include <ctime> //计时用的头文件
using namespace std;
typedef std::vector<std::string> file_lists;
template<typename 
  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值