Lecture

NOTE: For the log function, the reason as to why we are adding 1 to r is due to the fact that if log(0), then it would be undefined.

Recall from last lecture (Intensity Transformation):

Formula for intensity transformation (or point processing): $s = T(r)$

Formula for Image Negatives: $s = (L-1)-r$

Formula for Log Transformation: $s = clog(1 + r)$

Power Law (Gamma) Transformation

Formula is: $ s = cr^\gamma $ or $ s = c(r + \epsilon)^\gamma$ for $c > 0$ and $\gamma > 0$ and s and r are scaled to $[0, 1]$

Conditions to consider:

  1. If $\gamma < 1$: Enhance dark areas
  2. If $\gamma > 1$: Enhance bright areas
  3. If $\gamma = c = 1$: Identity transformation

Application that use Power Law (Gamma) Transformation

CRT Screens In terms of CRT screens/monitors, they must have their gammas be corrected. CRT monitors have a gammer response between 1.8 to 2.5–this would result to having images being darker than intended. To correct the gammas of CRTs, an inverse gamma transformation is applied $(s = cr^{1/\gamma})$

  1. Identity - no change within an image (linear line).
  2. Negative - light areas are converted to dark (inverted linear line).
  3. Log - enhances details of dark areas in an image (inverted exponential function).
  4. Inverse Log - reduces dominance of bright areas to balance the overall exposure (exponential function).
  5. Gamma - overall brightness for an image is adjusted using a non-linear transformation, which is controlled by a gamma value.

NOTE: REMEMBER THESE

Piecewise Linear Transformation Functions

There are four transformations:

  1. Global Transformations - uniformly applies a single formula to all pixel values.
  2. Piecewise Lienar Transformations - different linear adjustments are applied across specific intensity segments
  3. Complexity - a more detailed process–focuses on specific areas.
  4. Ideal Use Cases - enhances images w/ bright and dark areas.

NOTE: Piecewise basically just applies to a specific range/group of pixels.

Contrast Stretching:

Basically stretches a range of intensity levels to improve contrast.

What is an artifact?

  • It is a type of noise

The function for contract stretching must be increasing so artifacts won’t be present.

Conditions to consider for contrast stretching:

  1. If r1 = s1 and r2 = s2, then there is no change (basically an identity)
  2. If r1 = r2 and s1 = 0, s2 = L-1, then there are various degrees of spread in gray levels. _|- (this is basically saying there is a jump in intensity levels lol)
  3. If r1 <= r2 and s1 <= s2, then it is single valued and monotonically increasing.

Intensity-Level Slicing:

Technique that is used in DIP that enhances a specific range of intensities.

The ranges $[A, B]$ will have their ranges changed. For example, imagine a linear line, where each point (x, y) == x = y. The points within the ranges $[A, B]$ will have their values changed, and the others left untouched.

Bit-Plane Slicing:

It is a technique that divides an image into a series of binary images (For example, an 8-bit image being separated into 8 1-bit images) where each image represets one-bit level in the pixel intensity representation.

To separate the individual sliced images, refer to the columns. Basically, the total number of columns determine the number of images.

Uses for Bit-plane slicing:

  1. highlights different components of an image
  2. compression and watermarking
  3. enhancement and extraction

Histograms

Plots the frequency of each intensity value in an image (counts the number of times each intensity value occurs).

Intensity Levels in an image: The intensity level of an image is represented by $r_k$ for k = 0, 1, 2, … , L-1 L levels in total for image f(x,y)

Ex: For an 8-bit image, there are 0-255 bits. Therefore, L-1 = 255

Unnormalized Histogram: Basically counts the pixel occurrence by intensity

Is defined as $h(r_k) = n_k$, where $n_k$ is the number of pixels with intensity $r_k$.

Normalized Histogram: Represents the probability of intensity occurrence. Total number of pixels is M x N

Histogram Processing

The intensity level of k is represented by the sum of probabilities of k.

Histogram Equalization

In digital image processing, it can be categorized into two types:

  1. Discrete - Standard in DIP–pixel’s intensity values are discrete
  2. Continuous - Used in theory and simulations–data is not discrete; however, there is a specific range of values.

For discrete cases, it requires the use of probabilities and summations; continuous cases requires the use of probability densities and integration.

Readings

Summary (LECTURE 5/6)

Intensity Transformation Formulas:

  1. Intensity transformation (point processing): $s = T(r)$
  2. Image Negatives: $s = (L-1)-r$
  3. Log Transformation: $s = clog(1+r)$

Power Law (Gamma) Transformation

General formula is $s = cr^{\gamma}$ or $s = c(r+\epsilon)^{\gamma}$ if $c > 0$ and $\gamma > 0$ where $s$ and $r$ are scaled to $[0,1]$

Conditions to consider:

  1. If $\gamma < 1$, enhance dark areas
  2. If $\gamma > 1$, enhance bright areas
  3. If $\gamma = c = 1$, it is an identity transformation

IMPORTANT TO REMEMBER:

  1. Identity - no change in image (linear line, y=x)
  2. Negative - light areas converted into dark (inverted linear line)
  3. Log - enhances details of dark areas in an image (inverted exponential function)
  4. Inverse Log - reduces dominance of bright areas to balance overall exposure (exponential function)
  5. Gamma - overall brightness of image is adjusted using non-linear transformation controlled by a gamma value

Piecewise Linear Transformation Functions

  1. Global Transformation - uniformly applies single formula to all pixel values
  2. Piecewise Linear Transformation - different linear adjustments applied across specific intensity segments
  3. Complexity - more detailed process that focuses on specific areas
  4. Ideal Use Case - enhance images w/ bright and dark areas.

Contrast Stretching

Stretches a range of intensity levels to improve contrast.

Function for constrast stretching must be increasing so artifacts won’t be present.

ARTIFACT: A TYPE OF NOISE

Conditions for contrast stretching:

  1. $r1 = s1$, $r2 = s2$, then identity (no change)
  2. $r1 = r2$, $s1 = 0$, $s2 = L-1$, then there are various degrees of spread in gray levels.
  3. $r1 \leq r2$, $s1 \leq s2$, then single valued and monotonically increasing

Intensity-level Slicing

Enhances specific range of intensities at $[A,B]$.

Bit-plane Slicing

Divides an image into a series of binary images–each binary image represents one-bit level in the pixel intensity representation.

NOTE: total number of columns determine number of binary images

The first (or rightmost) bit of an intensity value at each pixel is the least significant bit

The last (or leftmost) bit of an intensity value at each pixel is the most significant bit

Useful for:

  1. highlighting different components of an image
  2. compression and watermarking
  3. enhancement and extraction

Histograms

Plots frequency of each intensity value in an image (basically counts the number of times each intensity value occurs).

Histogram Processing

Intensity level of $k$ is represented by the sum of probabilities of $k$.

Intensity Levels in an image: Total number of intensity levels for image $f(x,y)$ is represented using $r_k$, for $k = 0, 1, 2, … L-1$

EXAMPLE: For an 8-bit image, there are 0-255 bits, so L-1 = 255

Unnormalized Histogram: Counts the pixel occurrenec by intensity

Normalized Histogram: Represents probability of intensity occurrence. Total number of pixels is $M x N$

Histogram Equalization

It is categorized into two types:

  1. Discrete
  2. Continuous

For discrete cases, it requires probablities and summation; continuous requires probability densities and integration.