Nodes/opencv-comfyui/OpenCV integral3_1
ComfyUI Node

OpenCV integral3_1

The tilted-table twin nobody should overthink

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV integral3_1
  • src
  • sum
  • sqsum
  • tilted
  • nparray_0
  • nparray_1
  • nparray_2
sdepth
sqdepth

You know the drill by now: OpenCV integral3_1 is the duplicate overload of OpenCV integral3_0. cv2.integral3 appears twice in OpenCV's type stubs (MatLike and UMat), the generator made two numbered nodes, and they behave identically. Read integral3_0 for the full mechanics; this page is the short version plus the bits worth internalizing.

What it does

Computes three integral images in one pass: the plain sum table, the squared-sum table, and a tilted table summed along a 45°-rotated grid. The sum + squared-sum pair give O(1) mean and variance over any axis-aligned rectangle; the tilted table extends that to rotated (diamond) regions - the mechanism behind Haar-feature detectors. It's a niche building block. If you just want adaptive thresholding, local contrast, or a box blur, the pack's adaptiveThreshold_0, blur_0, and threshold_0 are the nodes that give you those results.

Inputs and outputs

  • src - NPARRAY, your image via Image2Nparray.
  • sdepth - INT, depth for the sum table (4 = CV_32S for 8-bit input).
  • sqdepth - INT, depth for the squared-sum table - use float (5 or 6) or overflow.
  • sum, sqsum, tilted - optional out-parameters; all three come back on the output sockets.
  • Outputs nparray_0 (sum), nparray_1 (squared sum), nparray_2 (tilted).

Installing

One pack, one clone, all ~635 nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
cd opencv-comfyui
pip install -r requirements.txt

ComfyUI Manager → search "opencv-comfyui" also works. No model downloads; requirements.txt is opencv-contrib-python, numpy, torch.

Gotchas

Same family warnings: the three outputs are tables, not pictures - don't preview them via Nparrays2Image and panic at the clipped result. Keep batch_size == 1. Keep sqdepth float. And the _1 suffix is overload numbering, not a feature level: this node has nothing integral3_0 lacks. If a shared workflow references _1, just use it - the only real risk is assuming the two variants differ, which they don't.

Categoryimage/OpenCV

Inputs (6)

NameTypeDefaultDescription
srcNPARRAY
sdepthINT
sqdepthINT
sumoptNPARRAY
sqsumoptNPARRAY
tiltedoptNPARRAY

Outputs (3)

NameTypeDescription
nparray_0NPARRAY
nparray_1NPARRAY
nparray_2NPARRAY