# Combined Use of 3D and HSI for the Classification of Printed Circuit Board Components
## 2 Materials and Methods
### Rules-Based Classification
Building on these extracted parameters regarding the spectra for each material and the 3D features describing the geometric domain, a collection of conditions can be used for classification. The combined use of both domains in particular allows to mutually support the content of each individual  
Figure 8: Use of minimum and maximum positions of 2 nd derivative to select significant parameters for shape description. Parameters are the location (min/max), the curvature values at these locations (red lines) and the direction of curvature value (up for convex and down for concave behavior) [31]. domain. For example, 3D features are mainly used in rule formation when the spectral information does not provide enough information (e.g., black objects on PCB). These include, for example, microchips. If the rules in the spectral domain do not produce any results, geometric rules are then checked. In the case of microchips, which are geometrically rectangular and have a planar surface, the rule is defined as follows. **IF** (omnivariance \(>\) threshold A) **AND** (change in curvature \(<\) threshold B)  
**THEN** class \(\rightarrow\) rectangular box  
A rule formation should follow a logical approach and be based on the characteristics of the objects. As example, in the case of the microchip, the feature 'change in curvature' is used to detect the planar surface of the object. This means that the threshold value for this characteristic must be set low, because a planar surface has no curvature. The thresholds used in our approach (threshold A = 10 and threshold B = 0.045) were empirically determined by investigations based on the underlying dataset. In the case of a different data basis due to different sensor technology, it would only be necessary to adjust the thresholds, as the features used reflect the characteristics of the objects. To better illustrate the rule formation in the spectral domain, we refer to the example of the spectral curves of PP and PS from Figure 9 and express the resulting rule as shown in Listing 1. **Listing 1**. Shape-based Rule for PS and PP. **THEN**\(class\to PP\)  
The rule for each material includes a number of conditions. Each of these conditions is based on the Curvature Value (CV) at a specific band and the sign of the curvature value. If the sign is negative, the curvature behavior is concave and CV must be smaller than the defined threshold value. For a convex curvature behavior, the sign is positive, i.e., the curvature value must be greater than the defined threshold value. Figure 9: Continuum Removed Reflectance spectra (black line), calculated curvature values (green lines), maximum points with concave behavior (red dots) and minimum points with convex behavior (magenta dots) for (**a**) Polystyrene (PS); (**b**) Polypropylene (PP) [31]. As mentioned before, for rule formation, mainly the significant bands with high curvature value are considered (red lines). Each significant band leads to a condition. By analyzing the spectra beforehand, the number of conditions can be reduced to a minimum and not all significant curvature values (red lines) have to be taken into account. Therefore, only six conditions are defined for sample PS in Listing 1, while in Figure 9 a total of seven red lines are present. An overview of the used spectra for the rule-formation is given in Figure 10.