← Computer Vision learning path
Computer Vision · Module 2 of 10

Image basics with OpenCV

Load, display and transform images in Python.

📖 Key ideas

  1. OpenCV (cv2) is the most popular CV library.
  2. cv2.imread loads images as NumPy arrays (BGR order).
  3. Resize, crop, rotate and flip images.
  4. Convert colour spaces: cv2.cvtColor(img, cv2.COLOR_BGR2GRAY).
  5. Draw shapes and text for annotations.
💡 Real-life example: OpenCV is a photo editor you control with code instead of a mouse.
OpenCVOpen-source computer vision library
BGROpenCV's default colour order
GrayscaleSingle-channel image
cvtColorConverts colour spaces