title: OpenCV java get pixel color
body: <p>I made the following Java program:</p>
  
  <pre><code> System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
   Mat image = Highgui.imread("lena.png");
  
   Imgproc.cvtColor(image, image, Imgproc.COLOR_BGR2GRAY);
   byte buff[] = new byte[ (int) (image.total() * image.channels())];
  
   int a;
   int b;
   int picdata[][] =  new int[10][10] ;
  
   for (a=0 ; a&lt;10;a++){
       for (b=0 ; b&lt;10;b++){
          picdata[a][b]=  image.get(a, b,buff);    
  
       }
   }
  </code></pre>
  
  <p>When I look at picdata, I receive a numbers:</p>
  
  <pre><code>"picdata"    (id=24)    
      [0] (id=25) 
          [0] 225 
          [1] 224 
          [2] 223 
          [3] 222 
          [4] 221 
      [1] (id=27) 
          [0] 210 
          [1] 209 
          [2] 208 
                 ............
  </code></pre>
  
  <p>If I check for <code>image.get(x,y)</code>, I receive the required number (between 0 and 255) but I don't know how to write it into the picdata.</p>
  
  <p>How do I alter the code to fill picdata with grayscale data?</p>