RoboticsIntermediate

Computer Vision for Robots with OpenCV

Detect, track and follow objects from a robot's camera.

Taught by Bikash Pandey · Embedded Systems Engineer

What you'll learn

  • Capture, process and display live camera frames with Python and OpenCV at a measured frame rate
  • Calibrate a camera with a chessboard and correct lens distortion using the saved intrinsics
  • Detect objects by colour and shape using HSV masks, morphology and contour filters
  • Estimate the 3D position and orientation of ArUco markers with solvePnP
  • Track a moving target across frames and smooth its position with a Kalman filter
  • Convert target position into bounded, fail-safe steering commands for a differential-drive robot or ROS 2 node

About this course

This intermediate course teaches you to give a robot working eyes using Python and OpenCV. It is for makers, robotics students and embedded engineers who can already write basic Python and want to move from still images to a camera that drives motion. You will calibrate a USB or Raspberry Pi camera, remove lens distortion, detect objects by colour in HSV space, find shapes with contours, and read ArUco markers to estimate a target's position and distance in real units. You will then track objects across frames, smooth noisy measurements with a Kalman filter, and close the loop by turning pixel error into steering commands for a wheeled robot or a ROS 2 node, with the fail-safe behaviour a real robot needs. Prerequisites: comfortable Python, basic NumPy and a webcam. A laptop is enough to start; a small robot kit is optional.

Course content

7 lessons
  1. 1How a Robot Sees: Cameras, Frames and OpenCVSet up OpenCV, grab live frames and learn the perception loop every vision-guided robot runs.Preview
  2. 2Camera Calibration and Lens DistortionCalibrate your camera with a chessboard so that pixels map reliably to real-world geometry.
  3. 3Colour Detection in HSV SpaceIsolate objects by colour with HSV thresholds, masks and morphology that cope with changing light.
  4. 4Shapes, Contours and Filtering DetectionsFind object outlines, classify simple shapes and reject false positives by area, aspect and solidity.
  5. 5ArUco Markers and Pose EstimationDetect fiducial markers and recover their 3D position and orientation relative to the camera.
  6. 6Tracking Objects Across FramesFollow a target with OpenCV trackers and smooth noisy positions with a Kalman filter.
  7. 7Closing the Loop: From Pixels to MotionTurn target position into steering and speed commands for a wheeled robot or a ROS 2 node.