ClassesClassesClassesClasses | | | | Operators

read_gray_seread_gray_seReadGraySeread_gray_seReadGraySeReadGraySe (Operator)


read_gray_seread_gray_seReadGraySeread_gray_seReadGraySeReadGraySe — Load a structuring element for gray morphology.


read_gray_se( : SE : FileName : )

Herror read_gray_se(Hobject* SE, const char* FileName)

Herror T_read_gray_se(Hobject* SE, const Htuple FileName)

Herror read_gray_se(Hobject* SE, const HTuple& FileName)

HImage HImage::ReadGraySe(const HTuple& FileName)

void ReadGraySe(HObject* SE, const HTuple& FileName)

void HImage::ReadGraySe(const HString& FileName)

void HImage::ReadGraySe(const char* FileName)

void HOperatorSetX.ReadGraySe(
[out] IHUntypedObjectX*SE, [in] VARIANT FileName)

void HImageX.ReadGraySe([in] BSTR FileName)

static void HOperatorSet.ReadGraySe(out HObject SE, HTuple fileName)

void HImage.ReadGraySe(string fileName)


read_gray_seread_gray_seReadGraySeread_gray_seReadGraySeReadGraySe 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_seread_gray_seReadGraySeread_gray_seReadGraySeReadGraySe 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 line specifies the data type of the structuring element as 'byte', 'uint2' or 'real' (without enclosing quotes). It must match the image type of the image to be processed in subsequent operator calls using this structuring element. The following 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 the number of chords of the region to be defined follows. Then the chords themselves follow: Each chord is defined by the row of the chord (L), the column begin (CB) and the column end (CE), separated by a space between them. Then values follow that are regarded as the corresponding values for gray morphology (their number depends on the defined width and height of the structuring element). Values that will not be part of the region of the structuring element (because no chord is defined for this points) must not be omitted. Nevertheless they will be ignored in the resulting structuring element. Structuring elements are stored internally as images with the data type specified above. Normal images can also be used as structuring elements, where the region of the image defines the shape of the structuring element. However, take care not to use too large images, since the runtime is proportional to the area of the image multiplied by the area of the structuring element. Flat structuring elements (i.e. elements with constant grayvalues) will be executed particularly fast though. The origin of the structuring element lies at half of the defined width and height. For even dimensions the origin will be rounded towards the upper left corner. The structuring element can be saved as image with the help of the operator write_imagewrite_imageWriteImagewrite_imageWriteImageWriteImage. However, take care to use an image format that supports alpha channels to save the shape of the structuring element such as 'tiff', 'jp2' or 'png'. These files can then be loaded again with the operator read_imageread_imageReadImageread_imageReadImageReadImage.



SESESESESESE (output_object)  image objectHImageHImageHImageHImageXHobject * (byte / uint2 / real)

Generated structuring element.

FileNameFileNameFileNameFileNameFileNamefileName (input_control) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Name of the file containing the structuring element.

File extension: .gse

Example (HDevelop)

* Load a byte structuring element of width 3 and height 3 that
* consists of 3 chords at lines 0 (from x=1 to x=1), 1 (from x=0
* to x=2) and 2 (from x=1 to x=1). The (used) grayvalues are
* 0, 0, 1, 0, 0 .
* contents of file 'isod4.gse':
* byte
*  3 3
* 3
* 0 1 1
* 1 0 2
* 2 1 1
*  -1  0 -1
*   0  1  0
*  -1  0 -1
read_gray_se (SE, environment('HALCONROOT')+'/filter/isod4')


read_gray_seread_gray_seReadGraySeread_gray_seReadGraySeReadGraySe returns 2 (H_MSG_TRUE) if all parameters are correct. Otherwise, an exception is raised.

Possible Successors

gray_erosiongray_erosionGrayErosiongray_erosionGrayErosionGrayErosion, gray_dilationgray_dilationGrayDilationgray_dilationGrayDilationGrayDilation, gray_openinggray_openingGrayOpeninggray_openingGrayOpeningGrayOpening, gray_closinggray_closingGrayClosinggray_closingGrayClosingGrayClosing, gray_tophatgray_tophatGrayTophatgray_tophatGrayTophatGrayTophat, gray_bothatgray_bothatGrayBothatgray_bothatGrayBothatGrayBothat, write_imagewrite_imageWriteImagewrite_imageWriteImageWriteImage


gen_disc_segen_disc_seGenDiscSegen_disc_seGenDiscSeGenDiscSe, read_imageread_imageReadImageread_imageReadImageReadImage, change_domainchange_domainChangeDomainchange_domainChangeDomainChangeDomain

See also

paint_regionpaint_regionPaintRegionpaint_regionPaintRegionPaintRegion, paint_graypaint_grayPaintGraypaint_grayPaintGrayPaintGray, crop_partcrop_partCropPartcrop_partCropPartCropPart



ClassesClassesClassesClasses | | | | Operators