title: The best algorithm for grayscale for tesseract input
body: <p>I am working on a project using tesseract library for recognizing word. It doesnt work as I expected, sometimes, it failed with a full focused image. I found that reason is image after my grayscale step is not really good.</p>
  
  <p>The algorithm I'm using come from zxing project: </p>
  
  <pre><code>int grey = yuv[inputOffset + x] &amp; 0xff;
  pixels[outputOffset + x] = (grey * 0x00010101) | 0xFF000000;
  </code></pre>
  
  <p>Are there any better solution for this case?</p>
  
  <p><strong>UPDATE</strong>:
  I tried to print image after crop and convert and I got a cropped image with expected size but not color. It looks like image is converted to a "purple-green" image. Anyone can help me :( ?</p>