<commit_before># IMAGE PROCESSING & PIPELINES

## Image Enhancement

Because your scientific images are not perfect and the objects of interest are difficult to see, you have to **enhance** your images. Usually, three main defects can be fixed:

- Brightness and Contrast
- Non uniform illumination
- Noise

### Enhancement: Brightness/Contrast

The brightness and contrast of an image can be enhanced by modifying the **transfer function** or playing with the pixel distribution of the **histogram**. Here is the first part with the transfer function...

#### 1\. Playing with the transfer function

The transfer function in ImageJ is defined by a straight line whose formula is:

> **y = Ax + B** with A is the slope and B is the y-intercept

Thus, two factors can be modified:

- The slope A
- The y-intercept B

Let's see the influence of these two parameters on the image :

![Ramp image](https://2.bp.blogspot.com/--LsNzKZCaxo/VIG0xZ9s09I/AAAAAAAABzE/Jy0WOSArc4U/s1600/lut.jpg)

##### 1.1 The y-intercept

If we modify the Y-intercept, the transfer function is now ...

y = x - 50

![Transfer function](https://3.bp.blogspot.com/-wR2rPMh-K10/VIG1HTYz_qI/AAAAAAAABzU/6p-iVxYBJtI/s1600/transferFunction_B.png)

In this case, a pixel value of 50 in the input image is displayed as a **black (value = 0) pixel** in the output. Consequently, the LUT is now darker than the original as shown and the input pixel value 255 now is **equal to 200** (a light gray but not a white).

![Output image](https://3.bp.blogspot.com/-zUbMzPBOPnI/VIG4tZQQo0I/AAAAAAAABzs/1NwkXf9Stuw/s1600/lut_B.jpg)

##### 1.2\. The slope

In this case, the **slope is equal to 3.5** leading to a variation of grays (gradient) from black to white restrained in the range of [60;130].

y = 3.5x - 210

![Transfer function](https://2.bp.blogspot.com/-zPrYhek2C94/VIG1FIi9XeI/AAAAAAAABzM/wQrswA6LYwI/s1600/transferFunction_A.png)

.. and the LUT appears as ...

![Output](https://1.bp.blogspot.com/-A4qAHE-vJuE/VIG23YbzCAI/AAAAAAAABzg/mwcvDAZe1pk/s1600/lut_A.jpg)

In conclusion, the **brightness** corresponds to the y-intercept and the **contrast** to the slope of the transfer function. The brightness is the amount of light, and the contrast, the speed necessary to go from 0 to 255;

There are multiple others transfer functions possible:

- Y = log(X)
- Y = \sqrt(X)
- Y = exp(X)

#### 2\. Playing with the histogram

The previous method based on the transfer function is powerful but you have to manually define the slope and the y-intercept of the transfer function. It is faster to directly **modify the histogram**.

Here is our test image...

![Clown](https://2.bp.blogspot.com/-C9FEiMRgGIY/VIGrSjDPj0I/AAAAAAAAByM/MY8Q_k10rx8/s1600/clownBright_contrast.png)

![Histogram](https://1.bp.blogspot.com/-Y31cAf4R7-s/VIGtdbV-Z6I/AAAAAAAAByg/BhoqtuXf-P0/s1600/clown_histogram.jpg)

##### 2.1\. Normalization of the histogram

In the histogram, there is no pixel value in the range of [0-50] and of [178-255]. It can be interesting to **use all the pixel values** available in a 8-bit image and thus to stretch the histogram between its extreme values (0 and 255) by **interpolating** all the values between 0 and 255\. This operation is called the **normalization** of the histogram.

##### 2.2\. Equalization of the histogram

An ideal transfer function based on the **cumulative histogram**. One disvantage is that it ehance the noise of the image, it'snot interesting for scientific images.

### Enhancement: Non uniform illumination

In the Image Enhancement series, the **non uniform illumination** is the second main defect that you must correct in your images.

#### 1\. With a reference image

If you are using a scientific device like a microscope (optical or electron), all the environmental parameters are well known (no clouds, fog, sun,etc.). In this case, you can record a blank image at the beginning of your session of images collection. A **blank image** or reference image is an image **without samples**. Thus, if there is a problem of illumination, this image **contains the defect**.

> **Note**: With this technique, we assume that the defect is constant during the session.

#### 2\. Without a reference image

Unfortunately, the reference image is outdated or you didn't backup this image or you didn't know where this image is located in the hard disk. So, the result is: **You have no reference image!**

All the techniques available tried to model the background image and then to subtract it to the images.

- Use filters like the 'Rolling Ball' or the 'Top Hat' filters.
- Model the background with a polynomial function.
- Use of Mathematical Morphology method.
- Removal of low frequencies in frequency - Fourier - space.

In ImageJ, only the 'Rolling Ball' filter is implemented to subtract the background.

### Noise

Image noise is random (not present in the object imaged) **variation of brightness or color information** in images, and is usually an aspect of electronic noise. It can be produced by the sensor and circuitry of a scanner or digital camera. Image noise can also originate in film grain and in the unavoidable shot noise of an ideal photon detector. Image noise is an undesirable by-product of image capture that adds spurious and extraneous information.

#### Different type of noise

##### 1 Gaussian noise

Gaussian noise is statistical noise having a **probability density function (PDF)** equal to that of the normal distribution, which is also known as the **Gaussian distribution**. In other words, the values that the noise can take on are Gaussian-distributed (in histogram).
Principal sources of Gaussian noise in digital images arise **during acquisition** e.g. sensor noise caused by poor illumination and/or high temperature, and/or transmission

In digital image processing Gaussian noise can be reduced using a **spatial filter**, though when smoothing an image, an undesirable outcome may result in the blurring of fine-scaled image edges and details because they also correspond to blocked high frequencies. **Conventional spatial filtering techniques** for noise removal include: mean (convolution) filtering, median filtering and Gaussian smoothing.

![512x512-No-Noise](https://i.imgur.com/14HHjSv.jpg)
![512x512-Gaussian-Noise](https://i.imgur.com/tYdtmxk.jpg)
> By Me - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10114819

##### 2 Salt and Pepper

Salt-and-pepper noise is a form of noise sometimes seen on images. It is also known as **impulse noise**. This noise can be caused by sharp and sudden disturbances in the image signal. An image containing salt-and-pepper noise will have **dark pixels** in bright regions and **bright pixels** in dark regions. This type of noise can be caused by analog-to-digital converter errors, bit errors in transmission, etc. It can be mostly eliminated by using dark frame subtraction, median filtering and interpolating around dark/bright pixels (extreme value of pixels in histogram). 

Dead pixels in an LCD monitor produce a similar, but non-random, display.

![Noise_salt_and_pepper](https://i.imgur.com/Hpjn9Il.png)
> By User Markome on en.wikipedia, Public Domain, https://commons.wikimedia.org/w/index.php?curid=1352731

[More noise in Wiki](https://en.wikipedia.org/wiki/Image_noise)

> **Note for each type** : In either case, the noise at different pixels can be either correlated or uncorrelated; in many cases, noise values at different pixels are modeled as being independent and identically distributed, and hence uncorrelated.

#### Noise reduction

Noise reduction is the process of **removing noise** from a signal.
All recording devices, both analog and digital, have traits that make them susceptible to noise. Noise can be random or white noise with no coherence, or coherent noise introduced by the **device's mechanism or processing algorithms**.

Images taken with both digital cameras and conventional film cameras will pick up noise from a variety of sources. Further use of these images will often require that the noise be (partially) removed – for aesthetic purposes as in artistic work or marketing, or for practical purposes such as computer vision.

##### 1 Removal
###### 1.1 Tradeoffs

In selecting a noise reduction algorithm, one must weigh several factors:

+ the available **computer power and time available**: a digital camera must apply noise reduction in a fraction of a second using a tiny onboard CPU, while a desktop computer has much more power and time
+ whether **sacrificing some real detail** is acceptable if it allows more noise to be removed (how aggressively to decide whether variations in the image are noise or not)
+ the **characteristics** of the noise and the detail in the image, to better make those decisions

##### 1.2 Chroma and luminance noise separation

In real-world photographs, the highest spatial-frequency detail consists mostly of variations in **brightness** ("luminance detail") rather than variations in **hue** ("chroma detail"). Since any noise reduction algorithm should attempt to remove noise without sacrificing real detail from the scene photographed, one risks a **greater loss** of detail from luminance noise reduction than chroma noise reduction simply because most scenes have little high frequency chroma detail to begin with.

Most dedicated noise-reduction computer software allows the user to control chroma and luminance noise reduction separately.

##### 1.3 Linear smoothing filters
One method to remove noise is by **convolving** the original image with a **mask** that represents a low-pass filter or smoothing operation.

**{**
**Convolution**

In mathematics (and, in particular, functional analysis) convolution is a mathematical operation on **two functions** (f and g); it **produces a third function**, that is typically viewed as a modified version of one of the original functions, giving the integral of the pointwise multiplication of the two functions as a **function of the amount** that one of the original functions is translated. Convolution is similar to cross-correlation. It has applications that include probability, statistics, computer vision, natural language processing, **image and signal processing**, engineering, and differential equations.

![Convolution_of_box_signal_with_itself2](https://i.imgur.com/Q00Uhfn.gif)
> By Convolution_of_box_signal_with_itself.gif: <NAME>bergderivative work: Tinos (talk) - Convolution_of_box_signal_with_itself.gif, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=11003835

**}**

For example, the **Gaussian mask** comprises elements determined by a Gaussian function. This convolution brings the value of each pixel into closer harmony with the values of its neighbors. In general, a smoothing filter sets each pixel to the **average value**, or a weighted average, of itself and its nearby neighbors; the Gaussian filter is just one possible set of weights.

Smoothing filters tend to **blur** an image, because pixel intensity values that are significantly higher or lower than the surrounding neighborhood would **"smear"**(salir) across the area. Because of this blurring, linear filters are seldom (rarement) used in practice for noise reduction; they are, however, often used as the basis for **nonlinear noise reduction filters**.

##### 1.4 Nonlinear filters

A **median filter** is an example of a non-linear filter and, if properly designed, is very good at preserving image detail. To run a median filter:

+ consider each pixel in the image
+ sort the neighbouring pixels into order based upon their intensities
+ replace the original value of the pixel with the median value from the list

A median filter is a **rank-selection (RS) filter**, a particularly harsh member of the family of rank-conditioned rank-selection (RCRS) filters; a much milder member of that family, for example one that selects the closest of the neighboring values when a pixel's value is external in its neighborhood, and leaves it unchanged otherwise, is sometimes preferred, especially in photographic applications.

Median and other RCRS filters are good at removing salt and pepper noise from an image, and also cause relatively **little blurring of edges**, and hence are often used in computer vision applications.

![Median_filter_example](https://i.imgur.com/vJQtNJi.jpg)
> By Debivort at en.wikipedia, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=17001283

##### 1.5 Anisotropic diffusion

In image processing and computer vision, anisotropic diffusion, also called **Perona–Malik diffusion**, is a technique aiming at reducing image noise without removing significant parts of the image content, typically edges, lines or other details that are important for the interpretation of the image. Anisotropic diffusion resembles the process that creates a **scale space**, where an image generates a parameterized family of successively more and more blurred images based on a diffusion process. Each of the resulting images in this family are given as a **convolution** between the image and a 2D isotropic Gaussian filter, where the width of the filter increases with the parameter. This diffusion process is a **linear and space-invariant** transformation of the original image. Anisotropic diffusion is a generalization of this diffusion process: it produces a **family of parameterized images**, but each resulting image is a combination between the original image and a filter that depends on the local content of the original image. As a consequence, anisotropic diffusion is a **non-linear and space-variant** transformation of the original image

##### 1.6 Non-local means

Non-local means is an algorithm in image processing for image denoising. Unlike "local mean" filters, which take the mean value of a group of pixels surrounding a target pixel to smooth the image, non-local means filtering takes a **mean of all pixels in the image**, weighted by how similar these pixels are to the target pixel. This results in much greater post-filtering clarity, and less loss of detail in the image compared with local mean algorithms.

[Références](https://en.wikipedia.org/wiki/Noise_reduction#In_images)


### Fourier transform

**Common Names:** Fourier Transform, Spectral Analysis, Frequency Analysis

The Fourier Transform is an important image processing tool which is used to **decompose** an image into its **sine and cosine components**. The output of the transformation represents the image in the Fourier or **frequency domain**, while the input image is the **spatial domain** equivalent. In the Fourier domain image, each point represents a particular frequency contained in the spatial domain image.

The Fourier Transform is used in a wide range of applications, such as image analysis, image filtering, image reconstruction and image compression.

[See more](https://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm)

#### Pass-filter
##### 1 High-pass filter

A high-pass filter (HPF) is an **electronic filter** that passes signals with a frequency **higher** than a certain cutoff frequency and attenuates signals with frequencies **lower** than the cutoff frequency. The amount of attenuation for each frequency depends on the filter design. A high-pass filter is usually modeled as a **linear time-invariant system**. It is sometimes called a low-cut filter or bass-cut filter. High-pass filters have many uses, such as blocking DC from circuitry sensitive to non-zero average voltages or radio frequency devices.

##### 2 Low-pass filter

A low-pass filter (LPF) is a filter that passes signals with a frequency **lower** than a certain cutoff frequency and attenuates signals with frequencies **higher** than the cutoff frequency. The exact frequency response of the filter depends on the filter design. The filter is sometimes called a high-cut filter, or treble-cut filter in audio applications. A low-pass filter is the complement of a high-pass filter.

Filter designers will often use the low-pass form as a **prototype filter**. That is, a filter with unity **bandwidth and impedance**. The desired filter is obtained from the prototype by scaling for the desired bandwidth and impedance and transforming into the desired bandform (that is low-pass, high-pass, band-pass or band-stop).

##### 3 Band-pass filter<commit_msg>Update processing-seb.md<commit_after># IMAGE PROCESSING & PIPELINES

## Image Enhancement

Because your scientific images are not perfect and the objects of interest are difficult to see, you have to **enhance** your images. Usually, three main defects can be fixed:

- Brightness and Contrast
- Non uniform illumination
- Noise

### Enhancement: Brightness/Contrast

The brightness and contrast of an image can be enhanced by modifying the **transfer function** or playing with the pixel distribution of the **histogram**. Here is the first part with the transfer function...

#### 1\. Playing with the transfer function

The transfer function in ImageJ is defined by a straight line whose formula is:

> **y = Ax + B** with A is the slope and B is the y-intercept

Thus, two factors can be modified:

- The slope A
- The y-intercept B

Let's see the influence of these two parameters on the image :

![Ramp image](https://2.bp.blogspot.com/--LsNzKZCaxo/VIG0xZ9s09I/AAAAAAAABzE/Jy0WOSArc4U/s1600/lut.jpg)

##### 1.1 The y-intercept

If we modify the Y-intercept, the transfer function is now ...

y = x - 50

![Transfer function](https://3.bp.blogspot.com/-wR2rPMh-K10/VIG1HTYz_qI/AAAAAAAABzU/6p-iVxYBJtI/s1600/transferFunction_B.png)

In this case, a pixel value of 50 in the input image is displayed as a **black (value = 0) pixel** in the output. Consequently, the LUT is now darker than the original as shown and the input pixel value 255 now is **equal to 200** (a light gray but not a white).

![Output image](https://3.bp.blogspot.com/-zUbMzPBOPnI/VIG4tZQQo0I/AAAAAAAABzs/1NwkXf9Stuw/s1600/lut_B.jpg)

##### 1.2\. The slope

In this case, the **slope is equal to 3.5** leading to a variation of grays (gradient) from black to white restrained in the range of [60;130].

y = 3.5x - 210

![Transfer function](https://2.bp.blogspot.com/-zPrYhek2C94/VIG1FIi9XeI/AAAAAAAABzM/wQrswA6LYwI/s1600/transferFunction_A.png)

.. and the LUT appears as ...

![Output](https://1.bp.blogspot.com/-A4qAHE-vJuE/VIG23YbzCAI/AAAAAAAABzg/mwcvDAZe1pk/s1600/lut_A.jpg)

In conclusion, the **brightness** corresponds to the y-intercept and the **contrast** to the slope of the transfer function. The brightness is the amount of light, and the contrast, the speed necessary to go from 0 to 255;

There are multiple others transfer functions possible:

- Y = log(X)
- Y = \sqrt(X)
- Y = exp(X)

#### 2\. Playing with the histogram

The previous method based on the transfer function is powerful but you have to manually define the slope and the y-intercept of the transfer function. It is faster to directly **modify the histogram**.

Here is our test image...

![Clown](https://2.bp.blogspot.com/-C9FEiMRgGIY/VIGrSjDPj0I/AAAAAAAAByM/MY8Q_k10rx8/s1600/clownBright_contrast.png)

![Histogram](https://1.bp.blogspot.com/-Y31cAf4R7-s/VIGtdbV-Z6I/AAAAAAAAByg/BhoqtuXf-P0/s1600/clown_histogram.jpg)

##### 2.1\. Normalization of the histogram

In the histogram, there is no pixel value in the range of [0-50] and of [178-255]. It can be interesting to **use all the pixel values** available in a 8-bit image and thus to stretch the histogram between its extreme values (0 and 255) by **interpolating** all the values between 0 and 255\. This operation is called the **normalization** of the histogram.

##### 2.2\. Equalization of the histogram

An ideal transfer function based on the **cumulative histogram**. One disvantage is that it ehance the noise of the image, it'snot interesting for scientific images.

### Enhancement: Non uniform illumination

In the Image Enhancement series, the **non uniform illumination** is the second main defect that you must correct in your images.

#### 1\. With a reference image

If you are using a scientific device like a microscope (optical or electron), all the environmental parameters are well known (no clouds, fog, sun,etc.). In this case, you can record a blank image at the beginning of your session of images collection. A **blank image** or reference image is an image **without samples**. Thus, if there is a problem of illumination, this image **contains the defect**.

> **Note**: With this technique, we assume that the defect is constant during the session.

#### 2\. Without a reference image

Unfortunately, the reference image is outdated or you didn't backup this image or you didn't know where this image is located in the hard disk. So, the result is: **You have no reference image!**

All the techniques available tried to model the background image and then to subtract it to the images.

- Use filters like the 'Rolling Ball' or the 'Top Hat' filters.
- Model the background with a polynomial function.
- Use of Mathematical Morphology method.
- Removal of low frequencies in frequency - Fourier - space.

In ImageJ, only the 'Rolling Ball' filter is implemented to subtract the background.

### Noise

Image noise is random (not present in the object imaged) **variation of brightness or color information** in images, and is usually an aspect of electronic noise. It can be produced by the sensor and circuitry of a scanner or digital camera. Image noise can also originate in film grain and in the unavoidable shot noise of an ideal photon detector. Image noise is an undesirable by-product of image capture that adds spurious and extraneous information.

#### Different type of noise

##### 1 Gaussian noise

Gaussian noise is statistical noise having a **probability density function (PDF)** equal to that of the normal distribution, which is also known as the **Gaussian distribution**. In other words, the values that the noise can take on are Gaussian-distributed (in histogram).
Principal sources of Gaussian noise in digital images arise **during acquisition** e.g. sensor noise caused by poor illumination and/or high temperature, and/or transmission

In digital image processing Gaussian noise can be reduced using a **spatial filter**, though when smoothing an image, an undesirable outcome may result in the blurring of fine-scaled image edges and details because they also correspond to blocked high frequencies. **Conventional spatial filtering techniques** for noise removal include: mean (convolution) filtering, median filtering and Gaussian smoothing.

![512x512-No-Noise](https://i.imgur.com/14HHjSv.jpg)
![512x512-Gaussian-Noise](https://i.imgur.com/tYdtmxk.jpg)
> By Me - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10114819

##### 2 Salt and Pepper

Salt-and-pepper noise is a form of noise sometimes seen on images. It is also known as **impulse noise**. This noise can be caused by sharp and sudden disturbances in the image signal. An image containing salt-and-pepper noise will have **dark pixels** in bright regions and **bright pixels** in dark regions. This type of noise can be caused by analog-to-digital converter errors, bit errors in transmission, etc. It can be mostly eliminated by using dark frame subtraction, median filtering and interpolating around dark/bright pixels (extreme value of pixels in histogram). 

Dead pixels in an LCD monitor produce a similar, but non-random, display.

![Noise_salt_and_pepper](https://i.imgur.com/Hpjn9Il.png)
> By User Markome on en.wikipedia, Public Domain, https://commons.wikimedia.org/w/index.php?curid=1352731

[More noise in Wiki](https://en.wikipedia.org/wiki/Image_noise)

> **Note for each type** : In either case, the noise at different pixels can be either correlated or uncorrelated; in many cases, noise values at different pixels are modeled as being independent and identically distributed, and hence uncorrelated.

#### Noise reduction

Noise reduction is the process of **removing noise** from a signal.
All recording devices, both analog and digital, have traits that make them susceptible to noise. Noise can be random or white noise with no coherence, or coherent noise introduced by the **device's mechanism or processing algorithms**.

Images taken with both digital cameras and conventional film cameras will pick up noise from a variety of sources. Further use of these images will often require that the noise be (partially) removed – for aesthetic purposes as in artistic work or marketing, or for practical purposes such as computer vision.

##### 1 Removal
###### 1.1 Tradeoffs

In selecting a noise reduction algorithm, one must weigh several factors:

+ the available **computer power and time available**: a digital camera must apply noise reduction in a fraction of a second using a tiny onboard CPU, while a desktop computer has much more power and time
+ whether **sacrificing some real detail** is acceptable if it allows more noise to be removed (how aggressively to decide whether variations in the image are noise or not)
+ the **characteristics** of the noise and the detail in the image, to better make those decisions

##### 1.2 Chroma and luminance noise separation

In real-world photographs, the highest spatial-frequency detail consists mostly of variations in **brightness** ("luminance detail") rather than variations in **hue** ("chroma detail"). Since any noise reduction algorithm should attempt to remove noise without sacrificing real detail from the scene photographed, one risks a **greater loss** of detail from luminance noise reduction than chroma noise reduction simply because most scenes have little high frequency chroma detail to begin with.

Most dedicated noise-reduction computer software allows the user to control chroma and luminance noise reduction separately.

##### 1.3 Linear smoothing filters
One method to remove noise is by **convolving** the original image with a **mask** that represents a low-pass filter or smoothing operation.

**{**
**Convolution**

In mathematics (and, in particular, functional analysis) convolution is a mathematical operation on **two functions** (f and g); it **produces a third function**, that is typically viewed as a modified version of one of the original functions, giving the integral of the pointwise multiplication of the two functions as a **function of the amount** that one of the original functions is translated. Convolution is similar to cross-correlation. It has applications that include probability, statistics, computer vision, natural language processing, **image and signal processing**, engineering, and differential equations.

![Convolution_of_box_signal_with_itself2](https://i.imgur.com/Q00Uhfn.gif)
> By Convolution_of_box_signal_with_itself.gif: <NAME>bergderivative work: Tinos (talk) - Convolution_of_box_signal_with_itself.gif, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=11003835

**}**

For example, the **Gaussian mask** comprises elements determined by a Gaussian function. This convolution brings the value of each pixel into closer harmony with the values of its neighbors. In general, a smoothing filter sets each pixel to the **average value**, or a weighted average, of itself and its nearby neighbors; the Gaussian filter is just one possible set of weights.

Smoothing filters tend to **blur** an image, because pixel intensity values that are significantly higher or lower than the surrounding neighborhood would **"smear"**(salir) across the area. Because of this blurring, linear filters are seldom (rarement) used in practice for noise reduction; they are, however, often used as the basis for **nonlinear noise reduction filters**.

##### 1.4 Nonlinear filters

A **median filter** is an example of a non-linear filter and, if properly designed, is very good at preserving image detail. To run a median filter:

+ consider each pixel in the image
+ sort the neighbouring pixels into order based upon their intensities
+ replace the original value of the pixel with the median value from the list

A median filter is a **rank-selection (RS) filter**, a particularly harsh member of the family of rank-conditioned rank-selection (RCRS) filters; a much milder member of that family, for example one that selects the closest of the neighboring values when a pixel's value is external in its neighborhood, and leaves it unchanged otherwise, is sometimes preferred, especially in photographic applications.

Median and other RCRS filters are good at removing salt and pepper noise from an image, and also cause relatively **little blurring of edges**, and hence are often used in computer vision applications.

![Median_filter_example](https://i.imgur.com/vJQtNJi.jpg)
> By Debivort at en.wikipedia, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=17001283

##### 1.5 Anisotropic diffusion

In image processing and computer vision, anisotropic diffusion, also called **Perona–Malik diffusion**, is a technique aiming at reducing image noise without removing significant parts of the image content, typically edges, lines or other details that are important for the interpretation of the image. Anisotropic diffusion resembles the process that creates a **scale space**, where an image generates a parameterized family of successively more and more blurred images based on a diffusion process. Each of the resulting images in this family are given as a **convolution** between the image and a 2D isotropic Gaussian filter, where the width of the filter increases with the parameter. This diffusion process is a **linear and space-invariant** transformation of the original image. Anisotropic diffusion is a generalization of this diffusion process: it produces a **family of parameterized images**, but each resulting image is a combination between the original image and a filter that depends on the local content of the original image. As a consequence, anisotropic diffusion is a **non-linear and space-variant** transformation of the original image
(local mean à trouver sur wiki)
##### 1.6 Non-local means

Non-local means is an algorithm in image processing for image denoising. Unlike "local mean" filters, which take the mean value of a group of pixels surrounding a target pixel to smooth the image, non-local means filtering takes a **mean of all pixels in the image**, weighted by how similar these pixels are to the target pixel. This results in much greater post-filtering clarity, and less loss of detail in the image compared with local mean algorithms.

[Références](https://en.wikipedia.org/wiki/Noise_reduction#In_images)


### Fourier transform

**Common Names:** Fourier Transform, Spectral Analysis, Frequency Analysis

The Fourier Transform is an important image processing tool which is used to **decompose** an image into its **sine and cosine components**. The output of the transformation represents the image in the Fourier or **frequency domain**, while the input image is the **spatial domain** equivalent. In the Fourier domain image, each point represents a particular frequency contained in the spatial domain image.

The Fourier Transform is used in a wide range of applications, such as image analysis, image filtering, image reconstruction and image compression.

[See more](https://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm)

#### Pass-filter
##### 1 High-pass filter

A high-pass filter (HPF) is an **electronic filter** that passes signals with a frequency **higher** than a certain cutoff frequency and attenuates signals with frequencies **lower** than the cutoff frequency. The amount of attenuation for each frequency depends on the filter design. A high-pass filter is usually modeled as a **linear time-invariant system**. It is sometimes called a low-cut filter or bass-cut filter. High-pass filters have many uses, such as blocking DC from circuitry sensitive to non-zero average voltages or radio frequency devices.

##### 2 Low-pass filter

A low-pass filter (LPF) is a filter that passes signals with a frequency **lower** than a certain cutoff frequency and attenuates signals with frequencies **higher** than the cutoff frequency. The exact frequency response of the filter depends on the filter design. The filter is sometimes called a high-cut filter, or treble-cut filter in audio applications. A low-pass filter is the complement of a high-pass filter.

Filter designers will often use the low-pass form as a **prototype filter**. That is, a filter with unity **bandwidth and impedance**. The desired filter is obtained from the prototype by scaling for the desired bandwidth and impedance and transforming into the desired bandform (that is low-pass, high-pass, band-pass or band-stop).

##### 3 Band-pass filter
{'fraction_non_alphanumeric': 0.07169903505557591, 'fraction_numerical': 0.01245877610846464, 'mean_word_length': 4.764654110191867, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 38, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 14, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5607858', 'n_tokens_mistral': 8785, 'n_tokens_neox': 7988, 'n_words': 4530}