Closed GoogleCodeExporter closed 9 years ago
If tesseract requires an uncompressed image, why then does it support jpeg? As
detailed above, since the Android implementation doesn't work with bitmaps,
there's no alternative. (Setting the jpeg quality in the camera parameters with
setJpegQuality(100) doesn't help.)
Original comment by ianjones1957@gmail.com
on 22 Sep 2011 at 9:13
Iam using Eclipse for developing android app.
while testing tesseract API I got this error: " tesseract-android-tools] Could
not find tesseract-android-tools.apk! " what does it mean and what should i do
please help!
below is the code Iam using and there is no error in this code :
package ocr.text.phase1;
import java.io.File;
import com.googlecode.leptonica.android.Pix;
import com.googlecode.leptonica.android.ReadFile;
import com.googlecode.tesseract.android.TessBaseAPI;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
public class OcrtextActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TessBaseAPI api = new TessBaseAPI();
boolean ok = api.init("D:/android/workspace/tesseract-android-tools/tessdata/", "eng");
String testImg = getFilesDir().toString() + "/javac.jpg";
File f = new File(testImg);
ImageView im = new ImageView(null);
Bitmap bm = BitmapFactory.decodeFile(testImg);
im.setImageBitmap(bm);
if (f == null || !f.canRead() || f.length()<1 ) {
Log.e("ocr", testImg+ " is not readable");
} else {
Log.i("ocr", "Trying to read file");
Pix px = ReadFile.readFile(f);
}
}
}
What version of the product are you using? On what operating system?
My Eclipse version is : Helios Service Release 2
Operating System is : Windows XP
Please Reply as soon as possible Iam waiting! thanks!
Original comment by tahir90....@gmail.com
on 11 Dec 2011 at 8:32
Removed libjpeg and added native bitmap support. Should be obsolete.
Original comment by alanv@google.com
on 11 Sep 2012 at 8:16
Original issue reported on code.google.com by
ianjones1957@gmail.com
on 30 Mar 2011 at 3:00Attachments: