cooc_feature_matrix — 2D texture op

• Data kinds: image → feature

• Call: fullseye.apply(img, "cooc_feature_matrix", a=0.5, b=0.5) (the 2-D model is one image plus two scalar knobs a,b∈[0,1])

• HALCON equivalent: cooc_feature_matrix (the HALCON reference is a useful guide to its meaning and parameters)

cooc_feature_matrix: input → output

*The figure is the actual output on a synthetic 128×128 input. Left: input, right: output. Point clouds are drawn as a top-down scatter (brightness = z), 1-D series as a line plot, volumes as the maximum-intensity projection along z, videos as the middle frame, complex images as magnitude; return values that are not pictures are shown as the values themselves.*

Sweeping knob a (0.1 / 0.5 / 0.9, the other knob at its default):

▸ cooc_feature_matrix: knob a sweep (docs site)

Sweeping knob b (0.1 / 0.5 / 0.9, the other knob at its default):

▸ cooc_feature_matrix: knob b sweep (docs site)

Usage

Computes the Haralick texture feature energy (angular second moment, i.e., how concentrated the matrix values are = texture uniformity) from a gray-level co-occurrence matrix (GLCM, skimage.feature.graycomatrix, quantized to 16 levels, distance 1+3*a, angle 0 degrees). Equivalent to HALCON's cooc_feature_matrix (Calculate gray value features from a co-occurrence matrix.) (HALCON can return multiple features and multiple angles simultaneously, but this is simplified to energy at a fixed 0-degree angle).

a sweeps the pixel distance at which co-occurrence is taken over the range 1-4. ★With b >= 0.75 it averages over the 4 directions 0/45/90/135 degrees (the default b=0.5 still uses only 0 degrees as before, so existing results do not change by even 1 bit).

Measuring rotated real textures (brick / grass / gravel) (section 6 of poc_real_texture_invariance) shows that whether it helps depends on the distance a:

• First, increasing a collapses the resolution between materials itself (0.0328 -> 0.0122, a factor of 1/2.7). The spread of the anisotropic brick swells to 0.30 -> 3.13 times the resolution.

• Averaging over 4 directions helps isotropic materials at short and medium distances (grass 0.23 -> 0.12, gravel 0.20 -> 0.11).

• For the anisotropic brick it helps only at distance 4 (3.13 -> 1.54) and actually makes things worse at distance 1 (0.30 -> 0.56).

• At distance 4 even the isotropic grass does not improve (0.17 -> 0.19) -- once the resolution has collapsed, averaging cannot win it back.

When using long distances, check that the materials are still separated before applying the average. Note that measuring by "number of mix-ups" is sensitive to the procedure (interpolation order, cropping method, angle step); the ratio (spread / resolution) is more stable.

Detailed usage guide

• gallery2d_texture_freq family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Try it in Studio

The program below has been verified to run (same input as the figure). In Studio's help this block becomes buttons that load and run it on the spot.

cooc_feature_matrix 0.50 0.50

▸ Load this pipeline  ·  Load & run

Runnable examples (verified samples that actually call this op)

• gallery2d_texture_freq — py -3.11 examples/gallery2d_texture_freq.py

• poc_real_texture_invariance — py -3.11 examples/poc_real_texture_invariance.py

Ops the type connects to (they accept feature as input)

identity · feature_to_img

Same category (texture)

std_filter · local_bimodality · local_std · scale_select_std · bootstrap_std_error · structure_tensor_orientation · structure_tensor_coherence · gabor


*Provenance: ops.py — 2D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.