0% found this document useful (0 votes)
6 views2 pages

Practical No. 2

The document outlines a practical exercise in digital image processing, focusing on modifying an image of size 1024x1024 to smaller sizes using subsampling techniques and then reconstructing it through resampling. It explains the processes of sampling and quantization, and details the steps for resizing images and performing histogram equalization to enhance image brightness and contrast. The conclusion confirms the successful execution of these techniques and the display of equalized histograms.

Uploaded by

TUSHAR RAJAWAT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Practical No. 2

The document outlines a practical exercise in digital image processing, focusing on modifying an image of size 1024x1024 to smaller sizes using subsampling techniques and then reconstructing it through resampling. It explains the processes of sampling and quantization, and details the steps for resizing images and performing histogram equalization to enhance image brightness and contrast. The conclusion confirms the successful execution of these techniques and the display of equalized histograms.

Uploaded by

TUSHAR RAJAWAT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Practical 2

Aim :

Consider any image with size 1024*1024. Modify the image to the sizes 512*512,256*256,
128*128, 64*64 and 32*32 using subsampling technique. Create the original image from all the
above subsampled images using resampling technique. Read any image. Display the histogram,
Equalized histogram, and image with equalized histogram.

Objective: RGB
images of size 1024*1024

Theory:

Image digitization (Sampling and quantization)

In Digital Image Processing, signals captured from the physical world need to be translated into
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-

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

4. Quantization: Digitizing the amplitude value is called quantization.

The subsampling was accomplished by deleting the appropriate number of rows and columns
from the original image. For example, the 512*512 image was obtained by deleting every other
row and column from the 1024*1024 image. The 256*256 image was generated by deleting
every other row and column in the 512*512 image, and so on. The number of allowed gray
levels was kept at256. These images show the dimensional proportions between various
sampling densities, but their size differences make it difficult to see the effects resulting from a
reduction in the number of samples. The simplest way to compare these effects is to bring all the
subsampled images up to size 1024*1024 by row and column pixel replication.

Quantization is opposite to sampling. It is done on y axis. When you are quantizing an image,
you are actually dividing a signal into quanta (partitions). On the x axis of the signal, are the co-
ordinate values, and on the y axis, we have amplitudes. So digitizing the amplitudes is known as
Quantization.
Procedure

6.Read and load the images obtained in the previous step of sizes 512*512, 256*256,
128*128,64*64, 32*32. (One by one).

7.Set the output size as: 1024*1024.

8.Resize the input image to resample it, using the cv2.resize() function by passing the input
image and output size as parameters.

9.Also, set the parameter


to cv2.INTER_LINEAR so that it follows linear interpolation while resampling. (Other types of
interpolation can also be tested).

10. Display the resampled images.

Histogram Equalization

The histogram technique that is used to enhance the brightness and contrast of an image is
histogram equalization. The goal of histogram equalization is to distribute the gray levels within
an image so that every gray level is equally likely to occur. In other words, histogram

uniformly distributed. Histogram equalization will increase the brightness and contrast of a dark
and low contrast image, making features observable that were not visible in the original image.
about the range of
gray levels, all images will have approximately the same brightness and contrast, hence allowing
images to be compared equally without a bias due to perceived contrast and brightness
differences.

Conclusion:

We have successfully modified the image to the sizes 512*512, 256*256, 128*128,64*64 and
32*32 using subsampling technique and create the original image from all the subsampled
images using resampling technique and also display equalized histogram for the images

You might also like