Tuesday, October 22, 2019

Linear Filters




In Image Processing, one of the most important application of the convolution is the filter. Here is a small introduction...


1. Principle

In linear filters, the output image is the result of the sum of neighboring pixels weighted by the factors in the kernel. The mathematical formula describing this operation of convolution is presented in Fig. 1.

Fig. 1: Formula of convolution. g(x,y) is the filtered image, ω is the kernel and f(x,y) the input image (source Wikipedia).

 

2. Convolve

In ImageJ, you can design your own filter by using the command Process > Filters > Convolve...

Fig. 2: ImageJ Convolver. Here is an example of a 5x5 mean filter
Note: In Wikipedia, you may find several examples of filters in their page about convolution kernels [Link].

3. Mean Filter

For example, in Fig.2, a mean filter defined as a 5x5 convolution mask is designed with all the weights equal to 1 and the Normalize Kernel parameter checked for dividing the resulting value by the sum of all the weights leading to the mean of all the pixel values under the kernel.

Fig.3: Result of a 5x5-mean filtration.



Rather than using the Convolve operator, there is a dedicated mean filter in ImageJ (Process > Filters > Mean).

3. Gaussian Blur Filter

 




Thank you for reading.


<<  Previous: Convolution Next: Rank Filters  >>

3. Other crazybiocomputing posts

Further readings are available in ...
  • Image Enhancement Series  [Link]
  • Image Processing TOC [Link]
  • Wikipedia about Kernel [Link]

No comments:

Post a Comment