compute a histogram for each layer of an image - Maple Help

Home : Support : Online Help : Graphics : Image Processing : ImageTools Package : ImageTools/Histogram

ImageTools[Histogram] - compute a histogram for each layer of an image

 Calling Sequence Histogram( img, buckets, opts )

Parameters

 img - Image; input image buckets - (optional) posint; number of buckets/bins in the histogram (per layer) opts - (optional) equation(s) of the form option = value; specify options for the Histogram command

Description

 • The Histogram command computes a histogram of the intensity of each layer of an image, and returns a Vector (for one-layer images) or Matrix (for multi-layer images) containing the histogram information.
 • The img parameter specifies the image.
 • The optional buckets parameter specifies the number of buckets per color channel desired. For most images, which were originally read from 8-bit per channel image files, the default of 256 is a suitable value.
 • For a single layer (grayscale) image, the Histogram command returns a column Vector with buckets elements. For multi-layer images, a buckets x N Matrix is returned, where N is the number of layers.

Examples

 > $\mathrm{with}\left(\mathrm{ImageTools}\right):$

Create a grayscale image with intensity varying from 1/4 to 3/4.

 > $\mathrm{img}:=\mathrm{Create}\left(100,200,\left(r,c\right)→\mathrm{evalf}\left(\frac{1}{2}+\frac{1\left(\mathrm{sin}\left(\frac{2\mathrm{π}r}{100}\right)+\mathrm{cos}\left(\frac{2\mathrm{π}c}{200}\right)\right)}{8}\right)\right):$
 > $\mathrm{Histogram}\left(\mathrm{img},10\right)$
 > $\mathrm{Histogram}\left(\mathrm{img},10,\mathrm{autorange},\mathrm{centers}\right)$
 > $\mathrm{Histogram}\left(\mathrm{img},10,\mathrm{range}=0..0.5,\mathrm{centers}\right)$
 > $\mathrm{Histogram}\left(\mathrm{img},10,\mathrm{range}=0..0.5,\mathrm{normalized}\right)$