pnmhisteq - histogram equalise a portable anymap
pnmhisteq [-gray] [-rmap pgmfile] [-wmap pgmfile] [-verbose] [pnmfile]
pnmhisteq increases the contrast of a portable graymap or pixmap through the technique of 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. Mathematically, if N[i] is the number of pixels of luminosity i in the image and T is the total number of pixels, luminosity j is replaced by: j --- \ > N[i] / T --- i=0 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. pnmhisteq's -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 pnmcat). Then, you can subsequently process each of the individual images using the luminosity map saved in the file, supplied with the -rmap option.
-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. -rmap mapfile Process the image using the luminosity map specified by the portable graymap mapfile. The graymap, 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) 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. -wmap mapfile Creates a portable graymap, 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 option, allowing a group of images to be processed with an identical map. -verbose Prints the histogram and luminosity map on standard error. All flags can be abbreviated to their shortest unique prefix.
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 pgnnorm, ppmnorm, and pnmgamma for more subtle contrast enhancement. 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 pnmdepth to agree with the input image. If the input is a PBM file (on which histogram equalisation is an identity operation), the only effect of passing the file through pnmhisteq will be the passage of time.
pgmnorm(1), pnm(5), pnmcat(1), pnmdepth(1), pnmgamma(1), pnmnorm(1) [1] Russ, John C. The Image Processing Handbook. Boca Raton: CRC Press, 1992. Pages 105-110.
Copyright (C) 1995 by John Walker (kelvin@fourmilab.ch). WWW home page: http://www.fourmilab.ch/ 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. 19 March 1995 pnmhisteq(1)
Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.
Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.
Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.
Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.
The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.
Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.
Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.
Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.