Go to the USGS Home Page

USGS MIPS Histdk Documentation






This program generates a histogram  of an image 's DN  values and outputs the histogram to a print file . In addition, statistics such as the mean, standard deviation, variance, median, and skew of the image/area being used are also calculated.

  

Files

This program requires as input one unsigned 8-bit , or one signed 16-bit , or one 32-bit  floating point image file. The results of this program are written to the print file and dumped onto the user's screen.

           

Parameters

SL, SS, NL and NS

These parameters are used to define a window/subarea of the image to be used to generate the histogram and statistics. The default values for starting line/sample and number of lines/samples are the entire image.

LINC and SINC

These parameters are used to subsample the image. Subsampling is useful for very large images in order to reduce the time required to generate the histogram, values of 2 and 3 usually do not seriously affect the results/does a good job of representing the entire area of interest. The default value for both parameters is 1(i.e., use every line and sample; a value of 2 will use every other pixel).

MIN and MAX

These parameters can be used to eliminate DNs in the images considered noise and could adversely affect the outcome of the statistics. For example, an image containing a large border or background of zeroes would reduce the average of the image. However by setting MIN to one, the zereos are not used so the statistics generated represent the image/information of interest better. The default values are 1 and 254, respectively.

NARROW or WIDE

These parameters are used to define the width of the histogram. By default the width of the histogram will be narrow which is 80 columns and can be output to a terminal screen without wrapping. A wide histogram will be 132 columns which can be output to most line printers without wrapping.

Uses

Valuable information about an image can be obtained from a histogram. For example, the range of the DNs can be found from the histogram and used to select a contrast stretch ; thresholds can be found to seperate land and water. Images with land and water will usually produce bimodal histograms. If looking at a near-infrared band the threshold between land will usually fall between the peaks of the bimodal histogram.

The calculated statistics can also provide information about the image. A low average implies a dark image while a high average implies a bright image. A high standard deviation implies an image with large contrast while a low standard deviation implies a poor contrast image.

Examples

Landsat TM Band 4 followed by histogram of the image. Note, the image was contrast stretched using the DN at cumulative percentage of 1 and 99 for the minimum and maximum, respectively.

[Example Image]
Total Pixels                       = 125000
Number of pixels below minimum     = 0
Number of pixels above maximum     = 0
Percentage of pixels below minimum = 0.00
Percentage of pixels above maximum = 0.00

Mean               = 64.1920
Standard Deviation = 15.8501
Variance           = 251.2255
Skew               = -0.5315


 DN  Percent     Freq   CumPer
 15   0.0032        4   0.0032    +    +    +    +    +    +    +    +    +    +
 16   0.0184       23   0.0216    +    +    +    +    +    +    +    +    +    +
 17   0.0408       51   0.0624*   +    +    +    +    +    +    +    +    +    +
 18   0.1016      127   0.1640*   +    +    +    +    +    +    +    +    +    +
 19   0.1632      204   0.3272**  +    +    +    +    +    +    +    +    +    +
 20   0.1936      242   0.5208**  +    +    +    +    +    +    +    +    +    +
 21   0.2048      256   0.7256*** +    +    +    +    +    +    +    +    +    +
 22   0.2192      274   0.9448*** +    +    +    +    +    +    +    +    +    +
 23   0.2160      270   1.1608*** +    +    +    +    +    +    +    +    +    +
 24   0.1840      230   1.3448**  +    +    +    +    +    +    +    +    +    +
 25   0.1736      217   1.5184**  +    +    +    +    +    +    +    +    +    +
 26   0.2256      282   1.7440*** +    +    +    +    +    +    +    +    +    +
 27   0.2712      339   2.0152*** +    +    +    +    +    +    +    +    +    +
 28   0.2992      374   2.3144****+    +    +    +    +    +    +    +    +    +
 29   0.2680      335   2.5824*** +    +    +    +    +    +    +    +    +    +
 30   0.2552      319   2.8376*** +    +    +    +    +    +    +    +    +    +
 31   0.2624      328   3.1000*** +    +    +    +    +    +    +    +    +    +
 32   0.2608      326   3.3608*** +    +    +    +    +    +    +    +    +    +
 33   0.2760      345   3.6368*** +    +    +    +    +    +    +    +    +    +
 34   0.2784      348   3.9152****+    +    +    +    +    +    +    +    +    +
 35   0.3296      412   4.2448****+    +    +    +    +    +    +    +    +    +
 36   0.4592      574   4.7040******   +    +    +    +    +    +    +    +    +
 37   0.5888      736   5.2928*******  +    +    +    +    +    +    +    +    +
 38   0.6976      872   5.9904*********+    +    +    +    +    +    +    +    +
 39   0.7488      936   6.7392*********+    +    +    +    +    +    +    +    +
 40   0.7936      992   7.5328**********    +    +    +    +    +    +    +    +
 41   0.8984     1123   8.4312***********   +    +    +    +    +    +    +    +
 42   1.0104     1263   9.4416************* +    +    +    +    +    +    +    +
 43   1.1584     1448  10.6000***************    +    +    +    +    +    +    +
 44   1.1592     1449  11.7592***************    +    +    +    +    +    +    +
 45   1.3000     1625  13.0592****************   +    +    +    +    +    +    +
 46   1.5376     1922  14.5968*******************+    +    +    +    +    +    +
 47   1.5472     1934  16.1440********************    +    +    +    +    +    +
 48   1.6600     2075  17.8040*********************   +    +    +    +    +    +
 49   1.6072     2009  19.4112********************    +    +    +    +    +    +
 50   1.5704     1963  20.9816********************    +    +    +    +    +    +
 51   1.5944     1993  22.5760********************    +    +    +    +    +    +
 52   1.5016     1877  24.0776*******************+    +    +    +    +    +    +
 53   1.4152     1769  25.4928****************** +    +    +    +    +    +    +
 54   1.3976     1747  26.8904****************** +    +    +    +    +    +    +
 55   1.3128     1641  28.2032*****************  +    +    +    +    +    +    +
 56   1.2672     1584  29.4704****************   +    +    +    +    +    +    +
 57   1.3080     1635  30.7784*****************  +    +    +    +    +    +    +
 58   1.3800     1725  32.1584*****************  +    +    +    +    +    +    +
 59   1.4312     1789  33.5896****************** +    +    +    +    +    +    +
 60   1.5872     1984  35.1768********************    +    +    +    +    +    +
 61   1.8632     2329  37.0400************************+    +    +    +    +    +
 62   1.8976     2372  38.9376************************+    +    +    +    +    +
 63   1.9504     2438  40.8880*************************    +    +    +    +    +
 64   2.0320     2540  42.9200**************************   +    +    +    +    +
 65   2.2920     2865  45.2120*****************************+    +    +    +    +
 66   2.6752     3344  47.8872**********************************+    +    +    +
 67   3.0264     3783  50.9136************************************** +    +    +
 68   3.3992     4249  54.3128******************************************* +    +
 69   3.7944     4743  58.1072************************************************ +
 70   3.9608     4951  62.0680**************************************************
 71   3.7600     4700  65.8280***********************************************  +
 72   3.5440     4430  69.3720*********************************************    +
 73   3.5568     4446  72.9288*********************************************    +
 74   3.3104     4138  76.2392******************************************  +    +
 75   3.1064     3883  79.3456***************************************+    +    +
 76   2.8152     3519  82.1608************************************   +    +    +
 77   2.5208     3151  84.6816********************************  +    +    +    +
 78   2.0728     2591  86.7544**************************   +    +    +    +    +
 79   1.7400     2175  88.4944**********************  +    +    +    +    +    +
 80   1.4976     1872  89.9920*******************+    +    +    +    +    +    +
 81   1.2272     1534  91.2192***************    +    +    +    +    +    +    +
 82   1.0112     1264  92.2304************* +    +    +    +    +    +    +    +
 83   0.9152     1144  93.1456************  +    +    +    +    +    +    +    +
 84   0.7424      928  93.8880*********+    +    +    +    +    +    +    +    +
 85   0.5776      722  94.4656*******  +    +    +    +    +    +    +    +    +
 86   0.5328      666  94.9984*******  +    +    +    +    +    +    +    +    +
 87   0.4080      510  95.4064*****    +    +    +    +    +    +    +    +    +
 88   0.3968      496  95.8032*****    +    +    +    +    +    +    +    +    +
 89   0.3624      453  96.1656*****    +    +    +    +    +    +    +    +    +
 90   0.3136      392  96.4792****+    +    +    +    +    +    +    +    +    +
 91   0.2880      360  96.7672****+    +    +    +    +    +    +    +    +    +
 92   0.2600      325  97.0272*** +    +    +    +    +    +    +    +    +    +
 93   0.2424      303  97.2696*** +    +    +    +    +    +    +    +    +    +
 94   0.2360      295  97.5056*** +    +    +    +    +    +    +    +    +    +
 95   0.1928      241  97.6984**  +    +    +    +    +    +    +    +    +    +
 96   0.1920      240  97.8904**  +    +    +    +    +    +    +    +    +    +
 97   0.1864      233  98.0768**  +    +    +    +    +    +    +    +    +    +
 98   0.1776      222  98.2544**  +    +    +    +    +    +    +    +    +    +
 99   0.1472      184  98.4016**  +    +    +    +    +    +    +    +    +    +
100   0.1520      190  98.5536**  +    +    +    +    +    +    +    +    +    +
101   0.1360      170  98.6896**  +    +    +    +    +    +    +    +    +    +
102   0.1224      153  98.8120**  +    +    +    +    +    +    +    +    +    +
103   0.1096      137  98.9216*   +    +    +    +    +    +    +    +    +    +
104   0.1096      137  99.0312*   +    +    +    +    +    +    +    +    +    +
105   0.1056      132  99.1368*   +    +    +    +    +    +    +    +    +    +
106   0.0976      122  99.2344*   +    +    +    +    +    +    +    +    +    +
107   0.0752       94  99.3096*   +    +    +    +    +    +    +    +    +    +
108   0.0656       82  99.3752*   +    +    +    +    +    +    +    +    +    +
109   0.0696       87  99.4448*   +    +    +    +    +    +    +    +    +    +
110   0.0624       78  99.5072*   +    +    +    +    +    +    +    +    +    +
111   0.0608       76  99.5680*   +    +    +    +    +    +    +    +    +    +
112   0.0472       59  99.6152*   +    +    +    +    +    +    +    +    +    +
113   0.0504       63  99.6656*   +    +    +    +    +    +    +    +    +    +
114   0.0408       51  99.7064*   +    +    +    +    +    +    +    +    +    +
115   0.0408       51  99.7472*   +    +    +    +    +    +    +    +    +    +
116   0.0256       32  99.7728    +    +    +    +    +    +    +    +    +    +
117   0.0256       32  99.7984    +    +    +    +    +    +    +    +    +    +
118   0.0240       30  99.8224    +    +    +    +    +    +    +    +    +    +
119   0.0240       30  99.8464    +    +    +    +    +    +    +    +    +    +
120   0.0176       22  99.8640    +    +    +    +    +    +    +    +    +    +
121   0.0168       21  99.8808    +    +    +    +    +    +    +    +    +    +
122   0.0072        9  99.8880    +    +    +    +    +    +    +    +    +    +
123   0.0144       18  99.9024    +    +    +    +    +    +    +    +    +    +
124   0.0176       22  99.9200    +    +    +    +    +    +    +    +    +    +
125   0.0072        9  99.9272    +    +    +    +    +    +    +    +    +    +
126   0.0104       13  99.9376    +    +    +    +    +    +    +    +    +    +
127   0.0136       17  99.9512    +    +    +    +    +    +    +    +    +    +
128   0.0040        5  99.9552    +    +    +    +    +    +    +    +    +    +
129   0.0080       10  99.9632    +    +    +    +    +    +    +    +    +    +
130   0.0048        6  99.9680    +    +    +    +    +    +    +    +    +    +
131   0.0024        3  99.9704    +    +    +    +    +    +    +    +    +    +
132   0.0040        5  99.9744    +    +    +    +    +    +    +    +    +    +
133   0.0024        3  99.9768    +    +    +    +    +    +    +    +    +    +
134   0.0048        6  99.9816    +    +    +    +    +    +    +    +    +    +
135   0.0040        5  99.9856    +    +    +    +    +    +    +    +    +    +
136   0.0040        5  99.9896    +    +    +    +    +    +    +    +    +    +
137   0.0032        4  99.9928    +    +    +    +    +    +    +    +    +    +
138   0.0024        3  99.9952    +    +    +    +    +    +    +    +    +    +
139   0.0024        3  99.9976    +    +    +    +    +    +    +    +    +    +
142   0.0016        2  99.9992    +    +    +    +    +    +    +    +    +    +
143   0.0008        1 100.0000    +    +    +    +    +    +    +    +    +    +

See Also

List 
Hstgrm 
Stats 
U.S. Department of the Interior | U.S. Geological Survey | Jobs
Home | Search | Disclaimers & Privacy Web Rings
Send comments to webman@TerraWeb.wr.usgs.gov
URL:
Last Modified: Thu Oct 31 15:08:22 MST 2002
FirstGov: Your First Click to the U.S. Gov ernment