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.
|
SE (output_object) |
image -> Hobject * : HImage ( byte ) |
| Generated structuring element. | |
|
FileName (input_control) |
filename -> HTuple.char * |
| Name of the file containing the structuring element. | |
::read_gray_se returns H_MSG_TRUE if all parameters are correct. If the file cannot be opened, H_MSG_FAIL is returned. Otherwise, an exception is raised.
::gray_erosion, ::gray_dilation, ::gray_opening, ::gray_closing, ::gray_tophat, ::gray_bothat
::read_image, ::paint_region, ::paint_gray, ::crop_part
Image filters