Segmentation by Clustering
Learn what image segmentation is and how perceptual grouping becomes a computational process. Explore human vision and Gestalt principles, shot-boundary detection, background subtraction, pixel clustering, and graph-theoretic clustering, then apply related texture extraction and pedestrian detection techniques through practical programs.
Start this course from the course page to save your progress.
Segmentation Fundamentals and Gestalt Grouping
Learn how segmentation assigns labels to pixels and how masks represent meaningful regions. Compare classification, detection, semantic segmentation, instance segmentation, and panoptic segmentation; then explore thresholding, Gestalt grouping principles, K-means clustering, morphology, and connected components in a practical damage-inspection pipeline.
Build an intuitive understanding of pixels, labels, masks, thresholding, visual grouping, clustering, morphology, and region measurement through interactive examples and a factory-damage case study.
Learn how to segment an image based on color using OpenCV and Python. Create a sample image, define BGR color ranges, generate a binary mask with cv2.inRange(), and apply the mask to isolate selected regions of an image.
Learn how K-means groups similar pixel colours to segment an image. Implement the algorithm using Python and OpenCV while understanding reshaping, clustering criteria, labels, cluster centers, and image reconstruction.
Learn how to clean and repair binary images using erosion, dilation, opening, and closing. Understand kernels, thresholding, noise removal, gap filling, and object-boundary manipulation using Python and OpenCV.
Video Segmentation Applications
Apply segmentation ideas across time. Detect hard shot boundaries by comparing normalized HSV histograms and extract moving foreground regions with MOG2 background subtraction, while learning how thresholds, camera motion, lighting changes, shadows, and gradual transitions affect results.
Explore shot-boundary detection and background subtraction with interactive thresholds, foreground-mask cleanup, practical assumptions, and common failure modes.
Graph-Theoretic Image Segmentation
Represent an image as a weighted graph whose nodes are pixels or superpixels and whose edges encode similarity or boundary evidence. Build a region adjacency graph with SLIC superpixels and use normalized cuts to separate dissimilar groups while preserving coherent regions.
Trace the full graph-based pipeline from RGB pixels to SLIC superpixels, a weighted region adjacency graph, and normalized-cut segmentation, then reason about the effect of important parameters.
Texture Feature Extraction
Describe spatial texture using gray-level co-occurrence matrices. Quantize grayscale images, count neighboring pixel pairs in multiple directions, and interpret contrast, dissimilarity, homogeneity, energy, and correlation for whole images and local patches.
Learn how to extract texture features from grayscale images using GLCM and detect pedestrians using OpenCV’s HOG-based object detector. This codelab explains both practicals step by step with simple code, line-by-line explanations, execution flow, and revision questions.