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

FrameProcessor - Byte Array to Bitmap #51

Closed
bsobe opened this issue Jul 4, 2017 · 2 comments
Closed

FrameProcessor - Byte Array to Bitmap #51

bsobe opened this issue Jul 4, 2017 · 2 comments

Comments

@bsobe
Copy link

bsobe commented Jul 4, 2017

I try to convert frame.image(Byte Array) to Bitmap with this code
BitmapFactory.decodeByteArray(frame.image, 0, frame.image.length);

But, bitmap always return null. How can I convert frame.image to bitmap?

Logcat message: --- SkImageDecoder::Factory returned null

@dmitry-zaitsev
Copy link
Member

Frame images are in NV21 format and BitmapFactory is not able to decode them and returns null.

There are various solutions available. Here is one of them: https://stackoverflow.com/a/32793861/926907

Out of curiousity, what are you going to do with those images? Maybe I can provide some advice.

@bsobe
Copy link
Author

bsobe commented Jul 5, 2017

I am developing real time OCR application with Tesseract (tess-two).
Also I need to crop preview (to improve success rate of OCR) with Rect like Barcode libs (barcode libs show full screen preview but only scan specified area).

Can you give a suggestion?

@dmitry-zaitsev

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