IP UT 1 Notes
IP UT 1 Notes
IP UT 1 Notes
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.
It is also used in the conversion of signals from an image sensor into the digital
images.
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.
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.
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.
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
Recognition is the process that assigns a label, such as, “vehicle” to an object
based on its descriptors.
● 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.
●
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.
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.
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
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
Quantization
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,
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.