write_cooc_matrix ( Regions, Image : : CoocFile, NumGray, Comment, Matrices : )
Generate co-occurrence matrices and write them to a file.
The operator write_cooc_matrix generates the
corresponding co-occurrence matrices from the input images. A gray
value reduction to a maximum of 16 gray values of gray is carried
out. The horizontal~(H), the vertical~(V), the forward diagonal~(D)
and the backward diagonal~(R) co-occurrence matrix are generated as
well as the gray value distribution~(T). Optionally less
co-occurrence matrices can be generated. The choice is made via
the bit pattern of the four lowest-order bits of Matrices:
Matrix Bit Valence
------------------------------
H 0 1
V 1 2
D 2 4
R 3 8
If, for example, only the matrices H, V and R shall be generated,
this corresponds to the number 11 to be transferred. All four
matrices are generated with the value 15 for Matrices.
The resulting matrices, the gray value table and Comment
are stored in the file CoocFile for further processing
with the operator texture_cooc. The resulting
CoocFile has the form:
# comment line
T: Gray value distribution
[H: Horizontal co-occurrence matrix]
[V: Vertical co-occurrence matrix]
[D: Forward diagonal co-occurrence matrix]
[R: Backward diagonal co-occurrence matrix]
At least one matrix is generated. The elements of the matrices are
integers. The columns of the matrices are each separated by a
comma, the lines by a semicolon. A matrix is concluded by a period.
Parameters
Regions (input_object)
|
region(-array) -> object : byte
|
Regions in which the matrix is to be calculated. |
Image (input_object)
|
image -> object : byte
|
Input image. |
CoocFile (input_control)
|
filename.named -> string
|
File name of the co-occurrence matrices. |
Default value: 'test.coc' |
NumGray (input_control)
|
integer -> integer
|
Number of degrees of gray to be used. |
Default value: 8 |
List of values: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 |
Comment (input_control)
|
string -> string
|
Commentary text incorporated into CoocFile. |
Default value: 'Testmatrix' |
Matrices (input_control)
|
integer -> integer
|
Choice of matrices to be generated (bit pattern). |
Default value: 15 |
List of values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 |
Result
The operator write_cooc_matrix returns the value TRUE if
the input parameters are correct and the file CoocFile
could be generated. Otherwise an exception is raised.
Possible Successors
texture_cooc
Alternatives
gen_cooc_matrix
Copyright © 1996-1997 MVTec Software GmbH