CUDALink`
CUDALink`

CUDAErosion

CUDAErosion[img,r]

gives the morphological erosion of img with respect to a range-r square.

CUDAErosion[list,r]

gives the morphological erosion of list with respect to a range-r square.

CUDAErosion[mem,r]

gives the morphological erosion of mem with respect to a range-r square.

更多信息和选项更多信息
  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • CUDAErosion works with binary, grayscale, and other images.
  • CUDAErosion works with CUDAMemory and lists.
  • CUDAErosion[image,r] is equivalent to Erosion[image,r].
  • If multiple image channels are present, CUDADilation operates on each of them separately.
  • The following options can be given:
  • "Device"Automaticdevice used for CUDA computation
    Padding"Fixed"value used on boundary
    "OutputMemory"NoneCUDAMemory where output is stored
  • 范例

    基本范例  (6)

    First, load the CUDALink application:

    In[1]:=
    Click for copyable input

    Erosion reduces smaller, light features:

    In[2]:=
    Click for copyable input
    Out[2]=

    Erosion of a grayscale image:

    In[1]:=
    Click for copyable input
    Out[1]=

    Erosion operates on each color channel independently:

    In[1]:=
    Click for copyable input
    Out[1]=

    Erosion can be used to perform a max filter on an input list:

    In[1]:=
    Click for copyable input
    Out[1]//MatrixForm=

    CUDAErosion works with graphics objects:

    In[1]:=
    Click for copyable input
    Out[1]=

    Using CUDAMemory, one can speed up computation by reducing the amount of memory operations. This loads memory onto the CPU:

    In[1]:=
    Click for copyable input

    This performs the erosion operation:

    In[2]:=
    Click for copyable input
    Out[2]=

    This gets the memory back to the CPU:

    In[3]:=
    Click for copyable input
    Out[3]=

    Memory must be deleted:

    In[4]:=
    Click for copyable input
    Out[4]=

    参见

    Erosion  CUDADilation  CUDAOpening  CUDAClosing

    教程