Unit-1
Unit-1
Digital Image is composed of a finite number of elements, each of which elements have a
particular value at a particular location.These elements are referred to as picture
elements,image elements,and pixels.A Pixel is most widely used to denote the elements of
a Digital Image.
Types of an image
1. BINARY IMAGE– The binary image as its name suggests, contain only two pixel elements i.e 0 & 1,where 0
refers to black and 1 refers to white. This image is also known as Monochrome.The image which consist of
only black and white color is called BLACK AND WHITE IMAGE.
2. 8 bit COLOR FORMAT(Grey scale image)– It is the most famous image format.It has 256 different shades
of colors in it and commonly known as Grayscale Image. In this format, 0 stands for Black, and 255 stands for
white, and 127 stands for gray.
3. 16 bit COLOR FORMAT– It is a color image format. It has 65,536 different colors in it.It is also known as
High Color Format. In this format the distribution of color is not as same as Grayscale image.
4. Color image: RGB
A 16 bit format is actually divided into three further formats which are Red, Green and Blue. That famous RGB
format.
What is a Pixel?
A pixel is the smallest unit of a digital image or display and stands for “picture element.” It is a very small, isolated
dot that stands for one color and plays the most basic part in digital images.
Pixels when combined help to create the mosaic of colors and shapes contributing towards visual content being
displayed on screens such as smartphones, computers TVs, etc.
A pixel, short for "picture element," is the smallest unit of a digital image or display that can be controlled or
manipulated. Pixels are the smallest fragments of a digital photo. Pixels are tiny square or rectangular elements that
make up the images we see on screens
What is Digital Image Processing System
The processes of acquiring an image of the area containing the text, preprocessing that
image, extracting (segmenting) the individual characters, describing the characters in a
form suitable for computer processing, and recognizing those individual characters are in
the scope of what we call digital image processing.
Purpose of Image processing
1. Visualization: The objects which are not visible, they are observed.
2. Image sharpening and restoration: It is used for better image resolution.
3. Image retrieval: An image of interest can be seen
4. Measurement of pattern: In an image, all the objects are measured.
5. Image Recognition: Each object in an image can be distinguished.
PHASES OF IMAGE PROCESSING:
PHASES OF IMAGE PROCESSING:
1.ACQUISITION
2.IMAGE ENHANCEMENT
3.IMAGE RESTORATION–
6.IMAGE COMPRESSION
7.MORPHOLOGICAL PROCESSING
8.SEGMENTATION PROCEDURE
2) Medical Field
3) Robot vision
4) Pattern recognition
5) Video processing
Applications, Components of Image Processing System:
Image sensing and Acquisition
• Images can be generated by the combination of an illuminating source and reflection or
absorption of energy from that source by the elements of the scene being imaged.
• The illuminating source could be sun or any other source of electromagnetic energy such
as radar, IR rays or X-ray energy.
• Depending upon the nature of source, illumination energy is reflected from or transmitted
through object. • This reflected or transmitted energy is focused onto a photo converter
which converts the energy into visible light
The incoming energy is transformed into a voltage by a combination of electrical energy
and sensor material.
• The output waveform is the response of the sensor and a digital image is obtained.
This is an inexpensive method and we can obtain high-resolution images with high precision control. But the downside of
this method is that it is slow.
Fig: Image Acquisition using a line sensor (sensor strips):
In this, the response of each sensor is proportional to the integral of the light energy projected onto the surface of the sensor.
Noise reduction is achieved by letting the sensor integrate the input light signal over minutes or ever hours.
Advantage: Since sensor array is 2D, a complete image can be obtained by focusing the energy pattern onto the surface of the
array.
The sensor array is coincident with the focal plane, it produces an output proportional to the integral of light received at each
sensor.
Digital and analog circuitry sweep these outputs and convert them to a video signal which is then digitized by another section of
the imaging system. The output is a digital image.
Fundamentals of Image Formation
Image formation is an analog to digital conversion of an image with the help of 2D Sampling and
Quantization techniques that is done by the capturing devices like cameras. In general, we see a 2D view of
the 3D world.
In the same way, the formation of the analog image took place. It is basically a conversion of the 3D world
that is our analog image to a 2D world that is our Digital image.
Generally, a frame grabber or a digitizer is used for sampling and quantizing the analog signals.
Imaging: The mapping of a 3D world object into a 2D digital image plane is called imaging. In order to do
so, each point on the 3D object must correspond to the image plane. We all know that light reflects from
every object that we see thus enabling us to capture all those light-reflecting points in our image plane.
Various factors determine the quality of the image like spatial factors or the lens of the capturing device.
Fundamentals of Image Formation
1.Optical Systems
2.Image Sensors
4.Image Processing
Advantages:
1) Improved Accuracy
2) Enhanced Flexibility:
Disadvantages:
1) Data Size
2) Image Noise
In digital image processing, two fundamental concepts are image sampling and quantization. These
processes are crucial for converting an analog image into a digital form that can be stored, manipulated, and
displayed by computers. Despite being closely related, sampling and quantization serve distinct purposes
and involve different techniques. This article delves into the definitions, processes, and differences between
image sampling and quantization.
● Grid Overlay: A grid is placed over the continuous image, dividing it into small, regular sections.
● Pixel Selection: At each intersection of the grid lines, a sample point (pixel) is chosen.
Examples of Sampling
● High Sampling Rate: A digital camera with a high megapixel count captures more details because it
samples the image at more points.
● Low Sampling Rate: An old VGA camera with a lower resolution captures less detail because it samples
the image at fewer points.
What is Image Quantization?
Image quantization is the process of converting the continuous range of pixel values (intensities) into a
limited set of discrete values. This step follows sampling and reduces the precision of the sampled values
to a manageable level for digital representation.
● Value Range Definition: The continuous range of pixel values is divided into a finite number of
intervals or levels.
● Mapping Intensities: Each sampled pixel intensity is mapped to the nearest interval value.
● Assigning Discrete Values: The original continuous intensity values are replaced by the discrete
values corresponding to the intervals
Examples of Quantization
● High Quantization Levels: An image with 256 levels (8 bits per pixel) can represent shades of gray
more accurately.
● Low Quantization Levels: An image with only 4 levels (2 bits per pixel) has much less detail and
appears more posterized.
Key Differences Between Image Sampling and Quantization
Measure Pixels per inch (PPI) or dots per Bits per channel (e.g., 8-bit
ment inch (DPI) color)
Impact Affects the sharpness and clarity Affects the color richness of the
of the image image
Representing Digital Pixels:
“Virtual image, a point or system of points, on one side of a mirror or lens, which, if it existed, would emit the
system of rays which actually exists on the other side of the mirror or lens.”
--Clerk Maxwell
1.Vector images
2.Bitmap images
Vector images
One way to describe an image using numbers is to declare its contents using position and size of geometric forms and
shapes like lines, curves, rectangles and circles; such images are called vector images.
Coordinate system:We need a coordinate system to describe an image, the coordinate system used to place
elements in relation to each other is called user space, since this is the coordinates the user uses to define elements
and position them in relation to each other.
The coordinate system used for all examples in this document has the origin in the upper left, with the x axis
extending to the right and y axis extending downwards.
Vector images: Defining shapes
It would have been nice to make a smiling face, instead of the dissatisfied face on the left, by using a bezier curve, or
the segment of a circle this could be achieved, this being a text focusing mainly on raster graphics though, that would
probably be too complex.
A vector image of a face, and the instructions used to create the image.
The preceding description of an image can be seen as a “cooking recipe” for how to draw the image, it contains
geometrical primitives like lines, curves and cirles describing color as well as relative size, position and shape of
elements. When preparing the image for display is has to be translated into a bitmap image, this process is called
rasterization.
A vector image is resolution independent, this means that you can enlarge or shrink the image without affecting the
output quality. Vector images are the preferred way to represent Fonts, Logos and many illustrations.
Bitmap images
Bitmap-, or raster [1] -, images are “digital photographs”, they are the most common form to represent natural
images and other forms of graphics that are rich in detail. Bitmap images is how graphics is stored in the video
memory of a computer. The term bitmap refers to how a given pattern of bits in a pixel maps to a specific color.
A rasterized form of the letter 'a' magnified 16 times using pixel doubling:
A bitmap images take the form of an array, where the value of each element, called a pixel picture element, correspond to the color of
that portion of the image. Each horizontal line in the image is called a scan line.
The letter 'a' might be represented in a 12x14 matrix as depicted in Figure , the values in the matrix depict the brightness of the pixels
(picture elements). Larger values correspond to brighter areas whilst lower values are darker.
Difference between Raster and Vector
Pros Cons
When measuring the value for a pixel, one takes the average color of an area around the location of the pixel. A
simplistic model is sampling a square, this is called a box filter, a more physically accurate measurement is to
calculate a weighted Gaussian average (giving the value exactly at the pixel coordinates a high weight, and lower
weight to the area around it). When perceiving a bitmap image the human eye should blend the pixel values together,
recreating an illusion of the continuous image it represents.
Raster dimensions:
The number of horizontal and vertical samples in the pixel grid is called Raster dimensions, it is specified as width x
height.
Resolution
Resolution is a measurement of sampling density, resolution of bitmap images give a relationship between pixel dimensions and
physical dimensions. The most often used measurement is ppi, pixels per inch [2].
A rasterized form of the letter 'a' magnified 16 times, where each pixel is represented as a circle instead of a square.
Megapixels
Megapixels refer to the total number of pixels in the captured image, an easier metric is raster dimensions which
represent the number of horizontal and vertical samples in the sampling grid. An image with a 4:3 aspect ratio with
dimension 2048x1536 pixels, contain a total of 2048x1535=3,145,728 pixels; approximately 3 million, thus it is a 3
megapixel image.
Scaling / Resampling
When we need to create an image with different dimensions from what we have we scale the image. A different name
for scaling is resampling, when resampling algorithms try to reconstruct the original continous image and create a
new sample grid.
Sample depth
The values of the pixels need to be stored in the computers memory, this means that in the end the data ultimately need to end up in a binary
representation, the spatial continuity of the image is approximated by the spacing of the samples in the sample grid. The values we can represent for
each pixel is determined by the sample format chosen.
8bit
A common sample format is 8bit integers, 8bit integers can only represent 256 discrete values (2^8 = 256), thus brightness levels are quantized into
these levels.
12bit
For high dynamic range images (images with detail both in shadows and highlights) 8bits 256 discrete values does not provide enough precision to store
an accurate image. Some digital cameras operate with more than 8bit samples internally, higher end cameras (mostly SLRs) also provide RAW images
that often are 12bit (2^12bit = 4096).
16bit
The PNG and TIF image formats supports 16bit samples, many image processing and manipulation programs perform their operations in 16bit when
working on 8bit images to avoid quality loss in processing.
Floating point
Some image formats used in research and by the movie industry store floating point values. Both "normal" 32bit
floating point values and a special format called half which uses 16bits/sample. Floating point is useful as a working
format because quantization and computational errors are kept to a minimum until the final render.
Floating point representations often include HDR, High Dynamic Range. High Dynamic Range images are images
that include sampling values that are whiter than white (higher values than 255 for a normal 8bit image). HDR
allows representing the light in a scene with a greater degree of precision than LDR, Low Dynamic Range images.
A floating-point is a way of representing and performing arithmetic operations on real
numbers in computing. It's a numerical data type that allows you to handle values with
fractional parts and a wide range of magnitudes.
The term "floating-point" refers to the fact that the decimal point can "float" or be
positioned anywhere within the number, enabling the representation of both very large and
very small numbers.
Value=Sign × Significand × BaseExponent
Colors
The most common way to model color in Computer Graphics is the RGB color model, this corresponds to the way both CRT monitors and LCD
screens/projectors reproduce color. Each pixel is represented by three values, the amount of red, green and blue. Thus an RGB color image will use
three times as much memory as a gray-scle image of the same pixel dimensions.
One of the most common pixel formats used is 8bit rgb where the red, green and blue values are stored interleaved in memory. This memory layout
is often referred to as chunky, storing the components in seperate buffers is called planar, and is not as common.
Palette / Indexed images
It was earlier common to store images in a palletized mode, this works similar to a paint by numbers strategy. We
store just the number of the palette entry used for each pixel. And for each palette entry we store the amount of red,
green and blue light.
On the left, image using just 16 colors, on the right the palette used for this image. The way an indexed/paletted
image works is similar to how paint by numbers work.
Image compression
Bitmap images take up a lot of memory, image compression reduces the amount of memory needed to store an image. For instance a 2.1
megapixel, 8bit RGB image (1600x1200) occupies 1600x1200x3 bytes = 5760000 bytes = 5.5 megabytes, this is the uncompressed size of
the image.
Compression ratio is the ratio between the compressed image and the uncompressed image, if the example image mentioned above was
stored as a 512kb jpeg file the compression ratio would be 0.5mb : 5.5mb = 1:11.
When an image is losslessly compressed, repetition and predictability is used to represent all the information using
less memory. The original image can be restored. One of the simplest lossless image compression methods is
run-length encoding. Run-length encoding encodes consecutive similar values as one token in a data stream.
JPEG is a file format implementing compression based on the Discrete Cosine Transform DCT, together with lossless
algorithms this provides good compression ratios. The way JPEG works is best suited for images with continuous tonal
ranges like photographs, logos, scanned text and other images with lot's of sharp contours / lines will get more
compression artifacts than photographs.
Loss through Generations
Lossy compression algorithms should not be used as a working format, only final copies should be saved as jpeg since
loss accumulates over generations.
An image specially constructed to show the deficiencies in the JPEG compression algorithm, saved, reopened and
saved again 9 times.
JPEG is most suited for photographics content where the adverse effect of the compression algorithm is not so
evident.
JPEG is not suited as an intermediate format, only use JPEG for final distribution where filesize actually matters.
File formats and applications
Raster File Formats: .jpg .png .gif .exr .raw, .raw .dgn .tiff, .tif .psd .xcf
Some basic relationships between Pixels:
Content
1. Regions
2. Boundaries.
3. Digital path.
4. Distance Measure
Some basic relationships like Neighbours:
An image is denoted by f(x,y) and p,q are used to represent individual pixels of the image.
Neighbours of a pixel:
A pixel p at (x,y) has 4-horizontal/vertical neighbours at (x+1,y), (x-1,y), (x,y+1) and (x,y-1). These are called the
4-neighbours of p : N4(p).
A pixel p at (x,y) has 4 diagonal neighbours at (x+1,y+1), (x+1,y-1), (x-1,y+1) and (x-1,y-1). These are called the
diagonal-neighbours of p : ND(p).
The 4-neighbours and the diagonal neighbours of p are called 8-neighbours of p : N8(p).
Adjacency between pixels
In a binary image, V ={1} if we are referring to adjacency of pixels with value 1. In a gray-scale image, the idea is
the same, but set V typically contains more elements.
For example, in the adjacency of pixels with a range of possible intensity values 0 to 255, set V could be any subset
of these 256 values.
a) 4-adjacency
b) 8-adjacency
c) m-adjacency(mixed adjacency)
a) 4-adjacency: Two pixels p and q with values from V are 4-adjacent if q is in the set
N4(p).
b) 8-adjacency: Two pixels p and q with values from V are 8-adjacent if q is in the set
N8(p).
c) m-adjacency(mixed adjacency): Two pixels p and q with values from V are
m-adjacent if
1. q is in N4(p), or
2. 2) q is in ND(p) and the set N4(p)∩N4(q) has no pixels whose values are from V.
Connectivity between pixels
a) 4-connectivity: Two or more pixels are said to be 4-connected if they are 4-adjacent
with each others.
b) 8-connectivity: Two or more pixels are said to be 8-connected if they are 8-adjacent
with each others.
c) m-connectivity: Two or more pixels are said to be m-connected if they are m-adjacent
with each others.
Introduction to colour image – RGB and HSI Models
A color model is a specification of a coordinate system and subspace where each
color is represented as single point.
• (R, G, B): all values of R, G, B are between 0 and 1. • With digital representation,
for a fixed length of bits each color element. The total number of bits is called color
depth, or pixel depth. For example, 24-bit RGB color (r, g, b), 8 g, b), 8-bits for
each color. The 8 bits for each color. The 8-bit binary number r bit binary number r
represents the value of r/256 in [0,1
Displaying Colors in RGB model
HUE:(H)
The hue of a color is a component of its chromaticity. Red, green, and blue are the three
main colors of light. Hue is a single value that describes the color of something and is
typically measured in degrees. It has the colors red, orange, yellow, green, blue, purple, and
magenta all the way back to red. Although, magenta and pink colors are not light
frequencies, and a rainbow may prove it. It begins with red and progresses to different
colors, but it doesn't contain magenta and pink because they are not genuine frequencies
humans can see.
Brightness:(I)
When working with color photography or printing systems, knowledge of these
three characteristics helps ensure the best results. Using a photo or print
application provides flexibility in mixing colors, adjusting contrast, inserting
grayscale elements, and adjusting saturation and brightness. And these tasks can
all be done in Real Time.
What is Saturation?
Saturation is defined by the purity of the color and its distance from the grey color. If a
color has much more greyness, it has a lower saturation level. Moreover, saturation could
be viewed as the hue's dominance in the color. The outermost edge of the hue wheel
includes the pure hue; as you move inside the wheel to the centre, which contains grey, the
hue steadily drops, and the saturation likewise falls. It relates to a physical property known
as the excitation property, which measures the percentage of brightness mixed with the
dominant or pure color.