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.

10.1 Hardware stack

 

10.2 Software stack

 
 
 

10.3 Detecting QR codes in an image

 

10.3.1 Exploring QR codes

 
 
 
 

10.3.2 Marking detected QR codes

 

10.4 Streaming live video to multiple applications

 
 

10.4.1 Saving the video stream to a ramdisk

 

10.4.2 Watching the filesystem for changes

 
 

10.4.3 Streaming to a graphical application

 
 
 

10.4.4 Detecting QR codes in a video stream

 
 
 

10.4.5 Streaming to a web browser

 
 

10.5 Moving the robot to a target QR code

 
 
 

10.5.1 Find the QR code

 
 
 

10.6 Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest