Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert Leptonica Pix Object to Android's Bitmap

I have a Leptonica Pix object returned by

TessBaseApi.getThresholdedImage();

now, how can I convert it to bitmap so that I can show it through the ImageView.

leptonica.android.Pix to android.graphics.Bitmap;

I didn't find conversion methods looking at the API files.

like image 546
Aavaas Avatar asked Feb 08 '23 11:02

Aavaas


1 Answers

For someone with the problem I found the way after lot of searching in the source .java files:

import com.googlecode.leptonica.android.WriteFile;

and then pass the pix object to writeBitmap.

Bitmap bitmap = WriteFile.writeBitmap(pixObject);
like image 165
Aavaas Avatar answered Feb 11 '23 01:02

Aavaas