0%

Book Description

Perform a wide variety of computer vision tasks such as image processing and manipulation, feature and object detection, and image restoration to build real-life computer vision applications

Key Features

  • Explore the potential of computer vision with Raspberry Pi and Python programming
  • Perform computer vision tasks such as image processing and manipulation using OpenCV and Raspberry Pi
  • Discover easy-to-follow examples and screenshots to implement popular computer vision techniques and applications

Book Description

Raspberry Pi is one of the popular single-board computers of our generation. All the major image processing and computer vision algorithms and operations can be implemented easily with OpenCV on Raspberry Pi. This updated second edition is packed with cutting-edge examples and new topics, and covers the latest versions of key technologies such as Python 3, Raspberry Pi, and OpenCV. This book will equip you with the skills required to successfully design and implement your own OpenCV, Raspberry Pi, and Python-based computer vision projects.

At the start, you'll learn the basics of Python 3, and the fundamentals of single-board computers and NumPy. Next, you'll discover how to install OpenCV 4 for Python 3 on Raspberry Pi, before covering major techniques and algorithms in image processing, manipulation, and computer vision. By working through the steps in each chapter, you'll understand essential OpenCV features. Later sections will take you through creating graphical user interface (GUI) apps with GPIO and OpenCV. You'll also learn to use the new computer vision library, Mahotas, to perform various image processing operations. Finally, you'll explore the Jupyter Notebook and how to set up a Windows computer and Ubuntu for computer vision.

By the end of this book, you'll be able to confidently build and deploy computer vision apps.

What you will learn

  • Set up a Raspberry Pi for computer vision applications
  • Perform basic image processing with libraries such as NumPy, Matplotlib, and OpenCV
  • Demonstrate arithmetical, logical, and other operations on images
  • Work with a USB webcam and the Raspberry Pi Camera Module
  • Implement low-pass and high-pass filters and understand their applications in image processing
  • Cover advanced techniques such as histogram equalization and morphological transformations
  • Create GUI apps with Python 3 and OpenCV
  • Perform machine learning with K-means clustering and image quantization

Who this book is for

This book is for beginners as well as experienced Raspberry Pi and Python 3 enthusiasts who are looking to explore the amazing world of computer vision. Working knowledge of the Python 3 programming language is assumed.

Table of Contents

  1. Raspberry Pi Computer Vision Programming
  2. Second Edition
  3. Why subscribe?
  4. Contributors
  5. About the author
  6. About the reviewers
  7. Packt is searching for authors like you
  8. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Code in Action
    6. Download the color images
    7. Conventions used
    8. Get in touch
    9. Reviews
  9. Chapter 1: Introduction to Computer Vision and the Raspberry Pi
    1. Understanding computer vision
      1. OpenCV
    2. Single-board computers
      1. The Beagleboard family
      2. ASUS Tinkerboard
      3. NVIDIA Jetson
      4. Intel boards
    3. Raspberry Pi
      1. Raspberry Pi models
    4. OSes for Raspberry Pi
    5. Setting up Raspbian on a Raspberry Pi
      1. Downloading the necessary software
      2. Preparing the microSD card manually
      3. Booting up the Raspberry Pi for the first time
      4. Connecting various RPi board models to the internet
    6. Updating the RPi
    7. Summary
  10. Chapter 2: Preparing the Raspberry Pi for Computer Vision
    1. Remotely logging into the RPi with SSH
    2. Remote desktop access
    3. Installing OpenCV on an RPi board
    4. Heatsinks and overclocking RPi 4B
    5. Summary
  11. Chapter 3: Introduction to Python Programming
    1. Technical requirements
    2. Understanding Python 3
      1. Python on RPi and Raspberry Pi OS
      2. Python 3 IDEs on Raspberry Pi OS
      3. Working with Python 3 in interactive mode
      4. The basics of Python 3 programming
    3. The SciPy ecosystem
      1. The basics of NumPy
      2. Matplotlib
    4. RPi GPIO programming with Python 3
      1. LED programming with GPIO
      2. Push-button programming with GPIO
    5. Summary
  12. Chapter 4: Getting Started with Computer Vision
    1. Technical requirements
    2. Exploring image datasets
    3. Working with images using OpenCV
    4. Using matplotlib to visualize images
    5. Drawing geometric shapes with OpenCV and NumPy
    6. Working with a GUI
    7. Event handling and a primitive paint application
    8. Working with a USB webcam
      1. Capturing images with the webcam
      2. Timelapse photography
      3. Webcam video recording
      4. Capturing images with the webcam using Python and OpenCV
      5. Live videos with the webcam using Python and OpenCV
      6. Webcam resolution
      7. FPS of the webcam
      8. Saving webcam videos
      9. Playing back the video with OpenCV
    9. The Pi camera module
      1. Capturing images and videos with the raspistill and raspivid utilities
      2. Using picamera with Python 3
      3. Using the RPi camera module and Python 3 to record videos
    10. Summary
  13. Chapter 5: Basics of Image Processing
    1. Technical requirements
    2. Retrieving image properties
    3. Basic operations on images
      1. Splitting the image into channels
      2. Adding a border to an image
    4. Arithmetic operations on images
    5. Blending and transitioning images
    6. Multiplying images by a constant and one another
    7. Creating a negative of an image
    8. Bitwise logical operations on images
    9. Summary
  14. Chapter 6: Colorspaces, Transformations, and Thresholding
    1. Technical requirements
    2. Colorspaces and converting them
      1. HSV colorspace
      2. Tracking in real time based on color
    3. Performing transformation operations on images
      1. Scaling
      2. The translation, rotation, and affine transformation of images
    4. Perspective transformation of images
    5. Thresholding images
      1. Otsu's binarization method
      2. Adaptive thresholding
    6. Summary
  15. Chapter 7: Let's Make Some Noise
    1. Technical requirements
    2. Noise
      1. Introducing noise to an image
    3. Working with kernels
    4. 2D convolution with the signal processing module in SciPy
    5. Filtering and blurring with OpenCV
      1. 2D convolution filtering
      2. Low-pass filtering
    6. Summary
  16. Chapter 8: High-Pass Filters and Feature Detection
    1. Technical requirements
    2. Exploring high-pass filters
    3. Working with the Canny edge detector
      1. Finding circles and lines with Hough transforms
    4. Harris corner detection
    5. Exercise
    6. Summary
  17. Chapter 9: Image Restoration, Segmentation, and Depth Maps
    1. Technical requirements
    2. Restoring damaged images using inpainting
    3. Segmenting images
      1. Mean shift algorithm segmentation
      2. K-means clustering and image quantization
      3. Comparison of k-means and the mean shift algorithm
    4. Disparity maps and depth estimation
    5. Summary
  18. Chapter 10: Histograms, Contours, and Morphological Transformations
    1. Technical requirements
    2. Computing and visualizing histograms
      1. Histogram equalization
    3. Visualizing image contours
    4. Applying morphological transformations to images
    5. Summary
  19. Chapter 11: Real-Life Applications of Computer Vision
    1. Technical requirements
    2. Implementing the Max RGB filter
    3. Implementing background subtraction
    4. Computing the optical flow
    5. Detecting and tracking motion
    6. Detecting barcodes in images
    7. Implementing the chroma key effect
    8. Summary
  20. Chapter 12: Working with Mahotas and Jupyter
    1. Technical requirements
    2. Processing images with Mahotas
      1. Reading images and built-in images
      2. Thresholding images
      3. The distance transform
      4. Colorspace
    3. Combining Mahotas and OpenCV
    4. Other popular image processing libraries
    5. Exploring the Jupyter Notebook for Python 3 programming
    6. Summary
  21. Chapter 13: Appendix
    1. Technical requirements
    2. Performance measurement and the management of OpenCV
    3. Reusing a Raspbian OS microSD card
      1. Formatting the SD card using the SD card formatter
      2. The Disk Management utility in Windows
    4. Tour of the raspi-config command-line utility
    5. Installation and the environment setup on Windows, Debian, and Ubuntu
    6. Python implementations and Python distributions
  22. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
18.221.165.246