Skip to content

Assignment 4

drebain edited this page Feb 26, 2020 · 1 revision

For this assignment you will be given partially completed skeleton code that contains some of the logic you will need. All areas that you need to add or modify code to to complete the assignment requirements will be marked with a TODO comment and some more specific instructions. It is not necessary to add or modify code outside these sections.

Tasks

(1 mark) Compute the Histogram of an Image

Before you run the algorithm to build F, you need to build a histogram of the image that will be transformed. You may do this with a single numpy call, or you can implement it yourself.

(4 marks) Build the Point Operation

Implement the algorithm for building the point operation that transforms each pixel. This can be done almost exactly like in the pseudo-code.

(2 marks) Apply the Point Operation

Use the array built in the previous step to transform the image. Remember that F is a look-up table that maps input pixel values to output pixel values.

Resources

The Lecture 14 slides contain pseudo-code for the algorithm that builds the operation F.