About the Course
Colour Image Processing is offered as an elective course for
M. Tech (CS/AI) students. The course is designed to show that
colour is much more than a combination of R, G, B components
and is a result of the complex interaction of the human vision
system with electromagnetic radiation in the visible range of
400 – 700 nm. Such knowledge leads to better processing
of colour images and developing a deeper understanding of the
typical colour degradations and their enhancements.
The course covers four main topics:
- Colour Science
- Processing Colour
- Colour Technologies
- Applications
Apart from the normal lectures, students have to participate
in classroom demonstrations and practical activities. It is
a course combining many theoretical concepts with practical
experiments and the students are required to take part in
the experimental aspects as much as in the classroom
lectures and
demonstrations. Several jupyter
notebooks are provided for these exercises.
There is no textbook for the course but most necessary
material will be made available during the course at
appropriate times through this course webpage.
Administrivia.
Instructor:
Chakravarthy
Bhagvati E207, AI Lab.
Class Timings:
Mondays 2:00 PM – 4:00 PM
Thursdays 2:00 PM – 4:00 PM
Assessment:
One Minor Exam: 20 Marks (Second or Third Week of April)
Two Assignments: 20 Marks each
Best two of the above three will be counted for internal
assessment out of 40 marks.
Final Exam: 60 Marks (as per university rules and
regulations)
Textbook:
There is no real textbook for the course but the following
are useful as references.
- Andreas
Koschan, Mongi Abidi.
Digital color image
processing,
John
Wiley and Sons, 2008.
(PDF Format, 52 MB)
- Gaurav
Sharma (Ed).
Digital color imaging
handbook,
CRC Press, 2003.
(PDF Format, 18 MB)
- Kurt Nassau (Ed).
Color for Science,
Art and Technology,
Elsevier
Press, 1998.
(PDF Format, 27 MB)
- Mark
D. Fairchild.
Color Appearance
Models (Second Edition),
John
Wiley and Sons, 2005.
(PDF Format, 8 MB)
Assignments
Please click on the assignment links below to toggle seeing the
assignments.
Assignment - II (Due Date: 25/02/2026)
- This assignment consists of three questions for 20
Marks. Answer all of them.
- The marks are given alongside the questions.
- You may use any source on the Internet but should give
the reference in your assignment.
- All programs must be in C, C++ or Python using
OpenCV library.
- If you use any AI Tool, make sure you include
the prompt given by you in the assignment. However,
remember that you are being very bad to the environment!
You can power 100 high-end apartments in Hyderabad for a month
with the power AI tools consume in one
hour.
submission instructions
- Your assignment MUST BE DONE in a Jupyter
notebook.
- The name of the notebook must be
<your roll
number>_assignment_II with the roll number being
in uppercase letters.
- Every question must be done in the following manner in
the notebook
- Create a
markdown cell with a copy
of the question.
- Create as many
code cells as needed
to implement the algorithms asked.
- Every cell MUST HAVE a comment line as
the first line(s) that say(s) what the cell
contains.
- There can be one or more
markdown
cells after your code to present your findings and
discussions.
- In case you are implementing your programs in
C/C++, use the magic commands such
as %%file and %%bash to show
execution in the notebook.
- The final notebook must be submitted by email
with the subject CIP Assignment II to
chakravarthybhagvati@uohyd.ac.in
by the due date, Wednesday, 08 April 2026, 9:00
PM.
Follow the instructions EXACTLY as given. Otherwise,
your assignment may not be graded and there will be a
delay.
Questions
- (7 Marks) Write a program to
implement
dispersed-dot dithering. The program MUST be
organised into the following function
Python:
apply_dither_mask(<input image>,
<dither_mask>,
<colour_mask>)
The return value is the output image.
C/C++:
int apply_dither_mask(<input image>,
<output image>,
<dither_mask>, <colour_mask>,
int mrows, int mcols)
mrows, mcols are the number of rows and
columns respectively in the dither mask. The return
value is \(0\) on success and any other value for errors.
Experiment with \(4\times4\) and \(5\times5\) dither
masks. You may use
flower image and
fall colours image
in your experiments.
Discuss the following based on your results
- How did you spread the threshold values and
the colour component positions?
- Did you allocate different number of
thresholds to different components? Did you
think it made any difference to quality of the
output?
- Did the image resolution have an effect on the
quality of the output?
- (6 Marks) Implement Floyd-Steinberg error
diffusion algorithm for colour images. Use any method
discussed either in the class or you find on the
Internet. Write the method clearly as an algorithm and
then show its working on the images from the previous
problem. Compare your results with dithering; discuss
times taken and the quality of the outputs.
- (7 Marks) Use any of the Bayer Colour Filter
arrays (get them from the Internet) and implement an
algorithm that simulates image formation using your
selected Bayer CFA. Remember that you get a
grayscale image.
Implement an appropriate demosaicking algorithm to
restore a full colour image from the grayscale Bayer
CFA image. Measure the difference between the
original image and the demosaicked image by
subtracting one from the other and taking the
absolute values. Remember that an
image is like a matrix and we know how to subtract
matrices, don't we?! What is the mean error per
pixel? Compute it as the sum of the errors / number
of pixels in the image.
You can use the same images as for the above
problems.
There are a few more images here for you to play with:
end of assignment ii
Assignment - I (Due Date: 25/02/2026)
- This assignment consists of three questions for 20
Marks. Answer all of them.
- The marks are given alongside the questions.
- You may use any source on the Internet but should give
the reference in your assignment.
- If you use any AI Tool, make sure you include,
in the assignment,
the prompt given by you. However,
remember that you are being very bad to the environment!
You can power 100 high-end apartments in Hyderabad for a month
with the power AI tools consume in one
hour.
Submit your assignments in a PDF via email to
chakravarthybhagvati@uohyd.ac.in
by the
due date, 25 February 2026, 9:00 PM.
Questions
- (8 Marks) Use the book,
Digital Image Processing, to
find the equations for converting RGB to L*a*b* space
and vice-versa. Write a Python module or C
functions on your own to implement the
conversions. Hint: You may want to use
the openCV library in both Python and
C languages.
Use your code to find the pair-wise distances between the
colours: C1 = (64, 192,
96), C2 = (168, 255,
128) and C3 = (64, 66,
96) in RGB and L*a*b* spaces. Which distances
appear to match your perception of the three
colours?
- (4 Marks) Consider the
colour C = (0, 32,
128). Convert it into Chsv using
Python colorsys/openCV libraries. Multiply
the intensity value by 1.5 and then convert the
colour back into RGB space. Multiply the
original C in RGB space by 1.5. In other words,
multiply each component by 1.5. Are the two
colours the same? Explain your answers.
- (8 Marks) Download the
Colour
Matching Matrix in csv format. This contains the CIE
colour matching functions from 400 nm to 700 nm in 5 nm intervals
(i.e. 61 rows and 3 columns).
Using the data, write programs for
two functions: to create a spectrum as follows
create_gauss_spectrum(center, bandwidth,
energy)
The parameter center is the wavelength, expressed
in nanometres between 400 and
700nm, bandwidth is the width of the spectrum
and energy is the total area under the
spectrum. The spectrum is a gaussian function centred
at the wavelength with its standard deviation given by
the bandwidth divided by 6. The
gaussian function is defined as
$$\mbox{gauss}(x, m, w, A) =
\frac{A}{\sqrt{2\pi}w}e^{-\frac{(x-m)^2}{2w^2}}~~~
\mbox{(Corrected,}~`-'~\mbox{missing in exponent earlier)}$$
In this equation, \(m = \mbox{center}, w =
\frac{\mbox{bandwidth}}{6}, A = \mbox{energy}\).
Important: Remember to write the function such that the
spectrum is also in steps of 5 nm from 400 nm to 700 nm.
The second function is to convert a spectrum into a colour
spect2rgb(spect)
where spect is the input spectrum and the return
value from the function is an RGB triplet. If you
are using a C program, use extra parameter(s) to get the
return value as it is not easy to return an array.
You also
need the XYZ to RGB conversion matrix (3x3). Download or
copy the XYZ to sRGB matrix for D65 illuminants from any
source on the WWW.
Use your functions to create three gaussian spectra with
different sets of parameters and convert them into RGB
colours. Are the colours what you expect? Explain briefly.
Minor - I (Syllabus) (Date: 12/03/2026)
DIYs and Stuff
Coming Soon ...