MorphoGraphs and Imagery - Practical session 4

Goals

General Instructions

Bon Courage :)

Problem 0
First of all download the file PS4-Images.tgz and uncompress it
This archive contains the images that will be used during the session. You can visualize them using 'display'.
 
Problem 1: Cleaning image cell.pgm

   INPUT: cell.pgm  DESCRIPTION OF THE PROBLEM
     EXPECTED RESULT (1C)
 

The small white spots and black holes in cell.pgm correspond to noise due to the
acquisition process. They do not carry any information about the cells under study. Such noise is called (binary) salt and pepper noise or speckles. Problem 1 is about removing salt and pepper noise from this image.
 

Guideline.
Tools.
You could use (compositions of) the dilation and erosion programs that you have implemented during the first practical session of the course. Instead, to save time, you can use the programs of Pink Library, which are made available to you, through Linux terminals of the provided Working Environment:
In order to visualize images you can use from a terminal the command 'display' followed by the name of the images to visualize.
 
Additional Tools for solving two stars questions are shown at the end of the page.

Problem 2: Filling the holes of cell3.pgm 

   INPUT: cell3.pgm  DESCRIPTION OF THE PROBLEM
EXPECTED RESULT (2B)
 


Image cell3.pgm contains cells (in white). The absence/presence/number of holes allows different kinds of cells to be distinguished. A first step towards identification of the different cells consists of extracting the holes. This can be done by i) filling all holes; and ii) taking the difference between the initial image and the one  without holes. Problem 2 is about filling the holes of cell3.pgm 

 



Guideline.


Tools.
You can use any tool presented for the previous problems. In addition, you can also use the following ones:

Additional Tools for solving two stars questions are shown at the end of the page.


Problem 3: Extracting descending objects of lines.pgm

 INPUT: lines.pgm   DESCRIPTION OF THE PROBLEM  EXPECTED RESULT (2B)
 
A common situation in image analysis consists of extracting objects that spread the image following one (or several) preferred direction(s). For instance, the sky line in a natural image is in general horizontal.The image lines.pgm is a synthetic one produced to illustrate how one can extract such kind of objects. Problem 3 is about extracting "descending objects" (from top left to bottom right) of image lines.pgm.
 

Guideline.

Tools.
You can use any tool presented for the previous problems.

Problem 4: Smoothing the aliasing in jagged.pgm 

 INPUT: jagged.pgm
 DESCRIPTION OF THE PROBLEM  EXPECTED RESULT (4B)
 
Have a look at this link. More details are provided here.
 


Guideline.
Tools.
You can use any tool presented for the previous problems.

The three star item 4B can be solved by a combination of tools presented until now. It can also be solved by a tool presented in the
'Additional Tools' shown at the end of the page.

Problem 5: Extracting the contours of cell2.pgm 

  INPUT: cell2.pgm
 DESCRIPTION OF THE PROBLEM  EXPECTED RESULT
 

The contour of a shape is useful for analyzing its geometry. For instance a shape (like a cell in image cell2.pgm) is circular when the ratio between the square of its perimeter and its area tends to  4, whereas it is elongated when this ratio is high. Problem 5 is about contour extraction of cell2.pgm.
 

Guideline.
Tools.
You can use any tool presented for the previous problems. Furthermore you can use:

Problem 6: Cleaning image sofitel.pgm

 INPUT : sofitel.pgm
  DESCRIPTION OF THE PROBLEM  EXPECTED RESULT (6B)
 
The small bright and dark spots in sofitel.pgm correspond to noise that may be due to the acquisition or transmission process for instance. They do not carry any information about the picture and disturb visualization. Such noise is called (grayscale) salt and pepper noise or speckles. Problem 6 is about removing salt and pepper noise from this image.  



Guideline.
Tools.
To obtain topographic surfaces from a grayscale images save the program '2d2relief.tcl' (dowload it here) in your working directory and enter './2d2relief.tcl'in a terminal to obtain a short help. You can visualize the reliefs with the command 'multirender' followed by the names of the reliefs.

Note that the programs 'dilation', 'erosion', 'opening', and 'closing' accept grayscale images whereas 'erosball', 'dilatball', 'openball' and 'closeball' do not.


Additional Tools for solving two and three stars questions are shown at the end of the page.

Problem 7: Sketching the edges from sofitel2.pgm

 INPUT: sofitel2.pgm
   DESCRIPTION OF THE PROBLEM  EXPECTED RESULT
 

In order to detect the contours of the object in image sofitel2.pgm, it is useful to start by "sketching its edge": computing an image whose values are high near the contours. Problem 7 is about producing such an image.
 


Guideline.
Tools.
You can use any tool presented for the previous problems.


Additional Tools

1. Connected components extraction

Let G = (E, Gamma) be a graph, and let X be a subset of E (eg, the white pixels of a binary image). A connected component of X is a subset of X that is exactly the vertex set of a connected component of the subgraph of G induced by X (see the definition of induced subgraph in exercise session 1). Let Y be a second subset of E. The set of connected components of X marked by Y is the union of all the connected components of X that contain at least one point of Y.

The command 'geodilat' allows to compute marked connected components in the case where X and Y corresponds tho sets of white pixels in binary images and where G is the graph induced by the "cross" structuring element Gamma_4:

 X (white pixels)
 Y (white pixels)
Connected components of X marked by Y (in white)
 
 
 
 IMAGE: X.pgm    
 IMAGE: Y.pgm
IMAGE: Z.pgm obtained by:
'geodilat Y.pgm X.pgm 4 -1 Z.pgm'
 

The command 'geoeros' is the dual of 'geodilat'. It allows to compute marked connected components in the case where X and Y corresponds tho sets of black pixels in binary images and where G is the graph induced by the "cross" structuring element Gamma_4:

 X (black pixels)
 Y (black pixels)
Connected components of X marked by Y (in black)
 

 IMAGE: Xi.pgm    
 IMAGE: Yi.pgm
IMAGE: Zi.pgm obtained by:
'geoeros Yi.pgm Xi.pgm 4 -1 Zi.pgm'


By threshold decomposition, these operators 'geodilat' and 'geoeros' are able to process grayscale images. More details on these stack operators will be provided in the next lecture on morphology.


2. Alternate sequential filter