CSE 455: Computer Vision

Autumn 2014


Homework 1
Binary Vision in Medical Image Analysis
Assigned September 30, 2014; Due October 7, 2014 11:59pm

Materials

Download the software and images you need: zip file. The code we give is in C/C++. You can work on any platform using any compiler. We provide CMake file to build your project. Ask Ezgi (ezgi@cs.washington.edu) any questions about the code or how to use CMake.

Contents

The main goal of this assignment is to find organs of interest in CT images, using techniques of binary vision. The organs of interest are the kidneys, the liver, and the spleen, as shown below.

original kidney image isolated regions

We provide you with the CT images and the following image analysis operators:

thresh
threshold an image within a given range, producing a binary image
conrgn
compute connected regions in a binary image
autocolor
autocolor a connected region image

After you compile the provided code, you can try using these operators on some images.

What To Do

1. Code Erosion and Dilation Modules

You'll have to code the following two image operators:

erode
perform erosion on a binary image
dilate
perform dilation on a binary image

Both of these operate on an image and a structuring element. You only need to support disc (circular) structuring elements of any user-specified radius. Simply open files dilute.cpp and erode.cpp and fill the parts marked for you. Do not change anything else if possible.

You are also expected to write the code for generating disc structuring elements of a given radius, as well as the actual dilation and erosion operations. An example disc structuring element with radius 1 is as follows:

0 1 0
1 1 1
0 1 0

This part should be the same for dilation and erosion.

2. Experiment

Once you're done, you can use these, along with the provided operators, to experiment with some CT images.

The first problem is to find a threshold that will produce a binary image that has most of the organs separated into distinct regions. Use thresh to try various threshold ranges yourself.

The second problem is to use the morphological operators you have written, erode and dilate, to help separate organs that are connected together or to fill small holes in organs. Once you have a decent binary image, you can feed it to the connected components labeling operator conrgn to produce a labeled image, which should have a distinct label (low integers) for each region. You can convert this to pseudocolor using autocolor.

Use your thresholding, morphology, and labeling procedure on the CT abdomen images included in the software package. Here is an example command sequence (THE NUMBERS ARE ONLY EXAMPLES, NOT TO USE.):

thresh 64 128 kidney.pgm > kidney_thresh.pgm
erode d 10 kidney_thresh.pgm > kidney_erode.pgm
dilate d 10 kidney_erode.pgm > kidney_dilate.pgm
conrgn g kidney_dilate.pgm > kidney_regions.pgm
autocolor kidney_regions.pgm > kidney_color.ppm

This sequence of commands

  • thresholds the CT image between gray values 64 and 128,
  • then erodes with a disc of radius 10,
  • then dilates with a disc of radius 10,
  • then labels the connected regions,
  • then creates a color image of the connected regions.

    When you do this yourself, you might want to try several different sequences of erosions and dilations.

    Evaluation

    What to Turn In

    You must turn in:

    1. your code for erode and dilate which are well commented and in ASCII format so that the grader can compile them to working binaries. We need only erode.cpp and dilate.cpp files.
    2. the results (which are images) of your thresholding, morphology, and labeling procedure on each of the three CT images, as well as the particular sequence of operations you used to get these results. This part can be either in MS Word or pdf format.

    Dropbox

    Upload your report and code to the homework dropbox HERE. Any modification made after the deadline will not be counted for your grade.

    Homework is due on October 7 (Tuesday) by 11:59 PM. Please plan your work early. You can submit until October 9 but you will lose 10% of your grade for every late day.

    This is a one-person assignment. You may discuss it, but please turn in your own individual work. It is an exercise, so it should not be very hard.