A method for adaptive positioning and measurement of a ground security cross-shaped laser spot

By combining image processing techniques and morphological feature-guided methods, and employing binarization, contour extraction, and clustering algorithms, the problem of large positioning errors of cross-shaped light spots in complex environments was solved, achieving efficient and accurate light spot positioning and measurement.

CN118411413BActive Publication Date: 2026-07-24NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHWESTERN POLYTECHNICAL UNIV
Filing Date
2024-05-17
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing spot positioning methods have large errors in detecting cross-shaped spots. The gray-scale centroid method is affected in accuracy under complex conditions, and the Gaussian fitting method has high computational complexity and is not suitable for real-time systems. Existing methods are difficult to achieve accurate positioning and measurement of cross-shaped laser spots in complex environments.

Method used

Combining image processing techniques, geometric optimization and morphological feature-guided methods are adopted. Through binarization processing, contour extraction, polygon fitting and clustering algorithms, the target contour is screened out, the vertices of the light spot are obtained and adaptively located, and the center of the light spot is calculated by the extreme value averaging method.

Benefits of technology

It achieves accurate positioning and measurement of cross-shaped light spots in complex environments. The algorithm has low time complexity, a simple and fast positioning process, high positioning accuracy, strong stability and robustness, and is suitable for real-time systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118411413B_ABST
    Figure CN118411413B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of visual data processing, and particularly relates to a method for adaptive positioning and measurement of ground security cross-shaped laser spot, which comprises the following steps: acquiring a cross-shaped spot image; acquiring a binary image; performing contour extraction from the binary image to acquire a plurality of closed contours; performing contour approximation on each closed contour to acquire a plurality of contours; screening a target contour from the plurality of contours through a filter; acquiring a plurality of convex hull point sets; acquiring a center point of each convex hull point set according to the extreme value average method, and taking the center point as a spot vertex; acquiring a spot center according to each spot vertex; and performing adaptive positioning according to the spot center. The present application adopts the clustering and extreme value average method to make the vertex position accurate, and the connecting line is always located on the central axis of the cross-shaped spot stripe, so that the center point is repositioned, and the accurate positioning of the cross-shaped spot is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual data processing technology, specifically to an adaptive positioning and measurement method for a cross-shaped laser spot in near-site security. Background Technology

[0002] With the continuous development of science and technology, people have increasingly higher requirements for measurement accuracy. Lasers, with their excellent directionality and small divergence angle, have become an auxiliary measurement method in many measurement systems and are widely used in weapon engineering, aerospace, and testing instruments. As a crucial component of laser measurement, the positioning and measurement accuracy of the laser spot directly affect the performance and precision of the measurement system. Therefore, the innovation and optimization of laser spot positioning and measurement algorithms are of great significance.

[0003] Currently, commonly used spot positioning and measurement algorithms can be roughly divided into two categories: one is the gray-scale centroid method, and the other is the Gaussian fitting method. (1) The gray-scale centroid method uses the gray-scale distribution of the image formed by the spot to determine the center position of the spot. By calculating the average value of the product of the gray-scale value of each pixel and its position in the image, the center position of the spot is estimated. This is a simple and fast measurement method, often used for real-time monitoring. The existing technology discloses a spot centroid algorithm based on the STAR1000 detector. The factors affecting the positioning accuracy have been analyzed and simulated. It has been proven that reducing noise, increasing the pixel duty cycle, and expanding the effective spot diameter can all improve the positioning accuracy. However, the gray-scale centroid method requires the spot to be relatively regular, and it will produce a large error for cross-shaped spots. (2) The Gaussian fitting method also uses gray-scale images. It uses a Gaussian mathematical model to fit the gray-scale distribution of the spot. The center position and shape parameters of the spot are calculated by the obtained Gaussian distribution function. It has high accuracy and good stability, and has a certain ability to suppress noise in the image. Those skilled in the art utilize the unsaturated points in the spot image to perform Gaussian fitting on the spot, and use the amplitude point of the fitted function as the spot center. This method avoids the error introduced by saturation in the spot center area and makes full use of the effective part of the spot. However, the Gaussian fitting method is easily affected by the specific distribution of the image and the size of the sampled data. In practical processing, it is often necessary to conduct specific analysis of the image and data sample size. Summary of the Invention

[0004] To address the following technical problems in existing technologies: the gray-scale centroid method is suitable for certain specific scenes and spot types, but has a large detection error for special-shaped spots like crosses; the gray-scale centroid method is highly dependent on gray-scale changes in the image, and its accuracy is affected in complex situations; the Gaussian fitting method has high computational complexity, is unsuitable for real-time systems, and requires more computational resources; the Gaussian fitting method is affected by the parameters selected during the fitting process, requiring continuous parameter optimization to adapt to different scenarios. This invention proposes an adaptive positioning and measurement method for cross-shaped laser spots in near-field security applications, combining image processing technology, especially geometric optimization and morphological feature guidance methods, to achieve accurate positioning and measurement of cross-shaped spots in complex lighting and vibration environments.

[0005] The first objective of this invention is to provide an adaptive positioning and measurement method for a cross-shaped laser spot in near-site security, comprising: Obtain a cross-shaped light spot image; perform binarization processing on the cross-shaped light spot image to obtain a binary image; Contour extraction is performed from a binary image to obtain multiple closed contours; contour approximation is performed on each closed contour to obtain multiple contours; The filter is set according to the morphological characteristics of the cross-shaped light spot, and the target contour is selected from multiple contours by the filter. Obtain multiple convex hull points of the target contour; use the K-means method to cluster the convex hull points to obtain a set of multiple classes of convex hull points; The center point of each type of convex hull point set is obtained by the extreme value averaging method, and this center point is used as the vertex of the light spot. Obtain the center of the light spot based on each light spot vertex; perform adaptive positioning based on the light spot center.

[0006] Preferably, when approximating the contour for each closed contour, the process includes: Select any two adjacent points on the closed contour as contour points and the line connecting them as the starting line segment. Calculate the distance from the point between these two points on the closed contour to this line segment and select the point with the farthest distance as the key point. If the distance from a key point to the starting line segment is higher than the threshold, then that point is added to the contour points. Divide the starting line segment into two line segments from its endpoint to the key point. Recursively perform the above operation on these two line segments until the distance from all line segments to their key points is less than the threshold. The set of contour points at this point is the extracted contour.

[0007] Preferably, a filter is configured based on the morphological characteristics of the cross-shaped light spot, and the filter comprises three parts: The first part is vertex filtering, which judges the number of vertices of the contour. If the number of vertices is not 8, the contour is excluded. The second part is area filtering, which calculates the ratio of the convex hull area to the contour area and filters them. If the ratio is lower than the preset first threshold, the contour is excluded. The third part is perimeter filtering, which calculates the ratio of the convex hull perimeter to the perimeter of the contour and filters it. If the ratio is higher than the preset second threshold, the contour is excluded.

[0008] Preferably, the extreme value averaging method is calculated using the following formula:

[0009] in, The convex hull point of the i-th class; Let x and y represent the minimum x-coordinate and minimum y-coordinate of all convex hull points in the i-th class; This represents the maximum x-coordinate and maximum y-coordinate of all convex hull points in the i-th class.

[0010] Preferably, the center of the light spot is obtained according to the following steps: Calculate the center of the light spot based on each light spot vertex; Based on the arctangent angle between each spot vertex and the calculated spot center; Obtain the corresponding spot vertices based on the arctangent angle of the obtained spot center; Connect the corresponding vertices of the light spots to form the center line of the cross-shaped light spot axis; The center of the light spot is determined by the intersection of the midlines of the cross-shaped light spot axis.

[0011] Preferably, the method further includes measuring the length of the major axis of the cross-shaped laser spot and the spot width at a specified position, including: The length of the major axis of the light spot is obtained by the distance between the corresponding vertices of the light spot. To calculate the beam width at a specified location, based on the geometric relationship that the beam width is perpendicular to the long axis of the beam, determine the straight line through which the beam width passes at the specified location, and obtain the intersection point between them, which is recorded as the initialization point; obtain the left and right adjacent points of the initialization point on the beam width line, which are recorded as the left and right stop points, and obtain the beam width at the specified location by determining the final positions of the left and right stop points.

[0012] The second objective of this invention is to provide a near-site security cross-shaped laser spot adaptive positioning and measurement system, comprising: The data acquisition module is used to acquire cross-shaped light spot images; the cross-shaped light spot images are then binarized to obtain binary images. The contour extraction module is used to extract contours from a binary image and obtain multiple closed contours; to approximate each closed contour to obtain multiple contours; and to set a filter based on the morphological characteristics of the cross-shaped light spot, and to filter out the target contour from multiple contours through the filter. The vertex recognition module is used to obtain multiple convex hull points of the target contour; the K-means method is used to cluster the convex hull points to obtain multiple sets of convex hull points; the center point of each set of convex hull points is obtained according to the extreme value averaging method, and the center point is used as the spot vertex; The positioning module is used to obtain the center of the light spot based on each light spot vertex; and to perform adaptive positioning based on the light spot center.

[0013] A third objective of this invention is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the above-described method.

[0014] A fourth objective of this invention is to provide a storage medium on which a computer program is stored, which, when run, performs the steps of the above-described method.

[0015] The present invention has at least the following beneficial effects: This invention provides an adaptive positioning and measurement method for cross-shaped laser spots in near-field security applications, enabling precise positioning of cross-shaped laser spots. Existing spot positioning methods are mainly applied to regularly shaped spots, resulting in large positioning errors for cross-shaped spots. This method combines the morphological characteristics of cross-shaped laser spots, performing specialized contour extraction and polygon fitting, and feature filtering to achieve precise positioning of cross-shaped laser spots.

[0016] The method provided by this invention performs well in complex environments. This invention uses morphological features to detect cross-shaped light spots, avoiding the grayscale images commonly used in current mainstream light spot localization methods, effectively eliminating other interference and demonstrating excellent performance in complex environments. The parameters of this invention employ an adaptive method, automatically changing in conjunction with target features, eliminating the need for repeated manual adjustments.

[0017] The algorithm provided by this invention has low time complexity. The entire positioning process is simple and fast. The polygon fitting operation can effectively detect the features of the cross-shaped light spot without requiring high precision, and the number of iterations is strictly limited, thus speeding up the overall positioning process. Tests were conducted on an AMD Ryzen 7 3.2GHz CPU, 16GB of RAM, and an Ubuntu 20.04 operating system, running Visual Studio Code. The average total time for positioning and measuring a single cross-shaped light spot was 3ms.

[0018] The method provided by this invention offers high positioning and measurement accuracy. Repeated imaging positioning and measurement tests (e.g., 100 times typically) were performed on a cross-shaped light spot using this method, and the estimated standard deviation of the measurement results was 0.2 pixels (image resolution 10800×7450). Experimental results demonstrate that this algorithm is a highly stable and robust algorithm for positioning and measuring cross-shaped light spots. Attached Figure Description

[0019] Figure 1 This is a framework diagram of the adaptive positioning and measurement method of the cross-shaped laser spot for ground security in an example of the present invention.

[0020] Figure 2 Schematic diagram of cross-shaped laser spot positioning measurement Detailed Implementation In order to illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the following detailed description is provided in conjunction with the embodiments.

[0021] This invention proposes an adaptive positioning and measurement method for cross-shaped laser spots in near-site security. In the process of positioning the cross-shaped spot, a similar target is found through polygon fitting. The area ratio of the convex hull to the contour and the perimeter ratio are used as constraints. A clustering algorithm is used to obtain the vertices. Finally, the center point is updated to locate the spot.

[0022] To achieve the above objectives, see Figure 1 As shown, this invention provides an adaptive positioning and measurement method for a cross-shaped laser spot in near-site security, comprising: including: S1. Obtain the cross-shaped light spot image; The cross-shaped light spot image is binarized to obtain a binary image. In this embodiment, the input cross-shaped light spot image is first preprocessed to generate a binary image that facilitates subsequent operations. Specifically, the image is first converted into a grayscale image, as shown in formula (1), where R, G, and B are the three-channel pixel values ​​of the original image, and Gray(I) is the output grayscale image. Then, the grayscale image is subjected to threshold binarization, as shown in formula (2), where Binary(I) is the output binary image. Finally, morphological operations are performed on the binary image to remove noise from the image and make the edges of the light spot smoother, which is beneficial for subsequent contour extraction and edge fitting.

[0023] (1) (2) S2. Extract contours from the binary image to obtain multiple closed contours; approximate each closed contour to obtain multiple contours. When approximating the contour for each closed contour, the following steps are included: Select any two adjacent points on the closed contour as contour points and the line connecting them as the starting line segment. Calculate the distance from the point between these two points on the closed contour to this line segment and select the point with the farthest distance as the key point. If the distance from a key point to the starting line segment is higher than a threshold, then that point is added to the contour points; this threshold is set based on experience. Divide the starting line segment into two line segments from its endpoint to the key point. Recursively perform the above operation on these two line segments until the distance from all line segments to their key points is less than the threshold. The set of contour points at this point is the extracted contour.

[0024] In this embodiment, a starting point is found in the binary image as the contour starting point. Neighboring pixels are then searched sequentially to gradually form a complete contour line. This process is repeated until the starting point is reached, thus completing the extraction of the entire contour. First, the Sobel edge detection algorithm is used to extract edge information from the binary image. A random point on the edge is selected as the starting point. Then, the next point adjacent to the current point and located on the edge is searched clockwise. This process is repeated until a closed contour is formed. If there are points not covered by the closed contour, the above operation is repeated to form several closed contours. For each contour, an approximation process is performed: select any two adjacent points on the contour as contour points and the line connecting them as the starting line segment. Calculate the distance from the point between these two points on the contour to this line segment and select the point with the farthest distance as the key point. If the distance from the key point to the starting line segment is higher than a threshold, add this point to the contour points and divide the starting line segment into two line segments from its endpoints to the key points. Recursively perform the above operation on these two line segments until the distance from all line segments to their key points is less than the threshold. The set of contour points at this point is the extracted contour.

[0025] S3. Set up a filter based on the shape characteristics of the cross-shaped light spot, and use the filter to select the target contour from multiple contours. A filter is set based on the morphological characteristics of the cross-shaped light spot. The filter consists of three parts: The first part is vertex filtering, which judges the number of vertices of the contour. If the number of vertices is not 8, the contour is excluded. The second part is area filtering, which calculates the ratio of the convex hull area to the contour area for filtering. If the ratio is lower than a preset first threshold, the reference value of the first threshold is set to 1.5 based on experience, and then the contour is excluded. Here, the convex hull is the smallest rotating rectangle that surrounds the edge. The third part is perimeter filtering, which calculates the ratio of the convex hull perimeter to the perimeter of the contour for filtering. If the ratio is higher than the preset second threshold, the reference value of the second threshold is set to 0.75 based on experience, and then the contour is excluded.

[0026] The entire filter strictly incorporates the morphological characteristics of the cross-shaped light spot to achieve effective detection of the target.

[0027] The formulas for the area-perimeter ratio are shown in (3) and (4), respectively. Area_Ratio and Perimeter_Ratio are the ratios of area and perimeter, Convex_Hull_Area is the area of ​​the convex hull, Contour_Area is the area of ​​the contour, Convex_Hull_Perimeter is the perimeter of the convex hull, and Contour_Perimeter is the perimeter of the contour. (3) (4) S4. Obtain multiple convex hull points of the target contour; use the K-means method to cluster the convex hull points to obtain multiple sets of convex hull points; use the extreme value averaging method to obtain the center point of each set of convex hull points, and use the center point as the spot vertex; In this embodiment, the K-means method is used to cluster the convex hull points, and the extreme value averaging method is used to find the vertices. The convex hull points are obtained by enclosing the edges with the minimum rotation rectangle, and they are mainly clustered at the four endpoints of the cross-shaped light spot. By pre-determining the K value, the convex hull points are divided into several parts. For each set of parts, the extreme value averaging method is used to find the center of each class, and this center is used as the vertex of the light spot. The formula for the extreme value averaging method is shown in (5). The convex hull point of the i-th class.

[0028] (5) in, The convex hull point of the i-th class; Let x and y represent the minimum x-coordinate and minimum y-coordinate of all convex hull points in the i-th class; This represents the maximum x-coordinate and maximum y-coordinate of all convex hull points in the i-th class.

[0029] S6. Obtain the center of the light spot based on each light spot vertex; perform adaptive positioning based on the light spot center.

[0030] The center of the light spot is obtained according to the following steps: Calculate the center of the light spot based on each light spot vertex; Based on the arctangent angle between each spot vertex and the calculated spot center; Obtain the corresponding spot vertices based on the arctangent angle of the obtained spot center; Connect the corresponding vertices of the light spots to form the center line of the cross-shaped light spot axis; The center of the light spot is determined by the intersection of the midlines of the cross-shaped light spot axis.

[0031] In this embodiment, the center of the light spot is calculated based on the obtained light spot vertices, and the arctangent angles of each vertex and the center point are calculated accordingly. After sorting, the corresponding vertices can be obtained according to their size relationship. The formula for calculating the arctangent angle between the vertex and the center point is shown in (6). It is the x-coordinate of the center point. It is the x-coordinate of the vertex. It is the y-coordinate of the center point. It is the y-coordinate of the vertex.

[0032] (6) Specifically, the repositioning of the light spot center involves using the line connecting the corresponding vertices as the center line (axis center line) of the cross-shaped light spot axis to reposition the center point of the light spot, and then using the axis and the center point to position the entire cross-shaped light spot.

[0033] According to the present invention, the method further includes measuring the length of the major axis of the cross-shaped laser spot and the spot width at a specified position, including: The length of the major axis of the light spot is obtained by the distance between the corresponding vertices of the light spot. To calculate the beam width at a specified location, based on the geometric relationship that the beam width is perpendicular to the long axis of the beam, determine the straight line through which the beam width passes at the specified location, and obtain the intersection point between them, which is recorded as the initialization point; obtain the left and right adjacent points of the initialization point on the beam width line, which are recorded as the left and right stop points, and obtain the beam width at the specified location by determining the final positions of the left and right stop points.

[0034] In this embodiment, see Figure 2 As shown, the size calculation involves the lengths of the two major axes of the light spot, such as... Figure 2 The width of the light spot at the specified location and the blue line, such as Figure 2 The red line. The major axis of the light spot is the centerline obtained in S6, which can be directly calculated using the distance formula between two points. For calculating the light spot width at a specified location, first, using the geometric relationship that the light spot width is perpendicular to the major axis, determine the straight line passing through the light spot width at the specified location, and find their intersection point, denoted as the initialization point, such as... Figure 2 The middle green dot; next, find the two adjacent points to the left and right of the initial point on the straight line of the light spot width, and record them as the left and right stop points. Then, determine the final positions of the left and right stop points according to the following rules, taking the left stop point as an example: (1) Find the left adjacent point of the left stop point on the straight line of the light spot width.

[0035] (2) Calculate the pixel gradient of the left stopping point and its neighboring points in the binary image. The formula for calculating the pixel gradient is as follows:

[0036] (3) If the absolute value of the pixel gradient is less than the pre-set threshold, the left neighboring point is updated to the new left stopping point, and the iteration continues to (1).

[0037] (4) If the absolute value of the pixel gradient is greater than or equal to the pre-set threshold, then the current left stopping point is the final left stopping point, and the iteration stops.

[0038] Once the final stopping points on the left and right are determined, the line connecting them is the beam width segment, and the beam width can be calculated using the distance formula between the two points.

[0039] In summary, this invention proposes an adaptive positioning and measurement method for a cross-shaped laser spot in near-site security. During the positioning process, a near-target is found through polygon fitting, using the area ratio and perimeter ratio of the convex hull and contour as constraints. A clustering algorithm is employed to obtain the vertices, and finally, the center point is updated to perform spot positioning. The specific scheme is as follows: (1) Contour extraction: Find a starting point from the preprocessed binary image as the starting point of the contour, find neighboring pixels in turn, and gradually form a complete contour line. Repeat the above steps until you return to the starting point, thus completing the extraction of the entire contour.

[0040] (2) Contour Approximation: Select the starting and ending points on the contour to form a line segment. Calculate the perpendicular distance from each point in the contour to the starting line segment. Compare the maximum distance with a set threshold. If the maximum distance is less than the threshold, the points on the entire line segment can be ignored. Connect the starting and ending points. Otherwise, select the point with the largest perpendicular distance as the key point. Continuously divide the contour into small modules and recursively use the above algorithm. Finally, connect all the key points to form an approximate contour.

[0041] (3) Vertex selection for polygon fitting: Randomly select several points from the contour as vertices of the initial polygon, and continuously add, delete, and move the vertices of the polygon through iteration to optimize its position. Multiply the contour length by a specified coefficient to obtain the fitting metric to avoid overfitting or underfitting. Filter the number of vertices of the fitted polygon, and use the ratio of the area of ​​the convex hull to the contour and the ratio of the perimeter as constraints to ensure that a cross-shaped contour is found.

[0042] (4) Clustering to find vertices: The K-means clustering algorithm is used on the set of convex hull vertices, and the extreme value averaging method is used to find the center point of each class. The arctangent value of each vertex and the center point is calculated and sorted. Points with relative positions are selected and connected to find the intersection point to update the center point.

[0043] This invention provides an adaptive positioning and measurement method for cross-shaped laser spots in near-field security applications, which can accurately locate cross-shaped spots in images. During geometric optimization, contour extraction and approximation are performed first. Then, by limiting the number of vertices and using the ratio of the convex hull to the perimeter of the contour as a constraint, other interference terms can be eliminated. When finding corresponding vertices, clustering and extreme value averaging methods are used to ensure precise vertex positions. The connecting lines are always located on the central axis of the cross-shaped laser spot stripes, thereby repositioning the center point and achieving precise positioning of the cross-shaped laser spot.

[0044] This invention provides a near-site security cross-shaped laser spot adaptive positioning and measurement system, comprising: The data acquisition module is used to acquire cross-shaped light spot images; the cross-shaped light spot images are then binarized to obtain binary images. The contour extraction module is used to extract contours from a binary image and obtain multiple closed contours; to approximate each closed contour to obtain multiple contours; and to set a filter based on the morphological characteristics of the cross-shaped light spot, and to filter out the target contour from multiple contours through the filter. The vertex recognition module is used to obtain multiple convex hull points of the target contour; the K-means method is used to cluster the convex hull points to obtain multiple sets of convex hull points; the center point of each set of convex hull points is obtained according to the extreme value averaging method, and the center point is used as the spot vertex; The positioning module is used to obtain the center of the light spot based on each light spot vertex; and to perform adaptive positioning based on the light spot center.

[0045] The present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, performs the steps of the method described above.

[0046] The present invention provides a storage medium having a computer program stored thereon, which, when run, performs the steps of the above-described method.

[0047] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for adaptive positioning and measurement of a cross-shaped laser spot in near-site security, characterized in that, include: Obtain a cross-shaped light spot image; perform binarization processing on the cross-shaped light spot image to obtain a binary image; Contour extraction is performed from a binary image to obtain multiple closed contours; contour approximation is performed on each closed contour to obtain multiple contours; The filter is set according to the morphological characteristics of the cross-shaped light spot, and the target contour is selected from multiple contours by the filter. Obtain multiple convex hull points of the target contour; use the K-means method to cluster the convex hull points to obtain a set of multiple classes of convex hull points; The center point of each type of convex hull point set is obtained by the extreme value averaging method, and this center point is used as the vertex of the light spot. The center of the light spot is obtained from each light spot vertex; Adaptive positioning is performed based on the center of the light spot; When approximating the contour for each closed contour, the following steps are included: Select any two adjacent points on the closed contour as contour points and the line connecting them as the starting line segment. Calculate the distance from the point between these two points on the closed contour to this line segment and select the point with the farthest distance as the key point. If the distance from a key point to the starting line segment is higher than the threshold, then that point is added to the contour points. Divide the starting line segment into two line segments from its endpoint to the key point. Recursively perform the above operation on these two line segments until the distance from all line segments to their key points is less than the threshold. At this point, the set of contour points is the extracted contour. The extreme value averaging method is calculated using the following formula: in, The convex hull point of the i-th class; Let x and y represent the minimum x-coordinate and minimum y-coordinate of all convex hull points in the i-th class; Represents the maximum x-coordinate and maximum y-coordinate of all convex hull points in the i-th class; The center of the light spot is obtained according to the following steps: Calculate the center of the light spot based on each light spot vertex; Based on the arctangent angle between each spot vertex and the calculated spot center; Obtain the corresponding spot vertices based on the arctangent angle of the obtained spot center; Connect the corresponding vertices of the light spots to form the center line of the cross-shaped light spot axis; The center of the light spot is determined by the intersection of the midlines of the cross-shaped light spot axis.

2. The adaptive positioning and measurement method for cross-shaped laser spot in near-site security according to claim 1, characterized in that, A filter is set based on the morphological characteristics of the cross-shaped light spot. The filter consists of three parts: The first part is vertex filtering, which judges the number of vertices of the contour. If the number of vertices is not 8, the contour is excluded. The second part is area filtering, which calculates the ratio of the convex hull area to the contour area and filters them. If the ratio is lower than the preset first threshold, the contour is excluded. The third part is perimeter filtering, which calculates the ratio of the convex hull perimeter to the perimeter of the contour and filters it. If the ratio is higher than the preset second threshold, the contour is excluded.

3. The adaptive positioning and measurement method for cross-shaped laser spot in near-site security according to claim 1, characterized in that, It also includes measuring the length of the major axis of the cross-shaped laser spot and the spot width at a specified position, including: The length of the major axis of the light spot is obtained by the distance between the corresponding vertices of the light spot. To calculate the beam width at a specified location, based on the geometric relationship that the beam width is perpendicular to the long axis of the beam, determine the straight line through which the beam width passes at the specified location, and obtain the intersection point between them, which is recorded as the initialization point; obtain the left and right adjacent points of the initialization point on the beam width line, which are recorded as the left and right stop points, and obtain the beam width at the specified location by determining the final positions of the left and right stop points.

4. A system for adaptive positioning and measurement of a cross-shaped laser spot in ground-based security as described in claim 1, characterized in that, include: The data acquisition module is used to acquire cross-shaped light spot images; the cross-shaped light spot images are then binarized to obtain binary images. The contour extraction module is used to extract contours from a binary image and obtain multiple closed contours; to approximate each closed contour to obtain multiple contours; and to set a filter based on the morphological characteristics of the cross-shaped light spot, and to filter out the target contour from multiple contours through the filter. The vertex recognition module is used to obtain multiple convex hull points of the target contour; the K-means method is used to cluster the convex hull points to obtain multiple sets of convex hull points; the center point of each set of convex hull points is obtained according to the extreme value averaging method, and the center point is used as the spot vertex; The positioning module is used to obtain the center of the light spot based on each light spot vertex; and to perform adaptive positioning based on the light spot center.

5. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method as described in any one of claims 1-3.

6. A storage medium, characterized in that, It stores a computer program that, when run, performs the steps of the method according to any one of claims 1-3.