Nodes/opencv-comfyui/OpenCV HoughLinesWithAccumulator_1
ComfyUI Node

OpenCV HoughLinesWithAccumulator_1

The duplicate of 'Hough lines with confidence scores'

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV HoughLinesWithAccumulator_1
  • image
  • lines
  • nparray
rho
theta
threshold
srn
stn
min_theta
max_theta

HoughLinesWithAccumulator_1 is the twin of HoughLinesWithAccumulator_0 - same eight inputs, same (N, 1, 3) output, same cv2.HoughLinesWithAccumulator call. The opencv-comfyui generator numbers every overload, and this one is a duplicate with no behavioral difference. If a workflow saved with the _1 name, it runs identically with _0.

What it does (briefly)

Hough line detection that returns each line as [rho, theta, votes] - the third element being how many edge pixels supported it. That vote count is a confidence score you can threshold, sort, or keep-top-K with, which is the whole reason to pick this over plain HoughLines_*. Read the HoughLinesWithAccumulator_0 article for the full mechanics; everything there holds.

Quick recap of the knobs: image needs to be an 8-bit grayscale nparray (convert with cvtColor code 6, run Canny_0 in front - feeding a 3-channel image trips the img.type() == CV_8UC1 error), rho/theta are the resolution (start 1.0 and 0.0174), threshold is minimum votes, and min_theta/max_theta restrict the angle search. srn/stn stay 0 unless you're doing multi-scale Hough. The lines optional input is the generator's out-parameter; leave it disconnected.

Install

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

or "OpenCV" via ComfyUI Manager, plus pip install opencv-contrib-python. No model files.

Bottom line

There's no decision to make between _0 and _1. The real choice is this node vs. plain HoughLines_0 - and that comes down to whether you need the vote counts as a confidence score. If you don't, the plain version has one fewer column to trip over.

Categoryimage/OpenCV

Inputs (9)

NameTypeDefaultDescription
imageNPARRAY
rhoFLOAT
thetaFLOAT
thresholdINT
srnFLOAT
stnFLOAT
min_thetaFLOAT
max_thetaFLOAT
linesoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY