Skip to Content
Hands-On Edge Analytics with Azure IoT
book

Hands-On Edge Analytics with Azure IoT

by Colin Dow
May 2020
Intermediate to advanced
262 pages
6h 48m
English
Packt Publishing
Content preview from Hands-On Edge Analytics with Azure IoT

Explaining the code

It only takes 12 lines of code to read and display a QR code on screen using MicroPython. The only two libraries we need to import are sensor and image:

import sensorimport image

The sensor library is used by cameras for taking pictures. We store the resulting object in our code as an image object. Hence, we are required to import the image library.

After importing this library, we reset the sensor and then set parameters used for the rest of our code:

sensor.reset()sensor.set_pixformat(sensor.GRAYSCALE)sensor.set_framesize(sensor.QVGA)sensor.set_vflip(1)

Setting the format to GRAYSCALE as opposed to a color format reduces processing needs. Since QR codes are made with a black and white pattern, a color format would be ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Azure IoT Edge Computing: Extending the Cloud to the Intelligent Edge

Beginning Azure IoT Edge Computing: Extending the Cloud to the Intelligent Edge

David Jensen

Publisher Resources

ISBN: 9781838829902Supplemental Content