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 / pnmconvol.1 < prev    next >
Text File  |  1996-11-18  |  2KB  |  58 lines

  1. .TH pnmconvol 1 "26 November 1994"
  2. .IX pnmconvol
  3. .SH NAME
  4. pnmconvol - general MxN convolution on a portable anymap
  5. .SH SYNOPSIS
  6. .B pnmconvol
  7. .I convolutionfile
  8. .RI [ pnmfile ]
  9. .SH DESCRIPTION
  10. Reads two portable anymaps as input.
  11. Convolves the second using the first,
  12. and writes a portable anymap as output.
  13. .IX convolution
  14. .PP
  15. Convolution means replacing each pixel with a weighted average of the
  16. nearby pixels.  The weights and the area to average are determined by
  17. the convolution matrix.
  18. The unsigned numbers in the convolution file are offset by -maxval/2 to
  19. make signed numbers, and then normalized, so the actual values in the
  20. convolution file are only relative.
  21. .PP
  22. Here is a sample convolution file;
  23. it does a simple average of the nine immediate neighbors, resulting
  24. in a smoothed image:
  25. .nf
  26.     P2
  27.     3 3
  28.     18
  29.     10 10 10
  30.     10 10 10
  31.     10 10 10
  32. .fi
  33. .PP
  34. To see how this works, do the above-mentioned offset: 10 - 18/2 gives 1.
  35. The possible range of values is from 0 to 18, and after the offset
  36. that's -9 to 9.  The normalization step makes the range -1 to 1, and
  37. the values get scaled correspondingly so they become 1/9 - exactly what
  38. you want.
  39. The equivalent matrix for 5x5 smoothing would have maxval 50 and be
  40. filled with 26.
  41. .PP
  42. The convolution file will usually be a graymap,
  43. so that the same convolution gets applied to each color component.
  44. However, if you want to use a pixmap and do a different convolution to
  45. different colors, you can certainly do that.
  46. .SH "SEE ALSO"
  47. pnmsmooth(1), pnm(5)
  48. .SH AUTHORS
  49. Copyright (C) 1989, 1991 by Jef Poskanzer.
  50. .br
  51. Modified 26 November 1994 by Mike Burns, burns@chem.psu.edu
  52. .\" Permission to use, copy, modify, and distribute this software and its
  53. .\" documentation for any purpose and without fee is hereby granted, provided
  54. .\" that the above copyright notice appear in all copies and that both that
  55. .\" copyright notice and this permission notice appear in supporting
  56. .\" documentation.  This software is provided "as is" without express or
  57. .\" implied warranty.
  58.