HISTEX

Histogram-based texture analysis


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Algorithm :: References :: Related

Back to top

Description


HISTEX creates a set of texture images from a single channel in an input image. The measures are based on histogram statistics in a window surrounding each pixel. If necessary, you can use the extracted texture measures as input features with CATALYST Professional classification algorithms.
Back to top

Parameters


histex(file, dbic, texture, dboc, flsz, mask, fillpct)

Name Type Caption Length Value range
FILE * str Input file name 1 -    
DBIC * List[int] Input channel 1 - 1  
TEXTURE * str Texture measures 1 -    
DBOC * List[int] Texture-measure channels 1 - 12  
FLSZ List[int] Filter size (pixels, lines) 0 - 2 3 - 101
Default: 3,3
MASK List[int] Area mask 0 - 4  
FILLPCT List[float] Percentage of brightest fill pixels 0 - 1 100
Default: 5

* Required parameter
Back to top

Parameter descriptions

FILE

The PCIDSK file that contains the channel to analyze for a specific texture measure.

The file also contains the output channels.

DBIC

The channel in the input file to analyze.

TEXTURE

The list of texture measures to create.

You can select from the following options:

Do not specify duplicate texture measures.

For more information about the measures, see Algorithm.

DBOC

The output channels to which to write the texture measures. Output channels must be 32-bit real.

The total number of output channels must equal the number of texture measures you specify.

Do not use the input channel as an output channel.

Do not specify duplicate channels.

FLSZ

The size of the window, in pixels (x) and lines (y), to use for extracting the texture measures for each input pixel.

The window size must be odd so that the pixel to process is centered in the window. The value must be an odd integer between 3 and 101. The default value is 3,3.

MASK

The window or bitmap that defines the area of the input raster to process.

If you specify a single value, it represents the channel number of the bitmap segment in the input file. Only pixels under the bitmap are processed. The rest of the image remains unchanged.

If you specify four values, they define the x and y offsets and the x and y dimensions of a rectangular window identifying the area to process. Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

If you do not specify a value, the entire channel is processed.

FILLPCT

The percentage of brightest pixels to compute the weighted-rank fill-ratio measure. The value must be greater than zero (0) and less than or equal to 100.

The percentage value specified is converted to the number of pixel values (depending on the size of window), rounded to the nearest-integer value.

Back to top

Details

HISTEX creates a set of texture images from a single channel in an input image. The measures are based on histogram statistics in a window surrounding each pixel. If necessary, you can use the extracted texture measures as input features with CATALYST Professional classification algorithms.

Texture is an important characteristic used to identify objects or regions of interest in an image. Unlike spectral features, which describe the average tonal variation in the various bands of an image, textural features contain information about the spatial distribution of tonal variations within a band.

It is essential that filtering has not been applied previously on the input channel, because filtering smoothes out an image, and eliminates or alters its textural properties.

For each selected texture measure, HISTEX creates an image in which gray levels represent the value of the measure in the input image. The textural measures are derived from a histogram of pixel values in a rectangular window you specify. The window slides over the input image, and computed texture measures are assigned to the central pixel of the consecutive positions of the window.

The output images contain the raw texture measures, which may vary in ranges of values. To avoid loss of important information, always save in 32-bit real channels. After assessing the distribution of texture-measure values by running the HIS algorithm, you can scale the images to the range you want by running the SCALE algorithm.

With the MASK parameter, you specify the area within the input channel to process.

If you specify a single value, it represents the channel number of the bitmap segment in the input file.

Only the pixels under the bitmap are processed. The rest of the image remains unchanged.

If you specify four values, they define the x and y offsets and the x and y dimensions of a rectangular window identifying the area to process. Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

If you do not specify a value, the entire channel is processed. If the specified bitmap is empty (all pixels set to zero), a warning is displayed and processing does not occur.

HISTEX cannot process pixels on or near the edges of the image, because all the required pixels are not within it. Therefore, when an entire image is processed with a rectangular window that is x-pixels by y-lines, the first and last (X+1)/2 pixels per line will be the same and the first and last (Y+1)/2 lines in the output image will be the same. Each will contain a replicated value of the closest processed pixel. Avoid these regions when selecting training data for supervised classification. If a partial image is processed, the input image buffers are extended towards the margins as far as possible, so that all pixels in the selected area receive computed textures; however, pixels closer than a half-window to the image edge will contain replicated values.

The texture measures extracted by HISTEX are based on statistics of pixel values in the window. They complement measures extracted by running the TEX algorithm, based on a gray-level co-occurrence matrix (GLCM), and with the HISTEX algorithm, based on the histogram of pixel values in a window. To conduct additional analysis, such as standard segmentation and classification of the image, you can combine the three types of measures.

Back to top

Example

Create all 12 32-bit real texture-measure images from a 16-bit ERS-1 image on channel 11 of the irvine.pix file. Use exactly 50 pixels to compute the weighted-rank fill-ratio measure (50 pixels in a window with 25*25 pixels is equivalent to 50*100%/625 = 8%).

from pci.pcimod import pcimod
from pci.histex import histex

file='irvine.pix'
pciop='ADD'
pcival=[0,0,0,12]              #Add 12 32R channels

pcimod(file,pciop,pcival)

dbic = [11]                    #Radar image
texture = range(1,12+1)        #Select required texture
dboc    = range(12,23+1)
flsz    = [25,25]              #Filter Size in pixels
mask    = [12]                 #Process under bitmap
fillpct = [8]                  #Percent of brightest fill pixels

histex (file,dbic,texture,dboc,flsz,mask,fillpct)
Back to top

Algorithm

In the description of images, pixel color and brightness are parameters used commonly. A parameter used less often is the texture (graininess). As opposed to color and brightness, which are associated with one pixel, texture describes relationships between values of different pixels. Textures can be derived from global statistics of pixel values in a window, or from statistics of differences between pixel values.

HISTEX derives the measures derived from global statistics or a histogram of pixel values. The TEX algorithm derives measures from the statistics of differences or a global co-occurrence matrix.

Most of the texture measures HISTEX computes are based on the paper by Dekker cited in References.

The measures are extracted in a window with pixels (K) and lines (L), sliding over successive pixels of the image.

The supported texture measures are defined as follows:
The supported measures are as follows:

The preceding textural measures describe general characteristics of pixel values in the window. Each measure by itself contains little specific information. When combined with other information, however, the results of classification or segmentation of the underlying image may be improved. If necessary, you can combine these textural measures with those extracted by running the TEX algorithm. The best and most effective combination depends on the sensor type (optical, SAR) and the land-cover type. Some experimentation may be required to produce satisfactory results.

Back to top

References

Dekker, R.J. (2003). Texture Analysis and Classification of ERS SAR Images for Map Updating of Urban Areas in The Nederlands. IEEE Trans. Geosci. Remote Sensing, Vol. 41, No. 9, 1950-1958.

Beyer, W.H., editor (1984). CRC Standard Mathematical Tables, 27th Edition. CRC Press, Inc. Boca Raton, Florida.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.