title: Bytes Per Pixel value for byte representation of image in Android
body: <p>I'm currently writing an Android application which needs to use OCR within it.</p>
  
  <p>To achieve this I am using Tesseract in conjunction with the <a href="http://code.google.com/p/tesseract-android-tools/" rel="nofollow">tesseract-android-tools project</a>.</p>
  
  <p>I have managed to get the Tesseract API to initialize and need to use the following setImage function:</p>
  
  <pre><code>void com.googlecode.tesseract.android.TessBaseAPI.setImage(byte[] imagedata, int width, int height, int bpp, int bpl)
  </code></pre>
  
  <p>What I am struggling with is how to get the correct values for bpp (bytes per pixel) and bpl (bytes per line). <strong>Does anyone know how I can get these values?</strong> I have put fairly random values in there at the moment and believe it is causing errors later on.</p>
  
  <p>I should note that the application is also using JavaCV for image recognition which is recognising images fine and I'm using the same source of image data for this tesseract call.</p>
  
  <p>Thanks.</p>