title: How to convert a Mat object of OpenCV into a int?
body: <p>I am new in OpenCV code. I am working on a project and I need to split a video signal in its 3 different components. I have already obtain the RGB matrix of the video signal such us mat object. However, I need to convert this mrgba mat into a int to make this equation: </p>
  
  <p>ExG = 2*g - r - b;   Exceso de Verdes Woobeke 1995 </p>
  
  <p>Another possibility could be to operate directly with three matrixes R, G and B, after dividing the main one(mrgba), but I do not know the size of these matrixes and I neither know how to make this equation with them. </p>
  
  <p>Any ideas of how to solve this problem? </p>
  
  <p>This is the part of my code:</p>
  
  <pre><code>@Override
      public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
  
          mrgba = inputFrame.rgba();
  
  
  
          Mat r =new Mat();
          Core.extractChannel(mrgba, r, 0);
          Mat g =new Mat();
          Core.extractChannel(mrgba, g, 1);
          Mat b =new Mat();
          Core.extractChannel(mrgba, b, 2);
  
  
          return mrgba;
      }
  </code></pre>
  
  <p>I have right now 3 different matrixes, one per channel "r", "g" and "b".</p>