Digital ImageProcessing-Zooming in Image Processing
Digital ImageProcessing-Zooming in Image Processing
Established in 1998
Session: 2020-21
• Image size
Image size of a bitmapped image can be described by the horizontal (H) and
vertical (V) pixel count. The total number of pixels in an image is found by
multiplying the horizontal and vertical pixel counts:
Total pixel count=HxV
• Color Depth
Each pixel of the image contains unique color information. The a mount of
color information is the color depth therefore, it is described in the unit of bits.
Where
b= number of bits.
2b =number of possible display colors.
In a 1 bit image (b=1) each pixel has either a 0 or 1 to code color so only two colors
(21=2) black or white.
An 8-bit image uses 8 places of binary code to code for the colors. That allows a palette of
28=256 colors or 256 shades of gray.
A 24-bit color image works with a palette of over 16.7 million colors (i.e.,
224=16700000).
• Raw File Size
The image size combined with color depth gives the raw file size, the raw file size can be
though of as a volume. We multiply the horizontal (H) pixel count by the vertical (V )
count by the color depth (D ) to get the raw file size:
1. Preprocessing
Is used to remove noise and eliminate irrelevant, visually unnecessary information.
Noise is unwanted information that can result from the image acquisition process,
other preprocessing steps might include:
• Gray –level or spatial quantization (reducing the number of bits per pixel or the
image size).
• Finding regions of interest for further processing.
2. Data Reduction:
Involves either reducing the data in the spatial domain or transforming it into another
domain called the frequency domain, and then extraction features for the analysis process.
3. Features Analysis:
The features extracted by the data reduction process are examine and evaluated for their
use in the application.
After preprocessing we can perform segmentation on the image in the spatial domain or
convert it into the frequency domain via a mathematical transform. After these processes
we may choose to filter the image. This filtering process further reduces the data and
allows us to extract the feature that we may require for analysis.
Preprocessing
The preprocessing algorithms, Techniques had operators that used
to perform initial processing that makes the primary data reduction
and analysis task easier.
They include operations related to
- extracting regions of interest.
- -performing basic algebraic operations on images.
- enhancing specific image features.
- reducing data in both resolution and brightness.
Preprocessing is a stage where the requirements are typically
obvious and simple, such as the elimination of image information
that is not required for the application.
Regions Of Interest(ROI)
Often, for image analysis , we want to investigate more closely a
specific area within the image, called Regions Of Interest(ROI) . to
do this we need operations that modify the spatial coordinates for
the image of the image, and these are categories as image
geometry operations.
the image geometry discussed here is crop, zoom, shrink, translate
and rotate. the cutting it away from the rest of the image.
After we have cropped the subimage from the original image,we
can zoom in on it by enlarging it.
Zoom
The image crop process is the process of selecting a small portion of
the image, a sub image and cutting it away from the rest of the
image. After we have cropped a sub image from the original image
we can zoom in on it by enlarge it. The zoom process can be done in
numerous ways:
1. Zero-Order Hold. 2. First _Order Hold. 3.Convolution.
7 5 3 1
7 5 3 1
8 6 4 2
8 6 4 2
1 3 5 7
1 3 5 7
2 4 6 8
2 4 6 8
2. First _Order Hold: is performed by finding linear interpolation between a
adjacent pixels, i.e., finding the average value between two pixels and use that as
the pixel value between those two, we can do this for the rows first as follows:
The first two pixels in the first row are averaged (8+4)/2=6,
and this number is inserted between those two pixels. This is done for every pixel
pair in each row.
Next, take result and expanded the columns in the same way as follows:
3- Convolution: this process requires a mathematical process to enlarge an image.
This method required two steps:
1. Extend the image by adding rows and columns of zeros between the existing
rows and columns.
2. Perform the convolution.
Next, we use convolution mask, which is slide a cross the extended image, and perform
simple arithmetic operation at each pixel location
The convolution process requires us to overlay the mask on the image, multiply the
coincident all these results. This is equivalent to finding the vector inner product of the
mask with underlying sub image. The vector inner product is found by overlaying mask on
sub image. Multiplying coincident terms, and summing the resulting products.
For example, if we put the mask over the upper-left corner of the image, we obtain (from
right to left, and top to bottom):
1/4(0) +1/2(0) +1/4(0) +1/2(0) +1(3) +1/2(0) + 1/4(0) +1/2(0) +1/4(0) =3
Note that the existing image values do not change.
The next step is to slide the mask over by on pixel and repeat the process, as follows:
1/4(0) +1/2(0) +1/4(0) +1/2(3) +1(0) +1/2(5) + 1/4(0) +1/2(0) +1/4(0) =4
Note this is the average of the two existing neighbors.
-This process continues until we get to the end of the row, each time placing the result of the
operation in the location corresponding to center of the mask.
-When the end of the row is reached, the mask is moved down one row,
-and the process is repeated row by row. This procedure has been performed on the entire
image, the process of sliding, multiplying and summing is called convolution.
Note that the output image must be put in a separate image array called a buffer, so that
the existing values are not overwritten during the convolution process.
(r,c)=(1,1).
b. Move the mask one pixel to the
right , multiply coincident terms
sum ,
and place the new results into the
buffer at the location that corresponds
to the new center location of the
convolution mask which is now at
(r,c)=(1,2),
continue to the end of the row.
c. Move the mask down on row and
repeat the process until the mask is
convolved with the entire image.
Note that we lose the outer row(s)
and columns(s).
Why we use this convolution method when it require, so many more calculation than
the basic averaging of the neighbors method?
Note, only first-order hold be performed via convolution, but zero-order hold can
also achieved by extending the image with zeros and using the following convolution
mask.
Note that for this mask we will need to put the result in the pixel location corresponding
to the lower-right corner because there is no center pixel. These methods will only allows
6 4.5 2.5
7 4.5 2
Zoom Using K-factor
We take two adjacent values and linearly interpolate more than one value between
them. This is done by define an enlargement number k and then following this
process:
3. Add the result to the smaller value, and keep adding the result from the second
step in a running total until all (k-1) intermediate pixel locations are filled.
Example:
we want to enlarge an image to three times its original size, and we have two adjacent pixel
K-1=3-1=2. The two pixel values between the 125 and 140 are
• We do this for every pair of adjacent pixels .first along the rows and then along the
columns. This will allows us to enlarge the image by any factor of K (N-1) +1 where K is an