optional · CSS study notes
Relation to Related Fields (Graphics, Vision, AI)
CSS Optional — Paper-II, Section-B · P-II.V.I · The opening line of the DIP syllabus. Usually asked as a 5–8 mark "differentiate / relate" question, and it is the natural introduction paragraph for any long DIP answer.
1. Definitions
- Digital Image Processing (DIP): processing digital images with a computer — the input is an image and the output is an image, or attributes extracted from it (e.g. edges, regions).
- Computer Graphics (CG): synthesizing images from mathematical models or descriptions (3-D models, games, CAD, animation).
- Computer Vision (CV): enabling machines to understand scenes from images — recognizing objects, estimating depth and motion, making decisions.
- Artificial Intelligence (AI): the broader field of building systems that reason, learn and act intelligently; modern CV is largely driven by AI (machine learning, deep neural networks).
2. Input → Output View (the core exam answer)
| Field | Input | Output | Example |
|---|---|---|---|
| Image Processing | Image | Image (improved or transformed) | Removing noise from an X-ray; sharpening a photo |
| Computer Graphics | Description / model | Image | Rendering a 3-D building model; video game frames |
| Computer Vision | Image | Description / understanding | Detecting pedestrians; reading a number plate |
| Artificial Intelligence | Data / knowledge (including images) | Decisions, predictions, actions | Diagnosing disease from a scan; a self-driving car choosing to brake |
Memory hook: CG and CV are inverses — graphics goes model → image, vision goes image → model. Image processing sits in between (image → image) and serves as the pre-processing stage for vision.
graph LR
M["Model / description"] -->|"Computer Graphics"| I["Image"]
I -->|"Image Processing"| I2["Enhanced image"]
I2 -->|"Computer Vision"| U["Understanding / description"]
U -->|"AI: reasoning, learning"| D["Decision / action"]
3. Three Levels of Image Processing (Gonzalez)
| Level | Input → Output | Operations | Field |
|---|---|---|---|
| Low-level | Image → image | Noise reduction, contrast enhancement, sharpening | Image processing |
| Mid-level | Image → attributes | Segmentation, edge detection, object description | Image analysis |
| High-level | Attributes → meaning | Recognition, scene understanding, decision making | Computer vision / AI |
There is no sharp boundary: DIP → image analysis → computer vision form a continuum, with AI techniques entering as the level rises.
4. How They Overlap in Practice
- Medical imaging: acquisition (CT/MRI) → DIP (denoise, enhance) → CV (segment a tumour) → AI (classify benign/malignant).
- Self-driving cars: camera frames enhanced (DIP) → lanes/pedestrians detected (CV, deep learning) → driving decisions (AI).
- Augmented reality: CV tracks the real scene; CG renders virtual objects onto it.
- Deep learning (CNNs, Vision Transformers) has blurred boundaries: one network may learn the filtering (DIP), detection (CV) and decision (AI) end to end.
- Generative AI (diffusion models) is CG-like synthesis driven by AI rather than explicit geometry.
5. Fundamental Steps in DIP (Gonzalez & Woods)
- Image acquisition
- Image enhancement
- Image restoration
- Colour image processing
- Wavelets and multiresolution processing
- Compression
- Morphological processing
- Segmentation
- Representation and description
- Object recognition
All steps interact with a knowledge base — prior knowledge about the problem domain (e.g. "defects on this circuit board appear as dark spots").

6. Applications by Energy Source
| Source | Applications |
|---|---|
| Gamma rays | Nuclear medicine, PET scans, astronomy |
| X-rays | Medical radiography, CT, industrial inspection, airport baggage scanners |
| Ultraviolet | Fluorescence microscopy, lithography |
| Visible and infrared | Photography, remote sensing, fingerprints, face recognition, thermal/night vision |
| Microwaves | Radar imaging (works through clouds and at night) |
| Radio waves | MRI, radio astronomy |
| Non-EM | Ultrasound (sound), electron microscopy |
7. Pakistan Angle (useful for a closing paragraph)
- Remote sensing: SUPARCO's satellite imagery (e.g. PRSS-1, launched 2018) for crop monitoring, flood mapping and urban planning.
- Biometrics: NADRA's fingerprint and facial matching for CNIC verification.
- Surveillance: Safe City projects (Islamabad, Lahore) using CCTV with automatic number-plate and face recognition.
- Healthcare: AI-assisted reading of chest X-rays and retinal scans in resource-limited hospitals.
🎯 CSS Exam Angle
Lead with the input→output table — it answers "differentiate" in one glance. Then add the three-level classification, one overlapping application (medical imaging or self-driving cars works best), and finish with the observation that deep learning has merged the fields. Draw the mermaid-style flow as a quick box diagram.
📌 Past CSS Paper Frequency
| Year | Question |
|---|---|
| Syllabus | Named first in the DIP syllabus; no verified standalone question found in 2017–2021 papers, but it is the standard introduction to every DIP long answer |
⚠️ MCQ Traps
- Computer Graphics = description → image; Computer Vision = image → description. They are inverses — easy to swap under time pressure.
- Image analysis (mid-level) outputs attributes, not images.
- Image processing is not a subset of AI — classical DIP (filters, histograms) involves no learning at all.
- MRI uses radio waves, not X-rays; CT uses X-rays.
✅ Self-Check (with Answers)
Q1. Place OCR of a vehicle number plate into the three levels of processing.
Ans: Low-level: denoise, contrast-enhance and binarize the plate image (image → image). Mid-level: segment the plate and isolate each character (image → attributes). High-level: recognize the characters and match the number against a database to issue a challan (attributes → meaning/decision).
Q2. Why are Computer Graphics and Computer Vision called inverse problems?
Ans: Graphics goes from a model/description to an image (synthesis); vision goes from an image back to a model/description (analysis). Vision is harder because one image can come from many possible 3-D scenes (depth and lighting are lost in projection).
Q3. Name one application each for gamma rays, X-rays and radio waves.
Ans: Gamma rays — PET scans / nuclear medicine. X-rays — CT scans, airport baggage screening. Radio waves — MRI, radio astronomy.
Q4. Is image processing a subset of AI? Justify.
Ans: No. Classical DIP (histogram equalization, mean filtering, Sobel) is deterministic mathematics with no learning or reasoning. The fields overlap at higher levels, where AI (especially deep learning) performs recognition and decision-making on processed images.
Q5. How does deep learning blur the boundaries between these fields?
Ans: A single CNN learns filters (image processing), extracts and detects objects (computer vision) and outputs decisions (AI) end to end, while generative models synthesize images (graphics) — so one model can span all four.
📜 Past-Paper Questions & MCQs (CSS 2016–2026)
2022 · Paper-II · Q6(c) · 4 marks
Q. How are Digital Image Processing and Computer Vision related? Discuss.
Ans.
- Digital image processing (DIP): takes an image as input and gives an image (or attributes) as output. It is concerned with improving the image: enhancement, restoration, compression, filtering. It is low-level (pixel operations).
- Computer vision (CV): takes an image and extracts understanding: recognising objects, tracking, scene interpretation, 3-D structure. It aims to give machines human-like vision, and it is high-level (the output is a description or decision).
- Relation: they form a continuum. DIP is often the pre-processing stage of CV (noise removal, contrast enhancement, segmentation), and CV uses machine learning on the processed images. They overlap in feature extraction and segmentation.
- Example: DIP cleans a scanned number plate. CV reads the characters (OCR).
MCQs
2025 P-II · Q5. Which of the following comes under the application of image blurring?
- (A) Object detection
- (B) Gross representation ✅
- (C) Object motion
- (D) Image segmentation
- Answer: (B) Gross representation.
- Why: blurring removes small details so that only the gross shapes of the large objects of interest remain. This is useful before detecting those objects. Object detection and segmentation are tasks that may follow it, and object motion is a cause of blur, not an application.