CUDALink`
CUDALink`

CUDAImageSubtract

CUDAImageSubtract[img,x]

subtracts an amount x from each channel value in img.

CUDAImageSubtract[mem,x]

subtracts an amount x from each channel value in mem.

CUDAImageSubtract[img1,img2]

gives an image in which each pixel is the difference of the corresponding pixels in img1 and img2.

CUDAImageSubtract[mem1,mem2]

gives a CUDAMemory in which each pixel is the difference of the corresponding pixels in mem1 and mem2.

Details

  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • CUDAImageSubtract works with binary, grayscale, and other images.
  • CUDAImageSubtract works with CUDAMemory and lists.
  • CUDAImageSubtract[image1,val] is equivalent to ImageSubtract[image1,val].
  • The image returned by CUDAImageSubtract[image,] has the same dimensions as image.
  • If image2 is a single-channel image, each channel of image1 is subtracted by image2 in CUDAImageSubtract[image1,image2].
  • In CUDAImageSubtract[image,x], the number x is normally in the range 0 to 1.
  • CUDAImageSubtract[image,x] gives an image with the same underlying data type as image, clipping or truncating values if necessary.
  • CUDAImageSubtract[image1,image2] gives an image with the type of image1, clipping or truncating values if necessary.
  • The following options can be given:
  • "Device"Automaticdevice used for CUDA computation
    "OutputMemory"NoneCUDAMemory where output is stored

Examples

open allclose all

Basic Examples  (3)

First, load the CUDALink application:

This subtracts an image from another:

Subtracting a constant amount from each color channel darkens an image:

CUDAImageSubtract can be used to subtract rank 2 or 3 lists:

Applications  (1)

This defines the TopHatTransform using CUDALink:

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

Text

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

BibTeX

@misc{reference.wolfram_2021_cudaimagesubtract, author="Wolfram Research", title="{CUDAImageSubtract}", year="2010", howpublished="\url{https://reference.wolfram.com/language/CUDALink/ref/CUDAImageSubtract.html}", note=[Accessed: 18-June-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_cudaimagesubtract, organization={Wolfram Research}, title={CUDAImageSubtract}, year={2010}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDAImageSubtract.html}, note=[Accessed: 18-June-2021 ]}

CMS

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

APA

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