ImageDifference

ImageDifference[image1,image2]

gives an image in which each pixel is the absolute difference of the corresponding pixels in image1 and image2.

Details

  • The images image1 and image2 must have the same dimensions.
  • ImageDifference works with arbitrary single-channel or multi-channel images.
  • If image1 or image2 is a single-channel image, the absolute difference is computed from each channel of the other image in ImageDifference[image1,image2].
  • If image1 and image2 are both multichannel images, the values in each channel are compared separately.
  • ImageDifference[image1,image2] gives an image with the largest type of either image1 or image2.
  • For binary images, ImageDifference effectively finds the logical XOR of pixel values.
  • ImageDifference works with Image3D objects.

Examples

open allclose all

Basic Examples  (2)

Find differences between two versions of an image:

Logical XOR of two binary images:

Applications  (1)

Find the amount of variation in a fairly constant image:

Properties & Relations  (1)

Negate image pixels specified by a binary mask:

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

Text

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

CMS

Wolfram Language. 2010. "ImageDifference." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/ImageDifference.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_imagedifference, author="Wolfram Research", title="{ImageDifference}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/ImageDifference.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_imagedifference, organization={Wolfram Research}, title={ImageDifference}, year={2012}, url={https://reference.wolfram.com/language/ref/ImageDifference.html}, note=[Accessed: 22-December-2024 ]}