Dip Assignment Questions Unit-1
Dip Assignment Questions Unit-1
Unit-1
Ans. 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 a 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 the x axis. That
refers to 36 pixels of this image. Also the number sample is directly equal to the
number of sensors on the CCD array.
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.
2 Heine digital image? Explain the components of the general purpose rnagic
processing system.
Ans. 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.
3 What is half toning technique? Give the 1ogic to implement a half toned
image from a gray - level image.
Ans. Halftoning or analog halftoning is a process that simulates shades of gray by varying
the size of tiny black dots arranged in a regular pattern. This technique is used in printers, as
well as the publishing industry. If you inspect a photograph in a newspaper, you will notice
that the picture is composed of black dots even though it appears to be composed of grays.
This is possible because of the spatial integration performed by our eyes. Our eyes blend fine
details and record the overall intensity . Digital halftoning is similar to halftoning in which an
image is decomposed into a grid of halftone cells. Elements (or dots that halftoning uses in
simulates shades of grays) of an image are simulated by filling the appropriate halftone cells.
The more number of black dots in a halftone cell, the darker the cell appears. For example, in
Figure 4, a tiny dot located at the center is simulated in digital halftoning by filling the center
halftone cell; likewise, a medium size dot located at the top-left corner is simulated by filling
the four cells at the top-left corner. The large dot covering most of the area in the third image
is simulated by filling all halftone cells.
1. patterning
2. dithering
3. error diffusion
Unit-2
Unit- 3
a ) Explain the difference between operations involving 3*3 mask for median filtering and
average filtering.
Ans. Average filter-
import cv2
import numpy as np
img_new = img_new.astype(np.uint8)
cv2.imwrite('blurred.tif', img_new)
Median filter-
# Median Spatial Domain Filtering
import cv2
import numpy as np
temp = sorted(temp)
img_new1[i, j]= temp[4]
img_new1 = img_new1.astype(np.uint8)
cv2.imwrite('new_median_filtered.png', img_new1)
b) What would happen to the dynamic range of an image if all the slopes in the contrast
structured algorithm (/,m,n) arc less than 1. Answer using an example.
Unit-4
a) Discuss the method of edge detection. Show prewitt and sobel masks are used for
detecting diagonal edges.
When the weight at the central pixels, for both Prewitt templates, is doubled, this
gives the famous Sobel edge-detection operator which, again, consists of two masks
to determine the edge in vector form. The Sobel operator was the most popular
edge-detection operator until the development of edge-detection techniques with a
theoretical basis. It proved popular because it gave, overall, a better performance than
other contemporaneous edge-detection operators, such as the Prewitt operator. The
templates for the Sobel operator can be found in Figure 4.10.
A global thresholding technique is one which makes use of a single threshold value for the
whole image, whereas local thresholding technique makes use of unique threshold values for
the partitioned subimages obtained from the whole image.
Adaptive thresholding is the method where the threshold value is calculated for smaller
regions and therefore, there will be different threshold values for different regions. In
OpenCV, you can perform Adaptive threshold operation on an image using the method
adaptiveThreshold() of the Imgproc class.
UNIT-5
Opening and Closing are dual operations used in Digital Image Processing for restoring an
eroded image. Opening is generally used to restore or recover the original image to the
maximum possible extent. Closing is generally used to smoother the contour of the distorted
image and fuse back the narrow breaks and long thin gulfs. Closing is also used for getting
rid of the small holes of the obtained image.
The combination of Opening and Closing is generally used to clean up artifacts in the
segmented image before using the image for digital analysis.