
Nhập môn thị giác máy tính
Computer vision is a rapidly growing field within artificial intelligence that enables machines to interpret visual information from the world. Unlike simple image processing tasks, the core…

Vì sao máy tính khó nhận diện cùng một vật thể trong các ảnh khác nhau?
Điểm khác biệt chính giữa thị giác máy tính truyền thống và học sâu là gì?
Ảnh nhị phân khác ảnh xám ở điểm nào?
Ảnh RGB kích thước $640 \times 480$ có 3 kênh, mỗi giá trị 8 bit. Dữ liệu thô chiếm bao nhiêu byte?
Vì sao không thể khôi phục chắc chắn màu gốc của một pixel chỉ từ giá trị xám của nó?
Một ảnh tài liệu bị nghiêng và nhiễu cần được chuẩn bị để nhận dạng chữ. Trình tự nào phù hợp?
Khi phóng lớn ảnh có nhãn vùng, vì sao nội suy láng giềng gần nhất thường phù hợp?
Canny tạo ra loại thông tin nào từ ảnh?
Sơ đồ minh họa bốn nhiệm vụ trên cùng ảnh hoa. Nhiệm vụ nào thể hiện vùng đối tượng ở mức pixel?
Introduction to Computer Vision
Computer vision is a rapidly growing field within artificial intelligence that enables machines to interpret visual information from the world. Unlike simple image processing tasks, the core goal of computer vision is to transform raw pixel data into meaningful insights—such as recognizing objects, understanding scenes, or extracting text. This course provides a foundational overview of the key concepts, challenges, and techniques that underpin modern computer‑vision systems.
Core Objective of Computer Vision
The primary purpose of computer vision is to convert image data into useful information. Whether the task is detecting a pedestrian in a street‑view image, classifying medical scans, or reading handwritten text, the system must extract semantic meaning from the pixel matrix. Enhancing image resolution or storing images in specific formats are useful preprocessing steps, but they are not the ultimate aim.
- Semantic extraction: Identify objects, actions, and relationships.
- Scene understanding: Infer context, depth, and layout.
- Decision support: Provide actionable data for downstream applications (e.g., autonomous driving, quality inspection).
Why Visual Variability Is Challenging for Machines
Humans can recognize the same object under vastly different conditions—different viewpoints, lighting, distances, or partial occlusions. For computers, each variation creates a new pixel pattern that may look unrelated to the original. This variability is the main obstacle in visual recognition:
- Viewpoint changes: Rotation or perspective alters the shape of the object.
- Illumination changes: Shadows and highlights modify pixel intensities.
- Scale differences: Objects appear larger or smaller depending on distance.
- Occlusion: Parts of the object may be hidden by other objects.
Effective vision systems therefore need to discover stable features—characteristics that remain consistent despite these transformations.
Traditional Vision vs. Deep Learning
Historically, computer‑vision pipelines relied on hand‑crafted features such as edges, corners, or texture descriptors (e.g., SIFT, HOG). These features were designed by experts to capture specific visual cues. In contrast, deep learning approaches automatically learn hierarchical representations directly from raw images:
- Traditional methods: Feature extraction → feature selection → classifier (often a linear model or SVM).
- Deep learning methods: End‑to‑end neural networks that learn both feature extraction and classification simultaneously.
The shift to deep learning has dramatically improved performance on complex tasks because networks can model intricate patterns that are difficult to encode manually.
Image Types: Binary, Grayscale, and Color
Understanding the different image representations is essential for preprocessing and algorithm selection:
- Binary images: Contain only two intensity levels (typically 0 for black and 1 for white). They are useful for segmentation, mask creation, and morphological operations.
- Grayscale images: Represent a range of intensities, usually 256 levels (0‑255). They capture luminance information while discarding color, reducing computational load.
- Color images (e.g., RGB): Consist of three channels—red, green, and blue—each stored with its own intensity value.
While binary images are a subset of grayscale, the key distinction lies in the number of possible intensity values, not in resolution or channel count.
Calculating Raw Image Size
Consider an RGB image with a resolution of 640 × 480 pixels. Each pixel stores three color values, each occupying 8 bits (1 byte). The total memory consumption is calculated as:
640 × 480 × 3 bytes = 921,600 bytes
This simple arithmetic is fundamental when planning storage, transmission, or real‑time processing pipelines.
Loss of Color Information in Grayscale Conversion
Converting a color image to grayscale involves collapsing the three RGB channels into a single intensity value, typically using a weighted sum (e.g., 0.298 × R + 0.587 × G + 0.114 × B). Because many different RGB triples can produce the same grayscale value, the original color information is irretrievably lost. Consequently, it is impossible to reconstruct the exact original colors from a grayscale image alone.
Pre‑Processing Pipeline for Document Images
When preparing a scanned document that is skewed and noisy for optical character recognition (OCR), an effective sequence of operations is:
- Rotate to correct orientation: Align text lines horizontally.
- Convert to grayscale: Simplify the data while preserving contrast.
- Apply noise reduction: Use median or Gaussian filters to suppress speckles.
- Threshold (binarize): Separate foreground text from background, creating a binary mask suitable for OCR engines.
Following this order ensures that each step builds on a clean, well‑aligned image, improving recognition accuracy.
Nearest‑Neighbor Interpolation for Labeled Images
When up‑sampling an image that contains discrete labels (e.g., segmentation masks), preserving the exact label values is crucial. Nearest‑neighbor interpolation copies the value of the closest original pixel to the new location, thereby maintaining the original class assignments. Other interpolation methods, such as bilinear or bicubic, compute weighted averages, which can generate non‑existent intermediate label values and corrupt the mask.
Key Takeaways
- The ultimate aim of computer vision is to turn pixels into meaningful information.
- Variations in viewpoint, lighting, scale, and occlusion make visual recognition difficult for machines.
- Traditional vision relies on hand‑crafted features; deep learning learns features automatically from data.
- Binary, grayscale, and RGB images differ mainly in the number of intensity levels they can represent.
- Raw image size is computed as width × height × bytes‑per‑pixel.
- Grayscale conversion discards color, making exact color recovery impossible.
- A robust preprocessing pipeline for document images includes rotation, grayscale conversion, denoising, and thresholding.
- Nearest‑neighbor interpolation is preferred for up‑sampling labeled masks because it preserves discrete class values.
Further Reading and Resources
To deepen your understanding, explore the following resources:
- Computer Vision Basics (Coursera)
- Very Deep Convolutional Networks for Large‑Scale Image Recognition (VGG paper)
- OpenCV Documentation – Practical image processing functions
- PyTorch Tutorial: Image Classification with CIFAR‑10
By mastering these foundational ideas, you will be well‑prepared to tackle more advanced topics such as object detection, semantic segmentation, and visual reasoning.
