How do you create an OCR application in App Inventor?

Hi Community,

How would I create an OCR application? I have tried few extensions but it all went in vain.

Please Suggest.

Thank You.

Here is one way:

and another

1 Like

Hi everyone,
I need some serious help please. I am creating an OCR application that scans ingredients from various food items to see if they contain specific chemicals. I figured out how to display the text it scans but I don't know how to scan it to see if it has one of the chemicals from a list of chemicals. This is my code :


Thanks!

You may need to UPCASE your OCR_Results ?

You don't want to try CONTAINS an entire list. That would only match something made entirely of those ingredients, in that order, the worst possible food.

Instead, you need to loop over the bad ingredients list, and look to see if the current bad ingredient is contained in the OCR result.

If the bad ingredient appears, add it to a separate, initially empty list of discovered ingredients, and at the end of the loop announce the list of discovered ingredients.

1 Like

You are right, needs to be using the "contains any" variant of the contains block, I missed that...

image

Thank you guys so much!
I finally fixed my app!!!

Hi,
I know I said it worked but I realized that whatever it scanned made the label say that it had the ingredients even when it didn't. I honestly don't know why.
Thank you

Show your blocks and your scan result

My blocks are


And the result is

You are not testing the OCR Results, but the same list. Try like this:

image

I tried but it is still showing the same results

I'm trying to use a for each item in list block but I don't know what to put inside it

When I use get global list of chemicals it says it doesn't have microplastics when it does

Add a text block to your app with OCR results for testing, then export the .aia and post it here.
(We can't OCR your food)