read_gray_se ( : SE : FileName : )

Load a structuring element for gray morphology.

read_gray_se loads a structuring element for gray morphology from a file. The file names of these structuring elements must end in '.gse' (for gray-scale structuring element). This suffix is automatically appended by read_gray_se to the passed file name, and thus must not be passed. The structuring element's data must be contained in the file in the following format: The first two numbers in the file determine the width and height of the structuring element, and determine a rectangle enclosing the structuring element. Both values must be greater than 0. Then, Width*Height integer numbers follow, with the following interpretation: Values smaller than 0 are regarded as not belonging to the region of the structuring element, i.e., they are not considered in morphological operations. This allows the creation of irregularly shaped, not connected structuring elements. All other values are regarded as the corresponding values for gray morphology. Structuring elements are stored internally as byte-images, with negative values being mapped to 0, and all other values increased by 1. Thus, normal byte-images can also be used as structuring elements. However, care should be taken not to use too large images, since the runtime is proportional to the area of the image times the area of the structuring element.


Parameters

SE (output_object)
image -> object : byte
Generated structuring element.

FileName (input_control)
filename -> string
Name of the file containing the structuring element.


Result

read_gray_se returns 2 (H_MSG_TRUE) if all parameters are correct. If the file cannot be opened, 5 (H_MSG_FAIL) is returned. Otherwise, an exception is raised.


Parallelization Information

read_gray_se is reentrant and processed without parallelization.


Possible Successors

gray_erosion, gray_dilation, gray_opening, gray_closing, gray_tophat, gray_bothat


Alternatives

gen_disc_se


See also

read_image, paint_region, paint_gray, crop_part


Module

Image filters



Copyright © 1996-2005 MVTec Software GmbH