opencv批量修改图片尺寸

时间:2024-04-05 23:34:23
 #include"opencv2/opencv.hpp"

 using namespace std;
using namespace cv;
#include<opencv2/opencv.hpp>
#include<iostream>
using namespace cv;
using namespace std;
int main()
{
int a = ;
char path[];
for (a = ; a < ;a++)
{
sprintf(path, "E:\\SVM_Class\\trainnigdata\\%d.jpg", a); Mat inputImg = imread(path, ); Mat resizea;
resizea.create(, , CV_8UC1);
resize(inputImg, resizea, resizea.size(), , , INTER_CUBIC);
if ()
{
stringstream ss;
ss << a << ".jpg";
imwrite(ss.str(), resizea); }
}
system("pause");
}