Proof of concept React Native (Expo) app using BoofCV

21 views
Skip to first unread message

Michael Wood

unread,
Apr 30, 2023, 6:01:40 PM4/30/23
to boo...@googlegroups.com
Hi

I have a proof of concept Expo module that I can call from an Expo app to read an image, call the QR code detector on it, and return an array of strings with the detections.

I don't really know what I'm doing, but I am pleased I could get something working.

By the way, is there a way to get the QR code detector to handle QR codes that have had the quiet zone cropped off? Unfortunately most people don't realise it's important and sometimes crop it off.

--
Michael Wood <esio...@gmail.com>

Peter A

unread,
May 10, 2023, 8:42:24 PM5/10/23
to boo...@googlegroups.com
Hi Michael,

The current approach to finding locator patterns won't work without the quiet zone. It works by finding the contour around and seeing if it's a quadrilateral. I've run into that problem a lot where people remove the quiet zone too. I personally don't have time to create a new detector but maybe someone else will jump in and help with that.

- Peter

--
You received this message because you are subscribed to the Google Groups "BoofCV" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boofcv+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/boofcv/CAP6d-HW3HcdomuL9ek2SumYSt%2BwVA%3D3SaQwd5PLxB-hu5x%2BjyQ%40mail.gmail.com.


--
"Now, now my good man, this is no time for making enemies."    — Voltaire (1694-1778), on his deathbed in response to a priest asking that he renounce Satan.

Michael Wood

unread,
May 11, 2023, 3:24:21 PM5/11/23
to boo...@googlegroups.com
Hi Peter

Thanks for the reply.

As a workaround which I think is better than nothing, but far from a general solution, I am adding a white border around the image before passing it to the detector. It works fine for e.g. screenshots of vouchers from an app where the image is perfect except for the missing quiet zone. The image picker I am using allows cropping the image before making use of it, so I can crop the image to include just the QR code (without the quiet zone) and then call the BoofCV code that adds a border and calls the QR code detector.

I want to use BoofCV for a Sudoku OCR app (just for fun). If I figure that out, then there's a small chance I can figure out how to improve the QR code detector, but don't hold your breath!

Thanks again.

On Thu, 11 May 2023 at 02:42, Peter A <peter....@gmail.com> wrote:
Hi Michael,

The current approach to finding locator patterns won't work without the quiet zone. It works by finding the contour around and seeing if it's a quadrilateral. I've run into that problem a lot where people remove the quiet zone too. I personally don't have time to create a new detector but maybe someone else will jump in and help with that.

- Peter

On Sun, Apr 30, 2023 at 3:01 PM Michael Wood <esio...@gmail.com> wrote:
Hi

I have a proof of concept Expo module that I can call from an Expo app to read an image, call the QR code detector on it, and return an array of strings with the detections.

I don't really know what I'm doing, but I am pleased I could get something working.

By the way, is there a way to get the QR code detector to handle QR codes that have had the quiet zone cropped off? Unfortunately most people don't realise it's important and sometimes crop it off.

--
Michael Wood <esio...@gmail.com>

--
"Now, now my good man, this is no time for making enemies."    — Voltaire (1694-1778), on his deathbed in response to a priest asking that he renounce Satan.


--
Michael Wood <esio...@gmail.com>

Peter A

unread,
May 12, 2023, 3:42:21 PM5/12/23
to boo...@googlegroups.com
How do you plan on doing the OCR part?

- Peter

--
You received this message because you are subscribed to the Google Groups "BoofCV" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boofcv+un...@googlegroups.com.

Michael Wood

unread,
May 13, 2023, 6:31:10 PM5/13/23
to boo...@googlegroups.com
I wrote a Sudoku OCR thing in Clojure a few years ago using OpenCV. It ran on a laptop using the webcam. It worked OK.

For the OCR I generated a bunch of images of digits from 1 to 9 using just about all of the fonts on my laptop and scaled them to the same width/height. When I detected the grid I chopped it into cells and then got the biggest object in the cell. If there was something in the cell I scaled it to the same size as the training digits.
I can't remember exactly how I did the training etc., but I used OpenCV's K-nearest neighbour implementation to match the digits from the image against the training data.

It wasn't perfect, but mostly worked fine.



--
Michael Wood <esio...@gmail.com>

Michael Wood

unread,
May 13, 2023, 7:05:46 PM5/13/23
to boo...@googlegroups.com
I might try porting Leptonica's digit recognition code to Java/Kotlin and using that this time.

I did play around with that in Clojure at the time, but I didn't finish it.
--
Michael Wood <esio...@gmail.com>
Reply all
Reply to author
Forward
0 new messages