WOLFRAM

ImageCooccurrence
ImageCooccurrence

gives the n×n co-occurrence matrix for image.

ImageCooccurrence[image,n,ker]

computes a co-occurrence matrix for arbitrary spatial relationships specified by a kernel ker.

Details and Options

  • ImageCooccurrence[image,n] returns an n×n matrix m whose elements mij represent the probability of all occurrences of a pixel with intensity i to the left or bottom of a pixel with intensity j, assuming all pixels to lie in one of n successive bins.
  • With ImageCooccurrence[image,n,ker], the co-occurrence matrix can be computed for arbitrary spatial relationships specified by a matrix ker.
  • The default two-dimensional kernel used by ImageCooccurrence is .
  • ImageCooccurrence[{image1,image2},] computes the co-occurrence matrix across two images. The images must have the same dimensions.
  • ImageCooccurrence supports a Masking option. The default setting is Masking->All, constructing the co-occurrence matrix based on all of the image pixels.

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

A co-occurrence matrix:

Out[1]=1

3D profile of a co-occurrence matrix:

Out[1]=1

Scope  (4)Survey of the scope of standard use cases

Graylevel co-occurrence matrix, computed for a color image:

Out[1]=1

Joint histogram of two color channels of the same image:

Out[1]=1

Specify a horizontally symmetric kernel:

Out[1]=1

Specify a diagonal kernel that matches the pattern of the image:

Out[1]=1

Options  (1)Common values & functionality for each option

Masking  (1)

Use a binary mask to specify the region of interest:

Out[1]=1

Applications  (2)Sample problems that can be solved with this function

Define a function that computes the Haralick texture contrast measure:

Contrast of a checkerboard image and a flat image:

Out[2]=2

Haralick texture correlation measure for grayscale images:

Compute the horizontal correlation:

Out[2]=2

Vertical correlation:

Out[3]=3

Properties & Relations  (4)Properties of the function, and connections to other functions

Co-occurrence matrix of a random image:

Out[1]=1

The total of all elements of the co-occurrence matrix is 1:

Out[1]=1

Co-occurrence matrix of a checkerboard image:

Co-occurrence matrix of a striped image using a horizontal kernel:

Wolfram Research (2010), ImageCooccurrence, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCooccurrence.html.
Wolfram Research (2010), ImageCooccurrence, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCooccurrence.html.

Text

Wolfram Research (2010), ImageCooccurrence, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCooccurrence.html.

Wolfram Research (2010), ImageCooccurrence, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCooccurrence.html.

CMS

Wolfram Language. 2010. "ImageCooccurrence." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ImageCooccurrence.html.

Wolfram Language. 2010. "ImageCooccurrence." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ImageCooccurrence.html.

APA

Wolfram Language. (2010). ImageCooccurrence. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageCooccurrence.html

Wolfram Language. (2010). ImageCooccurrence. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageCooccurrence.html

BibTeX

@misc{reference.wolfram_2025_imagecooccurrence, author="Wolfram Research", title="{ImageCooccurrence}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/ImageCooccurrence.html}", note=[Accessed: 26-April-2025 ]}

@misc{reference.wolfram_2025_imagecooccurrence, author="Wolfram Research", title="{ImageCooccurrence}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/ImageCooccurrence.html}", note=[Accessed: 26-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_imagecooccurrence, organization={Wolfram Research}, title={ImageCooccurrence}, year={2010}, url={https://reference.wolfram.com/language/ref/ImageCooccurrence.html}, note=[Accessed: 26-April-2025 ]}

@online{reference.wolfram_2025_imagecooccurrence, organization={Wolfram Research}, title={ImageCooccurrence}, year={2010}, url={https://reference.wolfram.com/language/ref/ImageCooccurrence.html}, note=[Accessed: 26-April-2025 ]}