Nodes/comfyui_cv/CV PPF Pose Estimation
ComfyUI Node

CV PPF Pose Estimation

Finds a known 3D model inside a larger 3D scene with no initial guess (cv2.ppf_match_3d.PPF3DDetector): it hashes oriented point PAIRS of the model, then lets the scene's pairs vote for the 4x4 pose that maps model -> scene. Unlike 'CV ICP Register' it does not need the clouds to be roughly aligned already - but its answer is COARSE (on the shipped example ~14 degrees out), so the standard pipeline is PPF then ICP: 'CV Transform Points 3D' the model by this pose, 'CV Point Cloud Normals' it again, 'CV ICP Register' onto the scene, and compose the two with 'CV Matrix Multiply'. Cost grows steeply as the sampling steps shrink (training is O(sampled^2)); downsample big clouds first. Failure tolerant: a degenerate cloud (a plane, too few points) returns the identity with found=false.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV PPF Pose Estimation
  • model
  • scene
  • pose
  • poses
  • votes
  • pose_count
  • found
relative_sampling_step0.050
relative_distance_step0.050
num_angles30
relative_scene_sample_step0.20
relative_scene_distance0.050
max_poses5
normal_neighbors12
Categoryimage/CV/contrib

Inputs (9)

NameTypeDefaultDescription
modelNPARRAYThe object to look for, Nx6 (x,y,z,nx,ny,nz) from 'CV Point Cloud Normals'. An Nx3 cloud is accepted and its normals are computed here - never hand cv2 one directly, it silently runs 31x-100x slower and answers wrong.
sceneNPARRAYThe cloud to search in, Nx6 (or Nx3, as above). May contain clutter and other objects - that is what PPF is for.
relative_sampling_stepFLOAT0.0500.005–0.5Model downsampling, as a fraction of the model's diameter: 0.05 keeps points ~5% of the diameter apart. THE cost knob - halving it roughly quadruples training time (0.025 -> 26 s where 0.05 -> 3.5 s on a 2400-point model).
relative_distance_stepFLOAT0.0500.005–0.5Quantization of the point-pair distance in the hash table, as a fraction of the diameter. Larger tolerates more noise and blurs the vote.
num_anglesINT306–120Angle bins the pair features are quantized into. More = finer rotation resolution, bigger table.
relative_scene_sample_stepFLOAT0.200.01–1Fraction of scene points used as reference points (0.2 = every 5th). Lower = faster, less thorough.
relative_scene_distanceFLOAT0.0500.005–0.5Scene downsampling distance, as a fraction of the model diameter (the scene equivalent of relative_sampling_step).
max_posesINT51–100How many of the highest-voted pose clusters to return in 'poses'. 'pose' is always the first.
normal_neighborsoptINT123–200Neighbours per plane fit, used ONLY for an input that arrives without normals. Prefer wiring 'CV Point Cloud Normals' explicitly.

Outputs (5)

NameTypeDescription
poseNPARRAY4x4 rigid transform mapping model -> scene, the highest-voted cluster (identity when found=false). Feed 'CV Transform Points 3D'.
posesNPARRAYKx4x4 stack of the top 'max_poses' candidates, best first. PPF often gets the right pose at rank 2-3, so refine several with ICP and keep the one with the lowest 'CV Point Cloud Nearest Distance'.
votesNPARRAYKx1 float32 vote count per candidate - a RELATIVE confidence only (it scales with the cloud size and the sampling steps), not a quality measure.
pose_countINTNumber of candidates returned (<= max_poses).
foundBOOLEANFalse when the match could not run (empty or degenerate cloud, cv2 error). Gate the transform on it with a 'Basic data handling: IfElse'.