DIP Unit 1
DIP Unit 1
1) Image acquisition: This involves capturing an image using a digital camera or scanner,
or importing an existing image into a computer.
2) Image enhancement: This involves improving the visual quality of an image, such as
increasing contrast, reducing noise, and removing artifacts.
3) Image restoration: This involves removing degradation from an image, such as blurring,
noise, and distortion.
4) Image segmentation: This involves dividing an image into regions or segments, each
of which corresponds to a specific object or feature in the image.
5) Image representation and description: This involves representing an image in a way
that can be analyzed and manipulated by a computer, and describing the features of an
image in a compact and meaningful way.
6) Image analysis: This involves using algorithms and mathematical models to extract
information from an image, such as recognizing objects, detecting patterns, and
quantifying features.
7) Image synthesis and compression: This involves generating new images or
compressing existing images to reduce storage and transmission requirements.
8) Digital image processing is widely used in a variety of applications, including medical
imaging, remote sensing, computer vision, and multimedia.
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.
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.
2. BLACK AND WHITE IMAGE– The image which consist of only black and
white color is called BLACK AND WHITE IMAGE.
3. 8 bit COLOR FORMAT– 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.
4. 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.
A 16 bit format is actually divided into three further formats which are Red, Green and
Blue. That famous RGB format.
Image as a Matrix :
As we know, images are represented in rows and columns we have the following syntax
in which images are represented:
The right side of this equation is digital image by definition. Every element of this matrix is
called image element , picture element , or pixel.
According to block 1,if input is an image and we get out image as a output, then it is termed
as Digital Image Processing.
According to block 2,if input is an image and we get some kind of information or description
as a output, then it is termed as Computer Vision.
According to block 3,if input is some description or code and we get image as an output,
then it is termed as Computer Graphics.
According to block 4,if input is description or some keywords or some code and we get
description or some keywords as a output,then it is termed as Artificial Intelligence .
The digital image is composed of a finite number of elements, each of which has a location
and values. These elements are referred as picture element, image element &pixels. Pixels used
to denote the element of a digital image. The process of acquiring an image of the area
containing the text, preprocessing that image, extracting the individual characters , describing
the character in the form suitable for computer processing & recognizing those individual
character are Digital Image Processing. Digital image processing techniques began in the late
1960s and early 1970s to be used in medical imaging, remote Earth resource observations and
astronomy. The invention in the early 1970s of computerized axial tomography (CAT) also called
computerized tomography (CT) is one of the most
Ray passes through the object and is collected at the opposite end by the corresponding
detectors in the ring. As the source rotates, this procedure is repeated. Tomography consist
algorithms that use the sensed data to construct an image that represent the slice through the
object. Computer procedure are used to enhance the contrast or code the intensity levels into
color for easier interpretation of X-Rays and other images
used in industry, medicine and the biological sciences. Image enhancement and
restoration procedure are used to process degraded images of unrecoverable objects or
experimental result too expansive to duplicate. Image processing methods have successfully
restored blurred pictures that were the only available records of rare artifacts lost or damaged
after being photographed.
Synthetic images used for modeling and visualization are generated by computer.
Electromagnetic waves can be conceptualized as propagating sinusoidal waves of varying
wavelengths, or they can be thought of as a stream of mass less particles, each traveling in a
wavelike pattern and moving at the speed of light. Each mass less particle contain a certain
amount (bundle ) of energy. Each bundle of energy is called a photon. If spectral bands are
grouped according to energy per photon, we obtain the spectrum ranging from gamma rays
(highest energy) at the one end to radio waves (lowest energy) at the other.
Gamma-Ray imaging :
Major uses of imaging based on gamma rays include nuclear medicine and astronomical
observations. In nuclear medicine, the approach is to inject a patient with a radioactive isotope
that emits gamma rays as it decays. Images are produced from emissions collected by gamma
ray detectors.
X-rays for medical and industrial imaging are generated using an x -ray tube, which is a
vacuum tube with a cathode and anode. The cathode is heated, causing free electrons to be
released. These electrons flow at high speed to the positively char ged anode. When the electron
strike a nucleus, energy is released in the form x-ray radiation. The energy (penetrating power)
of the x-rays is controlled by a current applied to the filament in the cathode.
Other Imaging Modalities Acoustic images, electron microscopy and synthetic (computer –
generated images) Imaging using sound finds application in geological exploration, industry
and medicine. The most important commercial applications of image processing in geology are
in mineral and oil exploration.
Ultrasound imaging is used routinely in manufacturing, the best known applications of this
technique are in medicine, especially in obsterics, where unborn babies are imaged to
determine the health of their development. Fractals are striking examples of computer-
generated images.
Fundamentals steps in DIP :
An Image is defined as a two dimensional function f(x, y). (x, y) is the spatial coordinate
(or location) and f is the intensity at that point. If x, y and f all are finite and discrete, then the
image is said to be a digital image. Digital image consists of finite and discrete image elements
called pixels, each of them having a location and intensity value. In digital image processing,
we process digital images using a digital computer.
Digital Image processing is not a field which is used for only high-end applications. There
are various fundamental steps in digital image processing. We will discuss all the steps and
processes that can be applied for different images.
Classification :
We can categorise the steps in digital image processing as three types of computerised
processing, namely low level, mid level and high level processing.
1. Low Level Processing :
Low level processing involves basic operations such as image preprocessing, image
enhancement, image restoration, image sharpening, etc. The main characteristic of low
level processing is that both its inputs and outputs are images.
2. Mid Level Processing :
Mid level processing involves tasks like image classification, object identification,
image segmentation, etc. The main characteristic of low level processing is that its inputs
are generally images whereas its outputs are attributes associated with image which are
extracted from it.
3. High Level Processing :
High level processing involves making sense of ensemble of recognised object and
cognitive tasks associated with computer vision.
Fundamental Steps in Digital Image Processing
1) Image Acquisition :
Image acquisition is the first step in digital image processing. In this step we get the
image in digital form. This is done using sensing materials like sensor strips and sensor arrays
and electromagnetic wave light source. The light source falls on an object and it gets reflected
or transmitted which gets captured by the sensing material. The sensor gives the output image
in voltage waveform in response to electric power being supplied to it. The example of a
situation where reflected light is captured is a visible light source. Whereas, in X-ray light
sources transmitted light rays are captured.
The image captured is analog image as the output is continuous. To digitise the image, we use
sampling and quantization where discretize the image. Sampling is discretizing the image
spatial coordinates whereas quantization is discretizing the image amplit ude values.
Sampling
2) Image Enhancement :
Image enhancement is the manipulation of an image for its specific purpose and
objectives. This is majorly used in photo beautify applications. These are performed using
filters. The filters are used to minimise noise in an image. Each filter is used for a specific
situation. Correlation operation is done between filters and input image matrix to obtain
enhanced output image in . To simplify the process, we perform multiplication in the frequency
domain which gives the same result. We transform the image from spatial domain to frequency
domain using discrete fourier transform (DFT) multiply with filter and then go back to spatial
domain using inverse discrete fourier transform (IDFT). Some filters used in frequency domain
are butterworth filter and gaussian filter.
Majorly used filters are high pass filter and low pass filter. Low pass filter smoothens the
images by averaging the pixel of neighbouring value thus minimising the random noise. It gives
a blurring effect. It minimises the sharpening edges. High pass filter is used to sharpen the
images using spatial differentiation. Examples of high pass filters are laplace filter and high
boost filter. There are other non linear filters for different purposes. For example, a median
filter is used to eliminate salt and pepper noise.
3) Image Restoration :
Like image enhancement, image restoration is related to improving an image. But image
enhancement is more of a subjective step where image restoration is more of an objective
step. Restoration is applied to a degraded image trying to recover back the original model.
Here firstly we try to estimate the degradation model and then find the restored image.
We can estimate the degradation by observation, experimentation and mathematical
modelling. Observation is used when you do not know anything about the setup of the image
taken or the environment. In experimentation, we find the point spread function of an impulse
with a similar setup. In mathematical modelling, we even consider the environment at which
the image was taken and it is the best out of all the other three methods.
To find the restored image, we generally use one of the three filters – inverse filter, minimum
mean square (weiner) filter, constrained least squares filter. Inverse filtering is the simplest
method but cannot be used in presence of noise. In the Wiener filter, mean square error is
minimised. In constrained least error filtering, we have a constraint and it is the bes t method.
5) Wavelets :
Wavelets represent an image in various degrees of resolution. It is one of the members
of the class of linear transforms along with fourier, cosine, sine, Hartley, Slant, Haar, Walsh-
Hadamard. Transforms are coefficients of linear expansion which decompose a function into a
weighted sum of orthogonal or biorthogonal basis functions. All these transforms are reversible
and interconvertible. All of them express the same information and energy. Hence all are
equivalent. All the transforms vary in only the manner how the information is represented.
6) Compression :
Compression deals with decreasing the storage required to the image information or the
bandwidth required to transmit it. Compression technology has grown widely in this era. Many
people are knowledgeable about it by common image extension JPEG (Joint Photographic
Experts Group) which is a compression technology. This is done by removing redundancy and
irrelevant data. In the encoding process of compression, the image goes through a series of
stages – mapper, quantizer, symbol encoder. Mapper may be reversible or irreversible.
Example of mapper is run length encoding. Quantizer reduces the accuracy and is an
irreversible process. Symbol encoders assign small values to more frequent data and is a
reversible process.
To get back the original image, we perform decompression going through the stage of symbol
decoder and inverse mapper. Compression may be lossy or lossless. If after compression we
get the exact same image, then it is lossless compression else it is lossy compression.
Examples of lossless compression are huffman coding, bit plane coding, LZW (Lempel Ziv
Welch) coding, (PCM) pulse code modulation. Examples of lossy compression are JPEG,
PNG. Lossy compression is ideally used in the world as the change is not visible to the naked
eye and saves way better storage or bandwidth than lossless compress.
1) Image Sensors :
• Two elements are reqired to acqired digital image. The first is a physical divice that is
sensitive to the energy radiated by the object we wish to image.
• The second, called a digitizer, is a device for converting the output of the physical sensing
device into digital form.
5) Mass storage :
• A must in image processing applications, an image of size 1024x1024 pixels, in which the
intensity of each pixel is an 8-bit quantity, requires one megabytes of storage space if the
image is not compressed.
• When dealing with thousands, or even millions, of images providing adequate storage in
an image processing system cna be challenge.
• Digital storage for image processing applications falls into 3 principle categories
❖ short-term storage for use during processing
❖ on-line storage for relatively fast recall
❖ archival storage characterized by infrequent access
• storage is measured in
❖ Bytes (8 bits)
❖ Kilobytes (1 thousands bytes)
❖ Mega bytes (1 million bytes)
❖ Giga bytes (1 billion bytes)
❖ Tera bytes (1 trillion bytes)
6) Image display :
• Mainly color TV monitors are driven by the outputs of image and graphics display cards
that are an integral part of the computer system
• Seldom are there requirements for image display applications that can’t be met by display
cards available commercially as part of the computer system
• In some cases, it is necessary to have stereo displays, and these are implemented in the
form of headgear containing two small display embedded in goggles worn by the user
7) Hardcopy :
• Devices for recoding images include laser printers, film cameras heat -sensitive devices,
inkjet units and digital units, such as optical and CD-ROM disks.
• Films provides the highest possible resolution, but paper is the obvious medium if image
project equipment is used.
• The latter approch is gaining acceptance as the standard for image presentations.
8) Networking :
• Almost a default function in any computer system in use today. Because of the large
amount of data inherent in image processing applications, the key consideration in image
transmission is bandwidth.
• In dedicated networks, this typically is not a problem, but communications with remote
sites via the internet are not always as efficient
• Fortunately, this situation is imporving quickly as a result of optical fiber and other
broadband technologies, etc.
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.
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.
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.
Light and the electromagnetic spectrum :
Light :
In 1666, Sir Isaac Newton discovered that when a beam of sunlight passes through a
glass prism, the emerging beam of light is not white but consists instead of 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 electromagnetic
spectrum. On one end of the spectrum are radio waves with wavelengths billions of times longer
than those of visible light. On the other end of the spectrum are gamma rays with wavelengths
millions of times smaller than those of visible light.
Electromagnetic spectrum :
Consider the electromagnetic spectrum as a wide cosmic highway that facilitates
the movement of various kinds of light. There is a vast spectrum of energy waves present
in this, ranging from extremely short waves like X-rays to long, languid waves like radio
broadcasts. This spectrum extends beyond the light that our eyes can detect.
The tiny portion of light that we can see, known as visible light, which includes every
color in the rainbow, is located exactly in the middle of this enormous spectrum. But there’s so
much more to it than that.
On one extreme are the incredibly small and intense gamma and X-rays, which are
employed in medicine to view the body and can penetrate through solid objects. The radio
waves, on the other hand, are like the long, slow waves that carry your favorite radio station’s
music through the air to your radio.
λν=c
where c is the speed of light, approximately 2.998×10^8 meters per second.
For example:
• Radio waves have low-energy photons.
• Microwaves carry more energy than radio waves.
• Infrared has more energy than microwaves.
• Visible light has even more energy, followed by ultraviolet, X-rays, and gamma rays,
which are the most energetic and can be harmful to living organisms.
Light is a type of electromagnetic radiation that our eyes can detect. The visible spectrum
spans from approximately 0.43 microns (violet) to about 0.79 microns (red). For ease of
discussion, the visible spectrum is divided into six broad color regions: violet, blue, green, yellow,
orange, and red.
The colors we see in objects depend on the type of light they reflect. An object that reflects
light evenly across all visible wavelengths appears white. However, if an object reflects light
within a specific range of wavelengths, it shows a certain color. For example, green objects
reflect light primarily in the range of 500 to 570 nm, while absorbing light from other parts of the
spectrum.
Light without any color is called monochromatic (or achromatic) light, which only varies in
intensity. Monochromatic light can range from black, through various shades of gray, to white.
This is why the term gray level is often used to describe the intensity of monochromatic light.
Images that display this intensity range are called grayscale images.
On the other hand, chromatic (color) light covers the electromagnetic spectrum from
about 0.43 to 0.79 mm. Besides frequency,
1. Radiance : The total amount of energy emitted by a light source, measured in watts (W).
2. Luminance : The amount of energy perceived by an observer, measured in lumens (lm).
For instance, a light source in the far-infrared region may emit a lot of energy (high
radiance), but because it’s not visible, its luminance is almost zero.
3. Brightness : A subjective perception of light intensity, which is hard to measure but plays
an essential role in how we perceive color.
Image sensing and acquisition :
Image sensing :
Image sensing in digital image processing refers to the process of capturing visual
information from the real world and converting it into a digital format that can be processed by a
computer. This involves detecting energy (usually light) from a scene using sensors, w hich then
transform that energy into electrical signals. These signals are digitized to form an image.
Most images are created by a combination of an illumination source and the reflection
or absorption of energy from that source by the objects (or "scene") being imaged. The terms
"illumination" and "scene" are used broadly, meaning they can refer to more than just visible
light illuminating a familiar 3D scene.
For example:
• Illumination could come from various sources, like radar, infrared, X-rays, or even
computer-generated light patterns.
• Scenes can include familiar objects, but they can also be things like molecules,
underground rock formations, or even parts of the human body (e.g., the brain).
When illumination energy interacts with objects, it can either be reflected or transmitted
through them. An example of reflection is light bouncing off a flat surface, while transmission
occurs when X-rays pass through a patient’s body to create a diagnostic image.
In some cases, the reflected or transmitted energy is directed onto a photo converter
(like a phosphor screen) that changes the energy into visible light. This technique is often used
in electron microscopy and gamma imaging.
There are three main sensor arrangements used to convert incoming energy into digital
images.
In this process, the key is transforming the energy into a measurable electrical signal and
converting that signal into a digital format for imaging.
(a) Single sensing element.
acquisition :
Image acquisition in digital image processing refers to the process of capturing an image
and converting it into a digital form suitable for further processing by a computer. It is the first
step in the digital image processing workflow and involves obtaining the image dat a from a
physical source, such as a camera or sensor.
( Combining a single sensing element with mechanical motion to generate a 2-D image.)
The Figure shows the parts of a single sensor, with the photodiode being one of the most
common examples. Made from silicon, the photodiode produces a voltage output that is
proportional to the amount of light it receives. To make the sensor more selective, filters can be
used. For instance, a green filter placed in front of the sensor will allow mostly green light to pass
through, so the sensor’s output will be stronger for green light compared to other colors.
To create a 2D image using a single sensor, both the sensor and the object being imaged
need to move relative to each other in the x- and y-directions. Figure 1.5 illustrates a method
used in high-precision scanning. In this setup, a film negative is placed on a rotating drum,
which moves it in one direction. The sensor is attached to a lead screw that moves it in the
perpendicular direction. This mechanical motion allows the sensor to capture the entire image.
Although this method is slow, it is a low-cost way to create high-resolution images, as the
mechanical motion can be precisely controlled. Similar systems use flat beds where the sensor
moves in two linear directions. These mechanical digitizers are sometimes called
microdensitometers.
Image Acquisition Using Sensor Strips :
(a) Image acquisition using a linear sensor strip (b) Image acquisition using a circular sensor strip.
A more common sensor arrangement than a single sensor is a sensor strip, as shown in
the Above Figure. This strip consists of a line of sensors arranged in one direction. To capture
a 2D image, the sensor strip scans in one direction, while the motion perpendicular to the strip
captures the other dimension of the image, as shown in the above Figure .The strip captures
one line of the image at a time, and the full image is formed by combining these lines as the strip
moves. Lenses or other focusing systems are used to project the area to be scanned onto the
sensor strip.
In medical and industrial imaging, sensor strips are often mounted in a ring
configuration to capture cross-sectional (or "slice") images of 3D objects, as shown in Figure
(b). A rotating X-ray source illuminates the object, and sensors on the opposite side of the ring
collect the X-ray energy that passes through the object. The sensors used ar e sensitive to X-ray
energy. This technique forms the basis of Computerized Axial Tomography (CAT), which is
widely used in both medical and industrial settings.
Image Acquisition Using Sensor Arrays :
CCD sensors are widely used in digital cameras and other light-sensing instruments.
Each sensor in the array measures the amount of light that hits its surface. The sensor's
response is proportional to the total light energy it receives, which is especially useful in
applications like astronomy where low-noise images are required. In these cases, the sensor
can collect light for extended periods (minutes or even hours) to reduce noise.
The main advantage of the 2D sensor array is that it can capture a complete image at
once by focusing the light or energy onto the sensor's surface.
An example of digital image acquisition. (a) Illumination (energy) source. (b) A scene. (c)
Imaging system. (d) Projection of the scene onto the image plane. (e) Digitized image.
The above figure illustrates how these array sensors work. The process begins with
energy from an illumination source being reflected (or transmitted) from the objects in a scene.
The first task of the imaging system shown in the Figure is to collect this energy and focus it
onto an image plane. If the energy is light, a lens is used to project the scene onto the focal
plane of the lens, as shown in Figure.
The sensor array, placed at the focal plane, produces outputs that correspond to the total
light received by each sensor. These outputs are then processed by digital and analog
circuitry, which converts the signals into a video signal. This signal is digitized by another part
of the system, producing a digital image, as shown in Figure.
When an image is generated from a physical process, its intensity values are proportional
to energy radiated by a physical source (e.g., electromagnetic waves).
0 f (x, y)
(1) the amount of source illumination incident on the scene being viewed, and
Appropriately, these are called the illumination and reflectance components and are denoted by
and i(x, y) ,and r(x, y) respectively.
0 i(x, y)
0 r(x, y) 1
l=f(x0,y0)
Lmin=imin rmin
Lmax=imax rmax
L-1is white
This is due to the fact that we cannot store the output of image sensors which are in the
form of analog signals because it requires infinite memory to store a signal that can have infinite
values. So we have to convert this analog signal into digital signal.
To create a digital image, we need to convert the continuous data into digital form. This
conversion from analog to digital involves two processes: sampling and quantization.
1. Sampling: Digitizing the co-ordinate value is called sampling.
Typically, a frame grabber or digitizer is used to sample and quantize the analogue video signal.
Sampling :
Since an analogue 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.
In digitizing sampling is done on independent variable. In cas e of equation y = sin(x), it is done
on x variable
When looking at this image, we can see there are some random variations in the signal caused
by 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.
Sampling has a relationship with image pixels. The total number of pixels in an image can be
calculated as Pixels = total no of rows * total no of columns. For example, let’s say we have total
of 36 pixels, that means we have a square image of 6X 6. As we know in sampling, that more
samples eventually result in more pixels. So it means that of our continuous signal, we have
taken 36 samples on x axis. That refers to 36 pixels of this image. Also the number sample is
directly equal to the number of sensors on CCD array.
Here is an example for image sampling and how it can be represented using a graph.
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 gr ay 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 dev ices uses quantization into k equal
intervals. If b-bits per pixel are used,
The number of quantization levels should be high enough for human perception of fine shading
details in the image. The occurrence of false contours is the main problem in image which has
been quantized with insufficient brightness levels. Here is an exampl e for image quantization
process.
1) Neighbours of pixel
2) Adjacency between pixel
3) Connectivity between pixel
4) Boundaries
5) Distance Measures
1) Neighbours of pixel :
In image processing, a pixel represents a point in an image and has neighboring pixels
surrounding it. For a pixel at coordinates (x, y), there are adjacent pixels arranged in different
ways:
1. 4-Neighbors (Np4): These are the immediate horizontal and vertical neighboring pixels.
For a pixel at (x, y), the four neighboring pixels are at coordinates (x+1, y), (x -1, y), (x,
y+1), and (x, y-1).
2. 8-Neighbors (Np8): In addition to the 4-neighbors, this includes diagonal neighbors as
well. For a pixel at (x, y), the eight neighboring pixels are at coordinates (x+1, y), (x -1, y),
(x, y+1), (x, y-1), (x+1, y+1), (x-1, y+1), (x+1, y-1), and (x-1, y-1).
The collection of pixels around a particular pixel p is called its neighborhood. If this neighborhood
includes the pixel p itself, it's termed a "closed" neighborhood. Conversely, if the neighborhood
excludes the pixel p, it's considered an "open" neighborhood.
In a binary image (where pixels have values of 0 or 1), adjacency considers pixels with a value
of 1 as connected. In a grayscale image (where pixels can have a range of values from 0 to
255), the idea remains the same, but the set of intensity values, denoted as V, includes more
values.
1. 4-adjacency: Two pixels, p, and q, with values from V, are 4-adjacent if q is one of the
immediate horizontal or vertical neighbors of p (as defined in the 4-neighbors concept
described earlier).
2. 8-adjacency: Here, two pixels, p and q, with values from V are 8-adjacent if q is one of
the horizontal, vertical, or diagonal neighbors of p (as defined in the 8-neighbors concept
described earlier).
The purpose of m-adjacency is to resolve ambiguity that might arise in 8-adjacency. For
instance, certain pixel configurations might lead to multiple possible 8-adjacent connections,
creating ambiguity. By using m-adjacency, these ambiguities can be eliminated, ensuring clearer
definitions of pixel adjacency.
There are three types of connectivity on the basis of adjacency. They are:
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.
4)Boundaries :
If R happens to be an entire image, then its boundary (or border) is defined as the set of
pixels in the first and last rows and columns of the image. This extra definition is required
because an image has no neighbors beyond its border. Normally, when we refer to a region, we
are referring to a subset of an image and any pixels in the boundary of the region that happens
to coincide with the border of the image are included implicitly as part of the region boundary.
5)Distance Measures :
1) Euclidean distance: The straight-line distance between two pixels.
2) City-block distance: The distance considering only horizontal and vertical moves.