Nodes/opencv-comfyui/OpenCV filterSpeckles_1
ComfyUI Node

OpenCV filterSpeckles_1

The twin for disparity cleanup, identical in every way that matters

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV filterSpeckles_1
  • img
  • buf
  • nparray_0
  • nparray_1
newVal
maxSpeckleSize
maxDiff

filterSpeckles_1 is the second auto-generated overload of cv2.filterSpeckles, and it is the same node as filterSpeckles_0 as far as you'll ever be able to tell: same inputs (img, newVal, maxSpeckleSize, maxDiff, optional buf), same two nparray outputs, same behavior. The pack numbers overloads from OpenCV's type stubs; both schemas came out identical, so you get two nodes that do one job. Pick either.

The job, in one breath: it's the cleanup pass for stereo disparity maps - it finds tiny isolated regions of wrong depth (speckles) in the output of a stereo matcher and repaints them with a single value (newVal, conventionally a large negative for "invalid"), so your depth map stops looking like it has static on it. It's not a photo filter; if you're not producing disparity maps via stereo matching, skip it entirely. Details, tuning (maxSpeckleSize, maxDiff), and the two-output gotcha (output 0 is the cleaned map, output 1 is OpenCV's scratch buffer) are all on the filterSpeckles_0 page.

Installing it

It ships with the whole geroldmeisinger/opencv-comfyui pack. ComfyUI Manager → search opencv-comfyui, or:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui

then restart. Requirements: opencv-contrib-python, numpy, torch. If startup throws Cannot import name 'guidedFilter' from 'cv2.ximgproc', that's the known conflicting-OpenCV problem - one consistent install fixes it.

Pack-wide rules apply: nparrays in and out (Image2Nparray / Nparrays2Image), batch size 1 (use ImageFromBatch with length 1 if not).

That's all there is. This node exists because auto-generation is exhaustive, not because it offers anything the _0 variant doesn't - the useful writing is on the filterSpeckles_0 page, and this one is just its shadow.

Categoryimage/OpenCV

Inputs (5)

NameTypeDefaultDescription
imgNPARRAY
newValFLOAT
maxSpeckleSizeINT
maxDiffFLOAT
bufoptNPARRAY

Outputs (2)

NameTypeDescription
nparray_0NPARRAY
nparray_1NPARRAY