HALCON Reference Manual 10.0.2
Table of Contents / Image / Features ClassesClassesClasses | | | Operators

gen_cooc_matrixgen_cooc_matrixgen_cooc_matrixGenCoocMatrixGenCoocMatrix (Operator)

Name

gen_cooc_matrixgen_cooc_matrixgen_cooc_matrixGenCoocMatrixGenCoocMatrix — 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)

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

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

HImageArray HRegionArray::GenCoocMatrix(const HImage& Image, const HTuple& LdGray, const HTuple& Direction) const

void HOperatorSetX.GenCoocMatrix(
[in] IHUntypedObjectX* Regions, [in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*Matrix, [in] VARIANT LdGray, [in] VARIANT Direction)

IHImageX* HImageX.GenCoocMatrix(
[in] IHRegionX* Regions, [in] Hlong LdGray, [in] Hlong Direction)

IHImageX* HRegionX.GenCoocMatrix(
[in] IHImageX* Image, [in] Hlong LdGray, [in] Hlong Direction)

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)

Description

The operator gen_cooc_matrixgen_cooc_matrixgen_cooc_matrixGenCoocMatrixGenCoocMatrix 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. LdGrayLdGrayLdGrayLdGrayldGray indicates the number of gray values to be distinguished (namely 2^LdGray).

Example: Input image with gray values     0 0 3
         (scaled with LdGray=2)           1 1 2
                                          1 2 3

        Co-occurrence matrix (not scaled):

                2 0 0 1          0 1 1 0
            0:  0 2 2 0    135:  1 0 1 1
                0 2 0 1          1 1 0 0
                1 0 1 0          0 1 0 0

                0 2 0 0          0 1 0 0
           90:  2 2 1 0     45:  1 2 0 1
                0 1 0 2          0 0 2 0
                0 0 2 0          0 1 0 0
 

Parallelization

Parameters

RegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHRegionXHobject

Region to be checked.

ImageImageImageImageimage (input_object)  image objectHImageHImageHImageXHobject (byte)

Image providing the gray values.

MatrixMatrixMatrixMatrixmatrix (output_object)  image(-array) objectHImageHImageHImageXHobject * (real)

Co-occurrence matrix (matrices).

LdGrayLdGrayLdGrayLdGrayldGray (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Number of gray values to be distinguished (2^LdGray).

Default value: 6

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

Typical range of values: 1 ≤ LdGray LdGray LdGray LdGray ldGray ≤ 256 (lin)

Minimum increment: 1

Recommended increment: 1

DirectionDirectionDirectionDirectiondirection (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Direction of neighbor relation.

Default value: 0

List of values: 0, 45, 90, 135

Result

The operator gen_cooc_matrixgen_cooc_matrixgen_cooc_matrixGenCoocMatrixGenCoocMatrix 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>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("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>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>). If necessary an exception is raised.

Possible Predecessors

draw_regiondraw_regiondraw_regionDrawRegionDrawRegion, gen_circlegen_circlegen_circleGenCircleGenCircle, gen_ellipsegen_ellipsegen_ellipseGenEllipseGenEllipse, gen_rectangle1gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1, gen_rectangle2gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2, thresholdthresholdthresholdThresholdThreshold, erosion_circleerosion_circleerosion_circleErosionCircleErosionCircle, binomial_filterbinomial_filterbinomial_filterBinomialFilterBinomialFilter, gauss_imagegauss_imagegauss_imageGaussImageGaussImage, smooth_imagesmooth_imagesmooth_imageSmoothImageSmoothImage, sub_imagesub_imagesub_imageSubImageSubImage

Alternatives

cooc_feature_imagecooc_feature_imagecooc_feature_imageCoocFeatureImageCoocFeatureImage

See also

cooc_feature_matrixcooc_feature_matrixcooc_feature_matrixCoocFeatureMatrixCoocFeatureMatrix

Module

Foundation


Table of Contents / Image / Features ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH