Filters (Spatial): Adaptive Noise Reduction and Filters (Spatial): Adaptive Path Smooth: Difference between pages

From MIPAV
(Difference between pages)
Jump to navigation Jump to search
MIPAV>Olgavovk
mNo edit summary
 
MIPAV>Olgavovk
mNo edit summary
 
Line 1: Line 1:
This algorithm reduces noise without blurring the edges by replacing a pixel value with a weighted sum of all local pixels reached by following a path with small pixel intensity values between neighboring pixels.
By replacing a pixel value with a weighted sum of the local pixels on the low-cost path, this algorithm reduces noise without blurring edges. It determines the weighted sum by following the path from the lowest-cost pixel at the edge of a local neighborhood back to the original pixel.


=== Background ===
=== Background ===


The Adaptive Noise Reduction algorithm is a port to Adaptive Noise Removal Filter, a software program. This program first transforms ''RGB'' color space into ''YCrCb'' color space. When the filtering is complete, it then transforms the ''YCrCb'' color space into ''RGB'' color space. Hence, all of the color operations occur in ''YCrCb'' space. However, the program does not transform black-and-white images into another space.
MIPAV uses a modified port of image noise removal software by Karlis Freivalds for this algorithm. Freivalds' program starts by transforming ''RGB'' color space into ''YCrCb'' color space. After filtering is complete, the program then transforms the ''YCrCb'' color space back into ''RGB'' color space. Hence, all of the color operations occur in ''YCrCb'' space.


In "Frequently Asked Questions About Color," Charles Poynton reveals that the ''RGB''-to-''YCrCb'' and ''YCrCb''-to-''RGB'' conversion equations used in Adaptive Noise Removal Filter differ significantly from standard ones. First, the program creates an edge graph or pixel neighbor graph using a weakly median-filtered version of the ''YCrCb'' space. A weakly median-filter version means that median filtering only occurs if the pixel is not on an edge in ''Y'', ''Cr'', or ''Cb'' space. The edge graph is an array of arrays with the first array having a length equal to the number of pixels in the image and the second array having eight edge weights. The eight edge weights are calculated from the intensity differences between the center pixel and one of the eight neighboring pixels:
"Frequently Asked Questions about Color" by Charles Poynton reveals that the ''RGB''-to-''YCrCb'' and ''YCrCb''-to-''RGB'' conversion equations used in Freivalds' program differ significantly from the standard ones. Grayscale images are not transformed into another space.
 
In the original program as ported in the Adaptive Noise Reduction algorithm, the weighted sum was applied to all pixels in the ([[Image:FiltersSpatialAdaptivePathSmooth4.jpg]]) by ([[Image:FiltersSpatialAdaptivePathSmooth5.jpg]]) local square where ''range'' = (int)(radius 0.999). The program finds the lowest-cost pixel at the edge of the ([[Image:FiltersSpatialAdaptivePathSmooth6.jpg]]) by ([[Image:FiltersSpatialAdaptivePathSmooth7.jpg]]) local neighborhood. That pixel and the pixels along the low-cost path back to the original center pixel are the only pixels used in the weighted sum.
 
First, the program creates an edge graph or pixel neighbor graph. The 2D ''edge graph'' is an array of arrays with the first array having a length equal to the number of pixels in the image and the second array having eight edge weights. The eight edge weights are calculated from the intensity differences between the center pixel and one of the eight neighboring pixels.
 
In 2D and 2.5D images, the edge graph encompasses the entire image. In 3D with 26 nearest neighbors, an edge graph of size
 
<math>
(2xrange+1)x(2xrange+1)x(2xrange+1)x26
</math>
 
is separately created for every voxel in the image to conserve memory.
 
For color images:


<math>
<math>
E =\sqrt{((dYwY)^2 + (dRwR)^2 + (dBwB)^2)}
E =\sqrt{((dYwY)^2 + (dRwR)^2 + (dBwB)^2)}
</math>
</math>
**converting color;<br />


where ''E'' is the edge weight; ''dY'', ''dR'', and ''dB'' are the ''Y'', ''Cr'', and ''Cb'' differences; and ''wY'', ''wR'', and ''wB'' are the ''Y'', ''Cr'', and ''Cb'' weights derived from the ''Y'', ''Cr'', and ''Cb'' radiuses. A bigger relative radius results in a smaller weight for radiuses &gt;= 0.1, which is typically the case.
where
 
;; ''EW'' = edge weight
;; ''dY, dR,'' and ''dB'' = ''Y, Cr,'' and ''Cb'' differences
;; ''wY, wR,'' and ''wB'' = ''Y, Cr,'' and ''Cb'' weights derived from the ''Y, Cr,'' and ''Cb'' radiuses
 
A bigger relative radius results in a smaller weight for radiuses &gt;= 0.1, which should typically be the case. For grayscale images, edge weights are simply the absolute values of the differences between two pixels.


After the edge graph is created, the program filters the ''Y'', ''Cr,'' and ''Cb'' spaces separately. It uses the selected pixel as the center of a square with ''L'' = 2''R'' 1 where ''L'' = sides of length, ''R'' = range, and range = (int)(radius 0.999).
After the edge graph is created, the ''Y, Cr,'' and ''Cb'' spaces are separately filtered. The filter uses the selected pixel as the center of a square with sides of [[Image:FiltersSpatialAdaptivePathSmooth10.jpg]].


The ''enhancePixel ''function returns the filtered pixel value at every pixel in the image. If neighboring pixels are connected to the center pixel via a low-cost path, queue elements corresponding to these neighboring pixels are added to the priority queue. If no queue element is retrieved from the queue, then the original pixel value is passed unchanged. If elements are retrieved from the queue, then those ''Y, Cr,'' or ''Cb'' pixel values that retrieved queue elements are put into a weighted sum. The weight is derived from an index into the filter array given by the queue element key times the invFilterLen. The filter array is generated with a Gaussian function.
The function ''enhancePixel'' returns the filtered pixel value at every pixel in the image. If neighboring pixels are connected to the center pixel via a low-cost path, queue elements corresponding to these neighboring pixels are added to the priority queue. If no queue element is retrieved from the queue, then the original pixel value is passed unchanged. If elements are retrieved from the queue, then those ''Y, Cr,'' or ''Cb'' pixel values that retrieved queue elements in the path from the low-cost edge pixel to the center pixel are put into a weighted sum. The weight, derived from the distMap array, is simply the Gaussian function of the distance from the center pixel.


Each queue element has a value, a baseKey, and a key. The ''value'' gives the location within the local [[Image:FiltersSpatialAdaptiveNoiseReduction8.jpg]] local square where ''R'' = range. The ''baseKey'' has a sum of the edgeGraph values over the low-cost path from the center pixel to the selected pixel, and ''key'' is equal to the sum of baseKey and the distMap value for the selected pixel. The distMap value at a given position inside the local square is equal to the edge preservation strength times the distance from the center pixel. A key is only added to the queue if key &lt; maxDistance:''''
Each queue element has a value, a key, and an origin as indicated in the following:


<math>
* ''value'' = the location within the local ([[Image:FiltersSpatialAdaptivePathSmooth11.jpg]])*([[Image:FiltersSpatialAdaptivePathSmooth12.jpg]]) local square
M = (int)(Rd(S+512))
* ''key'' = sum of the edge graph values on the low-cost path from the center pixel to the selected pixel
</math>
* ''origin'' = the value of the queue element that provides the neighboring pixel on the low-cost path back to the center pixel with the ''center pixel origin'' = -1


where ''M'' = maxDistance, ''Rd'' = radius, and ''S'' = edge preservation strength.
A key is only added to the queue if an edge weight is less than threshold.


The priority queue is implemented as a binary heap and the binary heap is implemented as an array. A binary heap is a nearly full binary tree (only the bottom level may not be complete). This binary heap has the property that for every node other than a leaf, its key value is less than or equal to that of its children. In a binary heap the item of highest priority is always at the root of the tree or at node 0. When the highest priority item at the root is removed, the item of highest priority among the remainder moves into the root position. The children of node ''i'' are at [[Image:FiltersSpatialAdaptiveNoiseReduction10.jpg]] and [[Image:FiltersSpatialAdaptiveNoiseReduction11.jpg]]. The parent of node ''i'' is at <math>
The priority queue is implemented as a binary heap and the binary heap is implemented as an array. A binary heap is a "nearly full" binary tree (only the bottom level may not be complete). This binary heap has the property that, for every node other than a leaf, its key value is less than or equal to that of its children. In a binary heap, the item of highest priority is always at the root of the tree or at node 0. When the highest priority item at the root is removed, the item of highest priority among the remainder moves into the root position. The children of node ''i'' are at [[Image:FiltersSpatialAdaptivePathSmooth13.jpg]] and [[Image:FiltersSpatialAdaptivePathSmooth14.jpg]]. The parent of node ''i'' is at <math>
(int) \left ( \frac {i-1}{2} \right )
(int) \left ( \frac {i-1}{2} \right )
</math>.
</math>.


The filter radius can be separately adjusted for each ''Y, Cr,'' and ''Cb'' channel for color images. For black-and-white images only, the ''Y'' filter radius can be adjusted. A larger radius removes more noise but loses more detail.


<div>


{| border="1" cellpadding="5"
{| border="1" cellpadding="5"
|+ <div>'''Figure 1. Adaptive Noise Reduction processing''' </div>
|+ <div>'''Figure 1. Example of adaptive path smooth processing''' </div>
|-
|-
|
|
<div><div><center>[[Image:exampleAdaptiveNoiseReduction.jpg]]</center></div> </div>
<div><div><center>[[Image:exampleAdaptivePathSmooth.jpg]]</center></div> </div>
|}
|}


</div>


The edge preservation strength can be adjusted. Larger values preserve more edges but sacrifice smoothness in low-contrast areas. Very large values may cause banding.
On the Adaptive Path Smooth dialog box for color images, you can separately adjust the filter radius for each ''Y, Cr,'' and ''Cb'' channel for color images. On the Adaptive Path Smooth dialog box for grayscale images, you can only adjust a single radius.
 
{| width="90%" border="1" frame="hsides" frame="hsides"
|-
| width="9%" valign="top" |
[[Image:tipicon.gif]]
| width="81%" bgcolor="#B0E0E6" | '''Tip:''' A larger radius removes more noise from the image but also loses more detail from the image.
|}


To speed the filtering on color images, you can select the Filter ''Cr'' and ''C''b at halv''e''d dimensions check box. When run, the algorithm shrinks the Cr and'' Cb'' spaces by a factor of 2, generates an edge table for the shrunken space, filters the image, and then expands the filtered ''Cr'' and ''Cb'' spaces to their original dimensions. Although the algorithm runs faster, it also loses some details.
<br />


The New image option causes MIPAV to place the resulting image in a new image window. The Replace image option causes MIPAV to place the changed image in the same window.
You can also adjust the threshold for both color and grayscale images. Again, larger values preserve more edges but sacrifice smoothness in low-contrast areas. In addition, banding may appear for very large values.


==== Image types ====
For color images only, there is an option to filter ''Cr'' and ''Cb'' at halved dimensions. If this option is selected, the ''Cr'' and ''Cb'' spaces are shrunk by a factor of 2, an edge table is generated for the shrunken space, the filtering is performed, and the filtered ''Cr'' and ''Cb'' spaces are expanded back up to their original dimensions. The algorithm runs faster, but the image loses detail.


On both dialog boxes, if you choose New image, MIPAV then places the resulting image in a new image window. Selecting the Replace image option causes MIPAV to place the changed image in the same window.


==== Image types ====


You can apply this algorithm to both color and black-and-white 2D images.
You can apply this algorithm to both color and grayscale 2D and 3D images.


==== Special notes ====
==== Special notes ====
Line 59: Line 84:
None.
None.


==== References ====
==== Reference ====
 
Refer to the following references for more information:


Karlis Freivalds, "Adaptive Noise Removal Filter," a software program, University of Latvia, Institute of Mathematics and Computer Science, at http://www.gradetools.com/karlisf.
Refer to the following references for more information about this algorithm:


Charles Poynton, "Frequently Asked Questions About Color," at http://www.poynton.com.
Image noise removal filter software by Karlis Freivalds at <u>http://www.gradetools.com/karlisf</u>


=== Applying the Adaptive Noise Reduction algorithm ===
Frequently Asked Questions About Color by Charles Poynton at <u>http://www.poynton.com/colorFAQ.html</u>.


=== Applying the Adaptive Path Smooth algorithm ===


To run this algorithm, complete the following steps:
To run this algorithm, complete the following steps:


# Open an image.
# Open an image.
# Perform, as an option, any image processing, such as improving the contrast, on the image.
# Select Algorithms &gt; Filter(spatial) &gt; Adaptive path smooth.
# Select Algorithms &gt; Filters (spatial) &gt; Adaptive noise reduction. The Adaptive Noise Reduction dialog box opens.
 
Depending on whether the image is grayscale or color, the Adaptive Path Smooth dialog box for grayscale images (Figure 2) or the Adaptive Path Smooth dialog box for color images opens. If the image is 3D, a check box to process each slice independently appears (Figure 3).
 
# Complete the information in the dialog box.
# Complete the information in the dialog box.
# Click OK. The algorithm begins to run.
# Click OK.


; A pop-up window appears with the status. A series of status messages appear in the window.
; The algorithm begins to run, and a progress bar appears with the status. When the algorithm finishes running, the progress bar disappears, and the results appear either in a new window or they replace the original source image.
; When the algorithm finishes running, the pop-up window closes.
; Depending on whether you selected New image or Replace image, the results appear in a new window or replace the image to which the algorithm was applied.


<div>
<div>


{| border="1" cellpadding="5"
{| border="1" cellpadding="5"
|+ <div>'''Figure 2. Adaptive Noise Reduction dialog box''' </div>
|+ <div>'''Figure 2. Adaptive Path Smooth dialog box for grayscale images''' </div>
|-
|
<div>'''Radius''' </div>
|
<div>The local square used is approximately (2 x ''Radius'' 1) times (2 x ''Radius'' 1) in size. As the radius increases the algorithm removes more noise but loses more details from the image.  </div><div>The default value is 2.0.  </div>
| rowspan="2" colspan="1" |
<div><div><center>[[Image:dialogboxAdaptivePathSmooth.jpg]]</center></div> </div><div> </div>
|-
|
<div>'''Threshold''' </div>
|
<div>Larger values preserve more edges but sacrifice smoothness in low-contrast areas. For very large values, banding may appear.  </div><div>The default value is 0.1 x (image maximum - image minimum). </div>
|-
|
<div>'''Include neighbors of low cost path''' </div>
| rowspan="1" colspan="2" |
<div>Adds nearest neighbors of path pixels to the queue if they differ from the path pixels by less than threshold. However, the nearest neighbor weight is only half that of a path pixel. The default value is ''not'' selected. </div>
|-
|
<div>'''Process each slice independently''' </div>
| rowspan="1" colspan="2" |
<div>Filters each slice of the dataset independently of adjacent slices. The default value is ''not'' selected. (This check box only appears for 3D images.) </div>
|-
|
<div>'''New image''' </div>
| rowspan="1" colspan="2" |
<div>Shows the results of the algorithm in a new image window (default choice). </div>
|-
|
<div>'''Replace image''' </div>
| rowspan="1" colspan="2" |
<div>Replaces the current active image with the new image produced by the algorithm. </div>
|-
|
<div>'''OK''' </div>
| rowspan="1" colspan="2" |
<div>Applies the algorithm according to the specifications in this dialog box. </div>
|-
|
<div>'''Cancel''' </div>
| rowspan="1" colspan="2" |
<div>Disregards any changes that you made in this dialog box and closes this dialog box. </div>
|-
|
<div>'''Help''' </div>
| rowspan="1" colspan="2" |
<div>Displays online help for this dialog box. </div>
|}
 
{| border="1" cellpadding="5"
|+ <div>'''Figure 3. Adaptive Path Smooth dialog box for 3D color images''' </div>
|-
|-
|
|
<div>'''Y radius''' </div>
<div>'''Y radius''' </div>
|
|
<div>Specifies the local square used for ''Y'' space filtering, which is approximately [[Image:FiltersSpatialAdaptiveNoiseReductionlz.jpg]]in size. </div><div>As the radius increases, the algorithm removes more noise, but loses more detail. The default value is 2.0. </div>
<div>The local square used for ''Y'' space is approximately (2 x ''YRadius'' 1) times (2 x ''YRadius'' 1) in size. As the radius increases the algorithm removes more noise but loses more details from the image. The default value is 2.0. </div>
| rowspan="2" colspan="1" |
| rowspan="3" colspan="1" |
<div><div><center>[[Image:dialogboxAdaptiveNoiseReduction.jpg]]</center></div> </div><div> </div>
<div><div><center>[[Image:dialogboxAdaptivePathSmooth3D.jpg]]</center></div> </div><div> </div>
|-
|-
|
|
<div>'''Cr radius''' </div>
<div>'''Cr radius''' </div>
|
|
<div>Specifies the local square used for ''Cr ''space filtering (only available for color), which is approximately <div align="left">[[Image:FiltersSpatialAdaptiveNoiseReduction3.jpg]]</div> in size. </div><div>As the radius increases, the algorithm removes more noise, but loses more detail. The default value is 4.0. </div>
<div>The local square used for ''Cr'' space filtering is approximately (2 x ''CrR'' 1) x (2 x ''CrR'' 1) in size. As the radius increases, the algorithm removes more noise but loses more details from the image. The default value is 4.0. </div>
|-
|-
|
|
<div>'''Cb radius''' </div>
<div>'''Cb radius''' </div>
|
<div>The local square used for ''Cb'' space filtering is approximately (2 x ''CbR'' 1) x (2 x ''CbR'' 1) in size. As the radius increases, the algorithm removes more noise but loses more detail from the image. The default value is 5.0. </div>
|-
|
<div>'''Threshold''' </div>
| rowspan="1" colspan="2" |
| rowspan="1" colspan="2" |
<div>Specifies the local square used for ''Cb'' space filtering, which is approximately [[Image:FiltersSpatialAdaptiveNoiseReduction4.jpg]]in size. As the radius increases, the algorithm removes more noise but loses more detail. The default value is 5.0. </div>
<div>Larger values preserve more edges but sacrifice smoothness in low-contrast areas. For very large values, banding may appear. The default value is 0.1 x (max (red max, green max, blue max) - min(red min, green min, blue min)). </div>
|-
|-
|
|
<div>'''Edge preservation strength''' </div>
<div>'''Include neighbors of low cost path''' </div>
| rowspan="1" colspan="2" |
| rowspan="1" colspan="2" |
<div>Specifies a value for preserving edges. Larger values preserve more edges but sacrifice smoothness in low-contrast areas. Very large values may cause banding. </div><div>For color images, the default value is 3072.0. For black-and-white images, the default value is [[Image:FiltersSpatialAdaptiveNoiseReduction5.jpg]] where ''IMx'' is image maximum and ''IMn'' is image minimum. </div>
<div>Adds nearest neighbors of path pixels to the queue if they differ from the path pixels by less than threshold. However, the nearest neighbor weight is only half that of a path pixel. The default value is ''not'' selected. </div>
|-
|-
|
|
<div>'''Filter Cr and Cb at halved dimensions''' </div>
<div>'''Filter Cr and Cb at halved dimensions''' </div>
| rowspan="1" colspan="2" |
| rowspan="1" colspan="2" |
<div>Causes the algorithm to run faster but with some loss of detail. For color images, the default value is enabled; for other images, the default value is disabled. </div>
<div>When this option is selected, the algorithm runs faster but loses some detail. The default value is ''not'' selected.  </div>
|-
|
<div>'''Process each slide independently''' </div>
| rowspan="1" colspan="2" |
<div>Filters each slice of the dataset independently of adjacent slices. The default value is ''not'' selected. (This check box only appears for 3D images.) </div>
|-
|-
|
|
<div>'''New image''' </div>
<div>'''New image''' </div>
| rowspan="1" colspan="2" |
| rowspan="1" colspan="2" |
<div>Shows the results of the algorithm in a new image window. </div>
<div>Shows the results of the algorithm in a new image window (default choice). </div>
|-
|-
|
|
<div>'''Replace image''' </div>
<div>'''Replace image''' </div>
| rowspan="1" colspan="2" |
| rowspan="1" colspan="2" |
<div>Replaces the original source image with the results of the algorithm. </div>
<div>Replaces the current active image with the new image produced by the algorithm. </div>
|-
|-
|
|
Line 130: Line 215:
|-
|-
|
|
<div>'''Cancel ''' </div>
<div>'''Cancel''' </div>
| rowspan="1" colspan="2" |
| rowspan="1" colspan="2" |
<div>Disregards any changes you made in this dialog box and closes the dialog box. </div>
<div>Disregards any changes that you made in this dialog box and closes this dialog box. </div>
|-
|-
|
|

Revision as of 18:15, 18 May 2012

By replacing a pixel value with a weighted sum of the local pixels on the low-cost path, this algorithm reduces noise without blurring edges. It determines the weighted sum by following the path from the lowest-cost pixel at the edge of a local neighborhood back to the original pixel.

Background

MIPAV uses a modified port of image noise removal software by Karlis Freivalds for this algorithm. Freivalds' program starts by transforming RGB color space into YCrCb color space. After filtering is complete, the program then transforms the YCrCb color space back into RGB color space. Hence, all of the color operations occur in YCrCb space.

"Frequently Asked Questions about Color" by Charles Poynton reveals that the RGB-to-YCrCb and YCrCb-to-RGB conversion equations used in Freivalds' program differ significantly from the standard ones. Grayscale images are not transformed into another space.

In the original program as ported in the Adaptive Noise Reduction algorithm, the weighted sum was applied to all pixels in the (FiltersSpatialAdaptivePathSmooth4.jpg) by (FiltersSpatialAdaptivePathSmooth5.jpg) local square where range = (int)(radius 0.999). The program finds the lowest-cost pixel at the edge of the (FiltersSpatialAdaptivePathSmooth6.jpg) by (FiltersSpatialAdaptivePathSmooth7.jpg) local neighborhood. That pixel and the pixels along the low-cost path back to the original center pixel are the only pixels used in the weighted sum.

First, the program creates an edge graph or pixel neighbor graph. The 2D edge graph is an array of arrays with the first array having a length equal to the number of pixels in the image and the second array having eight edge weights. The eight edge weights are calculated from the intensity differences between the center pixel and one of the eight neighboring pixels.

In 2D and 2.5D images, the edge graph encompasses the entire image. In 3D with 26 nearest neighbors, an edge graph of size

is separately created for every voxel in the image to conserve memory.

For color images:

where

EW = edge weight
dY, dR, and dB = Y, Cr, and Cb differences
wY, wR, and wB = Y, Cr, and Cb weights derived from the Y, Cr, and Cb radiuses

A bigger relative radius results in a smaller weight for radiuses >= 0.1, which should typically be the case. For grayscale images, edge weights are simply the absolute values of the differences between two pixels.

After the edge graph is created, the Y, Cr, and Cb spaces are separately filtered. The filter uses the selected pixel as the center of a square with sides of FiltersSpatialAdaptivePathSmooth10.jpg.

The function enhancePixel returns the filtered pixel value at every pixel in the image. If neighboring pixels are connected to the center pixel via a low-cost path, queue elements corresponding to these neighboring pixels are added to the priority queue. If no queue element is retrieved from the queue, then the original pixel value is passed unchanged. If elements are retrieved from the queue, then those Y, Cr, or Cb pixel values that retrieved queue elements in the path from the low-cost edge pixel to the center pixel are put into a weighted sum. The weight, derived from the distMap array, is simply the Gaussian function of the distance from the center pixel.

Each queue element has a value, a key, and an origin as indicated in the following:

  • value = the location within the local (FiltersSpatialAdaptivePathSmooth11.jpg)*(FiltersSpatialAdaptivePathSmooth12.jpg) local square
  • key = sum of the edge graph values on the low-cost path from the center pixel to the selected pixel
  • origin = the value of the queue element that provides the neighboring pixel on the low-cost path back to the center pixel with the center pixel origin = -1

A key is only added to the queue if an edge weight is less than threshold.

The priority queue is implemented as a binary heap and the binary heap is implemented as an array. A binary heap is a "nearly full" binary tree (only the bottom level may not be complete). This binary heap has the property that, for every node other than a leaf, its key value is less than or equal to that of its children. In a binary heap, the item of highest priority is always at the root of the tree or at node 0. When the highest priority item at the root is removed, the item of highest priority among the remainder moves into the root position. The children of node i are at FiltersSpatialAdaptivePathSmooth13.jpg and FiltersSpatialAdaptivePathSmooth14.jpg. The parent of node i is at .


Figure 1. Example of adaptive path smooth processing
ExampleAdaptivePathSmooth.jpg


On the Adaptive Path Smooth dialog box for color images, you can separately adjust the filter radius for each Y, Cr, and Cb channel for color images. On the Adaptive Path Smooth dialog box for grayscale images, you can only adjust a single radius.

Tipicon.gif

Tip: A larger radius removes more noise from the image but also loses more detail from the image.


You can also adjust the threshold for both color and grayscale images. Again, larger values preserve more edges but sacrifice smoothness in low-contrast areas. In addition, banding may appear for very large values.

For color images only, there is an option to filter Cr and Cb at halved dimensions. If this option is selected, the Cr and Cb spaces are shrunk by a factor of 2, an edge table is generated for the shrunken space, the filtering is performed, and the filtered Cr and Cb spaces are expanded back up to their original dimensions. The algorithm runs faster, but the image loses detail.

On both dialog boxes, if you choose New image, MIPAV then places the resulting image in a new image window. Selecting the Replace image option causes MIPAV to place the changed image in the same window.

Image types

You can apply this algorithm to both color and grayscale 2D and 3D images.

Special notes

None.

Reference

Refer to the following references for more information about this algorithm:

Image noise removal filter software by Karlis Freivalds at http://www.gradetools.com/karlisf

Frequently Asked Questions About Color by Charles Poynton at http://www.poynton.com/colorFAQ.html.

Applying the Adaptive Path Smooth algorithm

To run this algorithm, complete the following steps:

  1. Open an image.
  2. Select Algorithms > Filter(spatial) > Adaptive path smooth.

Depending on whether the image is grayscale or color, the Adaptive Path Smooth dialog box for grayscale images (Figure 2) or the Adaptive Path Smooth dialog box for color images opens. If the image is 3D, a check box to process each slice independently appears (Figure 3).

  1. Complete the information in the dialog box.
  2. Click OK.
The algorithm begins to run, and a progress bar appears with the status. When the algorithm finishes running, the progress bar disappears, and the results appear either in a new window or they replace the original source image.
Figure 2. Adaptive Path Smooth dialog box for grayscale images
Radius
The local square used is approximately (2 x Radius 1) times (2 x Radius 1) in size. As the radius increases the algorithm removes more noise but loses more details from the image.
The default value is 2.0.
DialogboxAdaptivePathSmooth.jpg
Threshold
Larger values preserve more edges but sacrifice smoothness in low-contrast areas. For very large values, banding may appear.
The default value is 0.1 x (image maximum - image minimum).
Include neighbors of low cost path
Adds nearest neighbors of path pixels to the queue if they differ from the path pixels by less than threshold. However, the nearest neighbor weight is only half that of a path pixel. The default value is not selected.
Process each slice independently
Filters each slice of the dataset independently of adjacent slices. The default value is not selected. (This check box only appears for 3D images.)
New image
Shows the results of the algorithm in a new image window (default choice).
Replace image
Replaces the current active image with the new image produced by the algorithm.
OK
Applies the algorithm according to the specifications in this dialog box.
Cancel
Disregards any changes that you made in this dialog box and closes this dialog box.
Help
Displays online help for this dialog box.
Figure 3. Adaptive Path Smooth dialog box for 3D color images
Y radius
The local square used for Y space is approximately (2 x YRadius 1) times (2 x YRadius 1) in size. As the radius increases the algorithm removes more noise but loses more details from the image. The default value is 2.0.
DialogboxAdaptivePathSmooth3D.jpg
Cr radius
The local square used for Cr space filtering is approximately (2 x CrR 1) x (2 x CrR 1) in size. As the radius increases, the algorithm removes more noise but loses more details from the image. The default value is 4.0.
Cb radius
The local square used for Cb space filtering is approximately (2 x CbR 1) x (2 x CbR 1) in size. As the radius increases, the algorithm removes more noise but loses more detail from the image. The default value is 5.0.
Threshold
Larger values preserve more edges but sacrifice smoothness in low-contrast areas. For very large values, banding may appear. The default value is 0.1 x (max (red max, green max, blue max) - min(red min, green min, blue min)).
Include neighbors of low cost path
Adds nearest neighbors of path pixels to the queue if they differ from the path pixels by less than threshold. However, the nearest neighbor weight is only half that of a path pixel. The default value is not selected.
Filter Cr and Cb at halved dimensions
When this option is selected, the algorithm runs faster but loses some detail. The default value is not selected.
Process each slide independently
Filters each slice of the dataset independently of adjacent slices. The default value is not selected. (This check box only appears for 3D images.)
New image
Shows the results of the algorithm in a new image window (default choice).
Replace image
Replaces the current active image with the new image produced by the algorithm.
OK
Applies the algorithm according to the specifications in this dialog box.
Cancel
Disregards any changes that you made in this dialog box and closes this dialog box.
Help
Displays online help for this dialog box.