Skip to content

MATLAB implementation of the Perona-Malik Diffusion (anisotropic diffusion). The algorithm is designed to denoise images while keeping edges intact. Both explicit and semi-implicit implementations can be found in the repository

Notifications You must be signed in to change notification settings

Henvezz95/Perona-Malik-Diffusion

Repository files navigation

Perona-Malik-Diffusion

Perona–Malik diffusion, also called anisotropic diffusion, is a technique aimed at reducing image noise presented by Perona and Malik in 1987. The main idea is to blur the uniform areas of the images to wash out noise while keeping the strong edges of the image intact. It is based on the equation of heat diffusion in a non-uniform medium. Different brightness levels are treated as different temperatures and edges are considered as materials with a low heat diffusion coefficient(thermal insulating material). The equation that describes the Perona-Malik diffusion is the following:

Anisotropic Diffusion Formula

where I is the intensity function representing the brightness levels of the image and c is a function that is equal to 1 when the gradient norm is zero and goes to 1 when the gradient norm tends to infinity.

The folder contains both an explicit solution and a semi-implicit solution to the differential equation in MATLAB. It can be used to remove noise from both gray-scale and RGB images.

Implementations

The repository contains two implementations of the algorithm:

  • Explicit Method: solves the equation in its explicit form using finite differences. It is easier to understand but to be mathematically stable, the time step dt must be less than 0.25. For this reason, more iterations are required, making the process slower
  • Semi-Implicit Method with AOS: solves the equation in its implicit form. It uses Additive Operator Splitting to reduce the system to the solution of a tridiagonal matrix, that can be processed in a short time using Thomas' algorithm. The Semi-Implicit Method is mathematically stable and allows for much bigger values of dt. In this way, the algorithm requires a small number of steps (max 5-10) and is thus faster than the explicit method.

This repository takes inspiration from this paper and a set of slides with more details on the final implementation can be found here.

Results

The advantage of the Perona-Malik diffusion is that it removes noise by blurring the smooth areas of the image while preserving the edges. Anisotropic Diffusion Examples.

Perona-Malik anisotropic diffusion results (explicit method): (a) noisy image, (b) denoised image after 10 iterations.

About

MATLAB implementation of the Perona-Malik Diffusion (anisotropic diffusion). The algorithm is designed to denoise images while keeping edges intact. Both explicit and semi-implicit implementations can be found in the repository

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages