OPENCV 转换图片为指定格式
来源:互联网 发布:儿童被网络诈骗 编辑:程序博客网 时间:2024/06/08 05:30
// TrainingFaceSegment.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include<windows.h>#include<iostream>#include<string>#include "cv.h" #include "highgui.h" IplImage* img;IplImage* resizeImg;void find(char * lpPath){char szFile[MAX_PATH] = {0};char szFind[MAX_PATH];char root[MAX_PATH];WIN32_FIND_DATA FindFileData;strcpy(szFind,lpPath);strcat(szFind,"*.*");HANDLE hFind=::FindFirstFile(szFind,&FindFileData);if(INVALID_HANDLE_VALUE == hFind) return;while(TRUE){if(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY){if(FindFileData.cFileName[0]!='.'){strcpy(szFile,lpPath);strcat(szFile,FindFileData.cFileName);strcat(szFile,"//");find(szFile);}}else{strcpy(root, lpPath);strcat(root,FindFileData.cFileName);img = cvLoadImage(root);strcpy(root, "..//..//images2//");strcat(root,FindFileData.cFileName);cvSaveImage(root,img);cvReleaseImage(&img);}if(!FindNextFile(hFind,&FindFileData)) break;}FindClose(hFind);}void main(){find("..//..//images//");getchar();}
strcat(root,FindFileData.cFileName);把上面这句话的cFileName改成自己想要的格式如jpg.bmp即可
0 0
- OPENCV 转换图片为指定格式
- opencv图片转换为avi格式视频
- 利用opencv把其它格式的图片转换为pgm格式代码
- 将日期时间转换为指定格式
- freemarker将指定日期字符串转换为指定的格式
- #region 把指定图片转换为byte
- OpenCV视频转换为图片代码
- JSONObject转换JSON--将Date转换为指定格式
- JSONObject转换JSON--将Date转换为指定格式
- JSONObject转换JSON--将Date转换为指定格式
- JSONObject转换JSON--将Date转换为指定格式
- JSONObject转换JSON--将Date转换为指定格式
- JSONObject转换JSON--将Date转换为指定格式
- JSONObject转换JSON--将Date转换为指定格式
- OpenCV 中YUV420格式转换为IpImage格式
- bmp图片转换为YUV422格式
- 将图片转换为ICON格式
- php各类图片转换为jpg格式
- Foundation框架(12)——NSValue的使用
- 静态黑洞路由应用及实例讲解
- 从Nand Flash启动U-BOOT的基本原理
- Hadoop之自定义Partitioner函数
- .NET总结一
- OPENCV 转换图片为指定格式
- PL/SQL %TYPE 属性
- 防止表单提交按钮多次提交的办法
- Udp实现聊天
- python调用浏览器,实现刷网页小程序
- J2EE的13 规范之解读JSP
- eclipse中使用git
- android基础3
- html5结合flash实现视频文件在所有主流浏览器兼容播放