5
Digital Image Processing: Lab Assignements #4: Color Image Processing, Morphological Image Processing and Image Analysis Todor Stoyanov and Achim Lilienthal, ¨ Orebro University Issue date: 2011-05-19 Due date: 2011-05-26 Instructions One report has to be handed in per team. Nevertheless, you must be able to answer questions about your lab report individually. Clearly state your names on the lab report. The printed lab report (including source code listings) must be handed in within one (1) week. Additionally, you have to send your source code (Matlab m-files) by electronic mail to [email protected]. Use the subject “DIP Lab”, clearly state your names and the lab session in the message and attach your files (in plain ASCII format). Each lab report is either marked as fail or pass. To pass the labs, all reports must have been marked as pass. If the report is handed in more than three days after the deadline, the report is marked as fail. Up to five bonus points may be awarded to the team for very good lab assignments that comply with the criteria described below: +1p Report is clearly written and easy to follow. +1p Code is well documented. +1p Efficient and correct use of matlab API (vectorization, API functions, plots, etc.) +1p Awarded for particularly well explained procedures – succinct, but descriptive, use of references from scientific articles, textbooks, etc. +1p Reserved for overall exceptional reports, that conform to all scientific writing standards . No bonus points are awarded to late reports (handed in after the due date). If the assignment is not accepted, due to a serious error in one of the problems, no bonus points will be awarded for this assignment and subsequent resubmissions. Any additional materials used during the completion of the assignment must be cited. Failure to correctly reference sources will result in zero points. You will find more material (assignments, images, source code, tutorials, etc.) for the labs on the course web page: http://aass.oru.se/Research/Learning/courses/dip/2011/index.html. 1

Digital Image Processing: Lab Assignements #4: Color Image ...130.243.105.49/Research/Learning/courses/dip/2011/labs/DIP_2011_… · Digital Image Processing: Lab Assignements #4:

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Digital Image Processing: Lab Assignements #4: Color Image ...130.243.105.49/Research/Learning/courses/dip/2011/labs/DIP_2011_… · Digital Image Processing: Lab Assignements #4:

Digital Image Processing: Lab Assignements

#4: Color Image Processing, Morphological Image Processing

and Image Analysis

Todor Stoyanov and Achim Lilienthal, Orebro University

Issue date: 2011-05-19 Due date: 2011-05-26

Instructions

• One report has to be handed in per team. Nevertheless, you must be able to answerquestions about your lab report individually.

• Clearly state your names on the lab report.

• The printed lab report (including source code listings) must be handed in within one (1)week. Additionally, you have to send your source code (Matlab m-files) by electronicmail to [email protected]. Use the subject “DIP Lab”, clearly state your namesand the lab session in the message and attach your files (in plain ASCII format).

• Each lab report is either marked as fail or pass. To pass the labs, all reports must havebeen marked as pass. If the report is handed in more than three days after the deadline,the report is marked as fail. Up to five bonus points may be awarded to the team forvery good lab assignments that comply with the criteria described below:

+1p ← Report is clearly written and easy to follow.

+1p ← Code is well documented.

+1p ← Efficient and correct use of matlab API (vectorization, API functions, plots,etc.)

+1p ← Awarded for particularly well explained procedures – succinct, but descriptive,use of references from scientific articles, textbooks, etc.

+1p ← Reserved for overall exceptional reports, that conform to all scientific writingstandards .

– No bonus points are awarded to late reports (handed in after the due date).

– If the assignment is not accepted, due to a serious error in one of the problems, nobonus points will be awarded for this assignment and subsequent resubmissions.

– Any additional materials used during the completion of the assignment must becited. Failure to correctly reference sources will result in zero points.

You will find more material (assignments, images, source code, tutorials, etc.) for the labson the course web page:http://aass.oru.se/Research/Learning/courses/dip/2011/index.html.

1

Page 2: Digital Image Processing: Lab Assignements #4: Color Image ...130.243.105.49/Research/Learning/courses/dip/2011/labs/DIP_2011_… · Digital Image Processing: Lab Assignements #4:

1 Histogram Equalization of Color Images

Write an M-function that loads a specified color image and applies histogram equalisation tothe R, G, and B channels separately.

Implement a second M-function that converts the specified input image into the HSI colourspace and applies histogram equalization on the intensity (I) channel.

Test these two functions on the image files glaucoma picture 01.tif, glaucoma picture 02.tif,and glaucoma picture 04.tif. Describe the effects on the image and compare the resultsobtained with the two methods.

2 Morphological Image Processing

In this task you will work on a binary image of a finger print (file fingerprint.tif) andperform some morphological operations to improve the image and to extract some usefulinformation. (This is for example of interest in connection with finger print recognition andclassification in authorization systems.)

Matlab already provides functions for morphological image processing (you may readthe help pages): imerode, imdilate, imopen, imclose, bwhitmiss. The function strel

(structuring element, SE) can be used to create SEs of various shapes, or you can constructyour own SE as a matrix with entries 1 (one) and 0 (zero).

2.1 Noise Elimination

The image fingerprint.tif shows some ‘noise’ from the registration process (e.g. dust onthe sensor that was not removed during binary thresholding). Design a morphological filterthat removes the noise and that alters the arcs of the fingerprint as little as possible (e.g.after filtering, the arcs should still be of the same size and should not have become thicker).Find a suitable structuring element and perform the appropriate morphological operationson the image.

Your report should include a comment on the chosen SE and the sequence of morphologicaloperations you have chosen, Also your SE (as matrices) and the final result of the filtering.It is helpful to describe the sequence of applied morphological operations in detail.

2.2 Connected Area and Boundary Extraction

Having ‘cleaned up’ the image, the task is now to find the (connected) areas of the fingerprint. Create a morphological filter that extracts the finger (tip) by ‘connecting’ the arcsin the finger print to a closed area. In other words, the morphological filter processes theoriginal image such that values of 1 in the output image indicate where the finger is and thevalue 0 indicates background). In a second step extract the boundary of the finger tip, usingthe ‘area’ image.

Only use Matlab functions that you can fully explain.Your report should include the results of the ‘area filling’ and the ‘boundary extraction’

process, details about the chosen SEs and the sequence of morphological operations.

2

Page 3: Digital Image Processing: Lab Assignements #4: Color Image ...130.243.105.49/Research/Learning/courses/dip/2011/labs/DIP_2011_… · Digital Image Processing: Lab Assignements #4:

Figure 1: Human eye cross-sectional view. Courtesy NIH National Eye Institute. FromWikipedia, http://en.wikipedia.org/wiki/Glaucoma.

3 Automatic Cup-to-Disc Ratio Computation

Background

In order to assess the progression of glaucoma1 the cup-to-disc ratio is used in ophthalmology2.The optic disc is the anatomical location of the eye’s “blind spot”, the area where the opticnerve and blood vessels enter the retina (see Fig. 1). The optic disc (see Fig. 2) can be flat orit can have a certain amount of normal cupping. Glaucoma produces additional pathologicalcupping of the optic disc.

Figure 2: The white cup is a pit with no nerve fibers. The disc surrounding the cup containsnerve fibers. As glaucoma advances, the cup enlarges until it occupies most of the disc area.Courtesy AgingEye Times. From Wikipedia, http://en.wikipedia.org/wiki/Glaucoma.

1Glaucoma is a group of diseases of the optic nerve. It is the second leading cause of blind-ness and difficult to diagnose by the eye pressure. More information can be found on Wikipedia,http://en.wikipedia.org/wiki/Glaucoma.

2Ophthalmology is the branch of medicine which deals with the diseases and surgery of the visual pathways,including the eye, brain, and areas surrounding the eye. More information can be found on Wikipedia,http://en.wikipedia.org/wiki/Ophthalmology.

3

Page 4: Digital Image Processing: Lab Assignements #4: Color Image ...130.243.105.49/Research/Learning/courses/dip/2011/labs/DIP_2011_… · Digital Image Processing: Lab Assignements #4:

Figure 3: Different stages of glaucoma. Stage 1 to 5 (German: “Stadium” 1 - 5), from left toright.

The cup-to-disc ratio compares the diameter of the ”cup” portion of the optic disc withthe total diameter of the optic disc. A good anology to better understand the cup to discratio is the ratio of a donut hole to a donut. The hole represents the cup and the surroundingarea the disc. If the cup fills 1/10 of the disc, the ratio will be 0.1. If it fills 7/10 then theratio is 0.7. A large cup-to-disc ratio may imply glaucoma or other pathology (see Fig. 3).

Task

Write a Matlab program that determines the horizontal and vertical cup-to-disc ratio

rh =dcup hor

ddisc hor(1)

rv =dcup vert

ddisc vert(2)

according to the definition of the variables dcup hor, ddisc hor, dcup vert, ddisc vert in Fig. 4. Totest your algorithm, use the pictures

“glaucoma picture 01.tif”, “glaucoma picture 02.tif”, and “glaucoma picture 04.tif”,

which can be found on the course web page. The correct values, obtained with the HeidelbergRetina Tomograph (HRT), are given in the table below. For comparison, the table alsocontains the ratios as determined by eye by a human expert (HE). A cup-to-disc ratio between0.0 and 0.3 is considered normal, between 0.0 and 0.3 as “suspect” and between 0.6 and 1.0as “increased”.

Image rh(HRT ) rv(HRT ) rh(HE) rv(HE)

“glaucoma picture 01.tif” 0.888 0.787 0.7 0.7“glaucoma picture 02.tif” 0.521 0.431 0.4 0.5“glaucoma picture 04.tif” 0.712 0.635 0.8 0.7

4

Page 5: Digital Image Processing: Lab Assignements #4: Color Image ...130.243.105.49/Research/Learning/courses/dip/2011/labs/DIP_2011_… · Digital Image Processing: Lab Assignements #4:

Figure 4: Definition of the variables that need to be estimated from the pictures in order toassess the progression of glaucoma.

Open Exercise

This is an open exercise, which means that you are encouraged to use whatever method youhave at your disposal. Feel free, for example, to apply your knowledge from the machinelearning course.

An open exercise also means that there is no single “correct” answer. When you hand inyour solution we will evaluate its robustness and accuracy with unseen eye images and discussyour particular solution. However, you cannot fail this assignement due to a bad performanceof your cup-to-disc ratio computation algorithm.

5