head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.54 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.3.0.52 pkgsrc-2012Q4-base:1.3 pkgsrc-2011Q4:1.3.0.50 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q2:1.3.0.48 pkgsrc-2011Q2-base:1.3 pkgsrc-2009Q4:1.3.0.46 pkgsrc-2009Q4-base:1.3 pkgsrc-2008Q4:1.3.0.44 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.42 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.40 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.38 pkgsrc-2008Q2-base:1.3 pkgsrc-2008Q1:1.3.0.36 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.34 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.32 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.30 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.28 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.26 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.24 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.22 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.20 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.18 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.16 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.14 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.3.0.12 pkgsrc-2005Q1-base:1.3 pkgsrc-2004Q4:1.3.0.10 pkgsrc-2004Q4-base:1.3 pkgsrc-2004Q3:1.3.0.8 pkgsrc-2004Q3-base:1.3 pkgsrc-2004Q2:1.3.0.6 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.3.0.4 pkgsrc-2004Q1-base:1.3 pkgsrc-2003Q4:1.3.0.2 pkgsrc-2003Q4-base:1.3 buildlink2-base:1.3 netbsd-1-3-PATCH003:1.2; locks; strict; comment @# @; 1.3 date 99.01.10.23.52.18; author tron; state dead; branches; next 1.2; 1.2 date 98.08.07.10.40.51; author agc; state Exp; branches; next 1.1; 1.1 date 98.07.15.19.52.56; author tron; state Exp; branches; next ; desc @@ 1.3 log @Major cleanup of "netpbm" package based on patches supply by John F. Woods in PR pkg/6763 and Rob Windsor in PR pkg/6779. @ text @$NetBSD: patch-bk,v 1.2 1998/08/07 10:40:51 agc Exp $ --- /dev/null Thu Oct 16 09:27:24 1997 +++ ./pnm/pnmhisteq.1 Sun Aug 13 00:13:48 1995 @@@@ -0,0 +1,161 @@@@ +.TH pnmhisteq 1 "19 March 1995" +.IX "pnmhisteq command" +.IX histogram +.SH NAME +pnmhisteq \- histogram equalise a portable anymap +.SH SYNOPSIS +.na +.B pnmhisteq +'ti 15 +.RB [ \-gray ] +.RB [ \-rmap +.IR pgmfile ] +.RB [ \-wmap +.IR pgmfile ] +.RB [ \-verbose ] +.RI [ pnmfile ] +.ad +.SH DESCRIPTION +.B pnmhisteq +increases the contrast of a portable graymap or pixmap through the +technique of +.IR "histogram equalisation" [1]. +A histogram of the luminance of pixels in the map is computed, from +which a transfer function is calculated which spreads out intensity levels +around histogram peaks and compresses them at troughs. This has the +effect of using the available levels of intensity more efficiently and +thereby increases the detail visible in the image. +.PP +Mathematically, if +.I N[i] +is the number of pixels of luminosity +.I i +in the image and +.I T +is the total number of pixels, luminosity +.I j +is replaced by: +.PP +.NF +.vs 9p + j + --- + \\ + \> N[i] / T + \/ + --- + i=0 +.vs +.FI +.PP +If you're processing a related set of images, for example frames of an +animation, it's generally best to apply the same intensity map to +every frame, since otherwise you'll get distracting frame-to-frame +changes in the brightness of objects. +.BR pnmhisteq 's +.B \-wmap +option +allows you to save, as a portable graymap, the luminosity map computed +from an image (usually a composite of the images you intend +to process created with +.BR pnmcat ). +Then, you can subsequently process each of the individual images using +the luminosity map saved in the file, supplied with the +.B \-rmap +option. +.SH OPTIONS +.TP 10 +.B \-gray +When processing a pixmap, 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 +colour annotations you don't want modified. Weather +satellite images that show continent outlines in colour are best +processed using this option. The option has no effect when the input +is a graymap. +.TP +.BI \-rmap " mapfile" +Process the image using the luminosity map specified by the portable +graymap +.I mapfile. +The graymap, usually created by an earlier run of +.B pnmhisteq +with the +.B \-wmap +option, contains a single row with number of columns equal to +the +.I maxval +(greatest intensity) of the image. Each pixel in the image is +transformed by looking up its luminosity in the corresponding +column in the map file and changing it to the value +given by that column. +.TP +.BI \-wmap " mapfile" +Creates a portable graymap, +.I mapfile, +containing the luminosity map computed from the histogram of the +input image. This map file can be read on subsequent runs of +.B pnmhisteq +with the +.B \-rmap +option, allowing a group of images to be processed with +an identical map. +.TP +.B \-verbose +Prints the histogram and luminosity map on standard error. +.PP +All flags can be abbreviated to their shortest unique prefix. +.SH BUGS +Histogram equalisation 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 +.BR pgnnorm , +.BR ppmnorm , +and +.B pnmgamma +for more subtle contrast enhancement. +.PP +The luminosity map file supplied by the +.B \-rmap +option must have the same +.I maxval +as the input image. This is always the case when the +map file was created by the +.B \-wmap +option of +.BR pnmhisteq . +If this restriction causes a problem, simply adjust the +.I maxval +of the map with +.B pnmdepth +to agree with the input image. +.PP +If the input is a PBM file (on which histogram equalisation is an +identity operation), the only effect of passing the file through +.B pnmhisteq +will be the passage of time. +.SH "SEE ALSO" +.PD +.BR pgmnorm (1), +.BR pnm (5), +.BR pnmcat (1), +.BR pnmdepth (1), +.BR pnmgamma (1), +.BR pnmnorm (1) +.TP 5 +[1] +Russ, John C. The Image Processing Handbook. +Boca Raton: CRC Press, 1992. Pages 105-110. +.ne 10 +.SH AUTHOR +.ce 2 +Copyright (C) 1995 by John Walker (kelvin@@fourmilab.ch). +WWW home page: http://www.fourmilab.ch/ +.PP +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +without any conditions or restrictions. This software is provided ``as +is'' without express or implied warranty. @ 1.2 log @Add NetBSD RCS Ids. @ text @d1 1 a1 1 $NetBSD$ @ 1.1 log @Add well known fixes for "netpbm-1mar1994" supplied by John F. Woods in PR pkg/5723. @ text @d1 2 @