CUDALink`
CUDALink`

CUDAImageMultiply

CUDAImageMultiply[img,x]

multiplies an amount x to each channel value in img.

CUDAImageMultiply[mem,x]

multiplies an amount x to each channel value in mem.

CUDAImageMultiply[img1,img2]

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

CUDAImageMultiply[mem1,mem2]

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

Details and Options

  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • CUDAImageMultiply works with binary, grayscale, and other images.
  • CUDAImageMultiply works with CUDAMemory and lists.
  • CUDAImageMultiply[image1,x] is equivalent to ImageMultiply[image1,x] and CUDAImageDivide[image1,1/x].
  • The image returned by CUDAImageMultiply[image,] has the same dimensions as image.
  • image1 and image2 must be the same dimensions in CUDAImageMultiply[image1,image2].
  • If image2 is a single-channel image, each channel of image1 is multiplied by image2 in CUDAImageMultiply[image1,image2].
  • In CUDAImageMultiply[image,x], the number x is normally in the range 0 to 1.
  • CUDAImageMultiply[image,x] gives an image with the same underlying data type as image, clipping or truncating values if necessary.
  • CUDAImageMultiply[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  (4)

First, load the CUDALink application:

This multiplies two images together:

This multiplies an image with a constant value 2.0:

Logical AND of two binary images:

CUDAImageMultiply can be used to multiply rank 2 or 3 lists:

Neat Examples  (1)

Multiplying two images together can produce an overlay effect:

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2023_cudaimagemultiply, author="Wolfram Research", title="{CUDAImageMultiply}", year="2010", howpublished="\url{https://reference.wolfram.com/language/CUDALink/ref/CUDAImageMultiply.html}", note=[Accessed: 28-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_cudaimagemultiply, organization={Wolfram Research}, title={CUDAImageMultiply}, year={2010}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDAImageMultiply.html}, note=[Accessed: 28-March-2024 ]}