gen_cooc_matrixgen_cooc_matrixGenCoocMatrixGenCoocMatrixgen_cooc_matrix (Operator)

Name

gen_cooc_matrixgen_cooc_matrixGenCoocMatrixGenCoocMatrixgen_cooc_matrix — Calculate the co-occurrence matrix of a region in an image.

Signature

gen_cooc_matrix(Regions, Image : Matrix : LdGray, Direction : )

Herror gen_cooc_matrix(const Hobject Regions, const Hobject Image, Hobject* Matrix, const Hlong LdGray, const Hlong Direction)

Herror T_gen_cooc_matrix(const Hobject Regions, const Hobject Image, Hobject* Matrix, const Htuple LdGray, const Htuple Direction)

void GenCoocMatrix(const HObject& Regions, const HObject& Image, HObject* Matrix, const HTuple& LdGray, const HTuple& Direction)

HImage HImage::GenCoocMatrix(const HRegion& Regions, Hlong LdGray, Hlong Direction) const

HImage HRegion::GenCoocMatrix(const HImage& Image, Hlong LdGray, Hlong Direction) const

static void HOperatorSet.GenCoocMatrix(HObject regions, HObject image, out HObject matrix, HTuple ldGray, HTuple direction)

HImage HImage.GenCoocMatrix(HRegion regions, int ldGray, int direction)

HImage HRegion.GenCoocMatrix(HImage image, int ldGray, int direction)

def gen_cooc_matrix(regions: HObject, image: HObject, ld_gray: int, direction: int) -> HObject

Description

The operator gen_cooc_matrixgen_cooc_matrixGenCoocMatrixGenCoocMatrixgen_cooc_matrix determines from the input regions how often the gray values i and j are located next to each other in a certain direction (0, 45, 90, 135 degrees), stores this number in the co-occurrence matrix at the locations (i,j) and (j,i) (the matrix is symmetrical), and finally scales the matrix with the number of entries. LdGrayLdGrayLdGrayldGrayld_gray indicates the number of gray values to be distinguished (namely ).

Example: Input image with gray values (scaled with LdGrayLdGrayLdGrayldGrayld_gray=2)

Co-occurrence matrix (not scaled):

Attention

Note that the operator gen_cooc_matrixgen_cooc_matrixGenCoocMatrixGenCoocMatrixgen_cooc_matrix only considers the given RegionsRegionsRegionsregionsregions and ignores any previously set domain of the input image ImageImageImageimageimage.

Execution Information

Parameters

RegionsRegionsRegionsregionsregions (input_object)  region(-array) objectHRegionHObjectHObjectHobject

Region to be checked.

ImageImageImageimageimage (input_object)  singlechannelimage objectHImageHObjectHObjectHobject (byte)

Image providing the gray values.

MatrixMatrixMatrixmatrixmatrix (output_object)  image(-array) objectHImageHObjectHObjectHobject * (real)

Co-occurrence matrix (matrices).

LdGrayLdGrayLdGrayldGrayld_gray (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of gray values to be distinguished ( ).

Default: 6

List of values: 1, 2, 3, 4, 5, 6, 7, 8

Value range: LdGray LdGray LdGray ldGray ld_gray (lin)

Minimum increment: 1

Recommended increment: 1

DirectionDirectionDirectiondirectiondirection (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Direction of neighbor relation.

Default: 0

List of values: 0, 45, 90, 135

Result

The operator gen_cooc_matrixgen_cooc_matrixGenCoocMatrixGenCoocMatrixgen_cooc_matrix returns the value 2 ( H_MSG_TRUE) if an image with defined gray values is entered and the parameters are correct. The behavior in case of empty input (no input images available) is set via the operator set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>), the behavior in case of empty region is set via set_system(::'empty_region_result',<Result>:)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>). If necessary an exception is raised.

Possible Predecessors

draw_regiondraw_regionDrawRegionDrawRegiondraw_region, gen_circlegen_circleGenCircleGenCirclegen_circle, gen_ellipsegen_ellipseGenEllipseGenEllipsegen_ellipse, gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1gen_rectangle1, gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2gen_rectangle2, thresholdthresholdThresholdThresholdthreshold, erosion_circleerosion_circleErosionCircleErosionCircleerosion_circle, binomial_filterbinomial_filterBinomialFilterBinomialFilterbinomial_filter, gauss_filtergauss_filterGaussFilterGaussFiltergauss_filter, smooth_imagesmooth_imageSmoothImageSmoothImagesmooth_image, sub_imagesub_imageSubImageSubImagesub_image

Alternatives

cooc_feature_imagecooc_feature_imageCoocFeatureImageCoocFeatureImagecooc_feature_image

See also

cooc_feature_matrixcooc_feature_matrixCoocFeatureMatrixCoocFeatureMatrixcooc_feature_matrix

Module

Foundation