QR Code Scanner

QR scanner
Extension Description
Detect, identify and read QR codes from images.

Introduction

What is QR Code?

QR Code is a machine-scannable image that can be instantly read, using a smartphone camera. Every QR code consists of a number of black squares and dots that represent some encoded piece of information; like alphabets, numbers, etc. When your Smartphone scans this code, it translates that encoded information that only computers can understand, into something that can be easily understood by humans.

 

The QR Code Scanner extension allows users to scan QR codes from the camera or stage and report the information:

  1. QR Code Data
  2. QR code position on the stage
  3. QR code angle alignment on the stage

Accessing QR Code Scanner in Block Coding

Following is the process to add QR Code Scanner capability to the PictoBlox Project.

  1. Open PictoBlox and create a new file.
  2. Select the coding environment as Block Coding.
  3. Next, click on the Add Extension button and add the QR Code Scanner extension.
  4. You can find the QR Code Scanner blocks available in the project.

Accessing QR Code Scanner  in Python Coding

Following is the process to add QR Code Scanner capability to the PictoBlox Project.

  1. Open PictoBlox and create a new file.
  2. Select the coding environment as Python Coding.
  3. Next, click on the Add Modules/Libraries button and add the QR Code Scanner extension.
  4. To access the library functions, you have to add the object declaration.
    qr = QRCodeScanner()

Example Project Video

In this project, a QR code is generated with the help of a QR code generator website. credits – https://www.qr-code-generator.com/

The QR code is linked to a URL. Then, the QR code is scanned with the help of the QR code scanner extension of Pictoblox. The project is created by RS Junction.

Read More

PictoBlox Blocks

The turn () video on stage with () % transparency block controls the control the camera feed on the stage.
The block enables or disables the automatic display of the box on the QR code on the stage. This is useful when you want to see if the detection happens or not.
This block analyses the image and saves the QR Code information locally, which can be accessed using other blocks. You have to run this block every time you want to analyze a new image from the camera.
The block returns whether the QR Code is detected in the analysis or not.
The block returns the QR Code data value detected.
The block returns the x or y coordinate of the specified landmark points of the QR code.
The function returns the QR Code angle detected.
All articles loaded
No more articles to load

Block Coding Examples

All articles loaded
No more articles to load

Python Functions

The function is used to control the state of the camera.
Syntax: video(video_state = “on”, transparency = 1)
The function enables the automatic display of the box on QR Code detection on the stage.
Syntax: enablebox()
The function disables the automatic display of the box on QR Code detection on the stage.
Syntax: disablebox()
This function is used to analyze the image received as input from the camera, for QR Code.
Syntax: analysecamera()
This function is used to analyze the image received as input from the stage, for QR Code.
Syntax: analysestage()
The function returns whether the QR Code is detected in the analysis or not.
Syntax: isdetected()
The function returns the X position of the specified landmark points of the QR code.
Syntax: xpos(landmark_name = “center”)
The function returns the Y position of the specified landmark points of the QR code.
Syntax: ypos(landmark_name = “center”)
The function returns the QR Code data value detected.
Syntax: codedata()
The function returns the QR Code angle detected.
Syntax: angle()
All articles loaded
No more articles to load

Python Coding Examples

All articles loaded
No more articles to load
Table of Contents