The QRD library provides applications with functionality to decode QR Code patterns. The QRD library supports decoding QR Code patterns with image sizes up to VGA size, and QR Code versions up to version 40.
Note: Once an image is passed to a function, control normally does not return to the calling function until processing is complete, regardless of whether it succeeds or fails.
This version supports the following QR Code specifications.
QR Code specifications
QR Code version | Versions 1 through 40 |
---|---|
Models | Model 2 only |
Mode | Numeric mode: 0-9 (ASCII codes 0x30 - 0x39 )Alphanumeric mode: 0-9 (ASCII codes 0x30 - 0x39 ), A-Z (ASCII codes 0x41 - 0x5A ), single-byte space, $, %, *, +, -, /, : symbols (ASCII codes 0x20 , 0x24 , 0x25 , 0x2A , 0x2B , 0x2D to 0x2F , 0x3A )Kanji mode: Shift_JIS kanji based on JIS X 0208. 8-bit byte mode: Data based on JIS X 0201 (ASCII codes 0x00 to 0xFF ). This mode includes the lowercase letters a-z (ASCII values 0x61 - 0x7A ).Mixed mode: Data that is a combination of the four modes above. Concatenate mode: Data split into multiple QR Code patterns. No support for FNC1 mode or ECI mode. |
Print resolution for read printed images | 96 dpi to 32 dpi (1x printing through 3x printing) (recommended size: 1.5x) |
Cell pitch size (For capture by the 3DS Camera) |
For a printed QR Code, a 0.45mm/cell or larger is recommended. For display on the 3DS screen, 2 dots or more is recommended. |
Error correction capability | L, M, H, Q (recommended value: M) |
The above specifications vary, depending on the printing conditions of the image being recognized (sharpness, paper quality) and on the conditions under which the image is being captured (brightness, hand shake).
Color-printed QR Code patterns can be recognized, but some colors may not be readable, depending on factors including printing conditions.
These are the recommended camera settings when images captured with the CTR Camera library are decoded using the QRD library.
Resolution | VGA |
---|---|
Frame Rate | 15 fps (default value) |
Output format | YUV422 |
Effect processing | None |
Flipping | None |
Photo mode | Text mode. |
White balance | Automatic |
Exposure time | Automatic |
Sharpness | +5 |
After changing the sharpness value in the CTR camera library, changing the photo mode alters the set sharpness value.
When using this recommended camera configuration, first set the photo mode to text, and then set the sharpness to +5.
The general procedure for decoding QR Code patterns is described below.
1. Pass the maximum height and width of the image to decode to theGetDecodeBufferSize
function, and obtain the size required for the decoding buffer.Initialize
function to prepare for decoding.ExecuteDecode
function.DecodeData
).Finalize
function.
It is possible to divide up and store a single set of data in as many as 16 QR Code patterns. The QRD library supports these concatenated QR Code patterns.
If the QR Code to be decoded is a concatenated QR Code, the values set in the total and index fields of the DecodeData
object will reflect this. If it is not a concatenatable QR Code, the value of the total field will be set to 0.
The parity information for the original complete set of data before dividing is stored in the parity field of the DecodeData
object. When concatenating the decoded results of QR Code patterns on the application side, use the total and index fields to confirm each QR Code pattern's place in the concatenation order. Also check that each QR Code pattern's parity value matches, to confirm that the divided QR Code patterns all belong to the correct set.
When the original complete set of data is divided among QR Code patterns, it is broken up in a logical way. If double-byte characters (for example, kanji or hiragana) are contained in the data, the kanji are divided up into units of 2 bytes. In other words, double-byte characters are not divided in half.
This example shows an original complete piece of data divided over several QR Code patterns. They store "abcdefg日本." | |||
![]() | |||
Data Divided into Four QR Code patterns | |||
![]() |
![]() |
![]() |
![]() |
ab | cde | fg | 日本 |
When the concatenating the data on the application side, first verify the concatenation order and the fact that all the divided pieces of data belong to the correct set. After that, simply append each piece of data onto the next to get the original data.
There is no feature for setting the content type of data stored in QR Code patterns. Accordingly, applications that decode QR Code patterns must themselves determine the content type of the decoded data. For more information, see the sample demos.
This library can decode images up to 640 pixels wide and 480 pixels tall. We recommend using a VGA camera resolution for better image quality if you are decoding images taken with the CTR camera. To decode a camera image, capture it at the VGA size, specify the region to be decoded, and then pass it to the ExecuteDecode
function.
This library is not thread-safe, so it may not operate normally when functions are called from an interrupt handler or a different thread.
CONFIDENTIAL