home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / NETWORK / netpbm_docs.lzh / NETPBM / DOCS / pnmhisteq.1 < prev    next >
Text File  |  1996-11-18  |  5KB  |  162 lines

  1. .TH pnmhisteq 1 "19 March 1995"
  2. .IX "pnmhisteq command"
  3. .IX histogram
  4. .SH NAME
  5. pnmhisteq \- histogram equalise a portable anymap
  6. .SH SYNOPSIS
  7. .na
  8. .B pnmhisteq
  9. 'ti 15
  10. .RB [ \-gray ]
  11. .RB [ \-rmap
  12. .IR pgmfile ]
  13. .RB [ \-wmap
  14. .IR pgmfile ]
  15. .RB [ \-verbose ]
  16. .RI [ pnmfile ]
  17. .ad
  18. .SH DESCRIPTION
  19. .B pnmhisteq
  20. increases the contrast of a portable graymap or pixmap through the
  21. technique of
  22. .IR "histogram equalisation" [1].
  23. A histogram of the luminance of pixels in the map is computed, from
  24. which a transfer function is calculated which spreads out intensity levels
  25. around histogram peaks and compresses them at troughs.  This has the
  26. effect of using the available levels of intensity more efficiently and
  27. thereby increases the detail visible in the image.
  28. .PP
  29. Mathematically, if
  30. .I N[i]
  31. is the number of pixels of luminosity
  32. .I i
  33. in the image and
  34. .I T
  35. is the total number of pixels, luminosity
  36. .I j
  37. is replaced by:
  38. .PP
  39. .NF
  40. .vs 9p
  41.          j
  42.         ---
  43.         \\
  44.          \>   N[i] / T
  45.         \/
  46.         ---
  47.         i=0
  48. .vs
  49. .FI
  50. .PP
  51. If you're processing a related set of images, for example frames of an
  52. animation, it's generally best to apply the same intensity map to
  53. every frame, since otherwise you'll get distracting frame-to-frame
  54. changes in the brightness of objects.
  55. .BR pnmhisteq 's
  56. .B \-wmap
  57. option
  58. allows you to save, as a portable graymap, the luminosity map computed
  59. from an image (usually a composite of the images you intend
  60. to process created with
  61. .BR pnmcat ).
  62. Then, you can subsequently process each of the individual images using
  63. the luminosity map saved in the file, supplied with the
  64. .B \-rmap
  65. option.
  66. .SH OPTIONS
  67. .TP 10
  68. .B \-gray
  69. When processing a pixmap, only gray pixels (those with identical red,
  70. green, and blue values) are included in the histogram and modified
  71. in the output image.  This is a special purpose option intended
  72. for images where the actual data are gray scale, with
  73. colour annotations you don't want modified.  Weather
  74. satellite images that show continent outlines in colour are best
  75. processed using this option.  The option has no effect when the input
  76. is a graymap.
  77. .TP
  78. .BI \-rmap " mapfile"
  79. Process the image using the luminosity map specified by the portable
  80. graymap
  81. .I mapfile.
  82. The graymap, usually created by an earlier run of
  83. .B pnmhisteq
  84. with the 
  85. .B \-wmap
  86. option, contains a single row with number of columns equal to
  87. the
  88. .I maxval
  89. (greatest intensity) of the image.  Each pixel in the image is
  90. transformed by looking up its luminosity in the corresponding
  91. column in the map file and changing it to the value
  92. given by that column.
  93. .TP
  94. .BI \-wmap " mapfile"
  95. Creates a portable graymap,
  96. .I mapfile,
  97. containing the luminosity map computed from the histogram of the
  98. input image.  This map file can be read on subsequent runs of
  99. .B pnmhisteq
  100. with the
  101. .B \-rmap
  102. option, allowing a group of images to be processed with
  103. an identical map.
  104. .TP
  105. .B \-verbose
  106. Prints the histogram and luminosity map on standard error.
  107. .PP
  108. All flags can be abbreviated to their shortest unique prefix.
  109. .SH BUGS
  110. Histogram equalisation is effective for increasing the visible detail
  111. in scientific imagery and in some continuous-tone pictures.  It is
  112. often too drastic, however, for scanned halftone images, where it
  113. does an excellent job of making halftone artifacts apparent.  You
  114. might want to experiment with
  115. .BR pgnnorm ,
  116. .BR ppmnorm ,
  117. and
  118. .B pnmgamma
  119. for more subtle contrast enhancement.
  120. .PP
  121. The luminosity map file supplied by the
  122. .B \-rmap
  123. option must have the same
  124. .I maxval
  125. as the input image.  This is always the case when the
  126. map file was created by the
  127. .B \-wmap
  128. option of 
  129. .BR pnmhisteq .
  130. If this restriction causes a problem, simply adjust the
  131. .I maxval
  132. of the map with
  133. .B pnmdepth
  134. to agree with the input image.
  135. .PP
  136. If the input is a PBM file (on which histogram equalisation is an
  137. identity operation), the only effect of passing the file through
  138. .B pnmhisteq
  139. will be the passage of time.
  140. .SH "SEE ALSO"
  141. .PD
  142. .BR pgmnorm (1),
  143. .BR pnm (5),
  144. .BR pnmcat (1),
  145. .BR pnmdepth (1),
  146. .BR pnmgamma (1),
  147. .BR pnmnorm (1)
  148. .TP 5
  149. [1]
  150. Russ, John C.  The Image Processing Handbook.
  151. Boca Raton: CRC Press, 1992.  Pages 105-110.
  152. .ne 10
  153. .SH AUTHOR
  154. .ce 2
  155. Copyright (C) 1995 by John Walker (kelvin@fourmilab.ch).
  156. WWW home page: http://www.fourmilab.ch/
  157. .PP
  158. Permission to use, copy, modify, and distribute this software and its
  159. documentation for any purpose and without fee is hereby granted,
  160. without any conditions or restrictions.  This software is provided ``as
  161. is'' without express or implied warranty.
  162.