Skip to main content

Instructions

High-Level Tasks
  • Implement pointwise image operations in the Photography notebook
  • Implement image warping in Distortion notebook
  • Implement filters and convolution in the Filtering notebook
Using Library Functions

Do not use library functions that defeat the purpose of this assignment. We will consider this a violation of academic integrity. For example, you cannot use np.convolve() in Part 3. If you're unsure if you can use something, please ask in a public post on Ed.

The instructions for each part will be found in the notebooks themselves, but this provides a nice overview of everything you will need to do for this assignment.

Part 1: Pointwise Image Operations

Tasks in [Photography.ipynb]:

Implement the following:

  • rawInt16ToFloat()
  • white_balance()
  • color_transform()

Choose values for the following:

  • black_level
  • gray
  • linear_exposure
  • filmic_exposure

One of the simplest ways to transform an image is to apply a function to each pixel. This kind of pointwise operation is simple to implement but has a lot of uses.

The first part of the assignment explores an application of several pointwise operations in digital photography. You can find the instructions for it in Photography.ipynb.

Part 2: Image Warping

Tasks in [Distortion.ipynb]:

Implement the following:

  • shift_image_to_left()
  • rotate_image()
  • undistort_image()

Pointwise image operations change the colors and tones in images while keeping content at the same location in the image; each pixel depends only on the pixel at that exact location. Image warping is, in some ways, the opposite: the content in the image stays the same color, but it moves from place to place.

In the second part of the assignment, we look at some simple image warps and correct the distortion of wide-angle lenses. We also explore the effects of different interpolation methods. You can find the instructions for it in Distortion.ipynb.

Part 3: Image Filtering

Tasks in [Filtering.ipynb]:

Implement the following:

  • gen_gaussian_filter()
  • convolve()
  • convolve_sep()
  • unsharp_mask()

In previous parts, each output pixel depended on a single point in the input. For pointwise operations, it was precisely the corresponding pixel. In contrast, the source locations for image warping came from arbitrary mappings. For other operations, we need output pixels to depend on a neighborhood in the input, and convolution is the canonical example.

The final part of the assignment is about convolution with arbitrary 2D filters and separable 2D filters. It looks at an application to image sharpening. You can find the instructions for it in Filtering.ipynb.