Biomedical Imaging Group

IP-LAB: Image Processing Laboratories

Java Notes |
||

Absolute value | y = |x| | y = Math.abs(x); |

Power elevation | y = x^{a} |
y = Math.pow(x, a); |

Exponential functions | y = e^{a} |
y = Math.exp(a) |

Number Pi | π | double pi = Math.PI; |

Closest integer of x | int y = (int)Math.round(x); | |

Largest integer of x | int y = (int)Math.ceil(x); |

1. Implementation of the 3x3 moving-average filter

The 3x3 moving-average filter replaces a pixel by its average in a 3x3 centered window. There are several ways to implement a moving-average filter. We provide three versions of the implementation and one version is :- MA3x3 NonSeparable plugin: The 3x3 window is scanned for each pixel of the image (mirror boundary conditions are applied);
- MA3x3 Separable plugin: The moving-average routine is implemented in 1D. It is applied to all rows and to all columns (mirror boundary conditions are applied);
- Convolver of ImageJ command: Find the mask of the 3x3 moving-average and write it in the window Convolver of ImageJ (menu Process→Filter→Convolve).

Read and understand the code of two plugin versions of the moving average filter in Code.java

Apply the three routines on the stack of images "cell-zstack.tif" and compare the results of the three versions in terms of time computation and image content. Fill in the report.

2. Implementation of filters

Implements the filters below. If it is a separable filter, implement it in a separable way, while taking proper care of the boundaries (mirror conditions).
2.1 Filter A
Write a method doFilterA() that implements the filter defined by the following mask. |

2.2 Filter B
Write a method doFilterB() that implements the filter defined by the following mask. |

2.3 Filter C
Write a method doFilterC() that implements the filter defined by the following mask. |

2.4 Filter D: Southeast shadows filter
Write a method doFilterD() that produces a Southeast shadows effect on an image. |

3. Detection of spots

Here, we propose to detect the brightest cities (bright spots) on a part of the world image "earth.tif" provided by a satelitte. Convert this image in grayscale image (menu Image→Type→8-bit).To acheive this goal, we will use the

a. Gaussian filter

First, we have to implement the 2D Gaussian filter h
To simplify the implementation, we choose a size of the filter equal to n = (int)(2*ceil(3*σ))+1, hence n is always odd.
Write a method doGaussian() that convolves an image with this Gaussian filter as non-separable or separable way.

Check the Gaussian filter using Gaussian plugin.

b. Difference of Gaussian

Write a method doDoG() that implements the *DoG* by calling two times the Gaussian filter and making the substraction.
We choose σ_{2} = 2 . σ_{1}.
Check the DoG filter using DoG plugin.

c. Application to the spot detection

Apply the *DoG* filter and the threshold T (menu Image→Adjust→Threshold).

Find the parameters σ_{1} and T to detect the brightest cities (around 50 ±20 cities) in the pictureand fill the report.

webmaster.big@epfl.ch • 17.10.2008