IP UT 1 Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Introduction to Digital Image Processing

What is Digital Image Processing (DIP)?

Digital Image Processing (DIP) is a software which is used to manipulate the digital
images by the use of computer system. It is also used to enhance the images, to get some
important information from it.

For example: Adobe Photoshop, MATLAB, etc.

It is also used in the conversion of signals from an image sensor into the digital
images.

A certain number of algorithms are used in image processing.

Digital Image Processing

o Digital Image Processing is a software which is used in image processing.


For example: computer graphics, signals, photography, camera mechanism,
pixels, etc.
o Digital Image Processing provides a platform to perform various operations
like image enhancing, processing of analog and digital signals, image
signals, voice signals etc.
o It provides images in different formats.

Digital Image Processing allows users the following tasks

o Image sharpening and restoration: The common applications of Image


sharpening and restoration are zooming, blurring, sharpening, grayscale
conversion, edges detecting, Image recognition, and Image retrieval, etc.
o Medical field: The common applications of medical field are Gamma-ray
imaging, PET scan, X-Ray Imaging, Medical CT, UV imaging, etc.
o Remote sensing: It is the process of scanning the earth by the use of satellite
and acknowledges all activities of space.
o Machine/Robot vision: It works on the vision of robots so that they can see
things, identify them, etc.

Characteristics of Digital Image Processing

o It uses software, and some are free of cost.


o It provides clear images.
o Digital Image Processing do image enhancement to recollect the data
through images.
o It is used widely everywhere in many fields.
o It reduces the complexity of digital image processing.
o It is used to support a better experience of life.

Advantages of Digital Image Processing

o Image reconstruction (CT, MRI, SPECT, PET)


o Image reformatting (Multi-plane, multi-view reconstructions)
o Fast image storage and retrieval
o Fast and high-quality image distribution.
o Controlled viewing (windowing, zooming)

Disadvantages of Digital Image Processing

o It is very much time-consuming.


o It is very much costly depending on the particular system.
o Qualified persons can be used.

What is an image?
An image is defined as a two-dimensional function,F(x,y), where x and y are
spatial coordinates, and the amplitude of F at any pair of coordinates (x,y) is called
the intensity of that image at that point. When x,y, and amplitude values of F are
finite, we call it a digital image. 
In other words, an image can be defined by a two-dimensional array specifically
arranged in rows and columns. 
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.

Fundamental steps in Digital Image Processing

There are 11 fundamental steps in digital image processing (DIP) , all these steps
may have sub-steps. The fundamental steps in DIP are described below with a neat
block diagram.

1. Image Acquisition

This is the first fundamental steps in digital image processing. Image acquisition
could be as simple as being given an image that is already in digital form.
Generally, the image acquisition stage involves pre-processing, such as scaling etc.
 

2. Image Enhancement

Image enhancement is among the simplest and most appealing areas of digital
image processing. Basically, the idea behind enhancement techniques is to bring
out detail that is obscured, or simply to highlight certain features of interest in an
image. Such as, changing brightness & contrast etc.  

3. Image Restoration

Image restoration is an area that also deals with improving the appearance of an
image. However, unlike enhancement, which is subjective, image restoration is
objective, in the sense that restoration techniques tend to be based on mathematical
or probabilistic models of image degradation.

4. Color Image Processing

Color image processing is an area that has been gaining its importance because of
the significant increase in the use of digital images over the Internet. This may
include color modeling and processing in a digital domain etc.  

5. Wavelets and Multi-Resolution Processing

Wavelets are the foundation for representing images in various degrees of


resolution. Images subdivision successively into smaller regions for data
compression and for pyramidal representation.  

6. Compression

Compression deals with techniques for reducing the storage required to save an
image or the bandwidth to transmit it. Particularly in the uses of internet it is very
much necessary to compress data.

7. Morphological Processing

Morphological processing deals with tools for extracting image components that
are useful in the representation and description of shape.
8. Segmentation

Segmentation procedures partition an image into its constituent parts or objects. In


general, autonomous segmentation is one of the most difficult tasks in digital
image processing. A rugged segmentation procedure brings the process a long way
toward successful solution of imaging problems that require objects to be identified
individually.

9. Representation and Description

Representation and description almost always follow the output of a segmentation


stage, which usually is raw pixel data, constituting either the boundary of a region
or all the points in the region itself. Choosing a representation is only part of the
solution for transforming raw data into a form suitable for subsequent computer
processing. Description deals with extracting attributes that result in some
quantitative information of interest or are basic for differentiating one class of
objects from another.

10. Object recognition

Recognition is the process that assigns a label, such as,  “vehicle” to an object
based on its descriptors.

11. Knowledge Base

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 also can 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-detection applications.

Componenets of digital image processing:


is the combination of the different elements involved in the digital image
processing. Digital image processing is the processing of an image by means of a
digital computer. Digital image processing uses different computer algorithms to
perform image processing on the digital images.
It consists of following components:-

● Image Sensors:
Image sensors senses the intensity, amplitude, co-ordinates and other features of
the images and passes the result to the image processing hardware. It includes
the problem domain.
● Image Processing Hardware:
Image processing hardware is the dedicated hardware that is used to process the
instructions obtained from the image sensors. It passes the result to general
purpose computer.
● Computer:
Computer used in the image processing system is the general purpose
computer that is used by us in our daily life.
● Image Processing Software:
Image processing software is the software that includes all the mechanisms
and algorithms that are used in image processing system.
● Mass Storage:
Mass storage stores the pixels of the images during the processing.
● Hard Copy Device:
Once the image is processed then it is stored in the hard copy device. It can
be a pen drive or any external ROM device.
● Image Display:
It includes the monitor or display screen that displays the processed images.
● Network:
Network is the connection of all the above elements of the image processing
system.

Elements of visual perception


The field of digital image processing is built on the foundation of mathematical and
probabilistic formulation, but human intuition and analysis play the main role to make the
selection between various techniques, and the choice or selection is basically made on
subjective, visual judgements. 
In human visual perception, the eyes act as the sensor or camera, neurons act as the
connecting cable and the brain acts as the processor. 
The basic elements of visual perceptions are: 
The basic elements of visual perceptions are: 
 
1. Structure of Eye
2. Image Formation in the Eye
3. Brightness Adaptation and Discrimination
Structure of Eye: 
The human eye is a slightly asymmetrical sphere with an average diameter of the
length of 20mm to 25mm. It has a volume of about 6.5cc. The eye is just like a
camera. The external object is seen as the camera take the picture of any object.
Light enters the eye through a small hole called the pupil, a black looking aperture
having the quality of contraction of eye when exposed to bright light and is focused
on the retina which is like a camera film. 

The lens, iris, and cornea are nourished by clear fluid, know as anterior chamber.
The fluid flows from ciliary body to the pupil and is absorbed through the channels
in the angle of the anterior chamber. The delicate balance of aqueous production
and absorption controls pressure within the eye. 
Cones in eye number between 6 to 7 million which are highly sensitive to colors.
Human visualizes the colored image in daylight due to these cones. The cone
vision is also called as photopic or bright-light vision. 
Rods in the eye are much larger between 75 to 150 million and are distributed over
the retinal surface. Rods are not involved in the color vision and are sensitive to
low levels of illumination. 
Image Formation in the Eye: 
When the lens of the eye focus an image of the outside world onto a light-sensitive
membrane in the back of the eye, called retina the image is formed. The lens of the
eye focuses light on the photoreceptive cells of the retina which detects the photons
of light and responds by producing neural impulses.

The distance between the lens and the retina is about 17mm and the focal length is
approximately 14mm to 17mm. 
Brightness Adaptation and Discrimination: 
Digital images are displayed as a discrete set of intensities. The eyes ability to
discriminate black and white at different intensity levels is an important
consideration in presenting image processing result. 
The range of light intensity levels to which the human visual system can adapt is of
the order of 1010 from the scotopic threshold to the glare limit. In a photopic vision,
the range is about 106.

Image Sensing and Acquisition,


The types of images in which we are interested are generated by the combination
of an “illumination” source and the reflection or absorption of energy from that
source by the elements of the “scene” being imaged.
We enclose illumination and scene in quotes to emphasize the fact that they are
considerably more general than the familiar situation in which a visible light source
illuminates a common everyday 3-D (three-dimensional) scene.

For example, the illumination may originate from a source of electromagnetic


energy such as radar, infrared, or X-ray energy.

But, as noted earlier, it could originate from less traditional sources, such as
ultrasound or even a computer-generated illumination pattern. Similarly, the scene
elements could be familiar objects, but they can just as easily be molecules, buried
rock formations, or a human brain.

We could even image a source, such as acquiring images of the sun. Depending on
the nature of the source, illumination energy is reflected from, or transmitted
through, objects. An example in the first category is light reflected from a planar
surface. An example in the second category is when X-rays pass through a patient's
body for the purpose of generating a diagnostic X-ray film.

In some applications, the reflected or transmitted energy is focused onto a photo


converter (e.g., a phosphor screen), which converts the energy into visible light.
Electron microscopy and some applications of gamma imaging use this approach.

The idea is simple: Incoming energy is transformed into a voltage by the


combination of input electrical power and sensor material that is responsive to the
particular type of energy being detected.

The output voltage waveform is the response of the sensor(s), and a digital quantity
is obtained from each sensor by digitizing its response. In this section, we look at
the principal modalities for image sensing and generation.
Fig: Single Image sensor

Fig: Line Sensor

Fig: Array sensor 

Image Sampling and Quantization

In Digital Image Processing, signals captured from the physical world need to be
translated into digital form by “Digitization” Process. In order to become suitable for
digital processing, an image function f(x,y) must be digitized both spatially and in
amplitude. This digitization process involves two main processes called

1. Sampling: Digitizing the co-ordinate value is called sampling.

2. Quantization: Digitizing the amplitude value is called quantization


Basic idea:
The basic idea behind converting an analog signal to its digital signal is

to convert both of its axis (x,y) into a digital format.


Since an image is continuous not just in its co-ordinates (x axis), but also in its
amplitude (y axis), so the part that deals with the digitizing of co-ordinates is
known as sampling. And the part that deals with digitizing the amplitude is known
as quantization.
Sampling.
Sampling has already been introduced in our tutorial of introduction to signals and
system. But we are going to discuss here more.
Here what we have discussed of the sampling.
The term sampling refers to take samples
We digitize x axis in sampling
It is done on independent variable
In case of equation y = sin(x), it is done on x variable
It is further divided into two parts , up sampling and down sampling
If you will look at the above figure, you will see that there are some random
variations in the signal. These variations are due to noise. In sampling we reduce
this noise by taking samples. It is obvious that more samples we take, the quality of
the image would be more better, the noise would be more removed and same
happens vice versa.
However, if you take sampling on the x axis, the signal is not converted to digital
format, unless you take sampling of the y-axis too which is known as quantization.
The more samples eventually means you are collecting more data, and in case of
image, it means more pixels.

Quantization

Quantization is opposite to sampling because it is done on “y axis” while sampling


is done on “x axis”. Quantization is a process of transforming a real valued
sampled image to one taking only a finite number of distinct values. Under
quantization process the amplitude values of the image are digitized. In simple
words, when you are quantizing an image, you are actually dividing a signal into
quanta(partitions).
Now let’s see how quantization is done. Here we assign levels to the values
generated by sampling process. In the image showed in sampling explanation,
although the samples has been taken, but they were still spanning vertically to a
continuous range of gray level values. In the image shown below, these vertically
ranging values have been quantized into 5 different levels or partitions. Ranging
from 0 black to 4 white. This level could vary according to the type of image you
want.
There is a relationship between Quantization with gray level resolution. The above
quantized image represents 5 different levels of gray and that means the image
formed from this signal, would only have 5 different colors. It would be a black
and white image more or less with some colors of gray.

When we want to improve the quality of image, we can increase the levels assign
to the sampled image. If we increase this level to 256, it means we have a gray
scale image. Whatever the level which we assign is called as the gray level. Most
digital IP devices uses quantization into k equal intervals. If b-bits per pixel are
used,

Relationships between pixels


Refer ppt :

Different color model

The colour spaces in image processing aim to facilitate the specifications of


colours in some standard way.
Different types of colour models are used in multiple fields like in hardware, in
multiple applications of creating animation, etc.  
Let’s see each colour model and its application.
● RGB
● CMYK
● HSV 
● YIQ 

RGB: The RGB colour model is the most common colour model used in Digital
image processing and openCV. The colour image consists of 3 channels. One
channel each for one colour. Red, Green and Blue are the main colour components
of this model. All other colours are produced by the proportional ratio of these
three colours only. 0 represents the black and as the value increases the colour
intensity increases.

Properties:
● This is an additive colour model. The colours are added to the black.
● 3 main channels: Red, Green and Blue.
● Used in DIP, openCV and online logos.

● Colour combination:
● Green(255) + Red(255) = Yellow
● Green(255) + Blue(255) = Cyan
● Red(255) + Blue(255) = Magenta
● Red(255) + Green(255) + Blue(255) = White

CMYK: CMYK colour model is widely used in printers. It stands for Cyan,
Magenta, Yellow and Black (key). It is a subtractive colour model. 0 represents the
primary colour and 1 represents the lightest colour. In this model, point (1, 1, 1)
represents black, and (0,0,0) represents white. It is a subtractive model thus the
value is subtracted from 1 to vary from least intense to a most intense colour value.

1-RGB = CMY
Cyan is negative of Red.
Magenta is negative of Green.
Yellow is negative of Blue.

HSV: The image consists of three channels. Hue, Saturation and Value are three
channels. This colour model does not use primary colours directly. It uses colour in
the way humans perceive them. HSV colour when is represented by a cone. 
Hue is a colour component. Since the cone represents the HSV model, the hue
represents different colours in different angle ranges. 
Red colour falls between 0 and 60 degrees in the HSV cone.
Yellow colour falls between 61 and 120 degrees in the HSV cone.
Green colour falls between 121 and 180 degrees in the HSV cone.
Cyan colour falls between 181 and 240 degrees in the HSV cone.
Blue colour falls between 241 and 300 degrees in the HSV cone.
Magenta colour falls between 301 and 360 degrees in the HSV cone.
YIQ: YIQ is the most widely colour model used in Television broadcasting. Y
stands for luminance part and IQ stands for chrominance part. In the black and
white television, only the luminance part (Y) was broadcast. The y value is similar
to the grayscale part. The colour information is represented by the IQ part.
Image file format:

Image Format describes how data related to the image will be stored. Data can be
stored in compressed, Uncompressed, or vector format. Each format of the image
has a different advantage and disadvantage. Image types such as TIFF are good for
printing while JPG or PNG, are best for the web.
● TIFF(.tif, .tiff) Tagged Image File Format this format store image data without
losing any data. It does not perform any compression on images, and a
high-quality image is obtained but the size of the image is also large, which is
good for printing, and professional printing.
● JPEG (.jpg, .jpeg) Joint Photographic Experts Group is a loss-prone (lossy)
format in which data is lost to reduce the size of the image. Due to
compression, some data is lost but that loss is very less. It is a very common
format and is good for digital cameras, nonprofessional prints, E-Mail,
Powerpoint, etc., making it ideal for web use.
● GIF (.gif) GIF or Graphics Interchange Format files are used for web graphics.
They can be animated and are limited to only 256 colors, which can allow for
transparency. GIF files are typically small in size and are portable.
● PNG (.png) PNG or Portable Network Graphics files are a lossless image
format. It was designed to replace gif format as gif supported 256 colors unlike
PNG which support 16 million colors.
● Bitmap (.bmp) Bit Map Image file is developed by Microsoft for windows. It
is same as TIFF due to lossless, no compression property. Due to BMP being a
proprietary format, it is generally recommended to use TIFF files.
● EPS (.eps) Encapsulated PostScript file is a common vector file type. EPS files
can be opened in applications such as Adobe Illustrator or CorelDRAW.
● RAW Image Files (.raw, .cr2, .nef, .orf, .sr2) These Files are unprocessed and
created by a camera or scanner. Many digital SLR cameras can shoot in RAW,
whether it be a .raw, .cr2, or .nef. These images are the equivalent of a digital
negative, meaning that they hold a lot of image information. These images need
to be processed in an editor such as Adobe Photoshop or Lightroom. It saves
metadata and is used for photography.

Component Labeling algorithm.
This is a computer vision algorithm to detect and count the number of connected
regions — also called blobs — in a binary image. Often, this is done after a
segmentation algorithm. The resulting segmentation (binary) mask is then run
through the connected component labelling algorithm to count the number of
distinct regions.

Goal
The input of the algorithm is a binary image. The goal is to label each connected
component (or blob) with the same unique label. Because each blob will labelled,
we can infer the total number of individual blobs. It is important to note that the
output will differ with respect to the representation/connectivity you use.

Different connectivities
There are two common ways of defining whether or not a component is connected.
One is stating that a pixel only has 4 neighbours (sometimes called 4-connectivity).
The other is stating that a pixel has 8 neighbours. See Figure 1.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy