Table of Contents

Function Definition: analysecamera()

Parameters

Description

This function is used to analyze the image received as input from the camera, for QR Code.

Alert: This block processes the image input and updates the values in the other functions hence it needs to be put inside loops while making projects.

Example

The example demonstrates how to make a QR Code reader in the Python Coding Environment.

Code

sprite = Sprite('Square Box')
qr = QRCodeScanner()

qr.video("on flipped", 0)
qr.disablebox()

while True:
  qr.analysecamera()
  if qr.isdetected():
    sprite.setx(qr.xpos("center"))
    sprite.sety(qr.ypos("center"))
    sprite.setdirection(qr.angle())
    sprite.say(qr.codedata())
    sprite.show()
  else:
    sprite.hide()

Output

Read More
All articles loaded
No more articles to load