Hexagon Geospatial
MENU

ERDAS IMAGINE Q&A

ERDAS IMAGINE, the world’s leading geospatial data authoring system, supplies tools for all your Remote Sensing and Photogrammetry needs.
Showing results for 
Search instead for 
Do you mean 

How to calculate the histogram percentage for each class in a thematic raster image?

by jdooley on ‎12-02-2016 10:34 AM (2,319 Views)

Question

How to calculate the histogram percentage for each class in a thematic raster image and add the results to the image attribute table?

Answer

You can add a Percentage column to the raster attribute table. Display a thematic image in a 2D View. From the IMAGINE workspace Contents panel, right-click on the image name to open the context menu for the displayed raster image and select Display Attribute Table. The attribute table will be added to the bottom of the IMAGINE workspace.

 

frame.png

 

 

Select Column Properties from the Table tab.

 

col_prop.png

 

 

From the Column Properties dialogue select New. Change the title to Percentage. Check the Editable option. Change the Type pulldown menu to Real.

 

prop_percentage.png

 

 

Select the More button located at the right of the Format window. In the Number Format dialogue, enter ‘0.00%’. Select OK.

 

num_format.png

 

 

Select the More button located at the right of the Formula window. Enter this formula $"Histogram"/(total number of pixels) where "262144" in this example equals the number of pixels in the raster image (columns X rows). In this example the raster image is 512 columns by 512 rows. Click OK to close the Formula dialogue.

 

formula.png

 

 

Select Apply on OK, then click OK in Column Properties dialogue to add the Percentage attribute.

 

add_percentage.png

 

 

 

 

show_table.png

 

 

See Related: How to calculate the area for each class in a thematic raster image?

Contributors