# Filtering Organized 3D Point Clouds for Bin Picking Applications
## 5 Data Processing
### Strategy to Set Parameters for New Filtering  
The proposed procedure uses three input parameters: \(\Delta d\), \(d_{max}\), and \(\mu_{thr}\). Their particular values can be derived from the CAD model of the part that fills a bin, the dimensions of the bin, and the characteristics of the sensor used for data collection. The first parameter (step \(\Delta d\)) defines two consecutive z-cuts, \(\mathbf{Z}_{d}\) and \(\mathbf{Z}_{d+\Delta d}\), which are checked inside a loop over \(d\), as shown in the flowchart in Figure 7. If \(\Delta d\) is very small (\(\Delta d\to 0\)), then every point in the 3D point cloud could form a one-pixel cluster, tagged as an outlier. If \(\Delta d\) is very large (say, equal to the height of the bin \(b_{h}\)), then none of the points will be labeled as outliers. The second input parameter \(d_{max}\) defines the threshold \(z_{thr}=z_{max}-d_{max}\), which is the lowest \(z\) component for which a z-cut is constructed. If \(d_{max}\) is too small (i.e., \(z_{thr}\) is too large), then the proposed procedure filters only outliers with \(z>z_{thr}\), leaving many outliers in the top zone of the pile of parts unfiltered. This is bad because many potentially good candidates for gripping reside in this zone. On the opposite end, if \(d_{max}\) is too large, then the loop over depth \(d\) (from \(d_{min}\) to \(d_{max}\)) becomes unnecessarily long and stretches the execution time. The suggested range for selecting a \(\Delta d\) is \([0.01,\ 0.04]\times p_{min}\), where \(p_{min}\) is the length of the smallest edge of a bounding box containing a part's CAD model. Similarly, the suggested \(d_{max}\) should be in the range \([p_{min},\ 0.7b_{h}]\). Both recommendations assume that sensor characteristics are appropriate for acquiring data from a given part, i.e., \(\sigma\ll p_{min}\), where \(\sigma\) is a level of sensor noise (e.g., residual error of fitting a planar target to 3D data). For the bin and parts used for this study, the selected nominal values were \(\Delta d^{*}=0.2\) mm and \(d^{*}_{max}=30\) mm. The third parameter \(\mu_{thr}\) in the proposed filtering is needed to prevent the erroneous tagging of correct data points as outliers. These false positives may appear when a cluster \(\mathbf{C}_{d}(i)\) on the \(\mathbf{Z}_{d}\) map (part of the original organized 3D point cloud) is fully surrounded by NaN pixels. Two such clusters, marked by asterisks, are shown in Figure 11. A practical way to set \(\mu_{thr}\) is to scan a single part placed in an empty bin in such a pose that the largest portion of the part's surface is facing the sensor. Then, if \(d_{max}\) denotes the number of points acquired from the surface, the third parameter \(\mu_{thr}\) can be chosen in the range \([0.05,\ 0.075]\times\ a_{max}\). A more convenient way of setting and using this parameter is to define the relative area \(\rho_{d}(i)\) of the cluster \(\mathbf{C}_{d}(i)\)  
\[\rho_{d}(i)=\mu_{d}(i)/a_{max}. \tag{5}\]  
Then, the third parameter \(\mu_{thr}\) can be replaced by the dimensionless threshold \(\rho_{thr}=\mu_{thr}/a_{max}\). All six datasets presented in this study were processed with the nominal value \(\rho^{*}_{thr}=0.07\). This threshold value eliminates the false positive in Figure 11b (which has a normalized area \(\rho_{d}\approx 0.063\)) but leaves a misclassified cluster in Figure 11a (which has a normalized area \(\rho_{d}\approx 0.51\)). A relatively small value of the selected threshold \(\rho^{*}_{thr}\)helps to suppress the number of incorrectly identified clusters: only two were observed for the data acquired from a bin filled with M8 screws and none from the six datasets of parts shown in Figure 8. In addition, a small value of \(\rho_{thr}\) ensures that only a small portion of 3D points acquired from a surface of a single part may be incorrectly removed as outliers. To check how different values of the parameters \(d_{max}\) and \(\rho_{thr}\) impact a performance of the proposed procedure, it was run for other than nominal parameter values.