Nodes/opencv-comfyui/OpenCV mulTransposed_1
ComfyUI Node

OpenCV mulTransposed_1

MulTransposed_1 — the Gram-matrix node's identical twin

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV mulTransposed_1
  • src
  • dst
  • delta
  • nparray
aTa
scale
dtype

mulTransposed_1 is the duplicate of mulTransposed_0. Same inputs - src, aTa, scale, dtype, plus optional delta and dst - same nparray output, same cv2.mulTransposed call. If you need the details, the _0 article is the full guide. This one is the "twin" article, short on purpose.

What it computes

The Gram / scatter matrix: with aTa=True, dst = scale · (src - delta)ᵀ · (src - delta) - that's XᵀX, the object at the heart of covariance analysis and PCA. With aTa=False you get the other transpose order, XXᵀ. delta lets you center the data first. This is linear algebra, not image processing, and it's for the rare workflow that genuinely needs a covariance-style matrix built inside the graph (usually heading into eigen_0 or eigenNonSymmetric_0).

The honest verdict from the _0 article applies here too: if you actually need a Gram matrix, a Python/numpy script is usually a better home. This node exists because geroldmeisinger/opencv-comfyui wraps every simple-typed top-level cv2 function, and it's a perfectly good educational toy - just don't build your pipeline around it unless you have a specific math need.

Inputs in one breath

  • src - the data matrix (samples × features for XᵀX).
  • aTa - transpose order; True for XᵀX.
  • scale - constant multiplier, 1.0 neutral.
  • dtype - -1 keeps input type; 6 (CV_64F) is safest for matrix math.
  • delta, dst (optional) - centering vector and the out-parameter; leave dst unconnected.

Output: a matrix nparray, never an image - don't feed it to Nparrays2Image.

Why two?

The generator emits one node per OpenCV overload (MatLike / UMat), and both collapse onto the same NPARRAY type. So mulTransposed_0 and _1 are functionally identical, same as every other _0/_1 pair in this pack. Pick _0.

Installing

ComfyUI Manager → "opencv-comfyui", or:

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

restart. Dependency: opencv-contrib-python.

Troubleshooting

  • Dimension mismatch - wrong transpose order for your src shape; swap aTa.
  • delta won't subtract - shape must be compatible with src.
  • "Result is garbage" - it's a matrix. Check it numerically, not visually.
Categoryimage/OpenCV

Inputs (6)

NameTypeDefaultDescription
srcNPARRAY
aTaBOOLEAN
scaleFLOAT
dtypeINT
dstoptNPARRAY
deltaoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY