title: OpenCV Android imwrite give me a blue image
body: <p>I have implemented a camera using <code>CvCameraViewListener2</code>, when I do imwrite, the picture save turn blue
  Here is my code</p>
  
  <pre><code>public Mat onCameraFrame(final CvCameraViewFrame inputFrame) {
      img_rgb = inputFrame.rgba();
  
      return img_rgb;
  
  }
  
  public void captureImage(View v){
      Mat mInter= new Mat(img_rgb.width(),img_rgb.height(),CvType.CV_32FC3);
      File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
      String filename = "temp.jpg";
      File file = new File(path, filename);
      Boolean bool = null;
      filename = file.toString();
      if(img_rgb.height() &gt; img_rgb.width()){
          Core.flip(img_rgb,mInter,1);
          bool = Imgcodecs.imwrite(filename, mInter);
      }
      else{
      bool = Imgcodecs.imwrite(filename,mInter);}
      if (bool == true)
          Log.i(TAG, "SUCCESS writing image to external storage");
      else
          Log.i(TAG, "Fail writing image to external storage");
      String PathName = "";
      Intent i = new Intent(getApplication(),Result.class);
      i.putExtra(EXTRA_MESSAGE ,filename);
      startActivity(i); 
  </code></pre>
  
  <p>And the result:</p>
  
  <p><a href="https://i.stack.imgur.com/Fo6mj.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Fo6mj.jpg" alt="enter image description here"></a></p>
  
  <p>I cannot find the problem, I have try to convert mat into other color but no result.</p>