8 Keyboard-controlled camera

This chapter covers

  • Capturing images and streaming live videos from the camera
  • Drawing shapes and writing text using the OpenCV library
  • Moving servo motors to specific angles and positions
  • Using keyboard events in OpenCV to make servo movements

In this chapter, we will build a robot with a camera attached to two servo motors. One servo will allow us to pan the camera, and the other will apply a tilt motion. In this way, we can point the camera in many different directions. In addition, we will detect and use keyboard events to move the motors in different directions and capture and save photos from the live camera stream.

We have explored the use of touch screens on mobile devices and joysticks as human interaction ...

Get Build Your Own Robot now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.