-
Notifications
You must be signed in to change notification settings - Fork 0
/
xor and or.cpp
51 lines (32 loc) · 936 Bytes
/
xor and or.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<iostream>
#include <stdio.h>
#include <opencv2\core\core.hpp>
#include "opencv2\imgproc\imgproc.hpp"
#include <opencv2\highgui\highgui.hpp>
using namespace std;
using namespace cv;
int main() {
Mat artificialimage1 = Mat::zeros(Size(400, 200),CV_8UC1);
Mat artificialimage2 = Mat::zeros(Size(400, 200),CV_8UC1);
artificialimage1(Range(0, artificialimage1.rows), Range(0, artificialimage2.cols / 2)) = 255;
artificialimage2(Range(100, 150), Range(150,350))=255;
imshow("img1",artificialimage1);
imshow("img2", artificialimage2);
Mat result;
/*
bitwise_and(artificialimage1,artificialimage2,result);
imshow("img1", result);
*/
/*
bitwise_or(artificialimage1,artificialimage2,result);
imshow("img3", result);
*/
bitwise_not(artificialimage1,result);
imshow("img3", result);
/*
bitwise_xor(artificialimage1,artificialimage2,result);
imshow("img3", result);
*/
cvWaitKey(0);
return(0);
}