Current state of 1D/2D barcode detection performance on RT1062

We are starting a project where openmv will be used as the vision for our AGV. We are currently detecting and following lines. The line detection is pretty solid at 90FPS (QQVGA). Camera is mounted with a global shutter and fisheye a couple inches from the ground looking straight downward.

As we travel the line we need to periodically read a code. The question is which code type will openmv read with the best performance, and most reliable? I have read that 1D codes are handled by zbar, and that all symbologies are always included, which likely slows down detection? As for 2D QR code and April tag, are those read with different libraries?

It seems to me that reading 1D codes would be much faster than 2D, but was hoping to learn more about the various options for code reading and how they compare to each other?

Sorry for the late response. I am at CES.

I have read that 1D codes are handled by zbar, and that all symbologies are always included, which likely slows down detection? As for 2D QR code and April tag, are those read with different libraries?

You can control which codes are decoded. This allows for a significant speedup. There are about 16 enabled by default so if you set it to just 1 then you should see a massive boost. Also, The algorithm scans each linear line of resolution for each code type. Given this, it’s quite easy to make it faster by just reducing the ROI height.

As for 2D QR code and April tag, are those read with different libraries?

Yes. 2D codes are going to be much slower. I would just stick with reading 1D barcodes of one family type with an ROI that has a short height.

How do we disable the other codes? Not seeing anything in the docs under Image.find_barcodes() or the Image class itself

I apologize, that functionality to disable different barcode types appears to be only implemented for AprilTags from the Python level.

Mmm, to disable these you have to recompile the firmware with the enable defines in the in src/omv/impib/zbar.c disabled at the top of the file.

Are you able to compile a custom firmware? If not, please let me know if you are able to get away with just reducing the ROI height and if you need me to disable the codes I can build a custom firmware image quickly if you let me know what codes you want enabled versus all.

@kwagyeman we’ve never compiled firmware before, if you are able to help us compile one we are just trying to read the Code128 symbology. At VGA and 10px ROI we currently are only getting around 10FPS so we are hoping this will help some. Codes would be 6 chars, something like https://www.webarcode.com/barcode/image.php?code=a1b2c3&type=C128B&xres=2&height=50&width=284&font=3&output=png&style=453

Appreciate the help, thanks!

firmware.zip (1.1 MB)

I’ve disabled all the codes but Code128. Please give it a try.

@kwagyeman I attempted to flash that firmware onto an RT1062. IDE (v4.4.7) on a Windows machine went through the process with no apparent errors but now the cam won’t reconnect to the IDE and the board is showing a solid green light.

Ah…

Sorry, I compiled it for the H7 Plus. Just got back for CES and processing emails.

Here’s how to recover:

  1. Attach a wire to SBL and VCC.
  2. Plug into the PC and follow the prompts.
  3. Remove the camera from the PC and remove the wire once the IDE gets to the final dialog about the blue LED flashing.
  4. Now it should be restored and you can flash the attached firmware below.

Uploading: firmware.zip…

I tested on the H7 Plus and it works for the code you linked to an runs at 40 FPS.

@kwagyeman Can you check the download link on that? Shows as “Uploading: firmware.zip…” but isn’t clickable/downloadable

firmware.zip (1.7 MB)

Fixed

Thanks! I am having trouble getting anything to happen when I plug it in the PC. Does it matter which 3.3v pin I jump the SBC pin to? Tried on both sides as well as the Raw output with no luck

Just the VCC pin. The SBL pin just needs to be pulled up to 3.3V when the camera turns on to put it into the SBL bootloader mode.

It should NOT be connected to RAW.

I’ve got it wired up, same result as in this thread RT1062 bricked and cannot connect to IDE - #4 by jjrzov

Resolved via PM.

Thanks for the help. A+++ service. To those looking for the right device for your project, the folks here at OpenMV have nailed it. Looking forward to the future!