Geoscience Reference
In-Depth Information
8.5 nearblack
The utility nearblack converts pixels near the border (collar) of an image, having
a value near to 0 (near black), to 0. Just those pixels at the border that are within some
(spectral) distance will be converted. The threshold for the spectral distance can be
set as an option ( -near ). Only images with a Byte data type are supported. This
utility is discussed here, because it can be useful if you want to mosaic images that
have been digitized from analog photographs. Due to noise, these images contain non
zero values near the borders that ideally should be black. A similar effect occurs for
compressed images. The idea is to reduce noise induced by the digitization process
or compression which would otherwise propagate to the resulting mosaic. By setting
a threshold, these values are forced to one particular value, which can then be ignored
in the mosaic process (as no-data). Unlike other GDAL command line utilities, the
default output format for a new output data set is HFA (a proprietary format from
Erdas imagine). You can obtain a GeoTIFF, however, using -of GTiff . Instead of
black, white pixels (or a different color) can also be selected near the image borders.
Usage: nearblack [-of format] [-white | [-color c1,c2,c3...cn]*]
[-near dist] [-nb non_black_pixels] [-setalpha]
[-setmask] [-o outfile] [-q]
[-co"NAME=VALUE"]* infile
-o outfile
The name of the output file to be created. Newly created files are created with
the HFA driver by default (Erdas Imagine - .img).
-of format
(from GDAL 1.8.0) Select the output format. Use the short format name (GTiff
for GeoTIFF for example).
-co "NAME=VALUE"
(from GDAL 1.8.0) Passes a creation option to the output format driver. Multiple
-co options may be listed. See format specific documentation for legal creation
options for each format. Only valid when creating a new file.
-white
Search for nearly white (255) pixels instead of nearly black pixels.
-color c1,c2,c3...cn
(from GDAL 1.9.0) Search for pixels near the specified color. May be specified
multiple times. When -color is specified, the pixels that are considered as the
collar are set to 0.
-near dist
Select how far from black, white or custom colors the pixel values can be and
still considered near black, white or custom color. Defaults to 15.
-nb non_black_pixels
number of non-black pixels that can be encountered before the giving up search
inwards. Defaults to 2.
 
 
Search WWH ::




Custom Search