liveBook · Manning

Machine learning

As explained in Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi

Machine learning is the computational practice of fitting models to data so they can make predictions or decisions without being explicitly programmed for every case.

Machine learning enables robots to use sensor or image inputs to detect events, choose actions, and respond autonomously without explicit rules for every case. section 9.0

Robotic uses include:

  • Detecting faces in camera images and live video. section 9.0
  • Driving servo motors so a camera follows detected face movements. section 9.0
  • Supporting autonomous tasks such as delivery and construction through sensor-based decisions. section 9.0

Face detection with OpenCV

OpenCV trains Haar feature-based cascade classifiers from positive and negative face images. A pretrained XML model can then classify an image: import cv2, locate the installed data directory, create a CascadeClassifier, read photo.jpg, convert it to grayscale, equalize its histogram, and call detectMultiScale. The resulting coordinates identify detected faces for later motor control. section 9.3.1

Figure 2.2 Raspberry Pi: the main hardware interfaces on the board are labeled.

Use the Raspberry Pi hardware overview to identify the compact computer, camera support, processing resources, and connectivity that support machine-learning robot projects. section 2.1.1

How Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi covers it

How deep it goes
Explains trained cascade classifiers and demonstrates a pretrained model, stopping short of broader learning algorithms or mathematical treatment.
Examples
Uses OpenCV face detection, Raspberry Pi camera images, pretrained XML models, and a servo-driven face-following camera.
What it assumes
Assumes a Raspberry Pi, camera, Python, and OpenCV environment while introducing the detection workflow incrementally.
What you can do after
Builds a face-detection pipeline with OpenCV and connects detected movement to robotic camera control.
How it connects
Connects machine learning with artificial intelligence, computer vision, face detection, sensor inputs, cameras, and servo motors.

Also explained in

Compare how 42 books explain machine learning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi. The section links point to the parts of the book it draws on.