QR Code Decoding

Hi,

I am working on a project that requires me to read a QR code off an ID Badge. Is there any library function available in the current version to read & decode a QR Code ?

If not available now, any plans to introduce this soon ? (Would appreciate a rough timeline to see if I can work with it)

Thanks !

We don’t have support for QR codes and don’t exactly have the man power to implement them right now.

Doing things like QR code and April Tags will be a priority once we’ve pushed out all documentation, IDE, and firmware fixes. We’re still trying to get to a stable place with the product where we can just focus on software. Hopefully we’ll be there sometime next year.

With the coming M7 board we’ll have a lot more RAM to make this possible and hopefully some kinda souls may help us with the project to add more algorithms to our system.

There is a nice library in C here: GitHub - dlbeer/quirc: QR decoder library

That looks like something we should definitely be able to get working on the M7. Thanks!

Thanks Guys, The library does look very portable. I am excited about seeing this in the new M7 Version.

I think this should be able to actually run on the M4. I’ll get working on this over the holidays.

That would be awesome !! … looking forward to some good news.

Merry Christmas and Happy Holidays Guys !

Hi, so, we got this working and its really robust and awesome. It’s going to be a major selling feature for the system. Anyway, I’ll get started working on a video to demo this. But, it works about as good as you can possibly think. The code will work on either the M4 or the M7 but it obviously runs a lot slower on the M4 and will be limited to 160x120. On the M7 you can do 320x240. The qr code algorithm won’t do a lot of work unless it finds a more or less valid qr code so the frame rate doesn’t really drop at all until you put like a bunch of qrcodes in front of it that are bad. If the qrcodes are good then the algorithm converges on what to do quickly and doesn’t cause a huge loss in the frame rate.

The code is up on the repo if you want to compile and give it a try in the mean time. I guess I should post a binary. Will do that soon.

https://github.com/openmv/openmv/blob/master/src/omv/img/qrcode.c
https://github.com/openmv/openmv/blob/master/src/omv/py/py_image.c#L1204

Also, the qrcode library pretty much takes care of a lot of problems that must be solved for april tags… so, we can probably get that working too… but, since there’s no ready library to do the work for us that’s going to require a large time commitment which I don’t think I can give it right now.

Massive blog post update coming soon along with a firmware release sometime after that. But, here’s the video: QR Code Detection w/ OpenMV Cam M7 - YouTube

Hi Kwabena,

In case you also decide to add support for AprilTags, here is a great paper on apriltag2; which details the fantastic gains in accurate recognition from greater distances and angles:

I actually do plan to support April Tags. I’ve found the C++ library for it. Reviewed it, and determined it can be ported. However, I’ll have to rewrite almost every line since the C++ library depends on OpenCV calls and it uses C++ objects. The QRCode library only required minor changes to be ported and basically worked on the first try… I don’t expect April tags to be that easy so supporting that will come after the M7 board is out.

The good news, QRCode supports works well on the M4.

Is the qrcode library in the latest firmware for M4? Any examples to test it?

Yes but we didn’t release the latest firmware yet, maybe in a week or so, for now you could build from source or try the development firmware images. I just updated them for you:
https://github.com/openmv/openmv/tree/master/firmware

You’ll find all the new scripts here:
https://github.com/openmv/openmv/tree/master/usr/examples

QR examples here:
https://github.com/openmv/openmv/blob/master/usr/examples/09-Feature-Detection/

Just install the M4 firmware and run this script: https://github.com/openmv/openmv/blob/master/usr/examples/09-Feature-Detection/qrcodes_with_lens_zoom.py

It works. Thank you both!

AprilTags 2 support done!

Yes: image — machine vision — MicroPython 1.15 documentation

See the example under codes in OpenMV IDE.