1.将二指图片的效果反转既黑色变白色,白色变黑色。

 使用 

bitwise_not(InputArray src, OutputArray dst, InputArray mask = noArray());
 

使用前

 

opencv中的bitwise_not,bitwise_xor,bitwise_or,bitwise_and的使用方法与效果。

使用后:

opencv中的bitwise_not,bitwise_xor,bitwise_or,bitwise_and的使用方法与效果。

 

 

2 bitwise_xor

对两个图像进行”异“处理。

 

3 bitwise_or

计算每个位操作分离的两个数组或一个数组和一个标量。

 

4  bitwise_and 

对像素进行加和。

 

 1 int main()
 2 {
 3     Mat srcimage = imread("C:\\Users\\Administrator\\Desktop\\2.jpg");
 4     Mat dstimage = imread("C:\\Users\\Administrator\\Desktop\\34.jpg");
 5     Mat outputimage,out,andout;
 6     bitwise_xor(srcimage, dstimage, outputimage);
 7     bitwise_or(srcimage, dstimage, out);
 8     bitwise_and(srcimage, dstimage, andout);
 9         imshow("xor", outputimage);
10         imshow("or", out);
11         imshow("and", andout);
12     waitKey(0);
13  
14  
15 }

 

相关文章:

  • 2021-08-26
  • 2021-11-17
  • 2021-11-02
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-11
  • 2021-10-29
  • 2022-12-23
  • 2021-04-21
  • 2021-06-28
相关资源
相似解决方案