Lead TAs: Nick Heckman, Igor Avramovic
This lab will help you understand some fundamental concepts of machine vision such
as thresholding, contrast and histograms.
For the following three programs, hand in at least three pictures demonstrating the algorithm. Use the Mona Lisa that is available on the web site, one that we provide based on the letter of your group from last week, and
another figure (not Mona Lisa) of your choice. If you are not sure about
the PGM format, please "man pgm." from an andrew system or look here.
Write a program that reads in a PGM file, takes as
input a number "n", and outputs a binary image. All pixels in
the output image are "black" if their corresponding pixels in the input
image are below "n". The remaining pixels in the output image
Write a program that searches for the lowest and highest
pixel value in an image and then scales the image such that the lowest
value is 0 and the highest value is 255. Output the image.
Compute the histogram of an image. Output the data in
a meaningful manner.
- Info on PGM: man pgm or click here
- a .pgm file of Mona Lisa
- a custom thresholding file for your group
- Some sample code that reads, writes, and thresholds PGM images
I have provided a new version that improves file io. It also allows you to do all three operations in one run of the program much more simply. -sean
Click Here for the new version
- Demonstrations of each of the above algorithms with three
different pictures: Mona Lisa, a group letter, and one of your choice.
- Note that the histogram also has to be graphically displayed and
that everything should be on one clearly labeled web page (email the
URL to Nick Armstrong and hand
in a hard copy) NOTE: Please display the images as .jpg's or .gif's rather than .pgm's.
(Save the .pgm image your code spits out, and use a graphics program
to convert to a .jpg or .gif) The webpage should have your original, constrasted and thresholded images, plus
the histogram for each image.
As always, do NOT hand in a printout of C code; instead, send it as an
attachment when you email your web page's URL.
You can use xv or Iview or whatever you want to display images. To
get a copy of Iview, click here . If
you have trouble downloading I_VIEW, try going to
Open Office .