0% found this document useful (0 votes)
9 views10 pages

Advanced Computer Vision - Notes - Topic3

The document discusses the representation of images as mathematical functions in computer vision, detailing grayscale and color images, pixel intensity, and color models like RGB and HSV. It also covers coordinate systems, image geometry, resolution, sampling, and the distinction between analog and digital images, emphasizing the importance of these concepts for image processing and analysis. Understanding these fundamentals is crucial for the development and application of computer vision algorithms.

Uploaded by

IT World
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views10 pages

Advanced Computer Vision - Notes - Topic3

The document discusses the representation of images as mathematical functions in computer vision, detailing grayscale and color images, pixel intensity, and color models like RGB and HSV. It also covers coordinate systems, image geometry, resolution, sampling, and the distinction between analog and digital images, emphasizing the importance of these concepts for image processing and analysis. Understanding these fundamentals is crucial for the development and application of computer vision algorithms.

Uploaded by

IT World
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.3.

1 Image as a Function (f(x, y))

Introduction
In computer vision, an image is commonly represented as a mathematical function
that maps spatial coordinates to intensity or color values. This abstraction allows
computers to process, analyze, and manipulate images using mathematical
operations. Representing an image as a function is foundational for all image
processing, analysis, and computer vision algorithms.

Definition
An image can be expressed as a 2D function:

f(x,y)=If(x, y) = If(x,y)=I

Where:

 x,yx, yx,y are the spatial coordinates of a pixel in the image.


 f(x,y)f(x, y)f(x,y) (or III) represents the intensity or color value at that
coordinate.

For grayscale images, f(x,y)f(x, y)f(x,y) typically ranges from 0 to 255 (8-bit
images), where 0 represents black and 255 represents white. For color images,
f(x,y)f(x, y)f(x,y) may represent multiple channels (e.g., RGB), each channel
having its own intensity values.

Grayscale Images

 A grayscale image has only one intensity value per pixel.


 Mathematically: f(x,y)∈[0,L−1]f(x, y) \in [0, L-1]f(x,y)∈[0,L−1], where
LLL is the number of possible intensity levels (commonly 256).
 Example: In an 8-bit image, a pixel value of 128 represents a medium gray
tone.

Color Images

 Color images have multiple channels. Commonly used color spaces include
RGB (Red, Green, Blue) or HSV (Hue, Saturation, Value).
 In RGB, the image is a function of three channels:

f(x,y)=[R(x,y),G(x,y),B(x,y)]f(x, y) = [R(x, y), G(x, y), B(x, y)]f(x,y)=[R(x,y),G(x,y),B(x,y)]


 Each channel has values in a fixed range (e.g., 0–255).

Continuous vs. Discrete Representation

 In theory, an image is a continuous function of space: f(x,y)f(x, y)f(x,y)


where x,yx, yx,y can take any real value.
 In practice, digital images are discrete functions, sampled at regular
intervals: f[m,n]f[m, n]f[m,n], where mmm and nnn are integer pixel
coordinates.

Mathematical Operations on Images


Representing images as functions allows the use of mathematical operations for
analysis:

 Point-wise Operations: Modify intensity values at each pixel


individually, e.g., brightness adjustment:

g(x,y)=f(x,y)+kg(x, y) = f(x, y) + kg(x,y)=f(x,y)+k

 Neighborhood Operations: Consider a pixel and its neighbors for


filtering, e.g., smoothing, edge detection.
 Transformations: Fourier transform, wavelet transform, and
convolution operations are applied to f(x,y)f(x, y)f(x,y) for feature
extraction and frequency analysis.
Applications

 Treating images as functions is critical in image enhancement, filtering,


edge detection, and feature extraction.
 It allows precise mathematical modeling for computer vision algorithms,
including convolutional neural networks (CNNs) that process images as
multi-channel arrays.

Example
For a grayscale image of size 256×256:

 Pixel at coordinate (50, 100) has intensity f(50,100)=200f(50, 100) =


200f(50,100)=200.
 A 3×3 neighborhood around this pixel can be used to apply a smoothing
filter or compute gradients for edge detection.
This functional representation provides the foundation for all further image
processing and computer vision techniques, enabling images to be treated as data
suitable for mathematical and algorithmic manipulation.

1.3.2 Pixels, Intensity, and Color Models (RGB, HSV, Grayscale)

Introduction
Images are composed of small units called pixels (picture elements), which are the
basic building blocks in digital images. Each pixel represents a sample of the
visual information at a specific location in the image. Understanding pixels,
intensity, and color models is fundamental for processing and analyzing images in
computer vision.

Pixels

 A pixel corresponds to a single point in the digital image.


 It stores information about intensity (grayscale) or color (RGB, HSV, etc.).
 The resolution of an image is determined by the number of pixels along its
width and height.
 Example: An image of size 512×512 has 512×512 = 262,144 pixels.

Intensity

 Intensity represents the brightness of a pixel.


 In grayscale images, a single intensity value is stored per pixel, usually
ranging from 0 (black) to 255 (white) for 8-bit images.
 Intensity is crucial for detecting edges, textures, and patterns, as many
computer vision algorithms work on brightness differences.

Color Models
Digital images with color require multiple intensity values per pixel, organized in
different color models.

1. RGB (Red, Green, Blue)

 The most widely used color model in computer vision and digital imaging.
 Each pixel has three components: R (Red), G (Green), and B (Blue).
 Each component typically ranges from 0 to 255 in 8-bit images.
 Example: A pure red pixel is represented as (255, 0, 0), green as (0, 255, 0),
and blue as (0, 0, 255).
 RGB is additive, meaning colors are created by adding varying intensities of
the three primary colors.

2. HSV (Hue, Saturation, Value)

 HSV separates color information into:


o Hue (H): The type of color (0–360 degrees, representing red, green,
blue, etc.).
o Saturation (S): Purity of the color (0–100%), with 0 being gray and
100% fully saturated.
o Value (V): Brightness or intensity (0–100%).
 HSV is useful in computer vision because it separates color from intensity,
making it easier to detect objects under varying lighting conditions.
 Example: For a bright yellow pixel: H = 60°, S = 100%, V = 100%.

3. Grayscale

 A single-channel representation storing only intensity values.


 Reduces computational complexity compared to full-color images.
 Many vision algorithms use grayscale images when color information is not
essential, e.g., edge detection, texture analysis, and optical character
recognition.

Other Color Models

 CMYK (Cyan, Magenta, Yellow, Key/Black): Used in printing.


 Lab (Lightness, a, b):** Designed to be perceptually uniform; often used in
color difference calculations.
 YCbCr: Used in video compression, separating luminance (Y) from
chrominance (Cb, Cr).

Pixel Representation in Computers

 Pixels are stored as discrete values in memory.


 Grayscale: 8-bit per pixel → 256 intensity levels.
 RGB: 24-bit per pixel → 8 bits per channel → 16,777,216 possible colors.
 Images are represented as 2D arrays (grayscale) or 3D arrays (color).

Applications

 Edge Detection: Grayscale intensity differences highlight boundaries.


 Object Recognition: Color information in RGB/HSV can help segment and
identify objects.
 Image Enhancement: Adjusting pixel intensity values improves visibility
and contrast.
 Filtering and Convolution: Algorithms operate on pixel neighborhoods to
extract features.

Example

 A pixel with RGB values (128, 64, 192) represents a medium purple color.
 Converting it to HSV may give H = 270°, S = 66.7%, V = 75.3%, separating
color from brightness.

Pixels and color models form the basic language of digital images, enabling
computer vision systems to interpret, manipulate, and analyze visual data
efficiently.

1.3.3 Coordinate Systems and Image Geometry

Introduction
Understanding coordinate systems and image geometry is fundamental in computer
vision because all operations on images—such as transformations, rotations,
scaling, and 3D reconstruction—require precise spatial referencing. Images are
represented in discrete pixel grids, but interpreting them often involves mapping
these pixels to continuous spatial coordinates.

Image Coordinate Systems

 An image is typically represented as a 2D array of pixels with coordinates


(x,y)(x, y)(x,y) or (i,j)(i, j)(i,j).
 Top-left origin: In most digital images, the origin (0,0)(0,0)(0,0) is at the
top-left corner.
o xxx or jjj increases to the right.
o yyy or iii increases downward.
 Cartesian coordinate system: Sometimes used for mathematical modeling,
where the origin is at the bottom-left and yyy increases upward.
Transformations between digital and Cartesian coordinates are often
necessary for algorithms involving geometry.

Pixel Indices vs. Spatial (space-based) Coordinates


 Pixel indices: Integer values representing the discrete location in the array:
(i,j)(i, j)(i,j).
 Spatial coordinates: Continuous values representing real-world distances or
positions.
 Conversion between the two is essential for tasks like camera calibration and
3D reconstruction.

Image Geometry Concepts

1. Distance Measurement
o Euclidean distance between two pixels (x1,y1)(x_1, y_1)(x1,y1) and
(x2,y2)(x_2, y_2)(x2,y2):

d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}d=(x2−x1)2+(y2


−y1)2

1.3.4 Image Resolution and Sampling

Introduction
Image resolution and sampling are fundamental concepts in digital imaging. They
determine the level of detail that can be captured, stored, and processed in an
image. Understanding these concepts is essential for computer vision tasks such as
object detection, recognition, and reconstruction.

Image Resolution

 Definition: Resolution refers to the amount of detail an image holds and is


typically measured in terms of pixel count along the width and height of an
image.
 Example: An image of size 1024×768 pixels has a resolution of 1024 pixels
in width and 768 pixels in height.
 Spatial Resolution: Number of pixels per unit distance in the real
world. High spatial resolution captures more detail.
 Temporal (Time-based) Resolution: For video sequences, the number of
frames captured per second (fps). Higher temporal resolution results in
smoother motion representation.
 Impact: Higher resolution provides more information but increases storage,
memory, and processing requirements. Lower resolution reduces detail but
can improve computational efficiency.
Sampling

 Definition: Sampling is the process of converting a continuous image


(analog) into a discrete digital representation by selecting specific points
(pixels).
 Sampling Rate: Determines how densely the image is sampled. According
to the Nyquist theorem, the sampling rate must be at least twice the highest
frequency present in the image to avoid information loss (aliasing).
 Spatial Sampling: Involves selecting pixel locations along the horizontal
and vertical axes.
 Quantization: Converts continuous intensity values into discrete levels
(e.g., 0–255 for 8-bit images).

Relationship Between Resolution and Sampling

 High-resolution images require dense sampling, capturing fine details.


 Low-resolution images result from coarse sampling, losing subtle features.
 Improper sampling can cause aliasing, where high-frequency details appear
distorted or misrepresented in the digital image.

Practical Considerations

 Downsampling: Reduces image size by removing pixels. Useful for


computational efficiency but can lose detail. (sampling)
 Upsampling/Interpolation: Increases image size by estimating new pixel
values. Methods include nearest-neighbor, bilinear, and bicubic
interpolation.
 Trade-Offs: Balancing image resolution and computational resources is
crucial in computer vision applications such as real-time processing or edge
devices.

Applications

 Object Recognition: Higher resolution helps detect small objects.


 Medical Imaging: High resolution captures fine anatomical details.
 Remote Sensing: Satellite images require appropriate resolution for
accurate analysis.
 Compression: Efficient storage relies on sampling and quantization
strategies.

Example
 A grayscale image of 512×512 pixels represents a higher spatial resolution
than one of 128×128 pixels.
 Downsampling the 512×512 image to 128×128 reduces computational load
but may lose small object details.
 Quantization converts the continuous intensity values of the original image
into 256 discrete levels for digital storage.

Understanding image resolution and sampling is crucial for ensuring that images
retain sufficient detail for analysis while balancing storage and processing
requirements.

1.3.5 Digital vs. Analog Images

Introduction
Images can exist in two main forms: analog and digital. Understanding the
distinction between these forms is critical in computer vision because all modern
computer vision algorithms operate on digital images, which are discrete
representations of continuous visual data.

Analog Images

 Definition: Analog images are continuous in both space and intensity. They
exist in the physical world or as signals without discrete steps.
 Examples: Photographs on film, human vision, and continuous-tone TV
signals.
 Characteristics:
o Continuous intensity values.
o Infinite resolution in theory (limited only by the medium).
o Cannot be directly processed by computers.
 Limitations for Computer Vision:
o Analog images cannot be stored, manipulated, or transmitted
digitally without conversion.
o Sensitive to noise, degradation, and loss during scanning or
capture.
Digital Images

 Definition: Digital images are discrete representations of visual information,


created by sampling and quantizing an analog image.
 Structure:
oRepresented as a 2D array of pixels.
o Each pixel has a finite intensity value (e.g., 0–255 for 8-bit grayscale).
o Color images use multiple channels (RGB, HSV, etc.).
 Advantages for Computer Vision:
o Easily stored, transmitted, and processed by computers.
o Compatible with algorithms for filtering, feature extraction, and
machine learning.
o Robust to certain types of noise through preprocessing techniques.

Conversion from Analog to Digital

1. Sampling: Select discrete points in space to form a pixel grid.


2. Quantization: Map continuous intensity values to discrete levels.
3. Digitization Example:
o An analog photograph is scanned at 300 dpi (dots per inch).
o Each scanned point becomes a pixel with a discrete intensity value.

Trade-Offs

 Resolution vs. Storage: Higher sampling rates increase image detail but
require more memory.
 Quantization Levels: More intensity levels capture finer variations but
increase file size.
 Information Loss: Analog-to-digital conversion inevitably loses some
detail compared to the continuous original.

Applications in Computer Vision

 All image processing, object detection, segmentation, and machine


learning models operate on digital images.
 Conversion quality affects performance in tasks such as facial recognition,
medical imaging, and autonomous driving.

Example

 A scanned film photograph at 1024×1024 pixels is a digital image


representing the original analog scene.
 Each pixel stores intensity values; for a color image, each pixel may store
three values corresponding to R, G, and B channels.
Digital images form the core data structure for computer vision, enabling
computers to perform analysis, recognition, and interpretation of visual
information efficiently.

You might also like