[英]Error occur during running the tesseract OCR engine in my application
我可以在調試應用程序時知道錯誤是什么嗎? 下面是我的編碼,並且tessdata保存在手機中。
public class testingtesting extends Activity {
private static final String data_path = "/mnt/sdcard/tessdata";
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.image);
ImageView a = (ImageView) findViewById (R.id.testingtesingt);
Bitmap aa = grayScale.bitmap_in_binarize;
// a.setImageBitmap(aa);
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.setDebug(true);
System.out.println("GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG");
//error
// File myDir = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
baseApi.init(data_path, "eng");
//error
baseApi.setImage(aa);
System.out.println("adwdwawdada");
String recognizedText = baseApi.getUTF8Text();
baseApi.end();
System.out.println("cimcaoioievfoaemmov");
Intent intent = new Intent(testingtesting.this, result.class);
intent.putExtra("title_input", recognizedText);
startActivity(intent);
}
請提供錯誤消息。
據我所知,您在使用System.out.println("GGGGGGGGGGGGGGGGGGGG");
遇到了麻煩System.out.println("GGGGGGGGGGGGGGGGGGGG");
Android不使用標准Java控制台。 而是使用Logcat像這樣:
Log.d("testingtesting", "GGGGGGGGGGGGGGGGG");
如果您使用的是Eclipse,請在啟動時打開LogCat視圖以查看應用程序的輸出:
窗口→顯示視圖→其他→Android→LogCat
有關LogCat的更多信息,請點擊此處
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.