1

These dont solve my questions : refs 1, refs 2, refs 3

Input 1 (Grayscale)Input 1

Input 2 (RGB)Input 2

Output Output

Question : Is it possible to achieve both output with provided inputs? If yes, how to do it in python?

ps. dont mind the ball please. Its intended

nfl-x
  • 487
  • 1
  • 6
  • 13
  • Why does your Ref 2 not solve your problem? It seems to me that it does. Please [edit] your question to show what you’ve tried. – Cris Luengo Jul 25 '19 at 04:07
  • The refs2 combine image operation is placing input1 beside input2. – nfl-x Jul 25 '19 at 04:34
  • 1
    mask = grayImage>0; cv::cvtColor(grayImage, grayImage, cv::COLOR_GRAY2BGR; grayImage.copyTo(colorImage, mask); – Micka Jul 25 '19 at 04:34
  • @Micka I replace `copyTo` with `cv::bitwiseAnd` since theres no copyTo in python. Thats the same right?. Whats the equivalent of `mask = gray > 0` in python. I got error `Expected cv::UMat for argument 'mask'`. – nfl-x Jul 25 '19 at 05:06
  • creating an image where every pixel that is not 0 in the imput image becomes 255 in the output image. biteise-and will not be the same, imho. What you want to do is copying all the pixels from gray image to color age, where the mask is 255 and don't change anything for the other pixels. – Micka Jul 25 '19 at 05:10
  • Okay, it solved my question. Thanks. :) Please add brief explanation to answer section so it easier for others to visualize what happen and I can mark it as the answer. – nfl-x Jul 25 '19 at 07:01

0 Answers0