Load a structuring element for gray morphology.
load_grey_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 load_grey_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 mut 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 connetcted 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 to not use too large images, since the runtime is proportional to the area of the image times the are of the structuring element.
SE (output_object) |
image -> object : byte |
Generated structuring element. |
FileName (input_control) |
filename.named -> string |
Name of the file containing the structuring element. |
load_grey_se returns TRUE if all parameters are correct. If the file cannot be opened, FAIL is returned. Otherwise, an exception is raised.
grey_erosion, grey_dilation, grey_opening, grey_closing, grey_tophat, grey_bothat
read_image, paint_region__, paint_grey__, crop_image