Lecture 2 - Binary Images Flashcards

(36 cards)

1
Q

How are images represented and how many grey levels are there?

A

An image is represented as a matrix of pixel values. In grayscale images:
* Each matrix entry corresponds to the intensity level (also called a grey level).
* The intensity levels range from 0 to 255:
○ 0 represents perfect black.
○ 255 represents perfect white.
○ Values in between represent varying shades of Gray.
Each pixel in this matrix typically uses 8 bits (1 byte) to store its value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the understanding of Pixel Location and Image Resolution

A

Each pixel has a specific location defined by its row (i) and column (j) coordinates: (i, j).
* The image size is defined by the number of rows and columns, e.g., 512 × 512.
* The image (spatial) resolution of the image refers to how detailed the image is, influenced by how many pixels are used to represent it.
○ A higher resolution image (more pixels) captures more detail and a lower resolution image appears blocky or pixelated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the understanding of Memory Requirements and Bit Representation

A
  • A grayscale pixel typically uses 8 bits to represent 256 intensity levels (0 to 255).
  • For a 512 × 512 grayscale image:
    ○ Total pixels = 512 × 512 = 262,144
    ○ Memory required = 262,144 pixels × 8 bits = 2,097,152 bits = 256 KB
    Compression techniques reduce the memory without degrading visual quality
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Effect of Reducing Image Size (Down sampling)

A
  • Down sampling decreases the resolution by reducing the number of pixels.
  • Visual effects of down sampling:
    ○ Pixelization: image becomes visibly blocky.
    ○ Loss of detail: fine textures are lost.
    ○ May involve reduction of grey levels too.
    This impacts the ability to interpret or analyse image features.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a Profile in Image Analysis?

A

A profile refers to the variation in pixel intensity values along a specific path or line in the image—commonly a row or column.
* It is useful to visualize how intensities change across a section of the image, for example when analysing edges or features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a histogram and how do you calculate it?

A

Histogram and How to Calculate It
* A histogram is a graphical representation of pixel intensity distribution.
* X-axis: grey level values (0 to 255).
* Y-axis: frequency of occurrence for each grey level.
* Used to identify modes, valleys, and set thresholds.
Computed by counting how many pixels have each grey level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Binarization?

A
  • Binarization is the process of converting a grayscale image into a BW image.
  • Achieved by applying a threshold.
  • Note: binarization simplifies processing but may cause information loss.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the Formula for Binarization

A

Uses a piecewise function where
g(x,y) = 1 if f(x,y) > T(x,y,p(x,y)) or 0 otherwise

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does T in binarization change the thresholding?

A

If T is constant -> global thresholding
If T depends on local property p(x,y) -> local thresholding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are some applications of Binarization?

A
  • Applications:
    ○ Cleaning scanned documents for OCR.
    ○ License plate recognition
    ○ Fingerprint and palm print analysis
    ○ Signature recognition
    ○ Edge detection
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between Black & White (BW) vs Grayscale Images

A
  • BW image: has only two values, 0 (black) and 1 (white), or 0 and 255.
  • Grayscale image: contains 256 levels of intensity.
  • BW images are typically the result of thresholding a grayscale image.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is Thresholding difficult?

A

As you have to consider the value when there are other factors such as illumnation and reflection that can affect it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to convert greyscale to BW using thresholding

A

Converting Grayscale to BW using Thresholding
* Thresholding methods:
○ Global thresholding: same threshold value for all pixels.
○ Local thresholding: threshold depends on local neighbourhood (e.g., local mean and standard deviation).
* Thresholding transforms the image by assigning:
○ 0 to pixels < threshold
○ 255 to pixels ≥ threshold

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Global Threshold?

A

Global thresholding: same threshold value for all pixels.
* Global Thresholding:
○ Efficient and fast.
○ Suitable for uniformly illuminated images.
○ May fail in varying lighting conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Local Threshold?

A

Local thresholding: threshold depends on local neighbourhood (e.g., local mean and standard deviation).
* Local Thresholding:
○ Slower.
○ Adapts to local brightness variations.
○ Works better for complex illumination.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is an Image Window (Sliding Window)?

A
  • A window is a small rectangular region (e.g., 15 × 15 pixels) centered on a pixel.
  • Used in local thresholding to calculate local statistics (mean, std dev).
  • It moves pixel-by-pixel across the image.
17
Q

What is Otsu Thresholding?

A

A global thresholding method.
Objective: select a threshold that minimizes intra-class variance( i.e. minimum variation in the foreground + minimum variation in the background)

Alternatively: maximize inter-class variance.

18
Q

What are the steps for Otsu Thresholding?

A

Compute the histogram and proabilities of the intensity level
Initialise the class probabilities and class means
Step through all possible thresholds t = 1 to 255
- As you do this compute probabilities and class mean
Compute FORMULA: σ_b²(t) = w₁(t) * w₂(t) * (μ₁(t) − μ₂(t))²
Select Threshold that maximises σ_b²

19
Q

What is Niblacks Method?

A

A local Thresholding method
For each pixel t=μ−kσ
Where 𝜇 μ and 𝜎 σ are the local mean and standard deviation in the window, and 𝑘 = 0.2

20
Q

What is Sauvolas Method?

A

A variant of Niblacks: t = μ(1 + k(σ/r − 1))

21
Q

What is Connected Component Analysis?

A
  • Scan the image pixel by pixel.
  • If the pixel is part of the object (black/foreground):
    • Check its neighbors (either 4-connected or 8-connected).
    • If neighbors are already labeled, assign the same label.
    • If not, assign a new label.
  • After the first pass, a second pass may be required to merge equivalent labels.
    REFER TO SLIDES FOR EXAMPLES ON HOW IT WORKS
22
Q

What is Connnected Component Analysis with 4 or 8 neighbours

A
  • 4-connected: Only connected to adjacent pixels in the left, right, top, bottom directions.
  • 8-connected: Is connected to all surrounding pixels (also includes diagonals).
    REFER TO SLIDES FOR EXAMPLE
23
Q

What are the features of Connected Components?

A

 Shape features
* Area
* Bounding box
* Boundary length
* Compactness

24
Q

Features of Connected Components – Area

A

 Count number of pixels
 For an arbitrarily fine resolution, the area is translation and rotation invariant.

25
Features of Connected Components – Bounding
Minimum area (rectangle) enclosing the object
26
Features of Connected Components – Boundary Length
 The boundary length (perimeter) is defined as the number of pixels which constitute the boundary of a shape. Basically the number of edge pixels
27
Features of Connected Components – Compactness
compactness = area / boundary length^2
28
What does is mean by the Quality of Features for connected components?
Ideal features should have: * Translation invariance: unchanged under position shift. * Rotation invariance: unchanged when rotated. * Scale invariance: unchanged with size. * Noise robustness: insensitive to minor pixel-level changes.
29
What is Morphological Image Processing?
- View binary images as 2-dimensional sets - Basic set-theory concepts you are familiar with: element, subset, union, intersection, disjoint sets, complement, difference
30
What are the Morphological Operations
Applied on binary images using a structuring element (e.g., 3×3 square): 1. Dilation: expands boundaries by adding pixels. 2. Erosion: shrinks boundaries by removing pixels. 3. Opening (Erosion → Dilation): removes small objects and noise. 4. Closing (Dilation → Erosion): fills small holes. 5. Subtraction: used to extract boundaries. REFER TO SLIDES FOR EXAMPLES
31
What are the Basics of Grayscale Image Analysis
While binary images are easier to process, grayscale images preserve more information. * Important for: ○ Edge detection ○ Segmentation ○ Recognition Most computer vision tasks work on grayscale rather than binary.
32
What is the Distance Transform?
The Distance Transform assigns to each foreground pixel a value that represents its distance to the nearest background pixel. It’s used to: - Measure object thickness - Extract skeletons - Aid in shape analysis and morphological operations
33
What is the Two-Pass Algorithm - In realtion to Distance Transform
This is an efficient method to compute the distance transform using local updates over two scans (passes) of the image: - First Pass: from top-left to bottom-right - Second Pass: from bottom-right to top-left
34
How does the Two-Pass Algorithm Work?
First Pass (Top-left to Bottom-right): For each white pixel, check the already-visited neighbours (above and left). Set the pixel’s value to the smallest neighbour distance + 1. Second Pass (Bottom-right to Top-left): For each pixel, check the neighbours to the right and below. Update the pixel’s value if a shorter distance is found.
35
What is the concept of terrain
- Uphill / downhill - Contour lines - Steepness of slope - Peaks / valleys (local extrema) === In Mathematical Notions - Normal vector - Curvature - Gradient vectors (vectors of partial derivatives) will help compute all these
36
What are 1D and 2D Gradients?
REFER TO SLIDES REFER TO SLIDES FOR EXAMPLES