Human target shooting calibration and recognition method based on sift image registration technology
By using SIFT image registration technology and employing cameras and feature extraction algorithms for human target calibration, the problem of inaccurate calibration in shooting training is solved, achieving higher calibration accuracy and controllability.
Patent Information
- Application Number
- CN202211219351.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-08
- Publication Date
- 2026-05-15
- Estimated Expiration
- 2042-10-08
AI Technical Summary
Existing methods for calibrating and identifying human targets in shooting training suffer from problems such as long processing time, poor security, high cost, poor real-time performance, and inaccuracy due to external factors.
SIFT-based image registration technology is used to acquire target paper images in real time through a camera. The SIFT feature extraction algorithm is used to calculate global feature points, and the homography matrix is calculated by brute-force K-nearest neighbor matching and random sampling RANSAC robust algorithm. Perspective transformation is then performed to calibrate the human-shaped target during the shooting process.
It improves the accuracy and controllability of calibration, effectively prevents target distortion caused by external factors, reduces false detections and missed detections, and makes the algorithm more accurate.
Smart Images

Figure CN115631348B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, specifically to a method for human target calibration and recognition based on SIFT image registration technology. Background Technology
[0002] In shooting training, target reporting is a crucial step. Traditional methods rely on manual visual observation of the target rings, which is time-consuming, unsafe, costly, and lacks real-time performance. With the development of deep learning technology, researchers have explored using key points on human-shaped targets for calibration, significantly improving efficiency compared to traditional methods. However, in practical applications, this approach is susceptible to target movement during shooting and varying lighting conditions due to weather. These factors severely impact the network output key points, which lack rotational stability, brightness consistency, and noise insensitivity, leading to significant misalignment between subsequent target image calibration and standard images, resulting in inaccurate target position and quantity statistics. Another method uses planar image scanning for target ring detection, employing image analysis for scoring. This involves photographing the target with a camera, but requires specially printed target paper with four additional black square calibration icons, making it unsuitable for complex and variable environments. Summary of the Invention
[0003] The purpose of this invention is to provide a human-shaped target shooting calibration and recognition method based on SIFT image registration technology. It utilizes the characteristics of SIFT feature points, such as scale invariance, rotation invariance, brightness invariance, noise insensitivity, small feature dimension, and anti-occlusion, to solve the problem of human-shaped target shaking distortion and overexposure and underexposure caused by external wind and light during the shooting process, which leads to subsequent image calibration deviation and inaccurate target reporting results.
[0004] To address the aforementioned technical problems, this invention provides a human-shaped target calibration and recognition method based on SIFT image registration technology, comprising the following steps:
[0005] S1. Set up a camera at the firing range; and adjust the camera to be aligned with the target paper, so that the camera can acquire images of the target paper in real time.
[0006] S2. Use the target paper image from the frame before the shooting to identify the template image;
[0007] S3. Calculate the global feature points of the template image obtained in step S2 using the SIFT feature extraction algorithm, store the global feature points of the template image, and do not extract the template image again in the future.
[0008] S4. A frame of the target paper after shooting is captured in real time using a camera and used as the target image to be identified;
[0009] S5. Calculate the feature points of the target image to be identified using the SIFT feature extraction algorithm;
[0010] S6. Perform brute-force K-nearest neighbor matching between the feature points of the target image to be identified obtained in step S5 and the global feature points of the template image stored in S3, calculate the similarity value between multiple matching point pairs, and select feature point pairs with similarity values less than 0.75 to perform homography matrix calculation.
[0011] S7. For the feature point pairs with similarity values less than 0.75 selected in step S6, use the robust algorithm of random sampling RANSAC to calculate the homography matrix of the global feature points of the target image to be mapped to the corresponding template image in the feature point pair. Then, use the homography matrix of the feature points of the target image to perform perspective transformation with the template image as the projection to finally obtain the target image of the paper to be identified.
[0012] S8. The actual bullet hole positions and numbers can be obtained by taking the difference between the target image to be identified obtained in step S7 and the template image obtained in S2.
[0013] Furthermore, step S3 includes the following steps:
[0014] S3.1. For the template image obtained in step S2, use the xfeatures2d_SIFT.create function in the computer vision processing library OPENCV to obtain the SIFT feature detector object;
[0015] S3.2. The SIFT feature detector calls the detectAndCompute function to obtain the feature point information of the template image and the feature vector representing the feature point. The feature point information includes the angle, which represents the direction of the key point. In order to ensure that the direction is not distorted, the SIFT algorithm calculates the direction of the point by performing gradient calculation on the neighborhood around the key point, class_id, which is the ID that distinguishes each feature point, pt, the coordinates of the feature point, response, which represents the strength of the point as a feature point, and size, which is the diameter of the point. The feature vector representing the feature point can represent the detection image as a point in a 128-dimensional feature vector set. SIFT feature descriptor is selected because it has rotation, scaling, translation and illumination invariance, which can overcome the influence of external force and illumination on the target paper in the target range.
[0016] S3.3. Write the SIFT feature point information and feature vector of the representative template image obtained in step S2 to a local file and load it into memory. Subsequent processes will not repeatedly extract the SIFT features of the template image.
[0017] Furthermore, step S5 includes the following steps:
[0018] S5.1. For the target image to be identified obtained in step S4, use the xfeatures2d_SIFT.create function in the computer vision processing library OPENCV to obtain the SIFT feature detector object, and call the detectAndCompute function to obtain the feature point information of the target image to be identified and the feature vector representing the feature points;
[0019] S5.2. For the target image to be identified obtained in step S4, it is divided into 16 sub-images of equal proportion and labeled as bi, i=1,2…16. After experimental comparison, it was found that dividing it into 4*4 sub-images of 16 can ensure that there are good SIFT features in the key sub-images. Dividing the target image of the target to be identified of equal proportion is simple and efficient. Dividing the target image of the target to be identified of 3*3 results in poor detail processing during the calibration process with the template image because the divided blocks are too large. Dividing the target image of the target to be identified of 5*5 results in more featureless or fewer feature blocks during the calibration process with the template image.
[0020] S5.3. For the feature point information and feature vectors representing the target image to be identified calculated in S5.1, the sub-images divided in S5.2 are allocated to bi, i=1,2…16. The allocation method obtains the feature point position coordinates according to the .pt attribute of the feature point information, and allocates the feature point information and feature vectors falling into each sub-image to bi, i=1,2…16.
[0021] Furthermore, in step S6, the feature points on each block bi, i=1,2…16 are matched with the global feature points of the template image stored in S3 using a brute-force K-nearest neighbor (KNN) method. The K value is 2, meaning that the two feature points in each block bi, i=1,2…16 of the target image to be identified are selected from the feature points of the template image that are most similar to each other. The calculation method is based on the Euclidean distance between vectors. Then, it is determined whether the ratio of the feature vector distance between the two selected template image feature points is less than 0.75 as stated in S6. If the feature point is less than the threshold of 0.75, the nearest feature point in the KNN is selected as the feature point pair that is successfully matched between the template image and each block bi, i=1,2…16 of the target image to be identified.
[0022] Furthermore, the brute-force K-nearest neighbor matching in step S6 includes the following steps:
[0023] S6.1. Brute-force K-nearest neighbor matching first selects a feature point in a certain block bi of the target image to be identified, i=1,2…16, as the feature point pair to be matched;
[0024] S6.2. Calculate the Euclidean distance between a feature point in a certain block bi of the target image to be identified selected in step S6.1, i=1,2…16, and the global feature points of the template image stored in S3. Select the first two with the smallest distances among the global feature points of the template image as pre-selected feature points, and then calculate whether the distance ratio between the two selected feature points is less than the threshold of 0.75.
[0025] S6.3. In S6.3, all two feature points with a value greater than 0.75 are discarded, and the feature point with a value less than the threshold of 0.75 is selected as the closest feature point as a matching feature point in the global feature point set of the template image for a certain feature point selected in a certain block bi of the target image to be identified, i=1,2…16. This results in feature point pairs between the feature point in a certain block bi of the target image to be identified, i=1,2…16 and the selected feature point in the template image.
[0026] Furthermore, step S7 includes the following steps:
[0027] S7.1. Using the feature points bi, i=1,2…16 of each block of the target image to be identified and the global feature point matching pairs of the template image stored in S3, calculate the homography matrix of each block and the template image stored in S3. The calculation process uses the findHomography function in the OpenCV computer vision library, where the robust algorithm of random sampling RANSAC is set as a parameter; RANSAC is an abbreviation for Random Sample Consensus. From a set of observation datasets containing outliers, the parameters of the mathematical model are estimated iteratively, that is, the optimal homography matrix is calculated iteratively using the RANSAC algorithm based on the feature points matched in S6. The homography matrix is a transformation matrix (3*3 matrix) bi, i=1,2…16 between the feature points of each block and the feature points of the template image, obtained according to the coordinate mapping relationship between the matching point pairs, and includes parameters such as scaling, rotation, and translation.
[0028] S7.2. Using the calculated blocks bi, i=1,2…16 and the homography matrix bi, i=1,2…16 of the template described in S3, call the perspective transformation function warpPerspective in the computer vision library OpenCV to complete the projection using the homography matrix bi, i=1,2…16 as the mapping function between each block image and each pixel of the template image.
[0029] Furthermore, step S8 includes the following steps:
[0030] S8.1. First, the image target detection task is used to perform bullet hole target detection on the projected images of each block bi, i=1,2…16 of the target image to be identified obtained in step S7.2. The detection model selected is the YOLOv5 target detection framework. Morphological dilation operation is used to enlarge the bullet hole target. The upper and lower regions of the detected bullet hole target image are expanded by 5 pixels. The adaptiveThreshold function in the computer vision library OPENCV is used to obtain the binary image of each bullet hole position region. The dilate function is used to expand the bullet hole boundary region.
[0031] S8.2. Then, the binary images of each bullet hole after step S8.1 are multiplied with the original bullet hole region to make the bullet hole target clearer. This is because the value of the binary image of the bullet hole region after morphological dilation is 1, which means it is not a bullet hole, and the value is 0, which means it is a bullet hole. Multiplying it with the original bullet hole region acts as a mask.
[0032] S8.3. The blocks bi, i=1,2…16 of the target image to be identified after completing step S8.2 are stitched together to obtain the target image to be identified. The difference between the target image and the template image obtained in step S2 is used to obtain the true location and number of bullet holes.
[0033] The beneficial effects of this invention are: This invention solves the problem of target re-identification and misidentification caused by inaccurate target identification and target distortion caused by inaccurate key point identification and external conditions in the current deep learning-based target calibration model; the identification results of this invention are more controllable and have better performance than neural network-based key point matching algorithms, and can effectively prevent distortion caused by target shaking during the target firing process. The algorithm is more accurate and has fewer false detections and missed detections; the target detection algorithm is less effective at detecting small targets such as bullet holes. Attached Figure Description
[0034] Figure 1 This is a flowchart of the present invention;
[0035] Figure 2 This is a schematic diagram of SIFT feature extraction from template images in this invention;
[0036] Figure 3 This is a schematic diagram of SIFT feature points allocated after 3×3 block division in this invention;
[0037] Figure 4 This is a schematic diagram of SIFT feature points allocated after 4×4 block division in this invention;
[0038] Figure 5 This is a schematic diagram of SIFT feature points allocated after 5×5 block division in this invention;
[0039] Figure 6 This is a schematic diagram of the projection between pixels of the block image and the template image according to the present invention. Detailed Implementation
[0040] This invention discloses a human-shaped target calibration and recognition method based on SIFT image registration technology, comprising the following steps:
[0041] S1. Set up a camera at the firing range; and adjust the camera to be aligned with the target paper, so that the camera can acquire images of the target paper in real time.
[0042] S2. Use the target paper image from the frame before the shooting to identify the template image;
[0043] S3. Calculate the global feature points of the template image obtained in step S2 using the SIFT feature extraction algorithm, store the global feature points of the template image, and do not extract the template image again in the future.
[0044] S3.1. For the template image obtained in step S2, use the xfeatures2d_SIFT.create function in the computer vision processing library OPENCV to obtain the SIFT feature detector object;
[0045] S3.2. The SIFT feature detector calls the detectAndCompute function to obtain the feature point information of the template image and the feature vector representing the feature point. The feature point information includes the angle, which represents the direction of the key point. In order to ensure that the direction is not distorted, the SIFT algorithm calculates the direction of the point by performing gradient calculation on the neighborhood around the key point, class_id, which is the ID that distinguishes each feature point, pt, the coordinates of the feature point, response, which represents the strength of the point as a feature point, and size, which is the diameter of the point. The feature vector representing the feature point can represent the detection image as a point in a 128-dimensional feature vector set. SIFT feature descriptor is selected because it has rotation, scaling, translation and illumination invariance, which can overcome the influence of external force and illumination on the target paper in the target range.
[0046] S3.3. Write the SIFT feature point information and feature vector of the representative template image obtained in step S2 to a local file and load it into memory. Subsequent processes will not repeatedly extract the SIFT features of the template image.
[0047] S4. A frame of the target paper after shooting is captured in real time using a camera and used as the target image to be identified;
[0048] S5. Calculate the feature points of the target image to be identified using the SIFT feature extraction algorithm;
[0049] S5.1. For the target image to be identified obtained in step S4, use the xfeatures2d_SIFT.create function in the computer vision processing library OPENCV to obtain the SIFT feature detector object, and call the detectAndCompute function to obtain the feature point information of the target image to be identified and the feature vector representing the feature points;
[0050] S5.2. For the target image to be identified obtained in step S4, it is divided into 16 sub-images of equal proportion and labeled as bi, i=1,2…16. After experimental comparison, it was found that dividing it into 4*4 sub-images of 16 can ensure that there are good SIFT features in the key sub-images. Dividing the target image of the target to be identified of equal proportion is simple and efficient. Dividing the target image of the target to be identified of 3*3 results in poor detail processing during the calibration process with the template image because the divided blocks are too large. Dividing the target image of the target to be identified of 5*5 results in more featureless or fewer feature blocks during the calibration process with the template image.
[0051] S5.3. For the feature point information and feature vectors representing the target image to be identified calculated in S5.1, the sub-images divided in S5.2 are allocated to bi, i=1,2…16. The allocation method obtains the feature point position coordinates according to the .pt attribute of the feature point information, and allocates the feature point information and feature vectors falling into each sub-image to bi, i=1,2…16.
[0052] S6. Perform brute-force K-nearest neighbor matching between the feature points of the target image to be identified obtained in step S5 and the global feature points of the template image stored in S3, calculate the similarity value between multiple matching point pairs, and select feature point pairs with similarity values less than 0.75 to perform homography matrix calculation.
[0053] The feature points in each block bi, i=1,2…16 are matched with the global feature points of the template image stored in S3 using a brute-force K-nearest neighbor (K) matching method. The K value is 2, meaning that the two feature points in each block bi, i=1,2…16 of the target image to be identified are selected from the feature points of the template image that are most similar to each other. The calculation method is based on the Euclidean distance between vectors. Then, it is determined whether the ratio of the feature vector distance between the two selected template image feature points is less than 0.75 as mentioned in S6. If the feature point is less than the threshold of 0.75, the nearest feature point in the K-nearest neighbor is selected as the feature point pair that is successfully matched between the template image and each block bi, i=1,2…16 of the target image to be identified.
[0054] S6.1. Brute-force K-nearest neighbor matching first selects a feature point in a certain block bi of the target image to be identified, i=1,2…16, as the feature point pair to be matched;
[0055] S6.2. Calculate the Euclidean distance between a feature point in a certain block bi of the target image to be identified selected in step S6.1, i=1,2…16, and the global feature points of the template image stored in S3. Select the first two with the smallest distances among the global feature points of the template image as pre-selected feature points, and then calculate whether the distance ratio between the two selected feature points is less than the threshold of 0.75.
[0056] S6.3. In S6.3, all two feature points with a value greater than 0.75 are discarded, and the feature point with a value less than the threshold of 0.75 is selected as the closest feature point as a matching feature point in the global feature point set of the template image for a certain feature point selected in a certain block bi of the target image to be identified, i=1,2…16. This results in feature point pairs between the feature point in a certain block bi of the target image to be identified, i=1,2…16 and the selected feature point in the template image.
[0057] S7. For the feature point pairs with similarity values less than 0.75 selected in step S6, use the robust algorithm of random sampling RANSAC to calculate the homography matrix of the global feature points of the target image to be mapped to the corresponding template image in the feature point pair. Then, use the homography matrix of the feature points of the target image to perform perspective transformation with the template image as the projection to finally obtain the target image of the paper to be identified.
[0058] S7.1. Using the feature points bi, i=1,2…16 of each block of the target image to be identified and the global feature point matching pairs of the template image stored in S3, calculate the homography matrix of each block and the template image stored in S3. The calculation process uses the findHomography function in the computer vision library OpenCV, where the robust algorithm of random sampling RANSAC is set as a parameter; RANSAC is an abbreviation for Random Sample Consensus. From a set of observation datasets containing outliers, the parameters of the mathematical model are estimated iteratively, that is, the optimal homography matrix is calculated iteratively using the RANSAC algorithm based on the feature points matched in S6. The homography matrix is a transformation matrix (3*3 matrix) bi, i=1,2…16 between the feature points of each block and the feature points of the template image, obtained according to the coordinate mapping relationship between the matching point pairs, and includes parameters such as scaling, rotation, and translation.
[0059] S7.2. Using the calculated blocks bi, i=1,2…16 and the homography matrix bi, i=1,2…16 of the template described in S3, call the perspective transformation function warpPerspective in the computer vision library OpenCV to complete the projection using the homography matrix bi, i=1,2…16 as the mapping function between each block image and each pixel of the template image.
[0060] S8. The actual bullet hole locations and quantities can be obtained by calculating the difference between the target image obtained in step S7 and the template image obtained in step S2.
[0061] S8.1. First, the image target detection task is used to detect bullet holes in the projected images of each block bi, i=1,2…16 of the target image to be identified obtained in step S7.2. The detection model is YOLOv5 target detection framework. 50,000 images were collected and labeled. The model accuracy is 99.9%. Morphological dilation operation is used to enlarge the bullet hole targets. The upper and lower regions of the detected bullet hole target image are expanded by 5 pixels. The adaptiveThreshold function in the computer vision library OPENCV is used to obtain the binary image of each bullet hole position region. The dilate function is used to expand the bullet hole boundary region.
[0062] S8.2. Then, the binary images of each bullet hole after step S8.1 are multiplied with the original bullet hole region to make the bullet hole target clearer. This is because the value of the binary image of the bullet hole region after morphological dilation is 1, which means it is not a bullet hole, and the value is 0, which means it is a bullet hole. Multiplying it with the original bullet hole region acts as a mask.
[0063] S8.3. The blocks bi, i=1,2…16 of the target image to be identified after completing step S8.2 are stitched together to obtain the target image to be identified. The difference between the target image and the template image obtained in step S2 is used to obtain the true location and number of bullet holes.
[0064] Experiments have verified that setting the threshold between the feature points bi, i=1,2…16 of each block of the target image to be identified obtained in step S5 and the global feature points of the template image stored in S3 to around 0.75 achieves a matching success rate of over 99%, while the false negatives and missed detections between feature pairs reach an ideal level. Therefore, in step S6, if the distance ratio between the two closest points obtained by brute-force nearest neighbor is less than 0.75, it is considered that a feature point has been matched.
[0065] This invention extracts features from a template image and the image to be identified during the shooting process using the SIFT feature extraction algorithm. The image to be identified during shooting needs to be divided into small blocks to overcome target shaking and deformation caused by external factors. Finally, a brute-force K-nearest neighbor matching is performed between the SIFT feature points of the small blocks to be identified during shooting and the SIFT feature points of the template image. These local image and template image feature point pairs are then obtained and sorted. For each pair of local images, the K most similar values are selected to calculate the homography matrix. Finally, based on the homography matrices, the image to be identified is projected onto the template image to obtain the calibration image.
[0066] This invention solves the problem of target re-identification and misidentification caused by inaccurate key point recognition and target distortion due to external conditions in current deep learning-based target calibration models. Compared with neural network-based key point matching algorithms, the recognition results of this invention are more controllable and have better performance. It can effectively prevent distortion caused by target shaking during the shooting process, and the algorithm is more accurate with fewer false positives and false negatives. The target detection algorithm is not very effective in detecting small targets such as bullet holes.
Claims
1. A method for humanoid target shooting calibration and recognition based on SIFT image registration technology, characterized in that: The steps include the following: S1. Set up a camera at the firing range; and adjust the camera to be aligned with the target paper, so that the camera can acquire images of the target paper in real time. S2. Use the target paper image from the frame before the shooting to identify the template image; S3. Calculate the global feature points of the template image obtained in step S2 using the SIFT feature extraction algorithm, store the global feature points of the template image, and do not extract the template image again in the future. S4. A frame of the target paper after shooting is captured in real time using a camera and used as the target image to be identified; S5. Calculate the feature points of the target image to be identified using the SIFT feature extraction algorithm; S6. Perform brute-force K-nearest neighbor matching between the feature points of the target image to be identified obtained in step S5 and the global feature points of the template image stored in S3, calculate the similarity value between multiple matching point pairs, and select feature point pairs with similarity values less than 0.75 to perform homography matrix calculation. S7. For the feature point pairs with similarity values less than 0.75 selected in step S6, use the robust algorithm of random sampling RANSAC to calculate the homography matrix of the global feature points of the target image to be mapped to the corresponding template image in the feature point pair. Then, use the homography matrix of the feature points of the target image to perform perspective transformation with the template image as the projection to finally obtain the target image of the paper to be identified. S8. The actual bullet hole positions and numbers can be obtained by taking the difference between the target image to be identified obtained in step S7 and the template image obtained in S2.
2. The human target shooting calibration and recognition method based on SIFT image registration technology according to claim 1, characterized in that: Step S3 includes the following steps: S3.
1. For the template image obtained in step S2, use the xfeatures2d_SIFT.create function in the computer vision processing library OPENCV to obtain the SIFT feature detector object; S3.
2. The SIFT feature detector calls the detectAndCompute function to obtain the feature point information of the template image and the feature vector representing the feature point. The feature point information includes the angle, which represents the direction of the key point. In order to ensure that the direction is not distorted, the SIFT algorithm calculates the direction of the point by performing gradient calculation on the neighborhood around the key point, class_id, which is the ID that distinguishes each feature point, pt, the coordinates of the feature point, response, which represents the strength of the point as a feature point, and size, which is the diameter of the point. The feature vector representing the feature point can represent the detection image as a point in a 128-dimensional feature vector set. SIFT feature descriptor is selected because it has rotation, scaling, translation and illumination invariance, which can overcome the influence of external force and illumination on the target paper in the target range. S3.
3. Write the SIFT feature point information and feature vector of the representative template image obtained in step S2 to a local file and load it into memory. Subsequent processes will not repeatedly extract the SIFT features of the template image.
3. The human target shooting calibration and recognition method based on SIFT image registration technology according to claim 2, characterized in that: Step S5 includes the following steps: S5.
1. For the target image to be identified obtained in step S4, use the xfeatures2d_SIFT.create function in the computer vision processing library OPENCV to obtain the SIFT feature detector object, and call the detectAndCompute function to obtain the feature point information of the target image to be identified and the feature vector representing the feature points; S5.
2. For the target image to be identified obtained in step S4, it is divided into 16 sub-images of equal proportion and labeled as follows. After experimental comparison, it was found that dividing it into 16 sub-images of 4*4 can ensure that there are good SIFT features in the key sub-images. Dividing the target image of the target image of equal proportion is simple and efficient. Dividing the target image of the target image of 3*3 results in poor detail processing during the calibration process with the template image because the division blocks are too large. Dividing the target image of 5*5 results in more featureless blocks or fewer feature blocks during the calibration process with the template image. S5.
3. For the feature point information and feature vectors representing the target image to be identified calculated in S5.1, the sub-images divided in S5.2 are allocated to bi, i=1,2…16. The allocation method obtains the feature point position coordinates according to the .pt attribute of the feature point information, and allocates the feature point information and feature vectors falling into each sub-image to bi, i=1,2…16.
4. The human target shooting calibration and recognition method based on SIFT image registration technology according to claim 3, characterized in that: In step S6, the feature points on each block bi, i=1,2…16 are matched with the global feature points of the template image stored in S3 using a brute-force K-nearest neighbor (KNN) method. The K value is 2, meaning that the two feature points in each block bi, i=1,2…16 of the target image to be identified are selected from the feature points of the template image that are most similar to each other. The calculation method is based on the Euclidean distance between vectors. Then, it is determined whether the ratio of the feature vector distance between the two selected template image feature points is less than 0.75 as stated in S6. If the feature point is less than the threshold of 0.75, the nearest feature point in the KNN is selected as the feature point pair that is successfully matched between the template image and each block bi, i=1,2…16 of the target image to be identified.
5. The human target shooting calibration and recognition method based on SIFT image registration technology according to claim 4, characterized in that: The brute-force K-nearest neighbor matching in step S6 includes the following steps: S6.
1. Brute-force K-nearest neighbor matching first selects a feature point in a certain block bi of the target image to be identified, i=1,2…16, as the feature point pair to be matched; S6.
2. Calculate the Euclidean distance between a feature point in a certain block bi of the target image to be identified selected in step S6.1, i=1,2…16, and the global feature points of the template image stored in S3. Select the first two with the smallest distances among the global feature points of the template image as pre-selected feature points, and then calculate whether the distance ratio between the two selected feature points is less than the threshold of 0.
75. S6.
3. In S6.3, all two feature points with a value greater than 0.75 are discarded, and the feature point with a value less than the threshold of 0.75 is selected as the closest feature point as a matching feature point in the global feature point set of the template image for a certain feature point selected in a certain block bi of the target image to be identified, i=1,2…16. This results in feature point pairs between the feature point in a certain block bi of the target image to be identified, i=1,2…16 and the selected feature point in the template image.
6. The human target shooting calibration and recognition method based on SIFT image registration technology according to claim 4, characterized in that: Step S7 includes the following steps: S7.
1. Using the feature points bi, i=1,2…16 of each block of the target image to be identified and the global feature point matching pairs of the template image stored in S3, calculate the homography matrix of each block and the template image stored in S3. The calculation process uses the findHomography function in the computer vision library OpenCV, where the robust algorithm of random sampling RANSAC is set as a parameter; RANSAC is an abbreviation for Random Sample Consensus. From a set of observation datasets containing outliers, the parameters of the mathematical model are estimated iteratively, that is, the optimal homography matrix is calculated iteratively using the RANSAC algorithm based on the feature points matched in S6. The homography matrix is a transformation matrix (3*3 matrix) bi, i=1,2…16 between the feature points of each block and the feature points of the template image, obtained according to the coordinate mapping relationship between the matching point pairs, and includes parameters such as scaling, rotation, and translation. S7.
2. Using the calculated blocks bi, i=1,2…16 and the homography matrix bi, i=1,2…16 of the template described in S3, call the perspective transformation function warpPerspective in the computer vision library OpenCV to complete the projection using the homography matrix bi, i=1,2…16 as the mapping function between each block image and each pixel of the template image.
7. The human target shooting calibration and recognition method based on SIFT image registration technology according to claim 6, characterized in that: Step S8 includes the following steps: S8.
1. First, the image target detection task is used to perform bullet hole target detection on the projected images of each block bi, i=1,2…16 of the target image to be identified obtained in step S7.
2. The detection model selected is the YOLOv5 target detection framework. Morphological dilation operation is used to enlarge the bullet hole target. The upper and lower regions of the detected bullet hole target image are expanded by 5 pixels. The adaptiveThreshold function in the computer vision library OPENCV is used to obtain the binary image of each bullet hole position region. The dilate function is used to enlarge the bullet hole boundary region. S8.
2. Then, the binary images of each bullet hole after step S8.1 are multiplied with the original bullet hole region to make the bullet hole target clearer. This is because the value of the binary image of the bullet hole region after morphological dilation is 1, which means it is not a bullet hole, and the value is 0, which means it is a bullet hole. Multiplying it with the original bullet hole region acts as a mask. S8.
3. The blocks bi, i=1,2…16 of the target image to be identified after completing step S8.2 are stitched together to obtain the target image to be identified. The difference between the target image and the template image obtained in step S2 is used to obtain the true location and number of bullet holes.