TestOpenCV.cpp文件代码为:
- #include "stdafx.h"
- int _tmain(int argc, _TCHAR* argv[])
- {
- Mat image1, image2, imageResult;
- image1 = cv::imread("1.jpg", 2 | 4);
- image2 = cv::imread("2.jpg", 2 | 4);
- cv::subtract(image1, image2, imageResult);
- cv::namedWindow("show image");
- cv::imshow("show image", imageResult);
- cv::waitKey(0);
- cv::destroyWindow("show image");
- return 0;
- }