ComfyUI > Nodes > ComfyUI_depthMapOperation > Clean Points (KDTree)

ComfyUI Node: Clean Points (KDTree)

Class Name

CleanPoints (KDTree)

Category
depthMapOperation
Author
chri002 (Account age: 2259days)
Extension
ComfyUI_depthMapOperation
Latest Updated
2025-05-27
Github Stars
0.01K

How to Install ComfyUI_depthMapOperation

Install this extension via the ComfyUI Manager by searching for ComfyUI_depthMapOperation
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_depthMapOperation in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Clean Points (KDTree) Description

Refine 3D point cloud data by removing outliers and noise using KDTree algorithm for enhanced model accuracy.

CleanPoints (KDTree):

The CleanPoints (KDTree) node is designed to refine and optimize 3D point cloud data by removing outliers and noise, which can significantly enhance the quality and accuracy of 3D models. This node leverages the KDTree algorithm, a highly efficient data structure for organizing points in a k-dimensional space, to identify and eliminate points that do not conform to the desired density or proximity criteria. By doing so, it ensures that the resulting point cloud is cleaner and more representative of the actual structure or object being modeled. This process is particularly beneficial in applications such as 3D scanning, computer vision, and augmented reality, where precision and clarity of the point cloud data are crucial.

CleanPoints (KDTree) Input Parameters:

points

This parameter represents the 3D point cloud data that you want to clean. It is expected to be in the format of Points3D, which is a structured representation of 3D coordinates. The quality of the input data directly affects the effectiveness of the cleaning process, as more accurate and detailed point clouds will yield better results.

k

The k parameter specifies the number of nearest neighbors to consider when evaluating each point in the point cloud. It is an integer value with a default of 20, a minimum of 0, and a maximum of 32. This parameter is crucial as it determines the local neighborhood size around each point, influencing how the node identifies outliers. A larger k value may result in a smoother point cloud by considering more neighbors, while a smaller value may preserve more detail but could also retain more noise.

m

The m parameter is a floating-point value that sets the maximum allowable distance to the k-th nearest neighbor for a point to be considered part of the main structure. It has a default value of 16, with a minimum of 0 and a maximum of 1024. This threshold helps in distinguishing between points that are part of the main structure and those that are outliers. A smaller m value will result in a stricter cleaning process, potentially removing more points, while a larger value may retain more points, including some that are less relevant.

CleanPoints (KDTree) Output Parameters:

Points3D

The output is a cleaned version of the input point cloud, represented as Points3D. This refined point cloud contains only the points that meet the specified criteria for proximity and density, resulting in a more accurate and noise-free representation of the original data. This output is essential for further processing or visualization tasks, as it provides a clearer and more precise model of the scanned object or environment.

CleanPoints (KDTree) Usage Tips:

  • To achieve optimal results, start with the default values for k and m, and adjust them based on the specific characteristics of your point cloud data. If your data is particularly noisy, consider reducing the m value to remove more outliers.
  • Experiment with different k values to find the right balance between detail preservation and noise reduction. A higher k value may be beneficial for smoother surfaces, while a lower value might be better for capturing fine details.

CleanPoints (KDTree) Common Errors and Solutions:

"k must be a positive integer"

  • Explanation: This error occurs when the k parameter is set to a non-positive value.
  • Solution: Ensure that the k parameter is set to a positive integer within the allowed range (0 to 32).

"Empty point cloud after cleaning"

  • Explanation: This situation arises when the cleaning process removes all points from the point cloud, possibly due to overly strict k or m values.
  • Solution: Consider increasing the m value or adjusting the k value to retain more points in the output. Re-evaluate the input data to ensure it is not excessively sparse or noisy.

Clean Points (KDTree) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_depthMapOperation
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.