# Approach to Automated Visual Inspection of Objects Based on Artificial Intelligence
## 2 Materials and Methods
### Lightning Set-Up  
Due to the pre-performed analysis of the scanned object and the elements that needed to be highlighted with the right lighting selection, several possible light configurations were selected, and the results of these experiments can be seen in (Figure 7). The elements on which the lighting methods have been tested reflect the text of the Tire Identification Code and the DOT marking. This text was selected due to the requirement to evaluate the quality of lighting used via OCR built in the Matlab function. As it was previously certain that in the process of imaging the tire surface with an industrial camera it would be necessary to experiment with the lighting method, the test equipment was designed so that it was possible to easily change the configuration of the  
Figure 6: Comparison of 200 mm red light (**a**) and circular 100 mm IR light (**b**). Figure 7: Visualizations variations of used different types of lights. (**(a)** without lighting, (**b**) circular light, (**c**) two line white 100 mm lights, (**d**) two IR line 100 mm lights, (**e**) two red line 200 mm lights, (**f**) two red line 200 mm lights at an angle of 30\({}^{\circ}\)). lighting used. During the experiment, several types of lights described in more detail in Section 2.2 were available at the department, which were placed differently and their most suitable configuration was chosen. As this was a visual inspection of the surface of the object, which is matte and dark, it can be assumed that lighting with high intensity and a relatively large lighting area would be needed, as the examined area had dimensions of about 300 \(\times\) 250 mm. The advantage of a particular object is paradoxically its shape. Since it is a rotating object, it was possible to take all the necessary images of the entire circumference from one position during the rotation of the tire on the designed rotating platform. The first image Figure 7a was taken without additional lighting, under normal lighting conditions in the laboratory. It is possible to see that the subject is captured with sufficient sharpness, but the required text is very difficult to recognize even with the naked eye. Such conditions are unsuitable for further processing by machine vision. The image Figure 7b was taken with the addition of a circular light with a diameter of 100 mm situated at the level of the lens. With such a configuration, it can be seen that the text is suppressed even more than in the image captured without additional illumination and, therefore, such illumination is also not suitable. In the image Figure 7c, two line lights with a length of 100 mm emitting white light of high intensity were used. These lights were placed at a distance from the tire and at an angle of 60\({}^{\circ}\) to the horizontal plane of the rotating platform. With this method of lighting, it is already possible to see an increase in the contrast between the text and the background. Another lighting tested was the use of IR lights. In the specific case of the image in Figure 7d, two linear IR lights with a length of 100 mm were used. In this image, the contrast between the desired text and its background, as well as between the other shape elements and the surface of the tire, can be seen very clearly. However, the problem with this method of illumination is that the lights had to be close to the illuminated area, and due to their length, the entire sensing area was unevenly illuminated. When taking the last two images in Figure 7e,f two red line lights with a length of 200 mm were used. In the image in Figure 7e, the lights were placed similarly to the white lights in Figure 7c and also the resulting images were very similar. When taking the image in Figure 7f, the lights were positioned relative to the image in Figure 7e at an angle of 30\({}^{\circ}\) to the horizontal plane of the rotating platform and at a distance of 160 mm from the tire.