Nine3KiD
Nine3KiD

Reputation: 713

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

I have a code in C# which is giving me a masking result. But I couldn't do it in python. Can anyone help me on how to do it? Is it possible in python? I almost went through the python openCV documentation

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

Original image

enter image description here Masking image enter image description here Result need to obtain enter image description here

Upvotes: 1

Views: 434

Answers (1)

hashcode55
hashcode55

Reputation: 5860

Theres a function in opencv, bitwise_or, I guess it'd do what you want.

import cv2 

fin_image = cv2.bitwise_or(src_image, masking_image)

Upvotes: 1

Related Questions