About this site

This page is a reference guide to the exercise program in the course INF4300 - Digital Image Analysis at the University of Oslo. It is an additional resource provided by me, your teaching assistant, and should not be confused with the official course site.

I will post exercises and assignments, together with solutions, both code and some explanatory text, at a semi-regular frequency, following the course progression. My solutions will be in python, but take a look at Ole Marius’ excellent page from a previous years class for a similar resource, using matlab.

As a disclaimer, I must emphasis that most of the content on this page is my understanding of the different topics. The solution proposals, are excactly that; proposals, so if there are things you do not understand, or you have ideas on how to improve the solutions, I am happy to hear from you.

Image representation

In digital imaging, an image is essentially a function mapping indices to real (or complex) values

where the index set for . Normally we think of and as the height and with of the image, respectively, and as the number of channels. If we collect all the values for all indices in an array, we get the usual array-representation of an image .

Common image categories are bits one-channel (i.e. graylevel) images, taking values in , and rgb(a) images taking real values in for the red, blue, and green channel.

Coordinate conventions

In a conventional 2D Cartesian coordinate system, we use coordinates to specify a certain location on the plane. We have an origin at , a positive x-axis horizontally to the right, and a positive y-axis vertically upwards.

When we are dealing with digital images that are represented as an array with numbers, (e.g. a 2D graylevel image with vertical pixels, and horizontal pixels), this will be represented with a matrix (which values are the graylevel intensity values in the image). I will denote a pixel location with (or ), so that the positive (or ) -axis is vertically downwards, and the positive y (or ) -axis is horizontally to the right (that is, the conventional cartesian system is rotated 90 degrees clockwise).

Note that this conventionis not neccessarily followed by every programming language or library. Most uses the same convention with [row_index, column_index], but when naming the axis, there can be some discrepancies (e.g. matplotlib.pyplot in python uses positive downwards and positive horizontally to the right). You can choose whatever convention you want, as long as you know what you are doing, and are consistent, but this is the way that works best for me.

I will explicitly use square brackets when dealing with images, and parenthesis when dealing with arguments of general mathematical functions.