Directional morphological dilation (max over the kernel). max/min are naturally separable and iterable on the GPU: iterations repeats the pass. Combine with render_erode_dir for open/close/gradient (bit-identical to OpenCV over the whole image — clamp-to-edge equals the ±inf border under max/min).

Module:GPU render · Task type:render_dilate_dir

Ports

Inputs

PortTypeRequired
inImage / cv::Mat✓

Outputs

PortTypeRequired
outtask_graph::Image✓

Parameters

参数类型默认值范围 / 选项说明
script_pathstring(空)custom render script path (from an effect manifest; empty = built-in effects)
widthint0[0, 65535]target width in pixels; 0 follows the input
heightint0[0, 65535]target height in pixels; 0 follows the input
formatenum0rgba8 / rgba32frender target texture format
clearbooltrueclear the target at pass start
clear_colorstring"0,0,0,0"clear color as comma-separated RGBA components
blendboolfalseenable blended output
ksizeint3[1, 31] (step 2)kernel edge length in pixels; must be a positive odd number
directionenum0horizontal / vertical

Example graph

A minimal runnable pipeline (read → process → write). Drag it into GraphStudio or open via --open; replace data/test.png with a real path.

{
  "version": "2.0",
  "tasks": [
    {
      "id": "read",
      "type": "opencv_image_read",
      "params": {
        "file_path": "data/test.png"
      }
    },
    {
      "id": "node",
      "type": "render_dilate_dir",
      "params": {
        "width": 0,
        "height": 0,
        "format": 0,
        "clear": true,
        "clear_color": "0,0,0,0",
        "blend": false,
        "ksize": 3,
        "direction": 0
      }
    },
    {
      "id": "save",
      "type": "opencv_image_write",
      "params": {
        "file_path": "out_out.png"
      }
    }
  ],
  "edges": [
    {
      "from": "read",
      "from_port": "out",
      "to": "node",
      "to_port": "in"
    },
    {
      "from": "node",
      "from_port": "out",
      "to": "save",
      "to_port": "in"
    }
  ]
}

Part of the GraphStudio node guide series; parameters reflect the latest release.