First Programming Sessions

As stated in the main page, this tutorial is with the help of the PinkDev library.

 

You can download the images, both the original image and the resulting image, by following the link. You can extract the images doing tar zxvf blobs.tar.gz.

 

Here are the questions.

 

1 - Image difference

 

As a first very basic exercise, write an operator 'diffimage' that takes as input two images and returns a third image that is the absolute difference between the first two images. The command line for this operator is something like

diffimage image1 image2 imageresult

How can you test it? Once you have done this operator, you can use it that the result of the following questions are indeed correct.

 

2 -Thresholding

 

Write an operator threshold that makes a combined threshold. The input for the program are an image and two integers which are the low and the high threshold.

An example is the following

thresold blobs.pgm 10 40 blobsThreshold.pgm

 

3 - Histogram normalization

 

Write an operator normalize that normalizes the image histogram. The inputs of this operator are an image, and two integers, one for the desired low level value and the other for the high level value. You can test your operator on the image blobs.pgm, with 0 and 255, you should obtain blobsNormalize.pgm

 

 

4 - Histogram Equalization

 

Write an operator equalize that makes an hitogram equalization of the input image. On the blobs.pgm image, you should obtain the blobsEqualize.pgm image. How do you interpret the results?

 

5 - Other operators

 

Implement gamma corrections, log transform, power law, etc.

 

6 - Weighted averaging

 

Implement weighted averaging. Thanks to that operator, you can compute a Laplacian. Do some image enhancement filters.