Skip to content
firepick1 (pixel) edited this page Jul 18, 2014 · 10 revisions

Detect and decode text QR codes.

<img src="https://raw.githubusercontent.com/wiki/firepick1/FirePick/LGPL-restricted.jpg"

This stage uses the zbar library (http://zbar.sourceforge.net/).

Pipeline

 {"op":"qrDecode", "show":1}
  • show update working image and 0:do not show detected QR codes; 1:show boundaries of detected QR codes;

Example: A ripped wiki pipeline

The output of the stage is an array of qr code center coordinates and decoded text. If the qr code is not decoded (or not present in the image), both the coordinates default to -1.

Running the following command

firesight -p json/qrDecode.json -i 600px-QR_Code_Damaged.jpg -o qr-damaged-result.jpg

on an image taken from Wikipedia yields the following results:

{
  "s1":{
    "qrdata":[
      {
        "x":304.0,
        "y":292.0,
        "text":"http://en.m.wikipedia.org"
      }
    ]
  }
}

qr-damaged-result

Example: See the tiny git pipeline

firesight -p json/qrDecode.json -i img/qr-tiny.jpg -o target/qr-tiny.png

Here's a tiny, not quite rectangular QRCode of a git commit hash:

qr-tiny.png qr-tiny.png

{
"s1":{
  "qrdata":[
      {
	"x":87.5,
	"y":117.0,
	"text":"29bf4b2f6036895011510c29da08d9d9fe097fd4"
      }
    ]
  }
}
Clone this wiki locally