IMGHASH

Compute image hash number


EnvironmentsPYTHON :: EASI
Quick linksDescription :: Parameters :: Parameter descriptions :: Return Value :: Details :: Example :: Related

Back to top

Description


IMGHASH computes a hash number that represents a window of image values from a specified image channel. This hash number is used as a checksum for software testing.
Back to top

Parameters


imghash(file, dbic, dbiw)

Name Type Caption Length Value range
FILE * str Input file name 1 -    
DBIC * List[int] Input raster channel(s) 1 -    
DBIW List[int] Raster input window 0 - 4 Xoffset, Yoffset, Xsize, Ysize

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the GDB-supported file containing the image data for which the hash number will be computed.

DBIC

Specifies the channel(s) or layer(s) in the input file to be processed.

DBIW

Specifies the raster window (Xoffset, Yoffset, Xsize, Ysize) that is read from the input layers. If DBIW is not specified, the entire layer is used by default. 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.

Back to top

Return Value

Returns: Image Statistics

Type:  PCI_FLOAT

Parameter: imstat

Upon completion, IMGHASH returns hash values for each of the image channels sampled. This value is always a number between 0 and 32767.

Back to top

Details

IMGHASH computes a hash value for a window of image data in a GDB-supported file. This function is primarily used for the construction of test procedures.

The hash function results in a value between 0 and 32767 being placed into the IMSTAT parameter.

The hash function is computed based on imagery returned by GDBIntChanIO();therefore, all floating point data is truncated to integer before being fed into the hash function.

Back to top

Example

Compute and display the hash values for each of the channels of irvine.pix.

from pci.imghash import imghash

file = "irvine.pix"
dbic = [1,-11]
dbiw = []
hascode = []

hashcode = imghash(file, dbic, dbiw)
print(hashcode)

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