OpenCV compareHist_1
CompareHist_0's twin — same node, second overload slot
- H1
- H2
- float
If you've already met compareHist_0, you've met this node. compareHist_1 is its duplicate: same cv2.compareHist call, same inputs, same float output. The pack auto-generates a node for every overload in OpenCV's type stubs and numbers them, and cv2.compareHist apparently declared two signatures that end up compiling to the same implementation. I diffed the two class bodies - identical apart from the name.
So the honest advice is: pick one and forget the other. Nothing changes.
The short version of what it does
Compares two histograms and returns a similarity score:
- H1 / H2 (NPARRAY) - histograms, same size.
- method (INT) -
0CORREL (higher = similar),1CHISQR (lower = similar),2INTERSECT (higher = similar),3BHATTACHARYYA (lower = similar). Start with2. - Output:
float, a scalar score - not an image.
The caveat that applies to both twins
The pack ships no calcHist node, so you can't produce the H1/H2 inputs inside opencv-comfyui itself. You need histograms from a custom Python node or another source. If you don't already have one, this node has no job for you yet - which is fine, it's an edge-of-the-pack measurement tool, not a daily driver.
Install
Standard for this pack - ComfyUI Manager (search "opencv-comfyui") or:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
Needs opencv-python-contrib (the pack's requirements.txt also lists numpy and torch). Watch for the Cannot import name 'guidedFilter' from 'cv2.ximgproc' conflict if multiple OpenCV packages collide in your environment. And don't try to preview the float output as an image - it's a scalar, and this pack will happily hand you a confusing 'NoneType' object has no attribute 'shape' if you feed it to an image node.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| H1 | NPARRAY | — | |
| H2 | NPARRAY | — | |
| method | INT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| float | FLOAT | — |