Digital Image Processing Assignment: Analysis of Histograms, Filters
VerifiedAdded on 2023/06/04
|6
|2203
|182
Homework Assignment
AI Summary
This assignment solution delves into various aspects of digital image processing, beginning with an analysis of intensity histograms for different images (lake, eye, man) and their correlation with image appearance. It explores the impact of brightness, contrast, and gamma adjustments on image histograms and appearance. The solution details how to stretch an image histogram using brightness and contrast adjustments. It further discusses the source of lobes in power spectra when using averaging filters and relates the number of lobes to the kernel size. The differences between arithmetic mean and Gaussian low-pass filters, as well as ideal low-pass and Gaussian filters, are compared. The power spectrum of median-filtered images is contrasted with that of Gaussian low-pass filters. The assignment also evaluates the effectiveness of different filters (average, ideal, Gaussian, median) in noise removal from test images. Finally, it examines the artifacts generated by JPEG and JPEG2000 compression, analyzes RMSE versus compression ratio plots, and compares visual inspection with RMSE plots, concluding with an experiment on compressing a gradient image using PNG, JPEG, and JPEG2000.

Digital Image Processing
Student Number:
Q1: Comment on the appearance of each of the intensity histograms (see appendix) and explain whether the
form of the histograms predict the appearance of the images themselves.
[ANSWER: SUGGEST 3 LABELLED ANSWERS, ONE EACH FOR ‘LAKE’,’EYE’ AND ‘MAN’; FOR EACH CASE, DESCRIBE THE SHAPE AND
POSITION OF THE HISTOGRAM AND HOW THIS AFFECTS THE APPEARANCE OF THE IMAGE]
Student Number:
Q1: Comment on the appearance of each of the intensity histograms (see appendix) and explain whether the
form of the histograms predict the appearance of the images themselves.
[ANSWER: SUGGEST 3 LABELLED ANSWERS, ONE EACH FOR ‘LAKE’,’EYE’ AND ‘MAN’; FOR EACH CASE, DESCRIBE THE SHAPE AND
POSITION OF THE HISTOGRAM AND HOW THIS AFFECTS THE APPEARANCE OF THE IMAGE]
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Ans: In the LAKE image it is seen that the all the intensity points are not used evenly in the intensity
histogram. The pixels are mostly clustered in the lower intensity values and hence the brightness of the image
is quite low as shown in the left side.
In the eye image also all the pixels are clustered inside a very small range of intensity values in the left side of
intensity histogram. Hence, the brightness of the eye image is even lower than the lake image.
In the Man image the intensity histogram is evenly distributed for half of the intensity values and for the upper
half of intensity values low number of pixels are associated. Hence, the background brightness is bright, but
the brightness of the man is low.
Q2: For each of the following transforms describe the change to (a) the intensity histogram and (b) the image
appearance following the suggestions given below.
[ANSWER: SUGGEST 3 LABELLED ANSWERS, ONE EACH FOR ‘BRIGHTNESS’,’CONTRAST’ AND ‘GAMMA’; FOR EACH CASE, DESCRIBE (A)
CHANGE IN HISTOGRAM AND (B) CHANGE IN THE IMAGE, BOTH DEPENDING ON THE VALUE (WHETHER +VE OR –VE FOR BRIGHTNESS, OR
GREATER OR LESS THAN 1 FOR CONTRAST AND GAMMA]
Ans: For the brightness if increased the intensity histogram will have large number of pixel values in every
intensity point. In other words, the frequencies of each intensity points will be increased if the overall
brightness is increased.
The range of intensity points that are effectively used in the image represents the contrast of the image. So, in
a low contrast image the pixel values will only be clustered in specific intensity points and in a high contrast
image almost every intensity point will have some pixel values.
Gamma is the correction factor of an image which transforms the intensity frequencies non-linearly to make
the image suitable for human eyes. In digital version of the image the number of photons input in an intensity
point is multiplied in the intensity histogram and hence the frequencies are in a linear scale. But, human eyes
do not realise the images in the way, a unit photon increase will minutely affect the brightness of the image in
human eyes. Hence, a non-linearity is applied while saving the images which is known as gamma correction
that is given by the following formula.
Output luminance= ( Input luminance ) gamma .
If the gamma is between 0 and 1 then non-linear curve is upward and if gamma is greater than 1 then the
curve become downward.
histogram. The pixels are mostly clustered in the lower intensity values and hence the brightness of the image
is quite low as shown in the left side.
In the eye image also all the pixels are clustered inside a very small range of intensity values in the left side of
intensity histogram. Hence, the brightness of the eye image is even lower than the lake image.
In the Man image the intensity histogram is evenly distributed for half of the intensity values and for the upper
half of intensity values low number of pixels are associated. Hence, the background brightness is bright, but
the brightness of the man is low.
Q2: For each of the following transforms describe the change to (a) the intensity histogram and (b) the image
appearance following the suggestions given below.
[ANSWER: SUGGEST 3 LABELLED ANSWERS, ONE EACH FOR ‘BRIGHTNESS’,’CONTRAST’ AND ‘GAMMA’; FOR EACH CASE, DESCRIBE (A)
CHANGE IN HISTOGRAM AND (B) CHANGE IN THE IMAGE, BOTH DEPENDING ON THE VALUE (WHETHER +VE OR –VE FOR BRIGHTNESS, OR
GREATER OR LESS THAN 1 FOR CONTRAST AND GAMMA]
Ans: For the brightness if increased the intensity histogram will have large number of pixel values in every
intensity point. In other words, the frequencies of each intensity points will be increased if the overall
brightness is increased.
The range of intensity points that are effectively used in the image represents the contrast of the image. So, in
a low contrast image the pixel values will only be clustered in specific intensity points and in a high contrast
image almost every intensity point will have some pixel values.
Gamma is the correction factor of an image which transforms the intensity frequencies non-linearly to make
the image suitable for human eyes. In digital version of the image the number of photons input in an intensity
point is multiplied in the intensity histogram and hence the frequencies are in a linear scale. But, human eyes
do not realise the images in the way, a unit photon increase will minutely affect the brightness of the image in
human eyes. Hence, a non-linearity is applied while saving the images which is known as gamma correction
that is given by the following formula.
Output luminance= ( Input luminance ) gamma .
If the gamma is between 0 and 1 then non-linear curve is upward and if gamma is greater than 1 then the
curve become downward.

Q3: How can you use the brightness and contrast adjustments to stretch the image histogram so that the
darkest pixels in the original eye image will have value 0 and the brightest pixels in the original image will
have value 255?
[ANSWER: SUGGEST A NUMBERED LISTING OF THE STEPS NEEDE FOR A GENERAL ALGORITHM. ALSO GIVE THE ACTUAL NUMERICAL
CORRECTION FACTOR(S) CALCULATED FOR THE EYE IMAGE]
Ans: The intensity values of the darkest pixels in the original image can be reduced to zero value and a
brightest pixel can be increased to value 255 by adjusting the bin sizes in the histogram. To be the bin range
must be adjusted in such a way that the frequency becomes zero in the darkest points and 255 in the brightest
points. It is assumed that the bin range will not be uniform in the intensity histogram or precisely the bin range
will be largest containing the brightest points and the bin ranges becomes minimum or even zero containing
the darkest points. This will increase the contrast and reduce the brightness of the original image.
Q4: What is the source of the lobes seen in the power spectrum when using the averaging filter? How does the
number of lobes relate to the width and height of the averaging filter kernel?
[ANSWER: SUGGEST ONE OR MORE SENTENCES DESCRIBING WHAT CAUSES THE LOBES, PLUS AN ADDITIONAL SENTENCE STATING THE
RELATIONSHIP BETWEEN KERNEL SIZE AND THE NUMBER OF LOBES SEEN]
Ans: In the averaging filter the lobes are created by taking the average of the surrounding pixel values and
then placing the average value in the centre pixel. Generally, the number of pixels as neighbour of a pixel is
taken as a square matrix and that matrix is known as a kernel. The kernel size is generally of the sizes 3X3 and
5X5. Now, as the size of the kernels are increasing the image smoothen and with small kernel size number of
lobes in much greater and as an effect the image has more contrast.
Q5: Describe the differences in the image and power spectra when comparing the arithmetic mean and
Gaussian low-pass filters. Both are low-pass filters, so why are the results so different?
[ANSWER: SUGGEST 2 LABELLED ANSWERS, ONE EACH FOR ‘POWER SPECTRA’ AND ‘IMAGES’; FOR EACH CASE, DESRIBE THE
DIFFERENCE IN APPEARANCE BETWEEN GAUSSIAN AND ARITHMETIC MEAN FILTERS]
darkest pixels in the original eye image will have value 0 and the brightest pixels in the original image will
have value 255?
[ANSWER: SUGGEST A NUMBERED LISTING OF THE STEPS NEEDE FOR A GENERAL ALGORITHM. ALSO GIVE THE ACTUAL NUMERICAL
CORRECTION FACTOR(S) CALCULATED FOR THE EYE IMAGE]
Ans: The intensity values of the darkest pixels in the original image can be reduced to zero value and a
brightest pixel can be increased to value 255 by adjusting the bin sizes in the histogram. To be the bin range
must be adjusted in such a way that the frequency becomes zero in the darkest points and 255 in the brightest
points. It is assumed that the bin range will not be uniform in the intensity histogram or precisely the bin range
will be largest containing the brightest points and the bin ranges becomes minimum or even zero containing
the darkest points. This will increase the contrast and reduce the brightness of the original image.
Q4: What is the source of the lobes seen in the power spectrum when using the averaging filter? How does the
number of lobes relate to the width and height of the averaging filter kernel?
[ANSWER: SUGGEST ONE OR MORE SENTENCES DESCRIBING WHAT CAUSES THE LOBES, PLUS AN ADDITIONAL SENTENCE STATING THE
RELATIONSHIP BETWEEN KERNEL SIZE AND THE NUMBER OF LOBES SEEN]
Ans: In the averaging filter the lobes are created by taking the average of the surrounding pixel values and
then placing the average value in the centre pixel. Generally, the number of pixels as neighbour of a pixel is
taken as a square matrix and that matrix is known as a kernel. The kernel size is generally of the sizes 3X3 and
5X5. Now, as the size of the kernels are increasing the image smoothen and with small kernel size number of
lobes in much greater and as an effect the image has more contrast.
Q5: Describe the differences in the image and power spectra when comparing the arithmetic mean and
Gaussian low-pass filters. Both are low-pass filters, so why are the results so different?
[ANSWER: SUGGEST 2 LABELLED ANSWERS, ONE EACH FOR ‘POWER SPECTRA’ AND ‘IMAGES’; FOR EACH CASE, DESRIBE THE
DIFFERENCE IN APPEARANCE BETWEEN GAUSSIAN AND ARITHMETIC MEAN FILTERS]
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Ans: The arithmetic filter only approximates each pixel points by the arithmetic mean of pixel values of its
neighbours. Hence, the smoothening of the image happens in a smaller rate and for high smoothening large
kernel size is required. However, for the low pass gaussian filter attenuates the frequencies of each intensity
points which are far away from the image centre and hence with low standard deviation the smoothening rate
is high. Hence, the results after applying the low pass filter and the gaussian filter the results are different.
Q6: Compare the results of the ideal low-pass filter and the Gaussian filter. Explain the reason for the
differences seen.
[ANSWER: SUGGEST 2 LABELLED ANSWERS, ONE EACH FOR ‘GAUSSIAN-FILTERED’ AND ‘IDEAL-FILTERED’; FOR EACH CASE, DESRIBE (A)
THE APPEARANCE OF THE POWER SPECTRUM AND (B) THE RESULTS SEEN IN THE IMAGE. THEN ADD A THIRD LABELLED ANSWER,
‘EXPLANATION’ WHICH EXPLAINS WHY THE DIFFERENT SHAPES OF THE POWER SPECTRA PRODUCE DIFFERENT RESULTS IN THE IMAGE]
neighbours. Hence, the smoothening of the image happens in a smaller rate and for high smoothening large
kernel size is required. However, for the low pass gaussian filter attenuates the frequencies of each intensity
points which are far away from the image centre and hence with low standard deviation the smoothening rate
is high. Hence, the results after applying the low pass filter and the gaussian filter the results are different.
Q6: Compare the results of the ideal low-pass filter and the Gaussian filter. Explain the reason for the
differences seen.
[ANSWER: SUGGEST 2 LABELLED ANSWERS, ONE EACH FOR ‘GAUSSIAN-FILTERED’ AND ‘IDEAL-FILTERED’; FOR EACH CASE, DESRIBE (A)
THE APPEARANCE OF THE POWER SPECTRUM AND (B) THE RESULTS SEEN IN THE IMAGE. THEN ADD A THIRD LABELLED ANSWER,
‘EXPLANATION’ WHICH EXPLAINS WHY THE DIFFERENT SHAPES OF THE POWER SPECTRA PRODUCE DIFFERENT RESULTS IN THE IMAGE]
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Ans: In case of an ideal low-pass filter the spatial frequencies are kept below a nominal level and above it is
eliminated. However, in case of a Gaussian low pass filter the frequencies aren’t filtered out ideally and result
is not produced with very sharp frequency selectivity. Hence, a large blurring effect can be produced with the
Gaussian filter, but in an ideal low pass filter there exist sharp edges in the image.
Q7: How does the power spectrum of the median filtered image differ from the Gaussian low-pass filter?
How would you expect these differences to be seen in the image?
[ANSWER: EXPLAIN IN 2 OR 3 SENTENCES HOW THE POWER SPECTRA DIFFER AND HOW THIS HELPS TO EXPLAIN THE DIFFERENCES SEEN
IN THE IMAGES]
Ans: In case of median filter each intensity point in the image is replaced with the median of its neighbour
kernel. Hence, with the increase in the kernel size the uniformity in the image is increased. Hence, the power
spectrum of a median filtered image which is the square of absolute value of FFT of the image will have the
spikes in the middle of the frequency range. However, in case of a Gaussian filter the filtering is applied
normally in all over the frequency range and hence the power spectrum of the image will be approximately
normally distributed depending on the parameters of the filtering. The gaussian filtered image will be much
more smooth or blurry than the median filtered image.
Q8: Compare the use of the above filters (average, ideal, gaussian and median) at removing noise from the
two test images. Comment on the merit (or lack of merit) of each filter on each image. Which filter gives the
best result in each case and why?
eliminated. However, in case of a Gaussian low pass filter the frequencies aren’t filtered out ideally and result
is not produced with very sharp frequency selectivity. Hence, a large blurring effect can be produced with the
Gaussian filter, but in an ideal low pass filter there exist sharp edges in the image.
Q7: How does the power spectrum of the median filtered image differ from the Gaussian low-pass filter?
How would you expect these differences to be seen in the image?
[ANSWER: EXPLAIN IN 2 OR 3 SENTENCES HOW THE POWER SPECTRA DIFFER AND HOW THIS HELPS TO EXPLAIN THE DIFFERENCES SEEN
IN THE IMAGES]
Ans: In case of median filter each intensity point in the image is replaced with the median of its neighbour
kernel. Hence, with the increase in the kernel size the uniformity in the image is increased. Hence, the power
spectrum of a median filtered image which is the square of absolute value of FFT of the image will have the
spikes in the middle of the frequency range. However, in case of a Gaussian filter the filtering is applied
normally in all over the frequency range and hence the power spectrum of the image will be approximately
normally distributed depending on the parameters of the filtering. The gaussian filtered image will be much
more smooth or blurry than the median filtered image.
Q8: Compare the use of the above filters (average, ideal, gaussian and median) at removing noise from the
two test images. Comment on the merit (or lack of merit) of each filter on each image. Which filter gives the
best result in each case and why?

[ANSWER: SUGGEST YOU USE A TABLE WITH ‘BRAIN IMAGE’ AND ‘SIGN IMAGE’ ON THE LEFT HAND SIDE AND ‘AVERAGE FILTER’,
‘IDEAL FILTER’, ‘GAUSSIAN’ FILTER’ AND ‘MEDIAN FILTER’ ALONG THE TOP, WITH EACH ENTRY STATING WHETHER THE RESULTS ARE
GOOD OR BAD AND DESCRIBING WHAT IS SEEN IN THE OUTPUT IMAGE. THEN ADD TWO FURTHER SENTENCES TO STATE (A) WHICH
FILTER IS BEST FOR THE BRAIN IMAGE AND (B) WHICH IS BEST FOR THE SIGN IMAGE, EXPLAINING WHY IN EACH CASE]
Ans: The Gaussian and average filters are linear filter and are used to remove Gaussian noise from an image.
Particularly, these two filters make the image blurry and the sharp edges are reduced. The median filter is a
non-linear filter which is used to remove “salt and pepper’’ type noise which are caused by sudden
disturbance which processing the image signal. The ideal filter filters out all the frequencies which are either
lower or higher than a nominal frequency and hence if an image has low contrast then the contrast of the
image is greatly increased.
Q9: Experiment with different compression algorithms and settings. Describe the types of artefacts generated
by (a) JPEG and (b) JPEG2000 compression.
[ANSWER: SUGGEST 2 ANSWERS, ONE EXPLAINING THE DIFFERENCE IN APPEARANCE OF THE TWO TYPES OF COMPRESSION AT LOW
COMPRESSION RATIOS AND THE OTHER DOING THE SAME FOR HIGH COMPRESSION RATIOS]
Ans: The types of artefacts that can be generated in JPEG and JPEG 2000 type compression are Ringing,
Contouring, Posturizing, Aliasing along the curving edges, block boundary artefacts.
Q10: What conclusions can you draw from the RMSE versus compression ratio plots for JPEG and JPEG
2000?
[ANSWER: SUGGEST 2 ANSWERS, ONE DESCRIBING THE DIFFERENCE IN IN THE GRAPH OF THE TWO TYPES OF COMPRESSION AT LOW
COMPRESSION RATIOS AND THE OTHER DOING THE SAME FOR HIGH COMPRESSION RATIOS, PERHAPS EXPLAINING WHAT YOU SEE. THEN
YOU COULD MENTION ANY LIMITATIONS IN USING RMSE TO ASSESS VISUAL QUALITY]
Ans: RMSE is the measure of error from the original image as compared with the compressed image. The
compression ratio in JPEG format is 3.2:1 while the compression ratio of the JPEG2000 is between 10:1 to
20:1. However, the error in JPEG compression is large and lossy image is produced but the JEEG 2000 is very
much robust to bit error as the coding is performed in comparatively small blocks which are independent.
Q11: By comparing some images compressed using JPEG and JPEG2000 at different compression ratios,
does your visual inspection agree with the RMSE plot?
[ANSWER: IN 2 OR 3 SENTENCES, COMPARE AND CONTRAST WHAT YOU SEE WITH WHAT IS SUGGESTED BY THE GRAPH, AND TRY TO
EXPLAIN ANY DIFFERENCES]
Ans: It is observed that the error associated in JPEG compression and JPEG 2000 with compression ratio
ranges from 10:1 to 20:1, the RMSE (root mean square error) plot is larger in magnitude in case of JPEG
compression. Hence, it is shown that JPEG 2000 compression is much more effective than JPEG compression.
Q12: Try compressing the ’gradient’ image using PNG, JPEG and JPEG 2000. What is the highest lossy
compression you can apply using JPEG and JPEG 2000 before the image visibly degrades? Comment on the
difference in the results. What is strange about the JPEG 2000 result?
[ANSWER: SUGGEST 3 ANSWERS, ONE FOR LOSSLESS COMPRESSION, ONE FOR JPEG COMPRESSION AND ONE FOR JPEG2000
COMPRESSION, HIGHLIGHTING THE COMPRESSION RATIOS ACHIEVABLE AND AT WHAT RATIOS ARTEFACTS BEGIN TO BE SEEN. ALSO,
EXPLAIN ANYTHING ODD THAT YOU MAY NOTICE WHEN TRYING A WIDE RATIO OF COMPRESSION RATIOS USING JPEG2000]
Ans:
‘IDEAL FILTER’, ‘GAUSSIAN’ FILTER’ AND ‘MEDIAN FILTER’ ALONG THE TOP, WITH EACH ENTRY STATING WHETHER THE RESULTS ARE
GOOD OR BAD AND DESCRIBING WHAT IS SEEN IN THE OUTPUT IMAGE. THEN ADD TWO FURTHER SENTENCES TO STATE (A) WHICH
FILTER IS BEST FOR THE BRAIN IMAGE AND (B) WHICH IS BEST FOR THE SIGN IMAGE, EXPLAINING WHY IN EACH CASE]
Ans: The Gaussian and average filters are linear filter and are used to remove Gaussian noise from an image.
Particularly, these two filters make the image blurry and the sharp edges are reduced. The median filter is a
non-linear filter which is used to remove “salt and pepper’’ type noise which are caused by sudden
disturbance which processing the image signal. The ideal filter filters out all the frequencies which are either
lower or higher than a nominal frequency and hence if an image has low contrast then the contrast of the
image is greatly increased.
Q9: Experiment with different compression algorithms and settings. Describe the types of artefacts generated
by (a) JPEG and (b) JPEG2000 compression.
[ANSWER: SUGGEST 2 ANSWERS, ONE EXPLAINING THE DIFFERENCE IN APPEARANCE OF THE TWO TYPES OF COMPRESSION AT LOW
COMPRESSION RATIOS AND THE OTHER DOING THE SAME FOR HIGH COMPRESSION RATIOS]
Ans: The types of artefacts that can be generated in JPEG and JPEG 2000 type compression are Ringing,
Contouring, Posturizing, Aliasing along the curving edges, block boundary artefacts.
Q10: What conclusions can you draw from the RMSE versus compression ratio plots for JPEG and JPEG
2000?
[ANSWER: SUGGEST 2 ANSWERS, ONE DESCRIBING THE DIFFERENCE IN IN THE GRAPH OF THE TWO TYPES OF COMPRESSION AT LOW
COMPRESSION RATIOS AND THE OTHER DOING THE SAME FOR HIGH COMPRESSION RATIOS, PERHAPS EXPLAINING WHAT YOU SEE. THEN
YOU COULD MENTION ANY LIMITATIONS IN USING RMSE TO ASSESS VISUAL QUALITY]
Ans: RMSE is the measure of error from the original image as compared with the compressed image. The
compression ratio in JPEG format is 3.2:1 while the compression ratio of the JPEG2000 is between 10:1 to
20:1. However, the error in JPEG compression is large and lossy image is produced but the JEEG 2000 is very
much robust to bit error as the coding is performed in comparatively small blocks which are independent.
Q11: By comparing some images compressed using JPEG and JPEG2000 at different compression ratios,
does your visual inspection agree with the RMSE plot?
[ANSWER: IN 2 OR 3 SENTENCES, COMPARE AND CONTRAST WHAT YOU SEE WITH WHAT IS SUGGESTED BY THE GRAPH, AND TRY TO
EXPLAIN ANY DIFFERENCES]
Ans: It is observed that the error associated in JPEG compression and JPEG 2000 with compression ratio
ranges from 10:1 to 20:1, the RMSE (root mean square error) plot is larger in magnitude in case of JPEG
compression. Hence, it is shown that JPEG 2000 compression is much more effective than JPEG compression.
Q12: Try compressing the ’gradient’ image using PNG, JPEG and JPEG 2000. What is the highest lossy
compression you can apply using JPEG and JPEG 2000 before the image visibly degrades? Comment on the
difference in the results. What is strange about the JPEG 2000 result?
[ANSWER: SUGGEST 3 ANSWERS, ONE FOR LOSSLESS COMPRESSION, ONE FOR JPEG COMPRESSION AND ONE FOR JPEG2000
COMPRESSION, HIGHLIGHTING THE COMPRESSION RATIOS ACHIEVABLE AND AT WHAT RATIOS ARTEFACTS BEGIN TO BE SEEN. ALSO,
EXPLAIN ANYTHING ODD THAT YOU MAY NOTICE WHEN TRYING A WIDE RATIO OF COMPRESSION RATIOS USING JPEG2000]
Ans:
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 6
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.