#include #include "opencv2/opencv.hpp" using namespace std; using namespace cv; int main() { Mat img1 = imread("..\\..\\resources\\images\\lenna256.bmp", IMREAD_GRAYSCALE); resize(img1, img1, Size(256, 256)); Mat img2 = imread("..\\..\\resources\\images\\square.bmp", IMREAD_GRAYSCALE); imshow("img1", img1); imshow("img2", img2); Mat dst1, dst2, dst3, dst4; bitwise_and(img1, img2, dst1); bitwise_or(img1, img2, dst2); bitwise_xor(img1, img2, dst3); bitwise_not(img1, dst4); imshow("dst1", dst1); imshow("dst2", dst2); imshow("dst3", dst3); imshow("dst4", dst4); waitKey(); return EXIT_SUCCESS; }