Unformatted text preview:

CS6640 – Project 1Assigned Sept. 08, 2010Due Sept. 21 (Just before midnight)Instructor: Guido GerigTA: Miaomiao ZhangGoalsThe purpose of this project is for you to develop the software platform you will use for the course (Matlabor C++), to get familiar with the process and expectations for reports, and to write code and experimentwith thresholding and connected components in images.The second purpose of this assignment is to develop your understanding of image histograms, histogramequalization and the use of histograms for image segmentation.1 Build a HistogramImplement a function or routine, for instance in matlabhistogram(I, n, min, max)that takes a 2D array (image) I as input (integers or floats) and returns a 1D array of floats (length n)that give the relative frequency of the occurance of greyscale values in each of the n bins that equally (towithin integer round off) divide the range of (integer) values between min and max.Experiment with this function on different images and show graphs or plots, in your report, of thehistogram. Explain how the histogram makes sense for each particular image. For the graphs you can usewhatever software you want, e.g. Matlab plotting routines, MS Excell, Open office. Document how you didit and show examples.2 Histogram Equalization1. Implement a Matlab or C++ function (you can use or build on one that already exists in the Matlabbase, if you want):histogram(I, n, min, max)that takes a 2D array (or image) I as input and returns a 1D array of floats (length n) that give therelative frequency of the occurance of greyscale values in each of the n bins that equally divide therange of values between min and max.2. Implement a functionhistoeq(I, n, min, max)that takes a 2D array (or image) I as input (e.g. VISImage¡float¿ in Vispack) and returns an imageof the same type that has undergone histogram equalization using n bins and has a range of outputsthat spans the range between min and max.3. Use this routine to transform and enhance the following images (see Fig. 1):(a) Crowd(b) University14.Figure 1: Test images: crowd, university, chang and portal.(c) People(d) PortalIn addition, include in your discussion 2-3 of your own greyscale images that you think would beinteresting from the point of view of this exercise. I.e. that have bad contrast characteristics and thatmight be improved by histogram equalization.5. Show graphs of the histograms of the images before and after equalization and explain their appearance.6. Discuss (briefly) why histogram equalization is or is not effective for each image.7. Derive an algorithm that processes an image to return an image with a histogram (pdf) that has atevery grey level a value that is a linear blend of the input histogram and a flat histogram. Implementa matlab functionhistoeq(I, n, min, max, alpha)where alpha is a float between 0 and 1 and every bin is (in principle) equal to αHeq+ (1 − α)HI.Thus, for a value of alpha = 0, the output equals the input and for a value of 1 the output is the sameas histoeq(I, n,). Experiment and report results on some of the images listed above. Explain theresults you get.3 Segmentation by ThresholdingAs discussed in class, the simplest segmentation is obtained by thresholding of the image. The imagehistogram may give you a hint on how to choose an optimal threshold but might also be misleading. Giventhe two figures with checkerboard patterns (Figure 3), design a method to find the optimal thresholds. Hint:Remember the class’ discussion on the mixed Gaussian model.The following images (see Fig. 1) are used in this task:1. checker12. checker23. CTscan2Checkerboard image segmentation1. Create and display histograms of the two checkerboard figures.2. Determine a “valley” in the histograms that might indicate the two region categories.3. Threshold the images at this value, display results and discuss.4. Select small regions of interest (e.g. 10x10 patches) in both types of regions and calculate class-specificpdf’s for the dark and light gray patches via estimates mean and standard deviation. Compare theresults of the pdf’s for both images.5. Design a strategy to select the threshold based on the pdf’s for the two categories. Apply this thresholdand discuss the resulting images. What is different to above, and why do you expect these differences?You can graph the pdf’s by drawing two Gaussians.6. Given these pdf’s and your estimates of the percentage area of the two categories, can you recreate thehistogram shapes as actually measured from the original images?CT scan segmentation1. The reasoning above is often applied to computer tomography image data (see Fig. 3 right), e.g. toseparate bone from soft tissue and then display bony structures as 3D graphics.2. Create the histogram of the CT image. Would the histogram be sufficient to separate bone from nonbone?3. Estimate pdf’s of bone and adjacent soft tissue by selection of small regions and calculation of meanand standard deviations.4. Determine best threshold, apply it to the image and discuss.4 Instructions, Requirements, and Restrictions1. Please use your name “NAME” in all reportts and submitted materials to uniquely identify yourprojects.2. Write your project code in a single directory, called project1-NAME.3. For Matlab each individual function (including functions you define) should be a “.m” file, and yourfunctions should call one another as necessary.4. We do not allow to use Matlab toolbox functions (e.g. Imaging Toolbox) or other existing imageprocessing libraries in order to give all students the same conditions for code development1.1The core MATLAB package comes with several rudimentary functions that can be used to load, save, and perform customfunctions on images. Taken from wikibooks35. You should have in your report a short description of each algorithm you used and documentation onhow your code is organized. Failure to do this will result in a loss of points. Please remmember to addyour name to the report title.6. Your project report will be in the form of an html file called index.html, contained in that directory.All links from that file must be relative and all other files necessary to read your report must be inthat directory (or subdirectories).7. You should use examples of images in your report. They should be viewable in the browser when weopen your html file.8. You will submit a single tar file created from from your project directory with the unix command


View Full Document

U of U CS 6640 - Histogram

Download Histogram
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Histogram and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Histogram 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?