Sorry! Problem is resolved, was caused by the traineddata file I used. Apparently it wasn't compatible with my version of tesseract.
getUTF8Text causes crash on android (tesseract)
Frage
I'm trying to use opencv & tesseract to detect characters in real-time. The problem I'm having is that when I run the method getUTF8Text() my app crashes also, it seems that if I don't have to much info in the picture (i.e. having my hand over the lens) it runs smoothly.
The code segment that fails looks like this:
public void onCreate(...){
//...
baseApi = new TessBaseAPI();
baseApi.init(DATA_PATH, "leu");
//...
}
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
//...
Mat mRgba = inputFrame.rgba();
Bitmap bm = Bitmap.createBitmap(mRgba.cols(), mRgba.rows(), Bitmap.Config.ARGB_8888);
Utils.matToBitmap(mRgba, bm , true);
baseApi.setImage(bm );
String reconText = baseApi.getUTF8Text();
baseApi.clear();
//...
}
It generates no error in logcat :(
Any idéas what could be wrong? Shout if you need more info!
Thanks a lot!
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow