1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>6.5. NL Filter</title>
<link rel="stylesheet" href="gimp-help-plain.css" type="text/css" />
<link rel="stylesheet" href="gimp-help-screen.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1" />
<link rel="start" href="index.html" title=" " />
<link rel="up" href="ch06s06.html" title="6. Enhance filters" />
<link rel="prev" href="ch06s06s04.html" title="6.4. Destripe" />
<link rel="next" href="ch06s06s06.html" title="6.6. Sharpen" />
</head>
<body>
<div xmlns="" class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center" id="chaptername">6.5. NL Filter</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="ch06s06s04.html">Prev</a> </td>
<th width="60%" align="center" id="sectionname">6.5. NL Filter</th>
<td width="20%" align="right"> <a accesskey="n" href="ch06s06s06.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="sect2" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="plug-in-nlfilt"></a>6.5. NL Filter</h3>
</div>
</div>
</div>
<a id="id3362708" class="indexterm"></a>
<div class="mediaobject">
<img src="../images/filters/filters-enhance-nlfilter.png" />
</div>
<div class="simplesect" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a id="id3362166"></a>Overview</h4>
</div>
</div>
</div>
<p>
This filter is found in
<span class="guimenu">Filters</span>-><span class="guisubmenu">Enhance</span>-><span class="guimenuitem"><span class="accel">N</span>L Filter</span>.
NL means "Non Linear". Derived
from the Unix <span><b class="command">pnmnlfilt</b></span> program, it joins
smoothing, despeckle and sharpen enhancement functions. It works
on the whole image, not on the selection.
</p>
<p>
This is something of a swiss army knife filter. It has 3 distinct
operating modes. In all of the modes each pixel in the image is
examined and processed according to it and its surrounding pixels
values. Rather than using the 9 pixels in a 3x3 block, 7 hexagonal
area samples are taken, the size of the hexagons being controlled
by the radius parameter. A radius value of 0.3333 means that the 7
hexagons exactly fit into the center pixel (ie. there will be no
filtering effect). A radius value of 1.0 means that the 7 hexagons
exactly fit a 3x3 pixel array.
</p>
</div>
<div class="simplesect" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a id="id3363001"></a>Options</h4>
</div>
</div>
</div>
<div class="variablelist">
<dl>
<dt>
<span class="term">Preview</span>
</dt>
<dd>
<p>
When <span class="guilabel">Do preview</span> is checked, parameter
setting results are interactively displayed in preview.
</p>
</dd>
<dt>
<span class="term">Parameter settings</span>
</dt>
<dd>
<p>
</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>
<span class="guilabel">Alpha</span>: Meaning of this value
depends on the selected option.
</p>
</li>
<li>
<p>
<span class="guilabel">Radius</span>:
Controls the strength of the filter (0.33-1.00).
</p>
</li>
</ul>
</div>
<p>
</p>
</dd>
</dl>
</div>
</div>
<div class="simplesect" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a id="id3362806"></a>Operating Modes</h4>
</div>
</div>
</div>
<p>
This filter can perform several distinct functions, depending on
the value of the parameter <i class="parameter"><tt>alpha</tt></i>.
</p>
<div class="variablelist">
<dl>
<dt>
<span class="term">Alpha trimmed mean filter. (0.0 <=
<i class="parameter"><tt>alpha</tt></i> <= 0.5)</span>
</dt>
<dd>
<p>
The value of the center pixel will be replaced by the mean of
the 7 hexagon values, but the 7 values are sorted by size and
the top and bottom <i class="parameter"><tt>alpha</tt></i> portion of the 7
are excluded from the mean. This implies that an
<i class="parameter"><tt>alpha</tt></i> value of 0.0 gives the same sort of
output as a normal convolution (ie. averaging or smoothing
filter), where <i class="parameter"><tt>radius</tt></i> will determine the
"strength" of the filter. A good value to start from for subtle
filtering is <i class="parameter"><tt>alpha</tt></i> = 0.0,
<i class="parameter"><tt>radius</tt></i> = 0.55. For a more blatant
effect, try <i class="parameter"><tt>alpha</tt></i> 0.0 and
<i class="parameter"><tt>radius</tt></i> 1.0.
</p>
<p>
An <i class="parameter"><tt>alpha</tt></i> value of 0.5 will cause the
median value of the 7 hexagons to be used to replace the center
pixel value. This sort of filter is good for eliminating "pop"
or single pixel noise from an image without spreading the noise
out or smudging features on the image. Judicious use of the
<i class="parameter"><tt>radius</tt></i> parameter will fine tune the
filtering. Intermediate values of <i class="parameter"><tt>alpha</tt></i>
give effects somewhere between smoothing and "pop" noise
reduction. For subtle filtering try starting with values of
<i class="parameter"><tt>alpha</tt></i> = 0.4,
<i class="parameter"><tt>radius</tt></i> = 0.6. For a more blatant effect
try <i class="parameter"><tt>alpha</tt></i> = 0.5,
<i class="parameter"><tt>radius</tt></i> = 1.0 .
</p>
</dd>
<dt>
<span class="term">Optimal estimation smoothing. (1.0 <=
<i class="parameter"><tt>alpha</tt></i> <= 2.0)</span>
</dt>
<dd>
<p>
This type of filter applies a smoothing filter adaptively over
the image. For each pixel the variance of the surrounding
hexagon values is calculated, and the amount of smoothing is
made inversely proportional to it. The idea is that if the
variance is small then it is due to noise in the image, while if
the variance is large, it is because of "wanted" image features.
As usual the <i class="parameter"><tt>radius</tt></i> parameter controls
the effective radius, but it probably advisable to leave the
radius between 0.8 and 1.0 for the variance calculation to be
meaningful. The <i class="parameter"><tt>alpha</tt></i> parameter sets the
noise threshold, over which less smoothing will be done. This
means that small values of <i class="parameter"><tt>alpha</tt></i> will
give the most subtle filtering effect, while large values will
tend to smooth all parts of the image. You could start with
values like
<tt class="code">
<i class="parameter"><tt>alpha</tt></i> = 1.2
</tt>,
<tt class="code">
<i class="parameter"><tt>radius</tt></i> = 1.0
</tt>,
and try increasing or decreasing the
<i class="parameter"><tt>alpha</tt></i> parameter to get the desired
effect. This type of filter is best for filtering out dithering
noise in both bitmap and color images.
</p>
</dd>
<dt>
<span class="term">Edge enhancement. (-0.1 >= <i class="parameter"><tt>alpha</tt></i> >=
-0.9)</span>
</dt>
<dd>
<p>
This is the opposite type of filter to the smoothing filter. It
enhances edges. The <i class="parameter"><tt>alpha</tt></i> parameter
controls the amount of edge enhancement, from subtle (-0.1) to
blatant (-0.9). The <i class="parameter"><tt>radius</tt></i> parameter
controls the effective radius as usual, but useful values are
between 0.5 and 0.9. Try starting with values of
<tt class="code">
<i class="parameter"><tt>alpha</tt></i> = 0.3
</tt>,
<tt class="code">
<i class="parameter"><tt>radius</tt></i> = 0.8
</tt>.
</p>
</dd>
<dt>
<span class="term">Combination use</span>
</dt>
<dd>
<p>
The various operating modes can be used one after the other to
get the desired result. For instance to turn a monochrome
dithered image into grayscale image you could try one or two
passes of the smoothing filter, followed by a pass of the
optimal estimation filter, then some subtle edge enhancement.
Note that using edge enhancement is only likely to be useful
after one of the non-linear filters (alpha trimmed mean or
optimal estimation filter), as edge enhancement is the direct
opposite of smoothing.
</p>
<p>
For reducing color quantization noise in images (ie. turning
.gif files back into 24 bit files) you could try a pass of the
optimal estimation filter (<i class="parameter"><tt>alpha</tt></i> 1.2,
<i class="parameter"><tt>radius</tt></i> 1.0), a pass of the median filter
(<i class="parameter"><tt>alpha</tt></i> 0.5, <i class="parameter"><tt>radius</tt></i>
0.55), and possibly a pass of the edge enhancement filter.
Several passes of the optimal estimation filter with declining
<i class="parameter"><tt>alpha</tt></i> values are more effective than a
single pass with a large <i class="parameter"><tt>alpha</tt></i> value. As
usual, there is a tradeoff between filtering effectiveness and
losing detail. Experimentation is encouraged.
</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="ch06s06s04.html">Prev</a> </td>
<td width="20%" align="center">
<a accesskey="u" href="ch06s06.html">Up</a>
</td>
<td width="40%" align="right"> <a accesskey="n" href="ch06s06s06.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">6.4. Destripe </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> 6.6. Sharpen</td>
</tr>
</table>
</div>
</body>
</html>
|