Design and Implementation of Automatic Aiming and Locking System

In this article, the training parameters of cascade classifiers for specific targets (such as human faces and palms) are obtained by using the program training function provided by OpenCV and adjusting parameters such as the number of positive and negative samples and ratios to achieve better recognition results. Finally, the aiming and locking system for specific targets is constructed by combining recognition, algorithm, and robot control capabilities.


Introduction
Facial recognition technology has been studied since 1872 in psychology research [1] [2] [3], and engineering-related studies began in the 1960s [4] [5].However, the real research on machine automatic recognition of human faces began in the 1970s with Kanade [6] and Kelly's [7] research reports.In recent years, due to the improvement of computer processing power and various machine learning algorithms [8] [9], facial recognition technology has matured and has been widely used in various fields such as airports, attendance checks, and mobile phone security.
In this article, we aim to replace human eyes with computer vision, human brains with programmatic judgments, and human arms with robotic arms to build an automatic targeting and locking system.OpenCV is used to train specific target classifiers, and optimal parameters are used to obtain better recognition results.The recognition results are then used with inverse kinematics algorithms to obtain the rotation angles of the robotic arm joints, thereby controlling the arm to target and lock onto the target object.Thus, an automatic targeting system is established and implemented.
In summary, this study provides a valuable reference for research and application in related fields by proposing a training parameter adjustment strategy and performance analysis for cascade classifiers, as well as an automatic aiming and locking system based on this classifier.

Performance Analysis of Cascading Classifiers under different Training Parameters
Cascading classifiers are classifiers with HARR features and are trained by waterfall algorithms.With the help of faceCascade.dectedMultiScalefunction provided by OpenCV cascading classifiers can detect the presence of a specific target in the image.The training method is by providing a certain number of positive photos (the image contains the target to be detected) and the negative photos (the image does not contain the target to be detected) generated by the opencv_traincascade.exe program.In the application of recognizing a specific face, due to the complex characteristics of the human face, the discriminating ability of the trained classifier is greatly affected by the type of positive and negative photo, quality, brightness, quantity, and other factors.Figure 1.shows the possible result of the classifier identifying the specific object in the image: a.The target object in the image is marked.b.The target object in the image is not marked.c.The nontarget object in the image is marked.To be identified For the convenience of explanation, the following parameters are defined: Identification rate: (number of identified targets in the samples / number of targets in the samples).Ideal value: 100% False positive rate: (the number of identified as non-targets in the samples / the number of non-targets in the samples) that is, the misjudgment of others as you.Ideal value: 0%  Several conclusions can be drawn from the results: 1.A larger number of positive samples leads to a higher identification rate.This is due to the increased quantity of positive samples, which provides a greater pool of reference features.As a result, the classifier can more effectively identify specific targets.
2. A higher quantity of negative samples leads to a reduced false positive rate.This occurs because the distinct characteristics of other samples are excluded, minimizing the likelihood of incorrect judgments.
3. A larger quantity of positive films increases both the identification rate and the false positive rate.This phenomenon arises from the fact that relatives may share similar characteristics with the samples.

Training a classifier for a specific target "human face"
Based on the conclusion above, a classifier for identifying "human faces" was trained with the training conditions of 10,000 positive images and 2,500 negative images, and the actual identification results were verified.The results obtained are shown in the Table 1:

Table 1. The actual identification results
object to be identified (human face) The recognition rate One thousand images containing faces 98.15% In actual environment, 100 personnel passed by (1).95% In actual environment, 100 personnel passed by. ( 2) 95% In actual environment, 100 personnel passed by. ( 3) 94% In actual environment, 100 personnel passed by. ( 4) 93% In actual environment, 100 personel passed by. ( 5) 95% According to the results in Table 1, it shows that in practical application, the recognition results will be affected by environmental variables such as lighting, angles, movements, and different individuals, resulting in a decrease in overall recognition rate to around 94%.

Design and Implementation of Automatic Aiming and Locking System
An automatic aiming system can be divided into two main parts: image recognition and motion control.First, an image of the environment is captured using a camera, and image processing techniques are used to identify the target and determine its position.Next, the system calculates the distance, direction, and angle to the target based on its position, and uses a mechanical arm control component to achieve aiming.This automatic aiming system can be applied in military, industrial, and aviation fields, improving operational efficiency and accuracy while reducing personnel risk and fatigue.
The operating procedure of the automatic targeting and locking system is shown in Figure 4, which is explained as follows: Fig. 4. The operating procedure of the automatic targeting and locking system Figure 5 illustrates a sequence of images during the system operation.In the images, it can be observed that as the face moves, the movement of the robotic arm consistently directs the laser pointer attached to the arm to continuously aim at the face.This demonstrates the effective operation of the system.Based on the conclusion above, a classifier for identifying " palms " was trained with the training conditions of 10,000 positive images and 2,500 negative images, and the actual identification results were verified.The results obtained are shown in the Table 2:  6 illustrates a sequence of images during the system operation.In the images, it can be observed that as the palm moves, the movement of the robotic arm consistently directs the laser pointer attached to the arm to continuously aim at the palm.This demonstrates the effective operation of the system.Fig. 6.The actual performance of the system during operation

Conclusion
In this study, we first searched for optimal training parameters to train the classifier and then locked onto specific objects to train the classifier.In actual recognition, we were able to achieve recognition rates of over 94% for human faces, 96% for human palm.Through recognition, algorithms, and arm control, a practical automatic aiming system can be formed.This system architecture can be applied to actual applications such as automatic aiming, automatic classification, security, and defense industries.

Fig. 1 .
Fig. 1.The possible result of the classifier identifying the specific object in the image In this study, different numbers of positive samples, negative samples, and different types of negative samples are selected in the training of cascade classifiers.The trained classifier is then tested with a set of samples (the samples contains 82 target's photos, 113 others human and background).For the convenience of explanation, the following parameters are defined:

Figure 2 and
Figure 2 and Figure 3 show the identification rate and false positive rate of various classifiers under different training parameters.

Fig. 5 .
Fig.5.The actual performance of the system during operation Training a classifier for a specific target "human palm"

Table 2 .
The actual identification results