10 Robotic QR code finder
This chapter covers
- Generating QR codes
- Detecting and decoding data in QR codes
- Streaming live video using Motion JPEG
- Creating a robot to search its environment for specific QR codes
This chapter will start off by exploring the QR code standard and learning how to generate your own QR codes. Then we will use the OpenCV computer vision library to detect QR codes in images as well as to read the data encoded in the QR code itself. We will then learn how to save the video stream data from the camera to the filesystem so that multiple applications can read live video data at the same time. This will allow us to check the video stream for QR codes we are interested in as well as stream the video to desktop and web applications at the same time. We will use the Tornado web framework to create a Motion JPEG video server that we can access from any mobile device or computer on the network to get a live view of the robot’s camera video stream. Finally, we end the chapter by creating a robot that can move around in search of matching QR codes in its environment.
Bringing all these technologies together helps us solve the problem of having robots use computer vision to see their environment and move around to different desired locations by looking for matching QR codes in the environment. This is a core functionality for many robots that must perform autonomous navigation in warehouses or factories.