Reading a Code

A run has two steps: say which image to read, then call execute. All paths below are relative to the application’s base path, hdvisionsystems/lumiscan-qr-code-reader.

1. Point the reader at an image

Write the address of the image node to input/image-address:

hdvisionsystems/lumiscan-cam-driver/camera1/output/image

This is the address of the image node itself, not of its data child — the reader appends /data, /width, /height and /pixel-type when it reads.

The address is remembered, so it only needs setting again when the image source changes.

2. Call execute

Write an empty value to the execute method.

The call is blocking: it returns when the search has finished. When it returns, output/results holds every QR code found in that image — see The Result.

What a run does

  1. Reads the address from input/image-address.

  2. Reads data, width, height and pixel-type from that address, and converts the pixels to an image — de-Bayering it if the format calls for that.

  3. Searches the whole image for QR codes.

  4. Writes every code it found to output/results.

There is no region of interest and no partial search: each run reads the entire current contents of the image node.

When a run fails

A run fails if the image cannot be read — no address set, an address that does not resolve, a missing or short data buffer, or a pixel format the reader does not support. The reason is written to the application log.

A failed run leaves output/results untouched, holding the previous run’s codes. This version publishes no status node and echoes no identifier, so the result alone cannot tell you whether it is fresh. If a run’s outcome matters, check the log — or read output/results before and after and compare.

An empty output/results means the image was read successfully and contained no QR code.