Process Surface by Filter
Description
This Step is used to preprocess the surface with a specific filter to obtain a better surface.
Workflow
The process of configuring this Step is shown below.
-
Configure the input. Connect the ports manually or select the input(s) under Input in the parameter configuration panel.
-
Determine whether to use the feature region, select the Filter Type, and set the filter parameters.
-
Select the output item Depth Map (selected by default).
Parameter Description
- Show Advanced Filters
-
Once this parameter is selected, advanced filters will be listed in the drop-down menu of Filter Type.
- Use Feature Region
-
Use feature region(s) to define the region where surface preprocessing will be performed. Once this parameter is selected, only data within or outside the feature region(s) will be processed.
-
Feature Region Mode
Once Use Feature Region is selected, this parameter is used to set the mode of the feature region, that is, to select whether to process the data within the feature region or the data outside the feature region.
Instruction: To preprocess data within the feature region, select Include data in Region; otherwise, select Exclude data in Region.
For more information on how to set and adjust the feature region, see Set the Feature Region.
-
- Keep Unfiltered Data
-
Once this parameter is selected, the unfiltered data will be retained in the output.
- Filter Type
-
Select a filter to process the surface data.
Options: The available filters are listed below. See Filter Type for detailed information.
-
Common filters: Gap filling, Mean, Median, and Decimation
-
Advanced filters: Dilation, Erosion, Opening, Closing, Morph gradient, Gaussian, Sobel, Laplacian, Negative, Normalization, Binarization, Percentile, Relative threshold, and Crop
Instruction: Please select the filter according to the actual requirement and data features.
Suggestions Description Understand data characteristics
Understand the features of the data: Familiarize yourself with your original data. Understand the noise types and the data processing tasks to be performed.
Check the available filters
Gain insight into the available filters. Different filters are applicable to different situations, such as the mean filter for smoothing and the median filter for noise removal.
Determine processing goal
When selecting a filter, consider the processing goals, such as noise removal, smoothing the curve, highlighting certain specific features, etc.
Test and compare
Use multiple filters to process the input data, and compare the results of each filter to see if the filtered data can meet the processing goals while preserving features.
Adjust parameters incrementally
Adjust the filter parameters incrementally for the best processing result.
Check filtering effect
Pay attention to the effect of each filter on the data. Ensure that the selected filter does not eliminate important features of the data.
-
Output Description
The output of this Step is a processed depth map that can be used as input to other Steps.
Appendix
Filter Type
-
Gap filling:
With the maximum or minimum Z values of the nearest neighbors or linear interpolation between neighboring values, this filter fills in missing data in the specified window.
Parameter Description Gap Filling Type
This parameter is used to select the method to fill the gaps.
-
Min Z point filling: Use the minimum Z value of the gap endpoints to fill the gap.
-
Max Z point filling: Use the maximum Z value of the gap endpoints to fill the gap.
-
Linear interpolation filling: Use Z values of the gap endpoints to perform linear interpolation and thus fill the gap.
Filter in X Direction
This parameter is used to determine whether to filter the surface data in the X-direction.
X-Direction Window Size
This parameter specifies the window size for X-direction filtering.
Filter in Y Direction
This parameter is used to determine whether to filter the surface data in the Y-direction.
Y-Direction Window Size
This parameter specifies the window size for Y-direction filtering.
-
-
Mean:
The mean filter can smooth the image by calculating the neighbors of pixels in the image and replacing the pixel values in the original image with the calculated average.
Parameter Description Filter in X Direction
This parameter is used to determine whether to filter the surface data in the X-direction.
X-Direction Window Size
This parameter specifies the window size for X-direction filtering.
Filter in Y Direction
This parameter is used to determine whether to filter the surface data in the Y-direction.
Y-Direction Window Size
This parameter specifies the window size for Y-direction filtering.
-
Median:
The median filter reduces noise in images, especially salt and pepper noise, by replacing each pixel in the image with the median of its neighboring pixels.
Parameter Description Filter in X Direction
This parameter is used to determine whether to filter the surface data in the X-direction.
X-Direction Window Size
This parameter specifies the window size for X-direction filtering.
Filter in Y Direction
This parameter is used to determine whether to filter the surface data in the Y-direction.
Y-Direction Window Size
This parameter specifies the window size for Y-direction filtering.
-
Decimation:
The decimation filter can reduce the image resolution. During decimation, some pixels in the raw image will be discarded.
Parameter Description Filter in X Direction
This parameter is used to determine whether to filter the surface data in the X-direction.
X-Direction Window Size
This parameter specifies the window size for X-direction filtering.
Filter in Y Direction
This parameter is used to determine whether to filter the surface data in the Y-direction.
Y-Direction Window Size
This parameter specifies the window size for Y-direction filtering.
-
Dilation:
This type of filter can be used to remove small holes and smooth object edges to make the image more complete.
Note that the dilation operation may magnify the noise in the image. When performing dilation on images, you should set a proper kernel size and symmetry to ensure that the dilation operation can achieve the desired result.
Parameter Description Kernel Size
This parameter is used to set the kernel size during dilation.
Symmetry
This parameter is used to set the applied method for dilation.
-
Horizontal symmetry: Perform dilation on the image horizontally by the set dilation kernel.
-
Vertical symmetry: Perform dilation on the image vertically by the set dilation kernel.
-
Central symmetry: Perform dilation on the image horizontally and vertically by a square dilation kernel of set size.
-
-
Erosion:
This type of filter can be used to remove small objects or noises in the image to make the image clearer.
Note that the erosion operation may lead to loss of image details, so you should set a proper kernel size and symmetry for the erosion operation.
Parameter Description Kernel Size
This parameter is used to set the kernel size during erosion.
Symmetry
This parameter is used to set the applied method for erosion.
-
Horizontal Symmetry: Perform erosion on the image horizontally by the set erosion kernel.
-
Vertical Symmetry: Perform erosion on the image vertically by the set erosion kernel.
-
Central symmetry: Perform erosion on the image horizontally and vertically by a square erosion kernel of set size.
-
-
Opening:
Opening is essentially erosion followed by dilation. This type of filter can be used to remove the noise in the details of the image while preserving the main features of the image.
Parameter Description Kernel Size
This parameter is used to set the kernel size for opening.
-
Closing:
Closing is essentially dilation followed by erosion. This type of filter can be used to fill small holes in objects and smooth edges without significantly altering their areas. Secondly, the closing operation can effectively improve the issue of uneven object edges caused by noise.
Parameter Description Kernel Size
This parameter is used to set the kernel size for closing.
-
Morph gradient:
Morphological gradient is an operation in image morphological processing. It highlights the edge information in an image with the difference between dilation and erosion. This type of filter can enhance the object edges in the image and make the edges more prominent.
Parameter Description Kernel Size
This parameter is used to set the kernel size for gradient operation.
-
Gaussian:
Gaussian filter can remove a certain amount of noise in the image. This type of filter can be used to effectively smooth the object edges while preserving the edges and details of the image. Therefore, it is usually used for image smoothing, removing high-frequency noise, and preprocessing before edge detection.
Parameter Description Kernel Size
This parameter is used to set the kernel size for Gaussian filtering.
-
Sobel:
Sobel is capable of performing operations within a certain range around pixels and is often used for image edge detection.
Parameter Description Kernel Size
This parameter is used to set the kernel size during edge detection.
Symmetry
This parameter is used to set the applied method for edge detection.
-
Horizontal Symmetry: Apply the set kernel on the image horizontally to detect edges.
-
Vertical Symmetry: Apply the set kernel on the image vertically to detect edges.
-
Central symmetry: Perform edge detection on the image horizontally and vertically by a square kernel of set size.
Min Threshold
After filtering, points with Z values greater than this threshold will be considered edge points.
Max Threshold
Limit the Z values of the filtered points to this threshold or below.
-
-
Laplacian:
Laplacian can effectively detect edge and regions where grayscale changes abruptly in images.
Parameter Description Kernel Size
This parameter is used to set the kernel size during edge detection.
Min Threshold
After filtering, points with Z values greater than this threshold will be considered edge points.
Max Threshold
This parameter is used to limit the Z values of the filtered points to this threshold or below.
-
Negative:
During image processing, each pixel of the image can be inverted to achieve a visual effect similar to that of a negative film.
-
Normalization:
Normalization is a method for enhancing image contrast, which can improve the local contrast of an image without affecting the overall contrast.
Parameter Description Min Threshold
The pixel values of points will be normalized to the range of Min Threshold to Max Threshold.
Max Threshold
The pixel values of points will be normalized to the range of Min Threshold to Max Threshold.
-
Binarization:
This type of filter sets the depth values of points in the image to custom values according to the height threshold.
Parameter Description Min Threshold
When the actual depth value of a data point is less than or equal to the set Depth Threshold, set the depth value of the point to the value of Min Threshold.
Max Threshold
When the actual depth value of a data point is above the set Depth Threshold, set the depth value of the point to the value of Max Threshold.
Depth Threshold
Depth threshold for image binarization. If the actual depth value of a data point is greater than or smaller than that of Depth Threshold, reset the depth value of the data point to that of Max Threshold or Min Threshold, respectively.
-
Percentile:
By setting Low Threshold Percentile and High Threshold Percentile, you can remove points that do not belong to this percentile range.
Parameter Description Low Threshold Percentile
The lower threshold for the percentile range. Points within the set percentile range will be retained.
High Threshold Percentile
The upper threshold for the percentile range. Points within the set percentile range will be retained.
-
Relative threshold:
Set the low and high thresholds to determine the height range of retained data points. When the Use Feature Region option is selected, the height range is relative to the mean height of data points defined by the feature region.
Parameter Description Low Threshold
Points with a height or relative height between low and high thresholds will be retained.
High Threshold
Points with a height or relative height between low and high thresholds will be retained.
-
Crop:
This type of filter can remove unqualified data in the feature region.
Troubleshooting
Invalid Type
No. | Error | Error Description | Possible Causes | Solution |
---|---|---|---|---|
1 |
The selected filter type is invalid. |
The selected filter type is invalid and cannot be used for filtering. |
The filter type was not selected properly. |
Select Filter Type again in the drop-down list. |
2 |
The selected gap filling type is invalid. |
When Filter Type is set to “Gap filling,” the selected Gap Filling Type is invalid. |
A valid gap filling type was not selected. |
Select Gap Filling Type again in the drop-down list. |
Invalid Parameter
No. | Error | Error Description | Possible Causes | Solution |
---|---|---|---|---|
1 |
The “Kernel Size” value is not set properly. |
After selecting a filter, the kernel size used for filtering is not set properly. |
“Kernel Size” was not greater than 0. |
Adjust the “Kernel Size” to ensure that it is greater than 0. |
2 |
The X-direction window size or Y-direction window size is not set properly. |
When Filter Type was set to “Gap filling,” the set value of “X/Y-Direction Window Size” is not appropriate. |
The “X/Y-Direction Window Size” was no greater than 0. |
Adjust the value of “X/Y-Direction Window Size” to ensure that it is greater than 0. |
3 |
Incorrect threshold setting. |
When Filter Type was set to “Relative threshold,” the threshold setting is incorrect. |
“Low Threshold” was not lower than “High Threshold” or was not within the range of 0–1. |
Adjust the thresholds again to ensure that the “Low Threshold” is smaller than the “High Threshold” and that both the “High Threshold” and “Low Threshold” are within the range of 0–1. |