Processing 2D Images - 40

Example Images

Goals

  1. Working with 2D images.
  2. Implementing simple operations on images, such as color manipulation, filtering.
  3. CS concepts: 2D array addressing, processing

Description

Students are provided with sample images in a simple text format (eg., PPM) that they read and display using the ColorGrid datatype (an abstraction for images). Students are asked to perform a number of simple processing operations on the provided input images, such as the one given above.

Students are provided with a skeleton of an Image class that they will use to implement the required image processing operations listed below.

Tasks

  1. Read Input Image. You will read images in PPM (text) format, with all of the data in pure text form. This is a simple format with a header containing 4 values: A magic number, width, height and maxVal, maxVal representing the maximum of the pixel values, which is useful for scaling when the image values are in a larger range. This is followed by a sequence of RGB triplets. Each pixel is thus represented by 3 integer values. For instance, (255, 0, 0) is red at full intensity. Sample images are provided. See Testing pages.

  2. Display Image. You will use BRIDGES to display the image by storing it in a ColorGrid object.

  3. Image Processing.

Extensions

  1. Image Representation: Images can be represented internally as a 1D array or 2D array. Representing as a 1D array allows students to practice conversion of addresses, which can be useful and relates more to typical pixel layouts and how images are stored in memory

  2. Filtering More advanced image processing operations such as convolution (low/high pass filtering), edge detection, Fourier transform can all be implemented, depending on the student level and programming skills

  3. Personalization Students can bring their own images (pets, themselves) and experiment with them, create pseudo colored images. Flexibility and creativity of students are very powerful engagement indicators. Ensure they are shared with the whole class.

Help

BRIDGES Team: Contact the BRIDGES team for any issues with the BRIDGES API. This is an active project.

for Java

ColorGrid documentation

Color documentation

Bridges class documentation

for C++

ColorGrid documentation

Color documentation

Bridges Class documentation

for Python

ColorGrid documentation

Color documentation

Bridges documentation