0% found this document useful (0 votes)
12 views64 pages

CVIP Lecture for stud

Computer vision and Image processing

Uploaded by

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

CVIP Lecture for stud

Computer vision and Image processing

Uploaded by

sisayyohannes997
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

Computer Vision and Image Processing

Lecture Note

Prepared By:- Wondimu Lambamo (PhD)

Department of Computer Science

College of Engineering and Technology

Wachemo University
Computer Vision and Image Processing Lecture Note 1
Chapter One: Introduction to Digital Image Processing
 Digital Image Processing

 Image is defined as 2D function f(x, y) where x and y are spatial/plane coordinates

 Amplitude of image at pair of coordinates (x, y) is the intensity/gray level

 When x, y and intensity values of an image are finite and discrete the image is digital

 Processing digital images using digital computer known as digital image processing

 Digital images are composed of a finite number of elements each having particular
location and value

 These elements are called picture elements, image elements, pels, and pixels

 Pixel is the term used most widely to denote the elements of a digital image
Computer Vision and Image Processing Lecture Note 2
Cont.

 Images play the most important role in human perception or vision

 Humans are limited to the visual band of the EM spectrum, imaging machines cover
almost the entire EM spectrum, ranging from gamma to radio waves

 IP operate on images generated by sources that humans are not accustomed to that
images

 The sources include ultrasound, electron microscopy, and computer-generated images

 Digital image processing encompasses a wide and varied field of applications

 No general agreement where image processing stops and computer vision start

Computer Vision and Image Processing Lecture Note 3


Image Processing

 Focus is on making the image more visually appealing or suitable for further use

 It’s about transforming the raw image into a refined version of itself

 Image processing focuses on enhancing and transforming images

 Image processing is the method of enhancing quality of image for specific application

 The primary aim is to improve image quality

 Image processing goal is to achieve visual perfection

 The main objective is to improve the quality of the original image


 Art of beautifying Images

 Imagine you have a photograph that isn’t perfect, maybe it’s dark, or the colors are dull
Computer Vision and Image Processing Lecture Note 4
Cont.

 Image processing is like a magic wand that transforms this photo into a better version

 It involves altering or improving digital images using various methods and tools

 Think of it as editing a photo to make it look more appealing or to highlight certain


features

 It’s all about changing the image itself

 It’s vital in digital photography, medical imaging, and graphic design

 Transformations improve aesthetics, make images more suitable for analysis, laying
the groundwork for deeper interpretation, including by computer vision systems

Computer Vision and Image Processing Lecture Note 5


Computer Vision

 Teaching computers to interpret images

 It tries to make sense of it, much like how our brain interprets what our eyes see

 Computer vision seeks to extract meaning from images

 CV’s goal is to use computers to emulate human vision, including learning and making
inferences and take actions based on visual inputs

 CV is a branch of AI whose objective is to emulate human intelligence

 The goal isn’t to change image, but to understand what the image represents

 In involves identifying objects, interpreting scenes, recognizing patterns and behaviors


within the image
Computer Vision and Image Processing Lecture Note 6
Cont.

 It’s more about comprehension rather than alteration

 Aims to extract meaning and understanding from images

 It’s at the heart of AI and robotics, helping machines recognize faces, interpret road
scenes for autonomous vehicles, and understand human behavior

 The success of computer vision often relies on the quality of image processing

 High-quality, well-processed images can enhance accuracy of computer vision


algorithms

 Image analysis/understanding is in between image processing and computer vision


 Three types of processes in the continuum from image processing to computer vision:
low level, mid level, and high level processes
Computer Vision and Image Processing Lecture Note 7
Cont.

 Low-level: operates preprocessing to reduce noise, contrast enhancement, and image


sharpening. Both inputs and outputs are images

 Mid-level: perform segmentation (partitioning an image into regions or objects),


description of those objects to reduce them to a form suitable for computer processing, an
classification (recognition) of individual objects. Inputs are images, but its outputs are
attributes extracted from those images (e.g., edges, contours, and the identity objects)

 Higher-level: involves making sense of an ensemble of recognized objects, as in image


analysis, and, at the far end of the continuum, performing the cognitive functions norma
associated with human vision.

 Based on the preceding comments, we see that a logical place of overlap between image
Computer Vision and Image Processing Lecture Note 8
Applications of Computer Vision
 Some examples of computer vision and image processing applications and goals:

 Automatic face recognition, and interpretation of expression

 Visual guidance of autonomous vehicles

 Automated medical image analysis, interpretation, and diagnosis

 Robotic manufacturing: manipulation, grading, and assembly of parts

 OCR: recognition of printed or handwritten characters and words

 Agricultural robots: visual grading and harvesting of produce

 Smart offices: tracking of persons and objects; understanding gestures

 Biometric-based visual identification of persons


Computer Vision and Image Processing Lecture Note 9
Cont.

 Visually endowed robotic helpers

 Security monitoring and alerting; detection of anomaly

 Intelligent interpretive prostheses for the blind

 Tracking of moving objects; collision avoidance; stereoscopic depth

 Object-based (model-based) compression of video streams

 General scene understanding

Computer Vision and Image Processing Lecture Note 10


Fundamentals Steps in Computer Vision and Image Processing

 Image acquisition:

 It could be as simple as being given an image that is already in digital form

 Generally, the image acquisition stage involves preprocessing, such as scaling

 Image enhancement:

 Process of manipulating an image to obtain more suitable than the original for a
specific application

 Enhancement techniques are problem oriented (e.g. a method useful for X-ray
images may not be good satellite images taken in the infrared band)

Computer Vision and Image Processing Lecture Note 11


Cont.

Computer Vision and Image Processing Lecture Note 12


Cont.

 Image restoration

 Is the process of improving the appearance of an image

 It is based on mathematical or probabilistic models of image degradation

 Color image processing

 It has significant increase in the use of digital images over the internet

 Color is used also as the basis for extracting features of interest in an image

 Wavelets: are foundation for representing images in various degrees of resolution

 Compression: process of reducing the required storage to save and bandwidth to


transmit an image
Computer Vision and Image Processing Lecture Note 13
Cont.

 Morphological processing: mechanism of extracting image components that are


useful in the representation and description of shape

 Segmentation: partitions an image into its constituent parts or objects

 Feature extraction:

 Uses raw pixel data, constituting either the boundary of a region (i.e., the set of pixels
separating one image region from another) or all the points in the region itself

 Feature extraction consists of feature detection and feature description

 Feature detection refers to finding the features in an image, region, or boundary

 Feature description assigns quantitative attributes to the detected features

Computer Vision and Image Processing Lecture Note 14


Cont.

 Image pattern classification: is the process that assigns a label to an object based on
its feature descriptors

 Knowledge about a problem domain

 Is coded into an image processing system in the form of a knowledge database

 This knowledge may be as simple as detailing regions of an image where the


information of interest is known to be located, thus limiting the search that has to
be conducted in seeking that information.

 The knowledge base can also be quite complex, such as an interrelated list of all
major possible defects in a materials inspection problem, or an image database
containing high-resolution satellite images of a region in connection with change-
Computer Vision and Image Processing Lecture Note 15
Application Areas of Digital Image Processing.

 Today most of the area demand digital image processing applications

 Principal energy source for images is electromagnetic energy spectrum

 Other sources of energy include acoustic, ultrasonic, and electronic (electron beams
used in electron microscopy)

 Synthetic images, used for modeling and visualization, are generated by computer

 Images generated at these energy categories can be employed in various areas

 Images based on radiation from the EM spectrum are familiar in X-ray and visual
bands of the spectrum

Computer Vision and Image Processing Lecture Note 16


Gamma Ray Imaging

 Used in nuclear medicine and astronomical observations

 In nuclear medicine, to inject a patient with a radioactive isotope that emits gamma
rays as it decays

 Images are produced from the emissions collected by gamma-ray detectors

 E.g. image of a complete bone obtained using gamma-ray imaging used to locate
sites of bone pathology, such as infections or tumors

 Positron emission tomography(PET) is another modality of nuclear imaging follows


X-ray tomography principle

Computer Vision and Image Processing Lecture Note 17


X-Ray Imaging

 X-rays are EM radiation used for imaging

 This images are useful in medical diagnostics, industry and astronomy

 X-rays images are generated using an X-ray tube, which is a vacuum tube with a
cathode and anode

 In digital radiography, digital images are obtained by one of two methods: (1) by
digitizing X-ray films; or; (2) by having the X-rays that pass through the patient fall
directly onto devices (such as a phosphor screen) that convert X-rays to light

 The light signal in turn is captured by a light-sensitive digitizing system

 Angiography is another major application in an area called contrast enhancement


radiography
Computer Vision and Image Processing Lecture Note 18
Imaging in the Ultraviolet Band

 Applications of ultraviolet light include lithography, industrial inspection,


microscopy, lasers, biological imaging, and astronomical observations

 Ultraviolet light is used in fluorescence microscopy, one of the fastest growing areas
of microscopy

Computer Vision and Image Processing Lecture Note 19


Imaging in the Visible and Infrared Bands

 Visual band of the EM spectrum is the most familiar in all our activities, imaging in
this band outweighs by far all the others in terms of breadth of application

 Infrared band often is used in conjunction with visual imaging

 Applications in light microscopy, astronomy, remote sensing, industry, and law


enforcement.

 Application ranges from pharmaceuticals and microinspection to materials


characterization

 Even in microscopy alone, the application areas are too numerous to detail here.

 It is not difficult to conceptualize the types of processes one might apply to these
images, ranging from enhancement to measurements.
Computer Vision and Image Processing Lecture Note 20
Chapter Two: Digital Image Fundamentals
Elements of Visual Perception
 Structure of human eye
 Eye is enclosed by three membranes: cornea and sclera outer cover, choroid, and retina
 Cornea is a tough, transparent tissue that covers the anterior surface of the eye

 Sclera is an opaque membrane that encloses the remainder of the optic globe

 Choroid lies below sclera containing blood vessels to serve as nutrition source of the eye

 Choroid coat reduces extraneous light entering the eye

 Choroid is divided into ciliary body and iris


 Retina lines the inside of the wall’s entire posterior portion
 When the eye is focused, light from an object is imaged on the retina
 Pattern vision is afforded by discrete light receptors of the retina
Computer Vision and Image Processing Lecture Note 21
Cont.

Computer Vision and Image Processing Lecture Note 22


Cont.

 There are two types of receptors: cones and rods

 Cones are located in central portion of retina called fovea, highly sensitive to color

 Humans can resolve fine details because each cone is connected to its own nerve end

 Muscles rotate the eye until the image of a region of interest falls on the fovea

 Cone vision is called photopicor, bright-light vision

 Rods capture an overall image of the field of view, not involved in color vision

 This phenomenon is known as scotopicor dim-light vision

 E.g. object appear colored in daylight appear colorless in moonlight because of rods

Computer Vision and Image Processing Lecture Note 23


Image formation in the eye

 In a photographic camera, lens has a fixed focal length

 Varying the distance between lens and imaging plane used for focusing at various distances

 In human eye, the distance between the center of the lens and retina (imaging sensor) is
fixed, and the focal length of proper focus is obtained by varying the shape of the lens

 The range of focal lengths is approximately 14mm to 17mm, the latter taking place when
the eye is relaxed and focused at distances greater than about 3m

 For an object with height h, a person looking an object at distance d, to obtain the retinal
image is h/d dimensions of an image formed on the retina,

 E.g. suppose that a person is looking at a tree 15m high at a distance of 100m, let h denote
height of object in the retinal image, yields 15/100 =h/17 or h=25mm

 Retinal image is focused primarily on the region of the fovea


Computer Vision and Image Processing Lecture Note 24
Brightness adaptation

 Is process of adjusting visual system sensitivity to changes in ambient light levels

 Allows to perceive light intensity from dimly lit to bright daylight for visual clarity, sensitivity

 Occurs in retina and involves adjustments in rods and cones to varying levels of light

 Helps in optimizing vision for different lighting conditions

 When moving from a bright to a darker, the eye becomes more sensitive to low light levels

 Moving from a dark to a bright, the eye becomes more sensitive to high light levels

Computer Vision and Image Processing Lecture Note 25


Brightness discrimination

 Is the ability to distinguish between different levels of brightness or colors

 Visual system’s perceive and differentiate fine details and contrasts within image or scene

 Spatial (fine vs. coarse) and temporal frequency (time) affect discrimination capabilities

 Contrast sensitivity to detect differences in luminance or color between adjacent areas

 Essential for reading text, recognizing faces, navigating environments, identifying objects

 Ambient lighting, noise, color contrast, and complexity of pattern influence discrimination

 Digital images are displayed as sets of discrete intensities

 Discriminating different intensity levels is important in presenting image processing results

Computer Vision and Image Processing Lecture Note 26


Light and Electromagnetic Spectrum

 When a beam of sunlight passes through a glass prism, the emerging beam of light consists a
continuous spectrum of colors ranging from violet at one end to red at the other

 The range of colors we perceive in visible light is a small portion of the EM spectrum

 Radio waves with the higher wavelengths than visible light exist at one end, whereas gamma
rays with smaller wavelengths than visible light found in another end

 Electromagnetic spectrum can be expressed as:

𝑠𝑝𝑒𝑒𝑑 𝑜𝑓 𝑙𝑖𝑔ℎ𝑡 (𝑐)


𝐸𝑀 𝑠𝑝𝑒𝑐𝑡𝑟𝑢𝑚(𝜆) =
𝑓𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 (𝑣)

 Energy of specific components of the λ is:

𝐸 = ℎ𝑣 h is planks constant
Computer Vision and Image Processing Lecture Note 27
Cont.

Electromagnetic Wave Frequency range Wave Length Range

Radio Wave 3KHz-300GHz 0.001m-1000m

Infrared Wave 300GHz-400THz 700nm-0.001m

Visible Light 400THz-800THz 30-700nm

Ultraviolet Light 800THz-30PHz 10-400nm

X-Ray 30PHz-30exaHz 0.01-10nm

Gamma Ray 3 ∗ 1018 to 3 ∗ 1022 Hz <one trillionth, most energy

Computer Vision and Image Processing Lecture Note 28


Cont.

 EM waves visualized as propagating sinusoidal waves, or stream of massless particles


traveling in a wavelike pattern at the speed of light

 Each massless particle contains a certain amount (or bundle) of energy called a photon

 Energy is proportional to frequency, and inverse proportional to the wavelength

 Radio waves have lowest frequency, whereas gamma waves have the highest frequency

 High-energy EM radiation, X-ray and gamma ray bands is harmful to living organisms

 Visible light EM spectrum is a type of EM radiation that can be sensed by human eye

 Color spectrum is divided into six regions: violet, blue, green, yellow, orange, and red

 The nature of light reflected by the object determines the colors perceived in an object

Computer Vision and Image Processing Lecture Note 29


Cont.

 A body that reflects balanced light in all visible wavelengths appears white to the observer

 A body that reflects in a limited range of the visible spectrum exhibits some shades of color

 E.g. green objects reflect light with wavelengths primarily in the 500 to 570 nm range, while
absorbing most of the energy at other wavelengths

 Void/no color light called monochromatic/achromatic light, its only attribute is intensity

 The intensity of monochromatic light vary from black to grays and finally to white

 The term gray level is used commonly to denote monochromatic intensity

 Monochromatic light values range from black to white which is called gray scale
 Monochromatic images are frequently referred to as grayscale images
 Chromatic/color light EM spectrum wavelength ranges from 0.43 to 0.79 mm
Computer Vision and Image Processing Lecture Note 30
Cont.

 Three quantities that describe a chromatic light source: radiance, luminance, and brightness

 Radiance is total amount of energy that flows from the light source, measured in watts (W)

 Luminance is the amount of energy an observer perceives from a light source, in lumens (lm)

 Brightness embodies the achromatic notion of intensity and is key in describing color sensation

 Predominant source of imaging is energy of EM wave, but this is not the only source

 Sound reflected from objects can be used to form ultrasonic images

 Electron beams for electron microscopy and software for generating synthetic images are
another sources of digital imaging

Computer Vision and Image Processing Lecture Note 31


Cont.

 In principle, if a sensor detects energy in the specific band of EM, object imaged at that band

 Wavelength of EM wave required to see an object must be the same/smaller size than the object

 E.g. a water molecule has a diameter on the order of 10 10 −m. Thus, to study these molecules,
we would need a source capable of emitting energy in the far (high energy) ultraviolet band or
soft (low-energy) X-ray bands

Computer Vision and Image Processing Lecture Note 32


Image Sensing and Acquisition

 Images are generated by illumination source and reflection or absorption of energy by


elements of the scene being imaged

 Illumination originate from a source of EM energy like radar, infrared, or X-ray system

 It also originate from sources like ultrasound or computer-generated illumination pattern

 Scene elements could be objects like molecules, buried rock formations, or a human brain

 Illumination energy either reflected from or transmitted through objects based on the source

 E.g. Light reflected from a planar surface, whereas X-rays pass through a patient’s body for
the purpose of generating a diagnostic X-ray image

 Reflected/transmitted energy is focused onto a photo converter (phosphor screen) to convert


energy into visible light. Electron microscopy and gamma imaging use this approach
Computer Vision and Image Processing Lecture Note 33
Cont.
 Image acquisition using single sensing element

 E.g. Photodiode constructed from silicon, output is a voltage proportional to light intensity

 It uses filter in front of a sensor to improves selectivity

 To generate 2D image, there is displacements in x and y directions of sensor and object area

 Sensor is mounted on a lead screw that provides motion in the perpendicular direction

 A light source is contained inside the drum

 Is inexpensive way to obtain high-resolution images because of mechanical motion

 Disadvantages is slow and not portable


 Such mechanical digitizers sometimes referred to as transmission microdensitometers

 Light is reflected instead of passing through object, called reflection microdensitometers


Computer Vision and Image Processing Lecture Note 34
Cont.
 Image acquisition using sensor trips

 A geometry used more frequently than single sensors is an in-line sensor strip

 Strip provides imaging elements in one direction

 Motion perpendicular to the strip provides imaging in the other direction

 Sensing devices with >4000 in-line sensors are possible

 1D imaging sensor strips that respond to various bands of the EM spectrum

 Imaging strip gives 1D of image at a time, and motion of strip relative to scene completes 2D
 Lens are used to project the area to be scanned onto the sensors
 Sensor strips in a ring used in medical and industrial imaging to obtain images of 3D object

Computer Vision and Image Processing Lecture Note 35


Cont.
 Image acquisition using sensor arrays

 Sensors arranged in a 2D array

 EM and ultrasonic sensing devices are arranged in this manner

 Is predominantly found in digital cameras and other light-sensing instruments

 Typical sensor for these cameras is a CCD (charge-coupled device) array, 4000*4000

 Used in astronomical and other applications requiring low noise images

 Sensor integrates the input light over minutes/even hours to achieve noise reduction

 Advantage is a complete image obtained by focusing the energy pattern onto the array
 Motion obviously is not necessary

 Sensor array, produces outputs proportional to integral of the light received at each sensor
Computer Vision and Image Processing Lecture Note 36
Image Sampling and Quantization

 Basic concepts in sampling and quantization

 Output of most sensors is a continuous voltage waveform (i.e., coordinates and amplitude)

 To create a digital image, the sensed data should be converted into a digital format

 Digitizing the coordinate values is called sampling

 Digitizing the amplitude (intensity level) values is called quantization

 Method of sampling is determined by the sensor arrangement used to generate the image

Computer Vision and Image Processing Lecture Note 37


Cont.
 Representing digital images

 Three ways of representing image function f(x, y):

 Representing with two axes (x, y) and value of z, useful in grayscale sets which is (x, y, z)

 Representing as it would appear on a computer display or photograph

 Representing using array/matrix, which is used for computer processing. Digital image
represented as array of real numbers. Each element of array is an picture element, pixel/p

Computer Vision and Image Processing Lecture Note 38


Cont.
 Image interpolation
 Used in zooming, shrinking, rotating, and geometrically correcting digital images
 Is the process of using known data to estimate values at unknown locations
 To enlarge 500*500 pixel image to 750*750 pixels, create 750*750 grid with the same pixel
spacing as original image, then shrink it so that it exactly overlays the original
 Pixel spacing in the shrunken 750*750 grid will be less than the pixel spacing in the original
 To assign an intensity, look for closest pixel in original image and assign the intensity of
that pixel to the new pixel in the 750*750 grid
 After assigning intensities to all pixels, expand it back to obtain the resized image
 This method is called nearest neighbor interpolation, it assigns intensity of its nearest
neighbor in the original image
 This approach is simple, but causes severe distortion of straight edges
 Bilinear interpolation use the four nearest neighbors to estimate intensity of given location

Computer Vision and Image Processing Lecture Note 39


Cont.

Rotation Translation Shearing

Computer Vision and Image Processing Lecture Note 40


Basic Relationships between Pixels
 Neighbors of a pixel

 A pixel p at (x, y) has 4 neighbors (2 horizontal, 2 vertical) with coordinates (x+1, y), (x-1, y),
(x, y+1), (x, y-1), This set of pixels called the 4-neighbors of p, or N4(p)

 4 diagonal neighbors of p denoted by ND(p) have coordinates (x+1, y+1), (x+1, y-1), (x-1,
y+1), (x-1, y-1)

 ND(p) and N4(p) together are called 8-neighbors of p, denoted by N8(p)

 Set of image locations of the neighbors of a point p is called the neighborhood of p

 Neighborhood is said to be closed if it contains p

 Otherwise, neighborhood is said to be open

Computer Vision and Image Processing Lecture Note 41


Cont.

 Adjacency, connectivity, regions, and boundaries

 Let V be the set of intensity values used to define adjacency

 In a binary image, V = {1} if we are referring to adjacency of pixels with value 1

 In a grayscale image, set V contains more elements. E.g. for the adjacency of pixels whose
values are 0 to 255, set V could be any subset of these 256 values

 We consider three types of adjacency:


 4-adjacency: Two pixels p and q with values from V are 4-adjacent if q is in the set N4(p)
 8-adjacency: Two pixels p and q with values from V are 8-adjacent if q is in the set N8(p)
 M or mixed adjacency: Two pixels p and q with values from V are m-adjacent if q is in N4(p) or
ND(p) and the set N4(p) and N4(q) has no pixels whose values are from V
 M-adjacency is a modification of 8-adjacency, eliminate the ambiguities of 8-adjacency
Computer Vision and Image Processing Lecture Note 42
Cont.

 A digital path from pixel p with (𝑥0 , 𝑦0 ) to pixel q with (𝑥𝑛 , 𝑦𝑛 ) is a sequence of distinct
pixels with coordinate (𝑥0 , 𝑦0 ), (𝑥1 , 𝑦1 )… (𝑥𝑛 , 𝑦𝑛 ) n is length of the path

 If (𝑥0 , 𝑦0 ) = (𝑥𝑛 , 𝑦𝑛 ), the path is closed

 Let S is subset of pixels in an image, two pixels p and q are said to be connected in S if there
exists a path between them consisting entirely of pixels in S

 For a pixel p in S, the set of pixels connected to p in S is called a connected component of S

 If p has only one component that is connected, S is called a connected set

 Let R is a subset of pixels in an image, if R is a connected set then R is a region of the image

 Two regions, 𝑅𝑖 and 𝑅𝑗 are said to be adjacent if their union forms a connected set

 Regions that are not adjacent are said to be disjoint


Computer Vision and Image Processing Lecture Note 43
Mathematical Operations in Digital Image Processing
 Elementwise vs. matrix operations
 Elementwise operation in images is carried out on a pixel by pixel basis
 Images can be viewed equivalently as matrices
 Two distinct operation elementwise and matrix can be performed for two matrices (images)
𝑎11 𝑎12 𝑏11 𝑏12
 E.g. for 2*2 images (matrices): 𝑎21 𝑎22 𝑏21 𝑏22
𝑎11 𝑎12 𝑏 𝑏 𝑎 𝑏 𝑎 𝑏
 Elementwise product is: 𝑎 𝑎 ʘ 11 12 = 11 11 12 12
21 22 𝑏21 𝑏22 𝑎21 𝑏21 𝑎22 𝑏22
𝑎11 𝑎12 𝑏11 𝑏12 𝑎11 𝑏11 +𝑎12 𝑏21 𝑎11 𝑏12 + 𝑎12 𝑏22
 Matrix product of images is: 𝑎 𝑎 x =
21 22 𝑏21 𝑏22 𝑎21 𝑏11 + 𝑎22 𝑏21 𝑎21 𝑏12 + 𝑎22 𝑏22

Computer Vision and Image Processing Lecture Note 44


Cont.
 Arithmetic operations

 Arithmetic operations between two images f(x, y)and g(x, y) are denoted as:

s(x, y) = f(x, y) + g(x, y), p(x, y) = f(x, y) * g(x, y),


d(x, y) = f(x, y) - g(x, y), v(x, y) = f(x, y) / g(x, y)

 Are elementwise operations, performed between corresponding pixel pairs in f and g

 The results s, d, p and v are images, which has the same size of inputs f and g

 Arithmetic addition is important in DIP for noise reduction, is image enhancement method

 Subtraction is important for comparing two images

 Image multiplication and division are important for shading correction and masking

Computer Vision and Image Processing Lecture Note 45


Cont.
Input Image1 Input Image2

Sum Difference Quotient Product

Computer Vision and Image Processing Lecture Note 46


Cont.

 Set and logical operations

 In DIP set operation can be implemented using logical operations

 Set is a collection of distinct elements/objects

 Image A and B union implemented using logical OR

 Image A and B Intersection implemented using logical AND

 The complement of image A can be implemented using NOT

 The difference of Image A and B can be implemented using XOR

Computer Vision and Image Processing Lecture Note 47


Cont.
IM1 IM2

IM1 AND IM2 IM1 OR IM2 IM1 XOR IM2 NOT IM1

Computer Vision and Image Processing Lecture Note 48


Cont.
 Spatial operations

 Are performed directly on the pixels of an image

 Types: single-pixel operations, neighborhood operations, geometric spatial transformation

 Single-pixel operations: used to alter intensity of pixels using a transformation, e.g. negatives

 Neighborhood Operations: For the set of coordinates of a neighborhood centered on an


arbitrary point (x, y) in an image. Generates a corresponding pixel at the same coordinates in
an output image, such the pixel is determined by a specified operation on the neighborhood
of pixels in the input image with coordinates in the set. E.g. average of pixels

 Geometric Spatial Transformation: Modify the spatial arrangement of pixels in an image.


Consist of two basic operations: Spatial transformation of coordinates and Intensity
interpolation that assigns intensity values to the spatially transformed pixels
Computer Vision and Image Processing Lecture Note 49
Image registration
 Techniques for Image Registration
 Feature-Based Image Registration
 Intensity-Based Image Registration
 Model-Based Image Registration
 Learning-Based Image Registration
 Hybrid Methods

Computer Vision and Image Processing Lecture Note 50


Chapter Three: Intensity Transformations and Spatial Filters

 Basics of intensity transformations and spatial filtering

 Spatial domain refers to the image plane itself, direct manipulation of pixels in an image

 Two categories of spatial processing are intensity transformations and spatial filtering

 Transformations operate on single pixels for contrast manipulation and image thresholding

 Spatial filtering performs operations on the neighborhood of every pixel in an image

 The spatial domain processing are denoted by the expression: g(x, y) = T[f(x, y)]

 f(x, y)input image, g(x, y)output image, and T is an operator on image

 T can be operate on a set of images e.g. addition of K images for noise reduction

Computer Vision and Image Processing Lecture Note 51


Intensity Transformation Functions
 Some basic intensity transformation functions
 Image negatives
 Log transformations
 Power-law (gamma) transformations
 Piecewise linear transformation functions (contrast stretching, intensity level slicing)

Computer Vision and Image Processing Lecture Note 52


Image Negatives

 The negative of an image with specific intensity levels is obtained using transformation

 Reversing intensity of a digital image produces equivalent of a photographic negative

 Enhance white/gray detail embedded in dark regions of an image

Original Image Negative Image

Computer Vision and Image Processing Lecture Note 53


Log Transformations
 Log transformation is 𝑠 = 𝑐𝑙𝑜𝑔(1 + 𝑟), where c is constant, r>=0
 Maps a narrow range of low intensity values in the input into a wider range of output
 Higher values of input levels are mapped to a narrower range in the output
 E.g. [0, L/4] mapped to [0, 3L/4],
 Used to expand the values of dark pixels in image, compress the higher-level values
 The opposite is true of the inverse log (exponential) transformation

Computer Vision and Image Processing Lecture Note 54


Power-Law(Gamma) Transformations
 Computed as: 𝑠 = 𝑐𝑟 𝛄 or 𝑠 = 𝑐(𝑟 + 𝛆)𝛄 , where c and 𝛄 are positive constants
 Gamma curves with fractional values of 𝛄 map a narrow range of dark input values into a
wider range of output values, with the opposite being true for higher values of input levels
 Curves generated with 𝛄 >1 have exactly the opposite effect as 𝛄 <1
 Exponent is referred to as gamma
 Correcting these power-law response phenomena is called gamma correction or encoding

Computer Vision and Image Processing Lecture Note 55


Cont.
At gamma 0.1 At gamma 0.5 Original Image

At gamma 1.2 At gamma 2.2

Computer Vision and Image Processing Lecture Note 56


Piecewise Linear Transformations (Contrast stretching, intensity slicing)
 Practical implementation of some transformation can be achieved as piecewise linear function
 Main disadvantage is that their specification requires considerable user input
 Contrast Stretching: Expands the range of intensity levels so that it spans the ideal full
intensity range of the recording medium or display device. Low-contrast images can result
from poor illumination, lack of dynamic range in the imaging sensor, or wrong setting of a lens
aperture during image acquisition
 Points (r1, s1) and (r2, s2) control the shape of the transformation function
 If r1=s1 and r2=s2 the transformation is a linear function that produces no changes in intensity
 If r1=r2 , s1=0 ,and s2=L-1 the transformation becomes a thresholding function that creates a
binary image
 Intensity level slicing:
 Bit-plane slicing:

Computer Vision and Image Processing Lecture Note 57


Cont.
Original input After Piecewise Linear Transformation

Computer Vision and Image Processing Lecture Note 58


Histogram Processing

 Histogram is used for graphical representation of a digital image

 Histogram manipulation is a fundamental tool in image processing

 Simple to compute, suitable for hardware implementations, useful for real-time image processing

 Histogram present in digital cameras and used to see the distribution of gray level captured

 X-axis represent intensity level, y-axis represent number of pixels at the specific intensity

 Black/dark presented in the left, medium gray in middle and white at the right end of the x-axis

 Histogram Processing includes: equalization, matching (specification), local histogram


processing, histogram statistics for image enhancement

Computer Vision and Image Processing Lecture Note 59


Cont.
 Applications of Histograms
 Used for simple calculations in software
 Used to analyze an image, image property can be predicted by analyzing of histogram
 Used to adjust brightness and contrast of the image
 Used for image equalization
 From input and output histogram of image, transformation type can be determined
Image Histogram of Image

Computer Vision and Image Processing Lecture Note 60


Cont.

 Histogram Equalization

 Is an intensity transformation technique which improves the image contrast

 Is the process of uniformly distributing the image histogram over the entire intensity axis
by choosing a proper intensity transformation function

Computer Vision and Image Processing Lecture Note 61


Cont.
 Histogram matching (specification)

 Used to normalize image representation

 Used for feature matching, for pictures from diverse sources or varied intensity

 Each image has a number of channels, each channel is matched individually

 Is possible only if the number of channels matches in the input and reference images

 Main target of histogram matching is:

 For each image, create histograms

 Take a look at the histogram of the reference image

 Using the reference histogram, update the pixel intensity values in the input picture
such that they match
Computer Vision and Image Processing Lecture Note 62
Cont.

Computer Vision and Image Processing Lecture Note 63


Cont.
 Using histogram statistics for image enhancement

 Statistics obtained directly from an image histogram can be used for image enhancement

 Mean is a measure of average intensity, variance is a measure of image contrast

 Global mean and variance are computed from entire image and are useful for gross
adjustments in overall intensity and contrast

 Local mean and variance are used as the basis for making changes that depend on image
characteristics in a neighborhood about each pixel in an image

Computer Vision and Image Processing Lecture Note 64

You might also like