python中图像处理中如何进行OR masking操作?

How to do OR masking operation in Image processing in python?

我有一个 C# 代码,它给我一个屏蔽结果。但我无法在 python 中完成。谁能帮我怎么做? python 有可能吗?我几乎浏览了 python openCV 文档

public void OROPeration()
       {
           IplImage orImage = Cv.CreateImage(src.Size, BitDepth.U8, 3);
           Cv.Or(src, mask, orImage, null);
           Cv.SaveImage("4.jpg", orImage);
       }

原图

屏蔽图像 结果需要获取

opencv 中有一个函数,bitwise_or,我猜它会做你想要的。

import cv2 

fin_image = cv2.bitwise_or(src_image, masking_image)