Nodes/comfyui_cv/CV Point Cloud Normals
ComfyUI Node

CV Point Cloud Normals

Estimates a surface normal per point by fitting a plane to each point's k nearest neighbours (cv2.ppf_match_3d.computeNormalsPC3d) and returns the Nx6 (x,y,z,nx,ny,nz) cloud the surface-matching nodes need. WIRE THIS IN FRONT OF 'CV PPF Pose Estimation' and 'CV ICP Register': given a bare Nx3 cloud those run 31x-100x slower and answer with a silently wrong pose instead of complaining. The plane fit leaves the SIGN of each normal arbitrary; 'flip toward viewpoint' orients them all towards a camera position, which is what you want for a cloud reconstructed from one view. Failure tolerant: fewer than 3 points (or a cv2 error) gives empty outputs with found=false.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Point Cloud Normals
  • points
  • cloud
  • normals
  • found
num_neighbors12
orientationas computed (sign arbitrary)
viewpoint_x0.0
viewpoint_y0.0
viewpoint_z0.0
Categoryimage/CV/points

Inputs (6)

NameTypeDefaultDescription
pointsNPARRAYNx3 point cloud (an Nx6 cloud is accepted - its normals are recomputed).
num_neighborsINT123–200Neighbours per local plane fit. Higher = smoother normals and more smearing across edges; lower = noisier. 6-20 is the usual range.
orientationCOMBOas computed (sign arbitrary)A plane fit cannot tell inside from outside. 'flip toward viewpoint' points every normal at the viewpoint below - correct for a cloud seen from one camera, wrong for a closed object sampled all round.
viewpoint_xoptFLOAT0.0Viewpoint the normals are flipped towards (only read when orientation is 'flip toward viewpoint').
viewpoint_yoptFLOAT0.0Viewpoint Y. The camera origin is (0,0,0) for a cloud straight out of 'CV Stereo Pair To Cloud'.
viewpoint_zoptFLOAT0.0Viewpoint Z.

Outputs (3)

NameTypeDescription
cloudNPARRAYNx6 float32 (x,y,z,nx,ny,nz) - feed the surface matching nodes with this, not with the Nx3 input.
normalsNPARRAYNx3 float32 unit normals only, in the input order (for drawing or filtering).
foundBOOLEANFalse when the normals could not be computed (fewer than 3 points, cv2 error).