Files
Capstone_Design/ch06/logical/main.cpp
2025-04-02 12:07:31 +09:00

29 lines
631 B
C++

#include <iostream>
#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;
}