Nodes/comfyui_cv/cv2.reprojectImageTo3D
ComfyUI Node

cv2.reprojectImageTo3D

Raw wrapper of cv2.reprojectImageTo3D(disparity, Q, handleMissingValues?, ddepth?). Parameters marked '?' are optional; blank means OpenCV default. See the OpenCV documentation for details.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
cv2.reprojectImageTo3D
  • disparity
  • Q
  • nparray
handleMissingValuesfalse
ddepthsame as input
Categoryimage/CV/low-level/cv2 R

Inputs (4)

NameTypeDefaultDescription
disparityNPARRAY,IMAGE,MASKInput single-channel 8-bit unsigned, 16-bit signed, 32-bit signed or 32-bit floating-point disparity image. The values of 8-bit / 16-bit signed formats are assumed to have no fractional bits. If the disparity is 16-bit signed format, as computed by or Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.
QNPARRAY$4 \times 4$ perspective transformation matrix that can be obtained with A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
handleMissingValuesoptBOOLEANfalseIndicates, whether the function should handle missing values (i.e. points where the disparity was not computed). If handleMissingValues=true, then pixels with the minimal disparity that corresponds to the outliers (see StereoMatcher::compute ) are transformed to 3D points with a very large Z value (currently set to 10000). Preset to the OpenCV default (False).
ddepthoptCOMBOsame as inputThe optional output array depth. If it is -1, the output image will have CV_32F depth. ddepth can also be set to CV_16S, CV_32S or CV_32F. The function transforms a single-channel disparity map to a 3-channel image representing a 3D surface. That is, for each pixel (x,y) and the corresponding disparity d=disparity(x,y) , it computes: $$\begin{bmatrix} X \ Y \ Z \ W \end{bmatrix} = Q \begin{bmatrix} x \ y \ \texttt{disparity} (x,y) \ 1 \end{bmatrix}.$$

Outputs (1)

NameTypeDescription
nparrayNPARRAY