Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect orientation fail if image path contains Chinese #89

Closed
pauljlchen opened this issue Apr 7, 2018 · 2 comments
Closed

detect orientation fail if image path contains Chinese #89

pauljlchen opened this issue Apr 7, 2018 · 2 comments

Comments

@pauljlchen
Copy link

I was failed to detect the image orientation if the image path contains Chinese with tess4j 4.0.
The code is from the sample. Could you help and let me know how to deal with it? Thanks.

`Pix pix = Leptonica1.pixRead(image.getPath());
TessAPI1.TessBaseAPISetImage2(handle, pix);

IntBuffer orient_degB = IntBuffer.allocate(1);
FloatBuffer orient_confB = FloatBuffer.allocate(1);
PointerByReference script_nameB = new PointerByReference();
FloatBuffer script_confB = FloatBuffer.allocate(1);

int oriDetectResult = TessAPI1.TessBaseAPIDetectOrientationScript(handle, orient_degB, orient_confB, script_nameB, script_confB);`

Exception:
tess->pix_binary() != NULL:Error:Assert failed:in file ....\ccmain\osdetect.cpp, line 199
java.util.concurrent.ExecutionException: java.lang.Error: Invalid memory access
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)

@nguyenq
Copy link
Owner

nguyenq commented Apr 7, 2018

Make sure the input image file exists by checking imageFile.exists().

If that's truly a Java language issue with Chinese characters in folder or file names, then... you'll probably need to go to a Java-centric site for help. Try Java Forum or stackoverflow.com.

@nguyenq nguyenq closed this as completed May 27, 2018
@nguyenq
Copy link
Owner

nguyenq commented Jul 25, 2018

Duplicate of #75.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants