OpenCV mulTransposed_1
MulTransposed_1 — the Gram-matrix node's identical twin
- src
- dst
- delta
- nparray
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 forXᵀX).aTa- transpose order;TrueforXᵀX.scale- constant multiplier,1.0neutral.dtype--1keeps input type;6(CV_64F) is safest for matrix math.delta,dst(optional) - centering vector and the out-parameter; leavedstunconnected.
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
srcshape; swapaTa. deltawon't subtract - shape must be compatible withsrc.- "Result is garbage" - it's a matrix. Check it numerically, not visually.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY | — | |
| aTa | BOOLEAN | — | |
| scale | FLOAT | — | |
| dtype | INT | — | |
| dstopt | NPARRAY | — | |
| deltaopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |