Laser spot detection method based on secretary bird optimization algorithm
By optimizing the image segmentation threshold using the Secretary Bird optimization algorithm, the problems of insufficient image data and background noise interference in laser spot detection are solved, achieving high-precision and efficient spot segmentation with strong adaptability, suitable for complex backgrounds and noisy environments.
Patent Information
- Application Number
- CN202510883465.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-29
- Publication Date
- 2025-11-28
AI Technical Summary
Existing laser spot detection methods struggle to achieve high-precision and efficient spot segmentation when there is insufficient image data, significant background noise, or when the laser spot and background have similar gray levels.
The Secretary Bird optimization algorithm is used for image segmentation. By initializing algorithm parameters, randomly generating an initial population, calculating fitness values, and dynamically adjusting individual positions, the threshold for image segmentation is optimized to improve detection accuracy and robustness.
It improves the accuracy and efficiency of laser spot detection, reduces missegmentation and missed segmentation, enhances robustness in complex backgrounds and noisy environments, and has higher adaptability and stability.
Smart Images

Figure CN121033091A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of image processing and optimization algorithm, and relates to a laser spot detection method based on a secretary bird optimization algorithm. BACKGROUND
[0002] In recent years, laser technology has developed rapidly. Laser rangefinders, laser pointers, and laser radars have achieved various applications in military and civilian fields. Laser devices can form a laser spot on the target by emitting a laser beam. This spot has high visibility in low-illumination and long-distance environments and occupies a high gray level in optical images. By detecting the formed laser spot, high-precision operations such as identification, aiming, and guidance can be completed. However, optical images with laser spots have characteristics such as strong background noise, difficulty in separating targets from backgrounds, and few training data sets. These characteristics will bring difficulties to the accurate detection of laser spots. Therefore, accurately detecting laser spots in the military field can effectively enhance the reliability and precision of the system and provide important support for the rapid response and efficient combat of weapon systems. At the same time, in the civilian field, the accurate detection of laser spots is also crucial for laser ranging, laser scanning, and automated navigation applications, promoting the widespread application of laser technology in various high-precision tasks.
[0003] There are mainly three types of laser spot detection methods for optical images.
[0004] (1) Edge detection-based method. The edge detection method is mainly used to extract significant edge information from the image, and the detection of the laser spot is realized by analyzing the boundary of the laser spot. Common edge detection algorithms include Sobel operator, Canny operator, etc. These methods calculate the gradient of the image to find the area with sharp changes in brightness or gray level to determine the edge position. Since the contrast between the laser spot and the background is large, the edge detection method can effectively extract the edge contour of the spot. The edge detection step usually includes image preprocessing, gradient calculation, edge enhancement, and edge connection. The advantage of this method is its strong local precision, which can clearly identify the boundary of the spot. However, the edge detection method is easily affected by noise, especially in low-contrast or complex background conditions, which may cause false detection and missed detection.
[0005] (2) Machine learning-based methods. With the development of artificial intelligence technology, machine learning-based laser spot detection methods have attracted more and more attention. By training a classifier (such as support vector machine, decision tree, etc.) or deep learning model (such as convolutional neural network), the features and patterns of the laser spot are learned from a large amount of image data. The core advantage of machine learning methods is that they can automatically extract image features, handle laser spot detection tasks in complex backgrounds, and improve the accuracy of laser spot recognition. Deep learning models, especially convolutional neural networks, have achieved remarkable results in many image segmentation and object detection problems. Through training on labeled datasets, the model can achieve end-to-end laser spot detection with strong robustness. However, it also has certain limitations. Machine learning methods require a large amount of labeled data for training, and the computational complexity is relatively high, with poor real-time performance.
[0006] (3) Threshold-based segmentation methods. Threshold-based segmentation methods divide the image into spot and background parts by setting an appropriate threshold. The core of this method is to select an optimal threshold that maximizes the gray level difference between the spot and background regions, thereby achieving accurate spot segmentation. Common threshold selection algorithms include Otsu's method, adaptive thresholding method, etc. These algorithms analyze the gray level histogram of the image to determine the optimal threshold, ensuring that the spot region is correctly extracted. Threshold segmentation methods have the advantages of simple calculation and high efficiency, and are particularly suitable for laser spot detection in low-contrast images. However, the performance of threshold segmentation methods is highly dependent on the selection of the threshold. If the image has a lot of background noise or the gray level of the laser spot is similar to the background, the segmentation result may not be good. SUMMARY
[0007] (I) Invention purpose
[0008] The purpose of the present application is to provide a laser spot detection method based on the secretary bird optimization algorithm, which solves the problems of insufficient image data, high background noise, and similar gray levels between laser spots and backgrounds in the prior art.
[0009] (II) Technical solution
[0010] To solve the above technical problems, the present application provides a laser spot detection method based on the secretary bird optimization algorithm, which comprises the following steps:
[0011] S1, initialize algorithm parameters, including population size, maximum iteration number, search space upper and lower bounds, and population dimension;
[0012] S2, randomly generate an initial population, each secretary bird population individual represents a laser spot image segmentation threshold, and map it to an optical image segmentation result;
[0013] S3, calculate the fitness value, take the number of detected laser spot pixels in the segmented image as the objective function, and introduce constraint conditions to ensure the rationality of the threshold selection range;
[0014] S4, determine the stage of the secretary bird optimization algorithm according to the current iteration number, which is respectively the prey exploration stage and the development stage, dynamically adjust the population individual position, and update the individual position to minimize the fitness function as the target;
[0015] S5, update the laser spot segmentation threshold represented by the optimal individual according to the optimization algorithm stage, and calculate its segmentation effect, and record the best fitness value;
[0016] S6, judge whether the maximum iteration number or the fitness convergence threshold is reached, if not, return to step S4, if reached, output the optimal threshold and generate the final segmentation image.
[0017] Further, in the step S1, the specific steps of initializing the algorithm parameters are:
[0018] S1.1, initialize the population matrix, provide a matrix containing N population sizes, each population has dim dimensions. The value of each dimension of each population is randomly generated between the lower bound lb and the upper bound ub of the corresponding dimension. Specifically, the value of each dimension of the sample is calculated by the following formula:
[0019] X i,j =lb j +r×(ub j -lb j ),i=1,2,...,N,j=1,2,...,Dim;
[0020] S1.2, set the iteration number parameter according to S1.1 and combined with the characteristics of the optical image.
[0021] Further, in the step S3, the specific steps of constructing the fitness function are:
[0022] S3.1, based on the formula: Where F(ε) is the fitness function, ε is the threshold value of the laser spot image segmentation, δ is the number of laser spots in the image, N i is the number of pixels in the i-th laser spot;
[0023] S3.2, evaluate each secretary bird individual using the fitness function to obtain the fitness value;
[0024] S3.3, consider the constraint conditions in the fitness function, including the number of laser points that should be detected Con(F S(x, y)) = δ and the threshold value range 0 < ε < 1 is used to balance the segmentation accuracy and the calculation efficiency;
[0025] Further, in the step S4, the individual position is updated to minimize the fitness function, and specifically, the individual position updating strategy in different stages is:
[0026] S4.1, the exploration stage can be divided into three stages: finding prey, consuming prey and attacking prey. The three stages can be distinguished by the ratio of the current iteration number t and the total iteration number Iter max The position updating strategy steps are:
[0027] S4.11, when , it is the finding prey stage, each individual explores in the solution space with high randomness. By randomly selecting two individuals X random_1 and X random_2 in the population, a new candidate solution is generated by using the position difference of the two individuals, and a random weight disturbance is added, and the new solution is constrained by the upper and lower bounds. The state update formula of each individual is:
[0028]
[0029] S4.12, when , it is the consuming prey stage, the position difference between the individual and the optimal solution in the population is calculated, the exponential weakening disturbance strategy and Brown motion are introduced to calculate the new position, and the calculation formula of the new position is:
[0030]
[0031] S4.13, when , it is the attacking prey stage, the secretary bird jumps around the optimal solution in a large range to search for the optimal position in the form of Levy flight. The formula for updating the position is:
[0032]
[0033] S4.14, in the three stages of the exploration stage, the position updating strategy of the secretary bird is:
[0034]
[0035] S4.2, the development stage simulates the escape behavior of the secretary bird, and realizes the updating of the individual position through two strategies: camouflage and escape. Each individual generates a random number rand and judges whether it is less than 0.5, and selects to execute the two strategies with equal probability. The specific steps are:
[0036] S4.21, camouflage strategy: the individual takes the optimal solution as the reference, and adjusts the position by adding random disturbance step by step. The specific formula is:
[0037]
[0038] S4.22, escape strategy: the individual refers to the position of other individuals, and adjusts the position by random jumping. The specific formula is:
[0039]
[0040] S4.23, in the development stage, the position update strategy of the secretary bird is the same as that in the S4.14 stage.
[0041] Further, the judgment in the step S6 is:
[0042] S6.1, when the iteration number reaches the set maximum iteration number Iter max , terminate the search process and return the current optimal solution.
[0043] (Three) beneficial effects
[0044] The laser spot detection method based on the secretary bird optimization algorithm provided by the above technical solution has the following beneficial effects:
[0045] (1) The secretary bird optimization algorithm is introduced to select the optimal threshold value of image segmentation, which improves the precision and efficiency of laser spot detection, and solves the problem of difficult threshold selection in traditional threshold segmentation methods. By utilizing the global optimization ability of swarm intelligence algorithm, the secretary bird optimization algorithm can automatically search for the optimal threshold value, making the segmentation of the spot more accurate, especially in low contrast and high noise environment, which can effectively reduce the missegmentation and missed segmentation phenomenon. Compared with the traditional manual selection of threshold value or simple heuristic method, the algorithm of the present application can significantly improve the calculation efficiency while maintaining high precision, reduce the manual intervention and experience dependence, and has higher self-adaptability.
[0046] (2) The present application overcomes the problem that the traditional laser spot detection method is sensitive to background noise and is prone to misjudgment in the case of strong noise or complex background. By introducing the secretary bird optimization algorithm, the present application significantly improves the spot detection performance in complex background by accurately optimizing the segmentation threshold, and enhances the robustness to complex background and noise environment. The adaptive mechanism in the optimization process of the secretary bird optimization algorithm can dynamically adjust the search range under different image features, improving the robustness in irregular background and low contrast images. Therefore, the present application has stronger adaptability and stability, and can provide more reliable spot detection results in various practical application scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0047] Fig. 1 is the flowchart of the detection method of the embodiment of the present application.
[0048] Fig. 2 A real laser spot image collected in an embodiment of the present application.
[0049] Fig. 3 A laser spot image segmented in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, content and advantages of the present application clearer, the specific embodiments of the present application are described in further detail below in combination with the drawings and examples.
[0051] Referring to Figs. 1 to 3 The laser spot detection method based on the secretary bird optimization algorithm in the embodiment is characterized by comprising the following steps:
[0052] S1, initialize algorithm parameters, including population size, maximum iteration number, search space upper and lower bounds, and population dimension. The specific steps are as follows:
[0053] S1.1, initialize the population matrix, and provide a matrix containing N population sizes, each population having a dim dimension. The value of each dimension of each population is randomly generated between the lower bound lb and the upper bound ub of the corresponding dimension. Specifically, the value of each dimension of the sample is calculated by the following formula:
[0054] X i,j = lb j + r * (ub j - lb j ), i = 1, 2,..., N, j = 1, 2,..., Dim
[0055] S1.2, set the iteration number parameter according to S1.1 and in combination with the characteristics of the optical image.
[0056] S2, randomly generate an initial population, each secretary bird population individual represents a threshold value of laser spot image segmentation, and map it to the optical image segmentation result;
[0057] S3, calculate the fitness value, take the number of detected laser spot pixels in the segmented image as the objective function, and introduce a constraint condition to ensure the rationality of the threshold value selection range. The specific steps are as follows:
[0058] S3.1, based on the formula: Where F(ε) is the fitness function, ε is the threshold value of laser spot image segmentation, δ is the true value of the number of laser spots, N i is the number of pixels of the i-th laser spot;
[0059] S3.2 Evaluate each secretary bird individual using the fitness function to obtain a fitness value;
[0060] S3.3, Consider the constraint conditions in the fitness function, including the number of existing laser points Con(F S (x,y)) = δ and the threshold value range 0 < ε < 1, which is used to balance the segmentation accuracy and computational efficiency;
[0061] S4, Determine the stage of the secretary bird optimization algorithm according to the current iteration number, which is divided into prey exploration stage and development stage, dynamically adjust the population individual position, and the update of individual position aims to minimize the fitness function. The specific steps are:
[0062] S4.1, The exploration stage can be divided into three stages: finding prey, consuming prey and attacking prey. These three stages can be distinguished by the ratio of the current iteration number t and the total iteration number Iter max . The position update strategy is:
[0063] S4.11, When , it is the prey finding stage, and each individual explores in the solution space with high randomness. By randomly selecting two individuals X random_1 and X random_2 in the population, a new candidate solution is generated by using the position difference of the two individuals and adding a random weight disturbance, and the new solution is constrained by the upper and lower bounds. The state update formula of each individual is:
[0064]
[0065] S4.12, When , it is the prey consumption stage, and the position difference between the individual and the optimal solution in the population is calculated, and an exponentially weakened disturbance strategy and Brownian motion are introduced to calculate the new position. The calculation formula of the new position is:
[0066]
[0067] S4.13, When , it is the prey attack stage, and the secretary bird jumps around the optimal solution in a large range to search for the optimal position in the form of Levy flight. The formula for updating the position is:
[0068]
[0069] S4.14, In the three stages of the exploration stage, the position update strategy of the secretary bird is:
[0070]
[0071] S4.2, the escape behavior of the secretary bird is simulated in the development stage, and the position of the individual is updated by two strategies: camouflage and escape. Each individual selects the two strategies with equal probability by generating a random number rand and determining whether it is less than 0.5. The specific steps are as follows:
[0072] S4.21, camouflage strategy: the individual adjusts the position step by step by adding random disturbance with the optimal solution as reference. The specific formula is:
[0073]
[0074] S4.22, escape strategy: the individual adjusts the position by random jump with reference to the position of other individuals. The specific formula is:
[0075]
[0076] S4.23, in the development stage, the position updating strategy of the secretary bird is the same as that in S4.14 stage.
[0077] S5, update the laser spot segmentation threshold represented by the optimal individual according to the optimization algorithm stage, and calculate its segmentation effect, record the best fitness value;
[0078] S6, judge whether the maximum iteration number or the fitness convergence threshold is reached, if not, return to step S4, if reached, output the optimal threshold and generate the final segmentation image. The specific steps are as follows:
[0079] S6.1, when the iteration number reaches the set maximum iteration number Iter max , terminate the search process and return the current optimal solution.
[0080] The above only describes the preferred embodiments of the present application, it should be pointed out that for ordinary skilled in the art, without departing from the technical principles of the present application, a number of improvements and modifications can be made, these improvements and modifications should also be considered as the protection scope of the present application.
Claims
1. A laser spot detection method based on the Secretary Bird optimization algorithm, characterized in that, Includes the following steps: S1. Initialize algorithm parameters, including population size, maximum number of iterations, upper and lower bounds of search space, and population dimension; S2. Randomly generate an initial population, with each individual secretary bird representing a threshold for laser spot image segmentation, and map it to the optical image segmentation result; S3. Calculate the fitness value, using the number of laser spot pixels detected in the segmented image as the objective function, while introducing constraints to ensure the rationality of the threshold selection range. S4. Determine the stages of the Secretary Bird optimization algorithm based on the current iteration number, namely the prey exploration stage and the development stage. Dynamically adjust the positions of individuals in the population, with the goal of minimizing the fitness function when updating the individual positions. S5. Update the laser spot segmentation threshold represented by the best individual according to the optimization algorithm stage, calculate its segmentation effect, and record the best fitness value. S6. Determine whether the maximum number of iterations or the fitness convergence threshold has been reached. If not, return to step S4. If so, output the optimal threshold and generate the final segmentation image.
2. The laser spot detection method based on the secretary bird optimization algorithm as described in claim 1, characterized in that, In step S1, the specific steps for initializing the algorithm parameters are as follows: S1.1 Initialize the population matrix, providing a matrix containing N population sizes, each population having a dimension of dim; S1.
2. Set the iteration number parameter based on the S1.1 matrix and in combination with the optical image characteristics.
3. The laser spot detection method based on the secretary bird optimization algorithm as described in claim 2, characterized in that, In step S1.1, the value of each dimension of each population is randomly generated between the lower bound lb and the upper bound ub of the corresponding dimension.
4. The laser spot detection method based on the secretary bird optimization algorithm as described in claim 3, characterized in that, In step S1.1, the value of each dimension of the sample is calculated using the following formula: X i,j =lb j +r×(ub j -lb j ),i=1,2,...,N,j=1,2,...,Dim。 5. The laser spot detection method based on the secretary bird optimization algorithm as described in claim 4, characterized in that, In step S3, the steps for constructing the fitness function are as follows: S3.1 Establish the fitness function; S3.
2. For each individual secretary bird, evaluate it using a fitness function to obtain a fitness value; S3.
3. Constraints are considered in the fitness function to balance segmentation accuracy and computational efficiency.
6. The laser spot detection method based on the secretary bird optimization algorithm as described in claim 5, characterized in that, In S3.1, the fitness function formula is: Where ε is the threshold for laser spot image segmentation, δ is the number of laser spots in the image, and N i It is the number of pixels in the i-th laser spot.
7. The laser spot detection method based on the secretary bird optimization algorithm as described in claim 6, characterized in that, In S3.3, the constraint condition includes the number of laser points that should be detected, Con(F). S The range of values for (x,y))=δ and the threshold is 0<ε<1.
8. The laser spot detection method based on the secretary bird optimization algorithm as described in claim 7, characterized in that, In step S4, the update of individual positions aims to minimize the fitness function. The individual position update strategies at different stages are as follows: S4.1 The exploration phase is divided into three stages: finding prey, consuming prey, and attacking prey. These three stages are represented by the current iteration count t and the total iteration count Iter. max The ratio is used to distinguish them; S4.2 During the development phase, the escape behavior of the secretary bird is simulated. Two strategies are used: camouflage and escape to update the individual's position. Each individual generates a random number rand and determines whether it is less than 0.5, and then chooses to execute one of the two strategies with equal probability.
9. The laser spot detection method based on the secretary bird optimization algorithm as described in claim 8, characterized in that, The location update strategy steps in step S4.1 are as follows: S4.11, when During the prey-hunting phase, each individual explores the solution space with high randomness; by randomly selecting two individuals X from the population... random_1 and X random_2 New candidate solutions are generated by utilizing their positional differences, and random weight perturbations are added. The new solutions are subject to upper and lower bound constraints. The state update calculation formula for each individual is as follows: S4.12, when During the prey consumption phase, using the current optimal solution in the population as a reference, the positional difference between the individual and the optimal solution is calculated. An exponentially weakening perturbation strategy and Brownian motion are introduced to calculate the new position. The formula for calculating the new position is: S4.13, when During the prey-attacking phase, the Secretary Bird uses a Levi-like flight pattern to perform large-scale jumps around the optimal solution to search for the optimal position; the formula for updating the position is: S4.14, The Secretary Bird's position update strategy during the three stages of the exploration phase is as follows:
10. The laser spot detection method based on the secretary bird optimization algorithm as described in claim 9, characterized in that, Step 4.2 includes the following sub-steps: S4.21, Camouflage Strategy: Individuals use the optimal solution as a reference and gradually adjust their positions by introducing random perturbations; the specific formula is: S4.22, Escape Strategy: An individual adjusts its position by randomly jumping, referencing the positions of other individuals; the specific formula is: S4.
23. During the development phase, the position update strategy for the Secretary Bird is the same as that in the S4.14 phase.
Citation Information
Patent Citations
Automatic target scoring method and system suitable for laser simulation shooting
CN118470106A
Light spot denoising method of long-distance laser triangular displacement measurement system
CN118537570A
Chip defect classification method for optimizing feature selection based on spot-bird optimization algorithm
CN118916772A
Three-dimensional scanning lidar based on one-dimensional optical phased arrays
US20210018599A1
Cited By
Power conversion equipment and power conversion equipment control method
CN122092647A