The IMAQ Read QR Code VI
has no input to specify the number of QR codes to detect. The expectation is that the ROI specified to this VI will only contain one QR code which can be read.
However, there is no such limitation while using Pattern Matching, either using Vision Assistant
or IMAQ VIs
. The number of matches to find can be specified in pattern matching. This can be leveraged to read multiple QR codes as shown below:
Figure 1: Block Diagram
- This snippet is from the Main VI (Read Multiple QR Codes.vi) in the attached LabVIEW project.
- In this VI, the image is loaded (QR CODES.png) and pattern matching is performed on it. Note that the template used (TestTemplate.png) is created using NI-Vision Template editor in NI-Vision Assistant Express VI.
- The pattern matching results, i.e., the bounding boxes are overlaid and then converted to ROIs using Convert Bounding Box to ROI and Overlay.vi in the for loop.
- Now that we have the individual ROIs, we can now perform QR code read on them individually.
- The front panel results are shown below:
Figure 2: The snip on left shows the Front panel after loading the main image. The snip on the right shows the front panel after Pattern Matching and QR Read.
Depending on the type of QR Codes to be read in the image, the template used in the pattern matching block inside the Vision Assistant Express VI can be changed.