1IM_COOC_MATRIX(3) Library Functions Manual IM_COOC_MATRIX(3)
2
3
4
6 im_cooc_matrix, im_cooc_asm, im_cooc_contrast, im_cooc_correlation,
7 im_cooc_entropy - calculate the co-occurrence matrix and features on it
8
10 #include <vips/vips.h>
11
12 int im_cooc_matrix(im, m, xp, yp, xs, ys, dx, dy, sym)
13 IMAGE *im, *m;
14 int xp, yp, xs, ys;
15 int dx, dy;
16 int sym;
17
18 int im_cooc_asm(m, asmoment)
19 IMAGE *m;
20 double *asmoment;
21
22 int im_cooc_contrast(m, contrast)
23 IMAGE *m;
24 double *contrast;
25
26 int im_cooc_correlation(m, correlation)
27 IMAGE *m;
28 double *correlation;
29
30 int im_cooc_entropy(m, entropy)
31 IMAGE *m;
32 double *entropy;
33
34
36 im_cooc_matrix() creates a 256 by 256 one channel co-occurrence matrix
37 of the box determined by the parameters (xp, yp; xs, ys) within the
38 image pointed by the IMAGE descriptor im. The matrix is written onto
39 the IMAGE descriptor m. The displacement vector is determined by (dx,
40 dy). The user must ensure that there is enough border pixels around
41 the box within im dictated by the displacement vector (dx,dy) or else
42 the program fails. All entries of the co-occurrence matrix are double
43 normalised to the number of pairs involved. This function is a direct
44 implementation of the paper: Haralick R. M., Shanmugan K. and Dinstein
45 I., 'Textural features for image classification', IEEE Transactions on
46 Systems, Man, and Cybernetics, Vol. SMC-3, No 6, Nov. 1973, pp
47 610-621. Input im should be one band unsigned char image.
48
49 If flag sym is 1, the created co-occurrence matrix is symmetric that is
50 dispacement vectors (dx, dy), (-dx, -dy) create exactly the same
51 matrix. If sym is 0, the created co-occurrence matrix is not symmetric
52 that is dispacement vectors (dx, dy), (-dx, -dy) create different
53 matrices.
54
55 im_cooc_asm() calculates the angular second moment of the co-occurrence
56 matrix held by m. The result is returned into the location pointed by
57 asmoment.
58
59 im_cooc_contrast() calculates the contrast of the co-occurrence matrix
60 held by m. The result is returned into the location pointed by con‐
61 trast.
62
63 im_cooc_correlation() calculates the correlation of the co-occurrence
64 matrix held by m. The result is returned into the location pointed by
65 correlation.
66
67 im_cooc_entropy() calculates the entropy of the co-occurrence matrix
68 held by m. The result is returned into the location pointed by
69 entropy.
70
72 All functions returns 0 on success and -1 on error.
73
75 im_glds_matrix(3)
76
78 N. Dessipris
79
81 N. Dessipris - 2/12/1991
82
83
84
85 2 Dec 1991 IM_COOC_MATRIX(3)