1.消除: warning C4996: 'sprintf': This function or variable may be unsafe. Consider 的方法
选项 Project | Configuration Properties | C/C++ | Preprocessor | Preprocessor Definitions
添加_CRT_SECURE_NO_DEPRECATE 和_SCL_SECURE_NO_DEPRECATE
2.OpenCV测试程序
配置教程(视频,需要翻墙):https://www.youtube.com/watch?v=aZ_2zLdNqRU
// ImageFlip.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include "stdio.h"
#include "iostream"
using namespace cv;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
Mat src = imread("D:\\Lenna.png");
Mat dst;
transpose(src, dst);
Mat dst2;
flip(dst, dst2, 1); // flip by y axis
Mat dst3;
flip(dst, dst3, 0); // flip by x axis
Mat dst4;
flip(dst, dst4, -1); // flip by both axises
imshow("src", src);
imshow("dst", dst);
imshow("dst2", dst2);
imshow("dst3", dst3);
imshow("dst4", dst4);
cvWaitKey();
return 0;
}
3.将图像保存到一个文件:
Mat src = imread("D:\\Lenna.png");
string imgname = "NewLenna.png";
imwrite(imgname,src); //将图片矩阵src以png图片的格式保存到当前项目目录下
777


&spm=1001.2101.3001.11974&articleId=24848743&d=1&t=3&u=e6482e6900e94aef989be0f68782a017)

被折叠的 条评论
为什么被折叠?



