From fabc39e7f3bf78fbbc4e2923a0b9e53a829a9a26 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 19 Jul 2020 22:02:52 +0000 Subject: miscellaneous update git-svn-id: http://svn.code.sf.net/p/netpbm/code/userguide@3897 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- pnmhisteq.html | 148 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 76 insertions(+), 72 deletions(-) (limited to 'pnmhisteq.html') diff --git a/pnmhisteq.html b/pnmhisteq.html index 463f81b0..2cd96a31 100644 --- a/pnmhisteq.html +++ b/pnmhisteq.html @@ -1,38 +1,38 @@ - -Pnmhisteq User Manual - -

pnmhisteq

+ +Pnmhisteq User Manual + +

pnmhisteq

Updated: 22 March 2015 -
-Table Of Contents +
+Table Of Contents -

NAME

+

NAME

pnmhisteq - histogram equalize a PNM image -

SYNOPSIS

+

SYNOPSIS

-pnmhisteq +pnmhisteq -[-gray] +[-gray] -[-noblack] -[-nowhite] +[-noblack] +[-nowhite] -[-rmap pgmfile] +[-rmap pgmfile] -[-wmap pgmfile] +[-wmap pgmfile] -[-verbose] +[-verbose] -[pnmfile] +[pnmfile] -

DESCRIPTION

+

DESCRIPTION

This program is part of Netpbm. -

pnmhisteq increases the contrast of a PGM or PPM image +

pnmhisteq increases the contrast of a PGM or PPM image through the technique of "histogram equalization."[1]

pnmhisteq computes a histogram of the luminosity of the @@ -45,10 +45,10 @@ The effect of this is that the image has equal numbers of pixels at each possible intensity level, which means it uses the available levels of intensity more efficiently and thereby has more visible detail. -

Mathematically, the luminosity mapping is this: Assume the pixels +

Mathematically, the luminosity mapping is this: Assume the pixels are sorted by luminosity into B buckets numbered from 0 (lowest -luminosity) to B-1. N[i] is the number of pixels in -bucket i. T is the total number of pixels (sum of +luminosity) to B-1. N[i] is the number of pixels in +bucket i. T is the total number of pixels (sum of N[i] over all i). W is the luminosity of white.

pnmhisteq replaces an input pixel whose luminosity falls into @@ -77,10 +77,10 @@ continuous, the luminosities in the output aren't either and pnmhisteq doesn't meet the ideal of having exactly the same number of pixels of each luminosity in the output. -

If you're processing a related set of images, for example frames of +

If you're processing a related set of images, for example frames of an animation, it's generally best to apply the same luminosity mapping to every frame, since otherwise you'll get distracting frame-to-frame -changes in the brightness of objects. pnmhisteq's -wmap +changes in the brightness of objects. pnmhisteq's -wmap option allows you to save, as a PGM image, the luminosity map it computes from an image. The -rmap option causes pnmisteq to use such an image as its luminosity map. @@ -99,14 +99,19 @@ see high bars interleaved with low bars, with the local average being flat. To see local averages, use the -width option of pnmhistmap. -

OPTIONS

+

OPTIONS

-

You can abbreviate any option to its shortest unique prefix. +

In addition to the options common to all programs based on libnetpbm +(most notably -quiet, see +Common Options), pnmhisteq recognizes the following +command line options: -

-
-gray +

You can abbreviate any option to its shortest unique prefix. -

When processing a color image, only gray pixels (those with identical +
+
-gray + +
When processing a color image, only gray pixels (those with identical red, green, and blue values) are included in the histogram and modified in the output image. This is a special purpose option intended for images where the actual data are gray scale, with color @@ -114,7 +119,7 @@ annotations you don't want modified. Weather satellite images that show continent outlines in color are best processed using this option. The option has no effect when the input is a graymap. -
-noblack +
-noblack
Do not include black pixels in the equalization. The black pixels in the output are exactly the black pixels in the input and the number of black @@ -129,87 +134,86 @@ significant, all the stars would end up close to full white.

This option was new in Netpbm 10.70 (March 2015). -

-nowhite +
-nowhite

Same as -noblack, but for the white pixels.

This option was new in Netpbm 10.70 (March 2015). -

-rmap mapfile +
-rmap mapfile -
Process the image using the luminosity map specified by the PGM -file mapfile. +
Process the image using the luminosity map specified by the PGM +file mapfile. -The PGM image, usually created by an earlier run of pnmhisteq -with the -wmap option, contains a single row with number of +The PGM image, usually created by an earlier run of pnmhisteq +with the -wmap option, contains a single row with number of columns equal to the maxval (greatest intensity value) of the image plus one. Each pixel in the image is transformed by looking up its luminosity in the corresponding column in the map file (column number = luminosity) and changing it to the value given by that column. -
-wmap mapfile +
-wmap mapfile -
Creates a PGM file mapfile, containing the luminosity map +
Creates a PGM file mapfile, containing the luminosity map computed from the histogram of the input image. This map file can be -read on subsequent runs of pnmhisteq with the -rmap +read on subsequent runs of pnmhisteq with the -rmap option, allowing a group of images to be processed with an identical map. -
-verbose +
-verbose -
Prints the histogram and luminosity map on Standard Error. +
Prints the histogram and luminosity map on Standard Error. -
+
-

LIMITATIONS

+

LIMITATIONS

Histogram equalization is effective for increasing the visible detail in scientific imagery and in some continuous-tone pictures. It is often too drastic, however, for scanned halftone images, where it does an excellent job of making halftone artifacts apparent. You -might want to experiment with pnmnorm and pnmgamma for +might want to experiment with pnmnorm and pnmgamma for more subtle contrast enhancement. -

The luminosity map file supplied by the -rmap option must +

The luminosity map file supplied by the -rmap option must have the same maxval as the input image. This is always the case when -the map file was created by the -wmap option of -pnmhisteq. If this restriction causes a problem, simply adjust -the maxval of the map with pamdepth to agree with the input +the map file was created by the -wmap option of +pnmhisteq. If this restriction causes a problem, simply adjust +the maxval of the map with pamdepth to agree with the input image. -

If the input is a PBM file (on which histogram equalization is an +

If the input is a PBM file (on which histogram equalization is an identity operation), the only effect of passing the file through -pnmhisteq will be the passage of time. +pnmhisteq will be the passage of time. -

SEE ALSO

+

SEE ALSO

-pnmnorm, +pnmnorm, -pnmcat, +pnmcat, -pamdepth, +pamdepth, -pnmgamma, +pnmgamma, -pnm, +pnm, -
-
[1] +
+
[1] -
Russ, John C. The Image Processing Handbook. Boca Raton: CRC +
Russ, John C. The Image Processing Handbook. Boca Raton: CRC Press, 1992. Pages 105-110. -
- -
-  -

Table Of Contents

- - - +
+ +
+

Table Of Contents

+ + + -- cgit 1.4.1