title: OpenCV merge two masks
body: <p>I would like to merge by "setTo()" two masks together. But I get an error i don't know why.</p>
  
  <p><strong>_ First mask is input video frame (RGBA actually black and white cause of inRange)
  _</strong> Second mask is a simple yellow mask(8UC4 i think it must be)</p>
  
  <pre><code>Imgproc.cvtColor(rgba, rgba, Imgproc.COLOR_RGB2HSV, 0);
          Core.inRange(rgba,  new Scalar(10,100,100), new Scalar(30,255,255), rgba);
  
          Imgproc.cvtColor(rgba, rgba, Imgproc.COLOR_GRAY2RGBA, 4);
          Mat yellow_mask = new Mat(cols, rows, CvType.CV_8UC4, new Scalar(255,255,0, 100));
          rgba.setTo(yellow_mask, rgba);
  </code></pre>
  
  <p>My goal is to make white inRange into Yellow.</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <pre><code>// DETECT YELLOW 
          Mat hsv = new Mat();
          Imgproc.cvtColor(rgba, hsv, Imgproc.COLOR_RGB2HSV);
  
          Mat mask = new Mat();
          Core.inRange(hsv,  new Scalar(10,100,100), new Scalar(30,255,255), mask);
  
          rgba.setTo(new Scalar(255,255,0, 100), mask);
  </code></pre>
  
  <p>Crash detected every 15 secondes after the launch :/</p>