PV-WAVE Extreme Advantage > Image Processing Toolkit User Guide > Reference A–I > GLRL Function (PV-WAVE Extreme Advantage)
GLRL Function (PV-WAVE Extreme Advantage)
Computes the graylevel run length (GLRL) matrix used for textural analysis of an image.
Usage
result = GLRL(image[, theta])
Input Parameters
image—A 2D image of data type byte, integer, or long.
theta—(optional) A scalar integer specifying the angle (in degrees) at which to measure run lengths. The following values are valid for the theta parameter: 0, 45, 90, and 135 degrees. (Default: 0)
Returned Value
result—2D long array, result(m, n), where m is number of graylevels considered and n is run length, ranging from 0 to N – 1 for an x-by-y image.
For theta = 45, or 135 degrees,        N = (x2 + y2)1/2
For theta = 0,                                  N = x
For theta = 90,                                N = y
The value at result(nm) is the number of m-length runs at graylevel n + Mingray.
Keywords
Maxgray—The maximum gray value in the image to consider. (Default: MAX(image))
Mingray—The minimum gray value in the image to consider. (Default: MIN(image))
Omax—Specifies a variable to hold the maximum gray value used.
Omin—Specifies a variable to hold the minimum gray value used.
Discussion
Graylevel run lengths indicate texture directionality and coarseness in an image. Short graylevel runs indicate finer textures, whereas coarse textures result in long graylevel runs. A diagonal texture produces long graylevel runs at theta = 45, and 135 degrees. Vertically and horizontally shifted textures produce long graylevel runs when theta = 0 and 90 degrees.
Example
; Read a grayscale image.
image = IMAGE_READ(!IP_Data + 'texture.tif')
; Compute the graylevel run length (GLRL).
glrl_array = GLRL(image('pixels'))
; Display the glrl_array.
SURFACE, glrl_array
; Compute the GLRL texture statistics for this image.
glrl_texture = GLRL_STATS(glrl_array, image('width'), $
image('height'))
See Also