How to perform OCR from image URI in React native expo?

69 Views Asked by At

I use the imagePicker SDK to get an image from the library in react native. I want to be able to perform OCR on this image. The result I get back from imagePicker is

{
  "assets": [
    {
      "assetId": "C166F9F5-B5FE-4501-9531",
      "base64": null,
      "duration": null,
      "exif": null,
      "fileName": "IMG.HEIC",
      "fileSize": 6018901,
      "height": 3025,
      "type": "image",
      "uri": "file:///data/user/0/host.exp.exponent/cache/cropped1814158652.jpg"
      "width": 3024
    }
  ],
  "canceled": false,
  "cancelled": false
}

However Tesseract.js does not work on the URI. Is there a way to work with the URI in Tesseract.js or should I convert the URI into a URL by uploading it to something like firebase or supabase and then use it?

0

There are 0 best solutions below