# Machine Vision System for Counting Small Metal Parts in Electro-Deposition Industry
## 1 Introduction  
As widely recognized, electroplating (more precisely electrodeposition) is a chemical process that uses electric current to transfer metal from a cation to an electrode (i.e., the object to be treated), to form a coherent thin metal coating [1]. The amount of mass deposit derives from [PERSON]'s laws on electrolysis [2] and directly depends on current intensity and time:  
\[m=\frac{M\cdot I\cdot t}{Z\cdot F} \tag{1}\]  
where:  
m = mass deposited on electrode [g];  
M = molar mass of the material to be deposited [g/mol];  
I = current intensity (A);  
t = time (s);  
Z = valence of material's ions;  
F = [PERSON]'s constant (96485.33 C mol\({}^{-1}\)). The process used by manufacturers working in the electrodeposition of fashion accessories consists of arranging the (usually) small parts to be plated on a frame by using hooks or, more often, metal wires, as shown in Figure 1.  
Therefore, electrodeposition simultaneously occurs on a number of parts. Since the material to be deposited on electrode (multiple items to be plated) is required to form a uniform thin layer, the overall mass is given by:  
\[m=n\text{-}s\text{-}T\text{-}\rho \tag{2}\]  
where: where:  
n = number of items to be electroplated;  
s = surface of a single item;  
T= coating thickness;  
\(\rho=\) material mass density. Hence, in order to obtain the desired coating thickness, both the number and surface of the items to be plated need to be known. While the item's surface is retrievable by means of possibly available items, Computer Aided Design (CAD) models, or by using 3D scanning, the number of items arranged on the galvanic frame is not straightforwardly available in order to compute the overall surface to be electroplated. To date, the parts attached to the frame are manually counted, however, the reliability of the process is limited by ensuing weakness and inattentiveness; in other words, it is inevitably prone to errors due to the operators' tiredness and lack of attention, etc. In scientific literature, several papers specifically address the topic of designing counting systems with reference to a variety of industrial fields [3; 4]. In addition, many counting machines have been available on the market for years [5; 6]. Unfortunately, regardless of the technology adopted (e.g., weight measurement, free-fall, optical scan lines), almost all the machines available on the market require items to be physically separated one from each other (i.e., not disposed on package or frames), or to be arranged upon a moving tray. Therefore, such solutions are not suitable or adaptable to count items that are already arranged on a galvanic frame. Fortunately, machine vision (MV) systems have the potential to solve this issue by implementing a combination of optical devices and proper image processing algorithms, finalized to determine the overall number of objects captured in a scene. Not by chance, a relevant number of MV systems have been proposed in the scientific literature to address  
Figure 1: Typical galvanic frame. the object counting issue [7]. However, the main issue for devising a system for counting metal parts attached to a galvanic frame is related to the high reflectivity of the items themselves, which presents an incredible challenge for any kind of optical acquisition system. For this reason, to the best of the authors' knowledge, no automatic counting system has been devised so far for the galvanic industry. Accordingly, the present paper proposes a machine vision-based method to automatically count small metal parts arranged on a galvanic frame. The devised method, relying on the definition of a proper acquisition system and on the development of image processing-based routines, is implemented on a counting machine to be adopted in the galvanic industrial practice. The machine architecture is designed to discard the undesired reflections due to the metal surface so to properly detach all attached items from the background.