CSE 455: Computer VisionAutumn 2010 |
Download the software and images you need: Windows rar file; Windows zip file; Linux rar file; Linux zip file; The code we give is in C/C++. You need to be able to understand C++, but if you are more comfortable coding in C, that should work. See Alfred for any explanations of code you need, or just email him.
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:
After you compile the provided code, you can try using these operators on some images.
Both of these operate on an image and a structuring element. You only need to support disc (circular) structuring elements of any user-specified diameter. The file BinaryOperator.cpp has some code to get you started.
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.
NOTE: In your final code, make 2 modules, one for dilate and one for erode. They should use the EXACT SAME COMMAND SYNTAX shown above, so Alfred can test them. Alfread will test erosion and dilation both in the context of the whole program and separately to be sure they work. To be sure that your erode and dilate work as he expects, make sure that the command line "erode d 1 input.pgm > output.pgm" performs an erosion with the following structuring element to input.pgm, producing output.pgm,
0 1 0
1 1 1
0 1 0
and similarly for dilate. Note2: the "d" stands for disc.
You must turn in:
Please email your homework to Alfred (alfredg@cs.washington.edu).
Homework is due on October 11 (Monday) by 11:59 PM. Please plan your work early.
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.