A highly expandable high-precision target center coordinate extraction method
By combining support vector machines and a unique constraint edge extraction algorithm with an activation function, the problems of high difficulty in expanding the target center coordinate extraction method and poor fitting accuracy are solved, and target center coordinate extraction that is easy to expand and has high accuracy is achieved.
Patent Information
- Application Number
- CN202211293880.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-10-21
AI Technical Summary
Traditional target center coordinate extraction methods suffer from the problems of high expansion difficulty and poor fitting accuracy.
Subpixel-level bullseye coordinate extraction is achieved based on support vector machines. Target datasets are automatically generated online using single target and single target images. A uniqueness-constrained edge extraction algorithm and a discriminative activation function are used to solve subpixel edges. Bullseye coordinates are then calculated using ellipse fitting.
It achieves easily scalable and highly accurate target center coordinate extraction, reduces the time cost of the expansion process, and improves the fitting accuracy.
Smart Images

Figure CN115713540B_ABST
Abstract
Description
Technical fields:
[0001] This invention belongs to the field of image processing technology, specifically relating to an easily expandable, high-precision target center coordinate extraction method. Background technology:
[0002] In the field of computer vision, an important task is to determine the spatial location and structural information of three-dimensional targets based on 2D cameras. This is generally achieved by using standard targets with specific shapes and sizes, and calculating the target's spatial information based on the position of the target's center in the 2D image. Therefore, the accuracy of target extraction from the 2D image directly affects the accuracy of spatial information calculation.
[0003] Target extraction primarily utilizes techniques such as detector learning, template matching, and connected component analysis. Typical localization algorithms often employ one or more of these methods, progressively determining the target center coordinates from coarse to fine, generally yielding relatively accurate results. However, they primarily suffer from the following two problems:
[0004] 1. High difficulty in expansion. When the algorithm is extended to new types of targets, a large number of offline samples need to be collected for modeling and parameter tuning in order to adapt to changes in the target's angle and background. On the one hand, this process is time-consuming; on the other hand, when there are insufficient samples, this expansion process will be difficult to complete.
[0005] 2. Poor fitting accuracy. To obtain accurate bullseye coordinates, the target image is usually fitted based on the edges. On the one hand, the target is often composed of multiple bright and dark areas, and the edges of both types of areas will affect the fitting accuracy. However, if all edges are involved in the fitting, the double edges of the adjacent parts between regions will affect the data weight, leading to a decrease in fitting accuracy. On the other hand, the boundary discrimination ability of sub-pixel edge calculation methods will also affect the edge accuracy. Summary of the Invention:
[0006] The technical problem to be solved by this invention is that traditional target center coordinate extraction methods are difficult to extend and have poor fitting accuracy.
[0007] To address the aforementioned issues, this invention provides an easily scalable and high-precision bullseye coordinate extraction method. Based on support vector machines, it achieves sub-pixel level bullseye coordinate extraction. This method can automatically generate target datasets online using single targets and single target images, extract features, and train target detectors. After detecting the target, an edge extraction algorithm with uniqueness constraints is used to determine the pixel edges of the target region. Then, an activation function with discriminative capabilities is optimized to solve for sub-pixel edges, thus realizing an easily scalable, high-precision, and fast bullseye extraction method.
[0008] To achieve the above objectives, the present invention specifically implements the following technical solution: an easily scalable, high-precision target center coordinate extraction method, comprising the following steps:
[0009] (1) Target dataset generation: offline acquisition of a single target image, extraction of the foreground and affine transformation, online acquisition of a single target image as background, superimposition of the target image foreground onto the target image, cropping to generate a positive target sample image, and then cropping to generate a negative sample image based on a randomly selected region on the target image.
[0010] (2) Target detection: For target sample images, gradient direction histogram features are extracted, a classifier is trained using a support vector machine, and the target is coarsely located using a sliding window to obtain target candidate regions.
[0011] (3) Sub-pixel edge extraction: Binarize the target candidate region obtained by coarse localization, extract the pixel edges of bright and dark areas, and then use an edge model based on activation function to extract sub-pixel edges. When extracting regional pixel edges, a uniqueness constraint is introduced, and the lower edge point and the right edge point are moved down and to the right by one pixel respectively, so as to coincide with the edge of the adjacent region, ensuring that the adjacent part shares a single edge;
[0012] (4) Target center calculation: The target center coordinates are obtained by fitting an ellipse based on the edge points.
[0013] Furthermore, step (1), the target dataset generation step, includes the following parts:
[0014] (1-1) Target foreground extraction: During offline preparation, the target is designed and manufactured according to the system requirements; the target is placed on a flat object, keeping the flat object parallel to the camera imaging plane, and the image is acquired; the distortion of the acquired image containing the target is corrected according to the parameters of the industrial camera; then the target area is cropped, the background is removed, and the effective pixels of the target are obtained.
[0015] (1-2) Target sample generation: When expanding the target type online, the distortion correction of the acquired image containing the target is performed according to the parameters of the industrial camera; the center of the target coincides with the center of the target image, and the effective pixels of the target are subjected to affine transformation, superimposed with the target image and cropped to generate positive target sample images with effective pixels of different angles and scales of the target as the foreground and different regions of the target as the background; correspondingly, random sampling is performed in the target image to generate negative sample images of the same size as the positive samples.
[0016] Furthermore, in step (1-1), the target is designed with an outer radius of 35mm, an inner radius of 20mm, and a center point radius of 1mm. Shooting is conducted at a field of view distance of 5-7 meters.
[0017] Furthermore, step (1-2) involves an affine transformation according to the following formula:
[0018]
[0019] Parameter t x ,t y ,a i These are the parameters that need to be set for the affine transformation; where (t) x ,t y ) represents the translation amount, while parameter a i This reflects changes in image rotation and scaling; let the rotation angle be θ, then...
[0020] a1=cosθ, a2=-sinθ, a3=sinθ, a4=cosθ
[0021] The range of θ is selected as -10° to 10°, with a step size of 0.1°. The translation amount on the X-axis is -300 to +300 pixels, with a step size of 20 pixels, and the translation amount on the Y-axis is -400 to +400 pixels, with a step size of 20 pixels. The rotation operation of the effective pixels of the target can also be completed during offline preparation.
[0022] Furthermore, step (2), the target detection step, includes the following parts:
[0023] (2-1) Sample feature extraction: Features are constructed by calculating and statistically analyzing the gradient direction histogram in the image region. The histogram is then normalized for contrast, and the normalized one-dimensional vector is the HOG feature.
[0024] The gradient calculated for each pixel includes the pixel's orientation and size:
[0025] G x (x,y)=I(x+1,y)-I(x-1,y)
[0026] G y (x,y)=I(x,y+1)-I(x,y-1)
[0027] In the above formula, G x (x, y) and G y (x, y) represent the horizontal and vertical gradients of the input image at pixel (x, y), respectively. Therefore, the gradient magnitude and gradient direction at pixel (x, y) can be obtained as follows:
[0028]
[0029]
[0030] (2-2) Classifier training: The classifier is obtained through mathematical operations such as the Lagrange formula and KKT conditions.
[0031]
[0032] Where d(X) T ) represents the classification result, y i For the class labels of the support vectors, a i The normal vector of the hyperplane, b0 is the intercept of the hyperplane; combining the target dataset obtained in (2-1), and using a supervised learning scheme, all parameters ω and b can be obtained, such that...
[0033] Where ω is a set of normal vectors of hyperplanes, and b is a set of intercepts of hyperplanes.
[0034] (2-3) Sliding window target detection: During online detection, a window is constructed based on the size of the target sample image. The window slides on the target image to extract features and classify the target, and the target candidate region is detected.
[0035] Further, in step (2-1), the training data in the target dataset is normalized into a 64*64 image, and the image is divided into 8-pixel*8-pixel connected regions, i.e., cell units; the gradient and edge direction of each pixel in the cell unit are collected, and then a one-dimensional gradient direction histogram is accumulated in each cell unit.
[0036] Further, after obtaining the gradient magnitude and gradient direction at pixel (x, y) in step (2-1), 2*2 cell units are combined into one block; first, the gradient histogram of the cell unit is calculated, and it is divided into nine angles according to the gradient direction: 0-10°, 10-20°, 20-40°, 40-90°, 90-110°, 110-130°, 130-150°, 150-170°, and 170-180°, resulting in nine histogram channels; for each block, the length of the feature vector is 2*2*9=36; finally, the two-dimensional Euclidean norm is used to normalize the feature vector.
[0037] Furthermore, in step (2-3), the sliding window is centered on the target image, with a translation amount of -300 to +300 pixels on the X-axis and a step size of 20 pixels, and a translation amount of -400 to +400 pixels on the Y-axis and a step size of 20 pixels.
[0038] Furthermore, step (3) subpixel edge extraction and calculation includes the following parts:
[0039] (3-1) Obtaining the edge list of the region: Use a threshold T to binarize the target candidate region image. The candidate region will be divided into multiple bright and dark regions. Obtain the edge list of each region.
[0040] The threshold T is set to 128.
[0041] (3-2) Single Edge Extraction: For each region, starting from the first boundary point between the region and other regions, the region edge is tracked according to the rules of the extended edge tracking algorithm with uniqueness constraints. If the boundary between the region and another region is reached, the first edge segment of the region is obtained. A similar operation is then performed starting from this intersection point until the first intersection point of the region is reached, at which point the tracking algorithm ends, thus obtaining all edge segments of the region. After extracting edges for all regions using this method, edge points that have not been extended are removed, resulting in single edge points at the boundaries of all regions.
[0042] (3-3) Sub-pixel edge calculation: For the acquired single edge, sub-pixel coordinates are calculated using a discriminative activation function model, as shown below:
[0043]
[0044] Where: a is the difference between the maximum and minimum grayscale values of the edge; b is the offset of the activation function on the x-axis, i.e., the difference between the coordinates of the point to be fitted and the coordinates of the last point; c represents the tilt of the edge, typically ranging from 0.4 to 0.6; d is the offset of the activation function on the y-axis, i.e., the minimum grayscale value of the edge. Using the least squares method, the grayscale values of the left and right sides of the edge point and the x-coordinate values are used as the fitting function to solve for the sub-pixel values of the edge.
[0045] Furthermore, step (4) includes the following parts:
[0046] Let the equation of an ellipse at any position in the plane be...
[0047] x 2 +Axy+By 2 +Cx+Dy+E=0
[0048] According to the least squares principle, the fitted objective function is:
[0049]
[0050] Using the edge points obtained in step 3, construct a system of linear equations and solve for A, B, C, D, and E. Then, based on the fundamental properties of an ellipse, obtain...
[0051]
[0052] Here, x0 and y0 are the coordinates of the target's center.
[0053] Furthermore, before step (4) is calculated, if there are more than two sets of edges, the edges need to be further filtered according to the principle of the largest closed edge.
[0054] The beneficial effects of this invention are as follows:
[0055] To address the challenges of scalability and poor fitting accuracy in target extraction algorithms, this invention provides an easily scalable, high-precision target center coordinate extraction method. Based on support vector machines, it achieves sub-pixel level target center coordinate extraction. This method can automatically generate a target dataset online using a single target and a single target image, extract features, and train a target detector. After target detection, an edge extraction algorithm with uniqueness constraints is used to determine the pixel edges of the target region. Finally, an activation function with discriminative capabilities is optimized to solve for sub-pixel edges, resulting in an easily scalable, high-precision, and fast target center extraction method. Attached image description:
[0056] Figure 1 This is a flowchart of the algorithm of the present invention;
[0057] Figure 2 This is a schematic diagram of the target;
[0058] Figure 3 This is a schematic diagram of the target center localization extraction results (where the boxes and crosses represent the extraction results);
[0059] Figure 4 It is a simulated scene diagram;
[0060] Figure 5 These are real-life scene images. Detailed implementation method:
[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0062] Example 1:
[0063] like Figure 1As shown, firstly, we convert the designed target model into a bitmap image and print it. Then, we use an industrial camera to photograph the target sample image and extract the effective pixels as the foreground. To extend to the target, we photograph the target image as the target background. The foreground is placed at the center of the target image, and scaling, rotation, and translation transformations are performed to crop a new target image with the target as the background, forming a target dataset. Based on the dataset, HOG features are extracted, and a support vector machine is used to train a target detection model. Based on the model, the target can be coarsely located on the entire image. Then, the located area is binarized to obtain bright and dark areas. By setting conditions, we determine whether the area is an ellipse. We obtain the single edge between the elliptical areas through an edge tracking algorithm with uniqueness constraints, and solve the sub-pixel edge through activation functions. Further, we solve the ellipse parametric equation to calculate the center of the ellipse, i.e., the target center. Specifically:
[0064] (1) Target dataset generation
[0065] The target dataset generation mainly involves generating positive and negative target samples. Positive samples are new target images with the target as the foreground and the target as the background, while negative samples are randomly selected regions on the target image. For generating positive samples, it is necessary to first create the target, take a picture of the target image, extract the target foreground, then take a picture of the target image as the background, and finally generate a new target image through affine transformation. For generating negative samples, random sampling is performed on the target image according to the size of the positive samples.
[0066] This process involves the following steps:
[0067] (1-2) Target foreground extraction: During offline preparation, the target is designed and manufactured according to system requirements; the target design dimensions are an outer radius of 35mm, an inner radius of 20mm, and a target center radius of 1mm. Figure 2 As shown. Place the target on a flat object, keeping the flat object parallel to the camera's imaging plane. Considering the actual working conditions, images can be captured at a field of view distance of 5-7 meters. Perform distortion correction on the captured images containing the target according to the parameters of the industrial camera. Then, crop the target area, remove the background, and obtain the effective pixels of the target.
[0068] (1-2) Target Sample Generation: When expanding the target type online, the distortion correction is performed on the acquired image containing the target according to the parameters of the industrial camera; the target center is made to coincide with the target image center, and the effective pixels of the target are subjected to affine transformation according to the following formula:
[0069]
[0070] Parameter t x ,t y ,a iThese are the parameters that need to be set for the affine transformation; where (t) x ,t y ) represents the translation amount, while parameter a i This reflects changes in image rotation and scaling; let the rotation angle be θ, then...
[0071] a1=cosθ, a2=-sinθ, a3=sinθ, a4=cosθ.
[0072] The range of θ is selected as -10° to 10°, with a step size of 0.1°. The translation amount on the X-axis is -300 to +300 pixels, with a step size of 20 pixels, and the translation amount on the Y-axis is -400 to +400 pixels, with a step size of 20 pixels. The rotation operation of the effective pixels of the target can also be completed during offline preparation.
[0073] The transformed target image is overlaid and cropped with the target image to generate positive target sample images with effective pixels of different angles and scales of the target as the foreground and different regions of the target as the background. Correspondingly, negative sample images of the same size as the positive samples are generated by randomly sampling from the target image. The image size is 2064 x 1544, which can generate approximately 30,000 positive target samples. Similarly, 60,000 negative target samples are generated.
[0074] (2) Target detector
[0075] The target detector is based on HOG features and a support vector machine classifier. Positive and negative samples have already been generated in step 1. HOG features are extracted from these samples, and a binary classification support vector machine model is trained. A sliding window is applied to the target image, and the model determines whether the window region is a positive sample, thus achieving the purpose of detecting that type of target. This process mainly consists of the following sub-steps:
[0076] (2-1) HOG Feature Extraction of Samples: HOG features are feature descriptors used for object detection in computer vision and image processing. This scheme mainly constructs features by calculating and statistically analyzing the gradient orientation histogram within the image region. The main implementation method of this invention is to normalize the training data in the target dataset into a 64*64 image, and divide the image into 8*8 pixel connected regions, called cell units. The gradient and edge direction of each pixel in the cell unit are collected, and then a one-dimensional gradient orientation histogram is accumulated in each cell unit. To achieve better invariance to illumination and shadows, the histogram is contrast-normalized. The normalized one-dimensional vector is the HOG feature.
[0077] The gradient calculated for each pixel, including the pixel's orientation and size:
[0078] G x(x,y)=I(x+1,y)-I(x-1,y)
[0079] G y (x,y)=I(x,y+1)-I(x,y-1)
[0080] In the above formula, G x (x, y) and G y (x, y) represent the horizontal and vertical gradients of the input image at pixel (x, y), respectively. Therefore, the gradient magnitude and gradient direction at pixel (x, y) can be obtained as follows:
[0081]
[0082]
[0083] Finally, 2x2 cell units are combined into one block. First, the gradient histogram of the cell unit is calculated, divided into nine angles according to the gradient direction: 0-10°, 10-20°, 20-40°, 40-90°, 90-110°, 110-130°, 130-150°, 150-170°, and 170-180°, resulting in nine histogram channels. For each block, the feature vector length is 2*2*9 = 36. Finally, the feature vector is normalized using the two-dimensional Euclidean norm. For a 64x64 pixel image, 7*7*36 = 1764 feature values are obtained, forming the feature vector of a single sample in the dataset.
[0084] (2-2) Classifier Training: Classifier training involves finding a set of parameters ω and b such that...
[0085] Where ω is a set of normal vectors of hyperplanes, and b is a set of intercepts of hyperplanes.
[0086] This is an optimization problem. After solving it using the Lagrange formula and KKT conditions, the following result is obtained:
[0087]
[0088] Where d(X) T ) represents the classification result, y i For the class labels of the support vectors, a i The normal vector of the hyperplane, b0 is the intercept of the hyperplane; combined with the target dataset obtained in (2-1), all parameters can be obtained using a supervised learning scheme.
[0089] (2-3) Sliding window target detection: During online detection, a window is constructed based on the size of the target sample image. The window slides on the target image to extract features and classify the target, and the target candidate region is detected.
[0090] (3) Subpixel edge extraction
[0091] Subpixel edge extraction technology primarily employs an edge model based on activation functions. Within the target candidate region obtained through coarse localization, pixel edges in bright and dark areas are binarized and extracted. Then, an edge model based on an exponential activation function is used to extract subpixel edges. During region pixel edge extraction, a uniqueness constraint is introduced, shifting the lower and right edge points down and to the right by one pixel respectively to ensure they coincide with the edges of adjacent regions, guaranteeing a single edge in the adjacent portion. The specific process is as follows:
[0092] (3-1) Obtaining the edge list of the region: Use a threshold T to binarize the target candidate region image. The candidate region will be divided into multiple bright and dark regions. Obtain the edge list of each region.
[0093] The threshold T is set to 128.
[0094] (3-2) Single Edge Acquisition: For each region, starting from the first boundary point between that region and other regions, the region edge is tracked according to the rules of the extended edge tracking algorithm with uniqueness constraints. If the boundary between that region and another region is reached, the first edge segment of that region is obtained. A similar operation is then performed starting from this intersection point until the first intersection point of the region is reached, at which point the tracking algorithm ends, thus obtaining all edge segments of that region. After extracting edges for all regions using this method, edge points that have not been extended are removed, resulting in single edge points at the boundaries of all regions.
[0095] (3-3) Sub-pixel edge calculation. For the acquired single edge, sub-pixel coordinates are calculated using a discriminative activation function model, as shown below:
[0096]
[0097] Where: a is the difference between the maximum and minimum grayscale values of the edge; b is the offset of the activation function on the x-axis, i.e., the difference between the coordinates of the point to be fitted and the coordinates of the last point; c represents the tilt of the edge, typically ranging from 0.4 to 0.6; d is the offset of the activation function on the y-axis, i.e., the minimum grayscale value of the edge. Using the least squares method, the grayscale values of the left and right sides of the edge point and the x-coordinate values are used as the fitting function to solve for the sub-pixel values of the edge.
[0098] (4) Target center calculation: The target center coordinates are obtained by fitting an ellipse based on the edge points.
[0099] The edge of the target region was obtained in the previous step. If there are more than two sets of edges, the edges need to be further filtered, generally according to the principle of the largest closed edge.
[0100] Let the equation of an ellipse at any position in the plane be...
[0101] x 2 +Axy+By 2 +Cx+Dy+E=0
[0102] According to the least squares principle, the fitted objective function is:
[0103]
[0104] Using the edge points obtained in step 3, construct a system of linear equations and solve for A, B, C, D, and E. Then, based on the fundamental properties of an ellipse, obtain...
[0105]
[0106] Here, x0 and y0 are the coordinates of the target's center, such as... Figure 3 The position indicated by the "plus sign" in the middle.
[0107] One specific application of this embodiment is:
[0108] The algorithm presented in this paper was implemented on a PC with an Intel Xeon 3.31GHz CPU, 8GB of RAM, and a 64-bit Windows 10 operating system. The algorithm was applied in both simulated and real-world scenarios. In the simulated scenario, ... Figure 2 Five images with a white background were generated by affine transformation of concentric circular targets. Each image contains two targets, for a total of ten targets. The precise position of the target center was calculated based on the coordinates of the circle centers using the affine transformation, and this was used as the ground truth, allowing for a quantitative comparison of the algorithm's accuracy. In a real-world scenario, four images were captured, each containing one target. The accuracy of the algorithm was qualitatively compared by observing the coordinates of the located target centers.
[0109] Using the algorithm proposed in this paper, a target dataset is automatically generated online from a single target and a single target background image collected in the scene. Gradient direction histogram features are extracted from the target samples, and a classifier is trained using a support vector machine. The target in the scene image is coarsely located using a sliding window to obtain target candidate regions. Then, the candidate regions are binarized, and pixel edges of bright and dark areas are extracted using uniqueness constraints. Sub-pixel edges are then extracted using an edge model based on activation functions. Finally, the target center coordinates are obtained by fitting an ellipse based on the edge points.
[0110] Simulated scenarios such as Figure 4 As shown in the table below, the algorithm presented in this paper is compared with traditional algorithms based on fitting circles to connected component boundaries. The experimental results are shown in the table below:
[0111]
[0112]
[0113] As can be seen from the table above, the algorithm presented in this paper has higher accuracy than the traditional algorithm. The error of the traditional algorithm is unstable, ranging from 0.55 to 4.86 pixels (mean 1.769, standard deviation 1.212), while the error of the algorithm presented in this paper is controlled below 0.1 pixels (mean 0.020, standard deviation 0.011).
[0114] Real-world scenarios Figure 5 As shown. The algorithm presented in this paper is compared with traditional algorithms based on fitting circles to connected component boundaries. Figure 5 The positioning results are marked accordingly. The larger red cross marks represent the traditional algorithm, and the smaller green cross marks represent the algorithm in this paper. It is clear from the figure that the algorithm in this paper is closer to the bullseye and has higher accuracy.
[0115] Therefore, the algorithm in this paper has both scalability and high accuracy.
Claims
1. A highly accurate target center coordinate extraction method that is easily expandable, characterized in that... Includes the following steps: (1) Target dataset generation: offline acquisition of a single target image, extraction of the foreground and affine transformation, online acquisition of a single target image as background, superimposition of the target image foreground onto the target image, cropping to generate a positive target sample image, and then cropping to generate a negative sample image based on a randomly selected region on the target image. (2) Target detection: For target sample images, extract gradient direction histogram features, train a classifier using support vector machine, and perform coarse localization of the target through a sliding window to obtain target candidate regions; (3) Sub-pixel edge extraction: Binarize the target candidate region obtained by coarse localization, extract the pixel edges of bright and dark areas, and then use the edge model based on activation function to extract sub-pixel edges; When extracting the pixel edges of the region, introduce a uniqueness constraint, move the lower edge point and the right edge point down and right by one pixel respectively, so as to coincide with the edge of the adjacent region, and ensure that the adjacent part shares a single edge. (4) Target center calculation: The target center coordinates are obtained by fitting an ellipse based on the edge points.
2. The easily scalable, high-precision target center coordinate extraction method as described in claim 1, characterized in that: Step (1) The target dataset generation step includes the following parts: (1-1) Target foreground extraction: During offline preparation, the target is designed and manufactured according to the system requirements; the target is placed on a flat object, keeping the flat object parallel to the camera imaging plane, and the image is acquired; the distortion of the acquired image containing the target is corrected according to the parameters of the industrial camera; then the target area is cropped, the background is removed, and the effective pixels of the target are obtained. (1-2) Target sample generation: When expanding the target type online, the distortion correction is performed on the acquired image containing the target according to the parameters of the industrial camera; The target center is aligned with the target image center. Affine transformations are performed on the effective pixels of the target, and the target image is overlaid and cropped to generate positive target sample images with effective pixels of different angles and scales of the target as the foreground and different regions of the target as the background. Correspondingly, random sampling is performed in the target image to generate negative sample images of the same size as the positive samples.
3. The easily expandable high-precision target center coordinate extraction method as described in claim 2, characterized in that: In step (1-1), the target is designed with an outer radius of 35mm, an inner radius of 20mm, and a center point radius of 1mm; the shooting is conducted at a field of view distance of 5-7 meters.
4. The easily expandable high-precision target center coordinate extraction method as described in claim 2, characterized in that: Step (1-2) involves performing an affine transformation according to the following formula: Parameter t x , t y a i These are the parameters that need to be set for the affine transformation; where (t) x , t y ) represents the translation amount, while parameter a i This reflects changes in image rotation and scaling; let the rotation angle be θ, then... a1=cosθ, a2=-sinθ, a3=sinθ, a4=cosθ The range of θ is selected as -10° to 10° with a step size of 0.1 degrees. The translation amount on the X-axis is -300 to +300 pixels with a step size of 20 pixels, and the translation amount on the Y-axis is -400 to +400 pixels with a step size of 20 pixels.
5. The easily expandable high-precision target center coordinate extraction method as described in claim 1, characterized in that: Step (2) Target detection includes the following parts: (2-1) Sample feature extraction: Features are constructed by calculating and statistically analyzing the gradient direction histogram in the image region. The histogram is then normalized for contrast, and the normalized one-dimensional vector is the HOG feature. The gradient calculated for each pixel includes the pixel's orientation and size: G x (x,y)=I(x+1,y)-I(x-1,y) G y (x,y)=I(x,y +1 )-I(x,y-1) In the above formula, G x (x, y) and G y (x, y) represent the horizontal and vertical gradients of the input image at pixel (x, y), respectively. Therefore, the gradient magnitude and gradient direction at pixel (x, y) can be obtained as follows: (2-2) Classifier training: The classifier is obtained through mathematical operations such as the Lagrange formula and KKT conditions. Where d(X) T ) represents the classification result, y i For the class labels of the support vectors, a i Let be the normal vector of the hyperplane, and b0 be the intercept of the hyperplane; combining the target dataset obtained in (2-1), and using a supervised learning scheme, all parameters ω and b can be obtained, such that... Where ω is a set of normal vectors of the hyperplane, and b is a set of intercepts of the hyperplane; (2-3) Sliding window target detection: During online detection, a window is constructed based on the size of the target sample image. The window slides on the target image to extract features and classify the target, and the target candidate region is detected.
6. The easily expandable high-precision target center coordinate extraction method as described in claim 5, characterized in that: Step (2-1) normalizes the training data in the target dataset into a 64*64 image, divides the image into 8-pixel*8-pixel connected regions, i.e., cell units; collects the gradient and edge direction of each pixel in the cell unit, and then accumulates a one-dimensional gradient direction histogram in each cell unit.
7. The easily expandable high-precision target center coordinate extraction method as described in claim 5, characterized in that: After obtaining the gradient magnitude and gradient direction at pixel (x, y) in step (2-1), 2*2 cell units are combined into one block. First, the gradient histogram of the cell unit is calculated, and the gradient direction is divided into nine angles: 0-10°, 10-20°, 20-40°, 40-90°, 90-110°, 110-130°, 130-150°, 150-170°, and 170-180°, resulting in nine histogram channels. For each block, the length of the feature vector is 2*2*9 = 36. Finally, the feature vector is normalized using the two-dimensional Euclidean norm.
8. The easily expandable high-precision target center coordinate extraction method as described in claim 5, characterized in that: In step (2-3), the sliding window is centered on the target image, with a translation amount of -300 to +300 pixels on the X-axis and a step size of 20 pixels, and a translation amount of -400 to +400 pixels on the Y-axis and a step size of 20 pixels.
9. The easily expandable high-precision target center coordinate extraction method as described in claim 1, characterized in that: Step (3) Subpixel edge extraction and calculation includes the following parts: (3-1) Obtaining the edge list of the region: Use a threshold T to binarize the target candidate region image. The candidate region will be divided into multiple bright and dark regions. Obtain the edge list of each region. (3-2) Single edge extraction: For each region, starting from the first boundary point between the region and other regions, the edge of the region is tracked according to the rules of the extended edge tracking algorithm with uniqueness constraints. If the boundary between the region and another region is reached, the first edge segment of the region is obtained. Then, a similar operation is performed starting from this intersection point until the first intersection point of the region is tracked, and the tracking algorithm ends, thus obtaining all edge segments of the region. After extracting the edges of all regions in this way, the edge points that have not been extended are removed to obtain the single edge points of all region boundaries. (3-3) Sub-pixel edge calculation: For the acquired single edge, sub-pixel coordinates are calculated using a discriminative activation function model, as shown below: Where: a is the difference between the maximum and minimum gray values of the edge; b is the offset of the activation function on the x-axis, i.e., the difference between the coordinates of the point to be fitted and the coordinates of the last point; c represents the tilt of the edge, generally taken as 0.4-0.6; d is the offset of the activation function on the y-axis, i.e., the minimum gray value of the edge; using the least squares method, the gray values of the left and right sides of the edge point and the x-coordinate values are used as the fitting function to solve for the sub-pixel values of the edge.
10. The easily scalable, high-precision target center coordinate extraction method as described in claim 1, characterized in that: Step (4) includes the following parts: Let the equation of an ellipse at any position in the plane be... x 2 +Axy+By 2 +Cx+Dy+E=0 According to the least squares principle, the fitted objective function is: Using the edge points obtained in step 3, construct a system of linear equations and solve for A, B, C, D, and E; then, based on the fundamental properties of an ellipse, obtain... Here, x0 and y0 are the coordinates of the target's center. Before the above calculation, if there are more than two sets of edges, the edges need to be further filtered according to the principle of the largest closed edge.
Citation Information
Patent Citations
Sub pixel edge based circle center detecting method
CN107516325A
Image center positioning optimization method
CN114638882A