title: Opencv bitwise_and difference in python and c++
body: <p>I am working with some pathology research.
  I need to mask some part of the image.`     </p>
  
  <pre><code>cv::Mat img = imread("orginal.jpg",1);
  cv::Mat mask = imread("mask.png",0);
  cv::Mat clean(img.size(), img.type());
  cv::bitwise_and(img, img, clean, mask);
  cv::imwrite("clean_c.png", clean);`
  </code></pre>
  
  <p>orginal.jpg</p>
  
  <p><img src="https://i.stack.imgur.com/w0tdi.jpg" alt=""></p>
  
  <p>mask.jpg</p>
  
  <p><img src="https://i.stack.imgur.com/jAqxT.jpg" alt=""></p>
  
  <p>Its working fine with white mask, but i get different output when its in python, it's have black mask</p>
  
  <pre><code>img1 = cv2.imread('orginal.jpg')
  mask = cv2.imread('mask.jpg',0)
  clean = cv2.bitwise_and(img1,img1,mask = mask)
  cv2.imwrite('clean_py.png',clean)
  </code></pre>