Multi-target light spot positioning method and system based on grey wolf algorithm
By applying the Gray Wolf algorithm to perform threshold classification and centroid positioning in multi-objective spot positioning, the problem of insufficient positioning accuracy and robustness in the prior art is solved, and more efficient and accurate multi-objective spot positioning is achieved.
Patent Information
- Application Number
- CN202411830155.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-05-02
AI Technical Summary
The prior art is difficult to meet the requirements of accuracy and robustness in multi-objective spot positioning, especially when the spot target is small and the noise interference is severe.
The multi-objective spot positioning method based on the Gray Wolf algorithm is adopted. By iteratively segmenting binary images, calculating the threshold of the connected domain group, and using the Gray Wolf algorithm for threshold classification, the spot positioning is finally performed using the weighted center of mass method.
It improves the accuracy and robustness of spot positioning, and can more accurately locate multiple spot targets, reduce noise interference, and adapt to the multi-objective positioning needs in different scenarios.
Smart Images

Figure CN119919478A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image analysis and processing, and in particular, relates to a multi-target spot positioning method and system based on a grey wolf algorithm. Background Art
[0002] At present, multi-target spot positioning is an important research direction in the field of computer vision. In the fields of optical communication, laser radar and industrial detection, accurate and fast positioning of multiple spot targets is crucial to achieve target tracking, measurement and control. However, due to factors such as the small size of the spot target and strong noise interference, traditional positioning methods are difficult to meet the requirements of accuracy and robustness.
[0003] Among the new solutions currently being explored, the multi-target spot positioning method based on image processing has attracted widespread attention. The method disclosed in the patent document "A Spot Centroid Positioning Method Based on Block Threshold" (CN113808193A) takes into account the importance of threshold segmentation, but only uses the threshold of the 3x3 area for processing, does not take into account more information about the target, and has a large amount of calculation. It can only obtain a single centroid, and cannot extract multiple centroids.
[0004] The method disclosed in the patent document "A method for identifying and locating the centroid of infrared spot images" (CN111462225A) only uses adaptive threshold processing, and the grayscale value of the entire image is processed without considering the grayscale value of the spot. Secondly, although the spot outline is located, more information about the target is not considered, and the effect needs to be improved. At the same time, only a single centroid can be obtained, and multiple centroids cannot be extracted.
[0005] The method disclosed in the patent document "A method for extracting the centroid of a laser spot based on grayscale threshold" (CN113421296A) only uses grayscale statistics to classify noise and spot, and does not take into account the influence of noise on the edge of the spot, which will make the threshold segmentation unclear after statistics. Without further consideration, the effect needs to be improved and only a single centroid can be obtained, and multiple centroids cannot be extracted.
[0006] The method disclosed in the patent document "A centroid positioning method and related equipment" (CN116109695A) is affected by noise in the threshold segmentation of the light spot, and only uses grayscale values to simply determine the area, resulting in low positioning accuracy and is only suitable for obtaining a single centroid, which makes it difficult to locate multiple targets.
[0007] The method disclosed in the patent document "A method and system for sub-pixel positioning of the center of a small-size spot of a laser image" (CN117593373A) uses the maximum grayscale value to select the area, which may be affected by noise and cause errors in the selection of the area and low accuracy.
[0008] At present, the research on multi-target spot positioning methods is still relatively limited. It is of great significance to further study and explore the theory and practical application value of this method. Summary of the invention
[0009] In view of the defects in the prior art, the object of the present invention is to provide a multi-target spot positioning method and system based on the Grey Wolf Algorithm.
[0010] A multi-target spot positioning method based on the grey wolf algorithm provided by the present invention includes:
[0011] Step S1: locate the multi-spot target and segment it into a binary image after iteration;
[0012] Step S2: dividing the binary image into small blocks according to the connected domain to form a connected domain group, and calculating the threshold of the connected domain group;
[0013] Step S3: classify the threshold value by using the grey wolf algorithm;
[0014] Step S4: performing light spot positioning based on different thresholds.
[0015] Preferably, in step S1, a light spot grayscale image M of size m×n is obtained. After the multi-target image is converted into a grayscale image A, the inter-class variance between the foreground and background of the grayscale image is calculated for the entire light spot grayscale image by histogram statistics, and the maximum inter-class variance var and the corresponding threshold T are obtained after iteration, and threshold segmentation is performed to obtain a binary image A.
[0016] The traversal is to traverse possible thresholds and calculate the prospect n f and background b Number of pixels Probability Average grayscale And calculate the between-class variance var = P b ·P f @(u b -u f ) 2 ;
[0017] Wherein, H(i) represents the number of pixels with gray level i, i = 1, 2, ..., L-1;
[0018] L represents the total number of gray levels;
[0019] t represents a possible threshold;
[0020] i represents the gray value of the image;
[0021] P b Represents background n bprobability;
[0022] P f Represents the prospect n f probability;
[0023] N represents the total number of pixels in the image;
[0024] u b Represents background n b The average grayscale of
[0025] u f Represents the prospect n f The average grayscale
[0026] M represents a total of M light spots.
[0027] Preferably, in step S2, all pixels in the binary image A are scanned one by one, and a certain pixel W1(i,j) and its four neighboring regions are connected by pixels with the same value of 1, and all connected pixels are grouped into a small block set A. i, Each is made up of pixels of varying sizes.
[0028] A group of small pixel blocks form a connected domain, denoted as the connected domain S l .
[0029] Each two S l The connected domains with common pixels are grouped as a connected domain group L q .
[0030] The connected domain group L is composed of the divided small connected domains. q For the target to be classified, the thresholds of these connected domain groups are calculated by Otsu's method and recorded. Finally, it is determined that there are q independent connected domain groups in total.
[0031] Where q represents the connected domain group number.
[0032] Preferably, the threshold obtained in step S3 is classified using the gray wolf algorithm, each connected domain group is classified into different targets according to its threshold, and the gray wolf with higher fitness is selected as the multi-target light spot to obtain the category of the multi-target light spot;
[0033] After differentiating the multiple targets, the threshold of the connected domain group where the light spot is located and the threshold U of the corresponding area caused by noise are obtained. i , and then perform threshold processing on the divided target area.
[0034] The threshold processing is to judge that if the gray value in the connected domain group after classification is less than the corresponding threshold U i , it is judged as noise, and the corresponding pixel gray value is set to 0. If the gray value in the connected domain group is greater than or equal to the threshold Ui , it is determined to be the target to be processed, and the grayscale value of the corresponding pixel in the connected domain group remains unchanged.
[0035] Preferably, in step S4, the weighted centroid method is used to obtain the center position coordinates (X I ,Y I ),include:
[0036]
[0037] Among them, x i Represents the horizontal coordinate of the pixel point ij in the connected domain group after classification;
[0038] y j Represents the ordinate of the pixel point ij in the connected domain group after classification;
[0039] M indicates that there are M light spots in total.
[0040] A multi-target spot positioning system based on the grey wolf algorithm provided by the present invention comprises:
[0041] Module M1: locates the multi-spot target and segments it into a binary image after iteration;
[0042] Module M2: divide the binary image into small blocks according to the connected domain to form a connected domain group, and calculate the threshold of the connected domain group;
[0043] Module M3: Classify thresholds using the Grey Wolf Algorithm;
[0044] Module M4: Spot positioning based on different thresholds.
[0045] Preferably, the module M1 obtains a light spot grayscale image M of size m×n. After converting the multi-target image into a grayscale image A, the inter-class variance between the foreground and background of the grayscale image is calculated for the entire light spot grayscale image by using histogram statistics. After iteration, the maximum inter-class variance var and the corresponding threshold T are obtained by traversal, and the binary image A is obtained by threshold segmentation.
[0046] The traversal is to traverse possible thresholds and calculate the prospect n f and background b Number of pixels Probability Average grayscale And calculate the between-class variance var = P b ·P f ·(u b -u f ) 2 ;
[0047] Wherein, H(i) represents the number of pixels with gray level i, i = 1, 2, ..., L-1;
[0048] L represents the total number of gray levels;
[0049] t represents a possible threshold;
[0050] i represents the gray value of the image;
[0051] P b Represents background n b probability;
[0052] P f Represents the prospect n f probability;
[0053] N represents the total number of pixels in the image;
[0054] u b Represents background n b The average grayscale of
[0055] u f Represents the prospect n f The average grayscale
[0056] M represents a total of M light spots.
[0057] Preferably, the module M2 scans all pixels in the binary image A one by one, and a certain pixel W1(i,j) and its four neighboring pixels with the same value of 1 are connected, and all connected pixels are grouped into a small block set A. i, Each is made up of pixels of varying sizes.
[0058] A group of small pixel blocks form a connected domain, denoted as the connected domain S l .
[0059] Each two S l The connected domains with common pixels are grouped as a connected domain group L q .
[0060] The connected domain group L is composed of the divided small connected domains. q For the target to be classified, the thresholds of these connected domain groups are calculated by Otsu's method and recorded. Finally, it is determined that there are q independent connected domain groups in total.
[0061] Where q represents the connected domain group number.
[0062] Preferably, the module M3 uses the gray wolf algorithm to classify the obtained threshold, each connected domain group is classified into different targets according to its threshold, and the gray wolf with higher fitness is selected as the multi-target light spot to obtain the category of the multi-target light spot;
[0063] After differentiating the multiple targets, the threshold of the connected domain group where the light spot is located and the threshold U of the corresponding area caused by noise are obtained. i , and then perform threshold processing on the divided target area.
[0064] The threshold processing is to judge that if the gray value in the connected domain group after classification is less than the corresponding threshold U i , it is judged as noise, and the corresponding pixel gray value is set to 0. If the gray value in the connected domain group is greater than or equal to the threshold U i , it is determined to be the target to be processed, and the grayscale value of the corresponding pixel in the connected domain group remains unchanged.
[0065] Preferably, the module M4 uses a weighted centroid method to obtain the center position coordinates (X I ,Y I ),include:
[0066]
[0067] Among them, x i Represents the horizontal coordinate of the pixel point ij in the connected domain group after classification;
[0068] y j Represents the ordinate of the pixel point ij in the connected domain group after classification;
[0069] M indicates that there are M light spots in total.
[0070] Compared with the prior art, the present invention has the following beneficial effects:
[0071] 1. The present invention utilizes the optimization characteristics of the gray wolf algorithm, performs threshold classification through the gray wolf algorithm, and iteratively searches for the exact position of the spot target. It has better anti-noise performance and positioning accuracy, high precision and good robustness.
[0072] 2. The present invention solves the problem of unclear threshold segmentation by calculating the inter-class variance of the spot grayscale image and iterative threshold segmentation. It can more accurately locate multi-spot targets, improve the accuracy of target positioning, and provide a more accurate and effective range for the next step of spot image processing.
[0073] 3. The present invention first distinguishes between targets and noise, and processes different target areas, thereby solving the problems of low centroid positioning accuracy and poor noise resistance of the adaptive threshold segmentation method and the segmented threshold segmentation method in the prior art. It can more accurately locate multiple targets and obtain the centroid of multiple targets.
[0074] 4. The present invention can reduce the influence of noise while processing multiple light spot targets through the classification of thresholds and the processing of target areas. It has certain adaptability and flexibility, adapts to the positioning requirements of multiple targets in different scenarios, and improves practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0076] Figure 1 This is a flow chart of the multi-target spot positioning method based on the Grey Wolf Algorithm.
[0077] Figure 2 A schematic diagram of three light spots.
[0078] Figure 3 Schematic diagram of the binarization after the Grey Wolf Algorithm processing and subsequent segmentation.
[0079] Figure 4 Schematic diagram of the results of spot positioning in the classified areas. DETAILED DESCRIPTION
[0080] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0081] According to a multi-target spot positioning method based on the grey wolf algorithm provided by the present invention, Figure 1 For example, the specific steps include:
[0082] Step S1: locate the multi-spot target and perform threshold segmentation into a binary image after iteration;
[0083] First, the spot grayscale image is obtained, and the inter-class variance of the grayscale image is calculated for the entire spot grayscale image. Figure 2 Take , for example, to calculate the between-class variance, Figure 3 For example, after iteration, the image is threshold segmented into a binary image.
[0084] Specifically, for a multi-spot grayscale image of size m×n, assuming there are M spots in total, after converting the multi-target image into a grayscale image A, the inter-class variance between the foreground and the background is calculated by histogram statistics, and after iteration, it is used as the threshold T. The image is traversed to obtain the maximum inter-class variance var and the corresponding threshold T, and the binary image A is obtained by segmentation.
[0085] The traversal is to traverse possible thresholds and calculate the prospect n f and background b The number of pixels, probability, and average grayscale are shown in formula (1), formula (2), and formula (3), respectively, and the inter-class variance is calculated as shown in formula (4).
[0086]
[0087] var=P b ·P f ·(u b -u f ) 2 (4)
[0088] Wherein, H(i) represents the number of pixels with gray level i, i = 1, 2, ..., L-1;
[0089] L represents the total number of gray levels;
[0090] t represents a possible threshold;
[0091] i represents the gray value of the image;
[0092] P b Represents background n b probability;
[0093] P f Represents the prospect n f probability;
[0094] N represents the total number of pixels in the image;
[0095] u b Represents background n b The average grayscale of
[0096] u f Represents the prospect n f The average grayscale.
[0097] Step S2: Then the connected domain is divided into small blocks to form a connected domain group, and the threshold of the connected domain group is calculated using the Otsu method;
[0098] According to the connected domain segmentation, it is divided into several small blocks, each small block is composed of pixels of different sizes, and several sets are obtained; the connected domain group L composed of the divided small block connected domains q For the target to be classified, the threshold of each pixel connected domain group image is calculated by Otsu's method.
[0099] Specifically, all pixels in the binary image A are scanned one by one. If there are pixels with the same value of 1 in the 4-neighborhood of a certain pixel W1(i,j), they are considered to be connected. All connected pixels are grouped into several small blocks A.i , and obtain several sets, denoted as S l . Small Block A i is a connected domain S l Each connected domain has one or more small blocks. A group of pixel blocks constitute a connected domain, and these pixels are also connected in space.
[0100] For every two S l There are connected domains with common pixels in the , which are grouped as L q , where q is the group number. Connected domain group L q It is a set of several connected domains. The connected domains in these connected domain groups have intersections, that is, they have common pixels. These connected domains S are calculated by Otsu's method. l The threshold is set and recorded, and finally it is determined that there are q independent connected domains.
[0101] Step S3: using the gray wolf algorithm to classify the thresholds and distinguish the multi-spot targets;
[0102] The obtained threshold is classified using the gray wolf algorithm to obtain the category of the multi-spot target. After distinguishing the multiple targets, the connected area where the spot is located is obtained, that is, the connected domain group L q The threshold value and the threshold value U of the corresponding area caused by noise i , and then perform threshold processing on the divided target area.
[0103] Specifically, the gray wolf algorithm classification is to classify the threshold value obtained by the gray wolf algorithm, and each connected domain group L q It can be classified into different targets according to its threshold. According to the fitness of the gray wolf, the gray wolf with higher fitness is selected as the multi-target light spot. The light spot is distinguished from the large noise, and the threshold of the connected area where the light spot is located and the threshold of the corresponding area caused by the noise are obtained.
[0104] The threshold processing is when the connected domain group L after classification q The gray value in the area block is less than the corresponding threshold U i When the gray value in the area is greater than or equal to the threshold U i When , it is considered to be the target to be processed, and the grayscale value of the corresponding pixel in the area block remains unchanged.
[0105] The processing of the threshold takes into account more target information, has a better effect on distinguishing targets from noise, can more accurately locate multiple targets to be processed, can accurately locate multiple targets, and provide more reliable accuracy for subsequent applications.
[0106] Step S4: Based on the threshold, the centroid method is used to locate the light spot.
[0107] The weighted centroid method is used to obtain the center position coordinates of the multi-spot targets in the processed images of different regions.
[0108] Using the centroid method, as shown in formula (5), the center position coordinates (X i ,Y i ).
[0109]
[0110] Among them, x i Represents the horizontal coordinate of the pixel point ij in the connected domain group after classification;
[0111] y j Represents the ordinate of the pixel point ij in the connected domain group after classification.
[0112] The present invention also provides a multi-target light spot positioning system based on the gray wolf algorithm. The multi-target light spot positioning system based on the gray wolf algorithm can be realized by executing the process steps of the multi-target light spot positioning method based on the gray wolf algorithm, that is, those skilled in the art can understand the multi-target light spot positioning method based on the gray wolf algorithm as a preferred implementation of the multi-target light spot positioning system based on the gray wolf algorithm.
[0113] A multi-target spot positioning system based on the grey wolf algorithm provided by the present invention comprises:
[0114] Module M1: locates the multi-spot target and segments it into a binary image after iteration;
[0115] Module M2: divide the binary image into small blocks according to the connected domain to form a connected domain group, and calculate the threshold of the connected domain group;
[0116] Module M3: Threshold classification by Grey Wolf Algorithm;
[0117] Module M4: Spot positioning based on different thresholds.
[0118] In more preferred examples, the module M1 obtains a light spot grayscale image M of size m×n. After converting the multi-target image into a grayscale image A, the inter-class variance between the foreground and background of the grayscale image is calculated for the entire light spot grayscale image through histogram statistics. After iteration, the maximum inter-class variance var and the corresponding threshold T are obtained, and threshold segmentation is performed to obtain a binary image A.
[0119] The traversal is to traverse possible thresholds and calculate the prospect n f and background b Number of pixels Probability Average grayscale And calculate the between-class variance var = P b ·P f ·(u b -u f ) 2 ;
[0120] Wherein, H(i) represents the number of pixels with gray level i, i = 1, 2, ..., L-1;
[0121] L represents the total number of gray levels;
[0122] t represents a possible threshold;
[0123] i represents the gray value of the image;
[0124] P b Represents background n b probability;
[0125] P f Represents the prospect n f probability;
[0126] N represents the total number of pixels in the image;
[0127] u b Represents background n b The average grayscale of
[0128] u f Represents the prospect n f The average grayscale
[0129] M represents a total of M light spots.
[0130] In more preferred embodiments, the module M2 scans all pixels in the binary image A one by one, and a certain pixel W1(i,j) and its four neighboring pixels with the same value of 1 are connected, and all connected pixels are grouped into a small block set A. i, Each is made up of pixels of varying sizes.
[0131] A group of small pixel blocks form a connected domain, denoted as the connected domain S l .
[0132] Each two S l The connected domains with common pixels are grouped as a connected domain group L q .
[0133] The connected domain group L is composed of the divided small connected domains. q For the target to be classified, the thresholds of these connected domain groups are calculated by Otsu's method and recorded. Finally, it is determined that there are q independent connected domain groups in total.
[0134] Where q represents the connected domain group number.
[0135] In more preferred examples, the module M3 uses the gray wolf algorithm to classify the obtained threshold, each connected domain group is classified into different targets according to its threshold, and the gray wolf with higher fitness is selected as the multi-target light spot to obtain the category of the multi-target light spot;
[0136] After differentiating the multiple targets, the threshold of the connected domain group where the light spot is located and the threshold U of the corresponding area caused by noise are obtained. i , and then perform threshold processing on the divided target area.
[0137] The threshold processing is to judge that if the gray value in the connected domain group after classification is less than the corresponding threshold U i , it is judged as noise, and the corresponding pixel gray value is set to 0. If the gray value in the connected domain group is greater than or equal to the threshold U i , it is determined to be the target to be processed, and the grayscale value of the corresponding pixel in the connected domain group remains unchanged.
[0138] In more preferred embodiments, the module M4 uses a weighted centroid method to obtain the center position coordinates (X i ,Y I ),include:
[0139]
[0140] Among them, x i Represents the horizontal coordinate of the pixel point ij in the connected domain group after classification;
[0141] y j Represents the ordinate of the pixel point ij in the connected domain group after classification;
[0142] M indicates that there are M light spots in total.
[0143] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0144] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A multi-target spot positioning method based on the grey wolf algorithm, characterized in that: include: Step S1: locate the multi-spot target and segment it into a binary image after iteration; Step S2: dividing the binary image into small blocks according to the connected domain to form a connected domain group, and calculating the threshold of the connected domain group; Step S3: classify the threshold value by using the grey wolf algorithm; Step S4: performing light spot positioning based on different thresholds.
2. The multi-target spot positioning method based on the grey wolf algorithm according to claim 1 is characterized in that: In the step S1, a light spot grayscale image M of size m×n is obtained. After the multi-target image is converted into a grayscale image A, the inter-class variance between the foreground and background of the grayscale image is calculated by histogram statistics for the entire light spot grayscale image. After iteration, the maximum inter-class variance var and the corresponding threshold T are obtained, and threshold segmentation is performed to obtain a binary image A; The traversal is to traverse possible thresholds and calculate the prospect n f and background b Number of pixels Probability Average grayscale And calculate the between-class variance var = P b ·P f ·(u b -u f ) 2 ; Wherein, H(i) represents the number of pixels with gray level i, i = 1, 2, ..., L-1; L represents the total number of gray levels; t represents a possible threshold; i represents the gray value of the image; P b Represents background n b The probability of P f Represents the prospect n f The probability of N represents the total number of pixels in the image; u b Represents background n b The average grayscale of u f Represents the prospect n f The average grayscale M represents a total of M light spots.
3. The multi-target spot positioning method based on the grey wolf algorithm according to claim 1 is characterized in that: In step S2, all pixels in the binary image A are scanned one by one. A certain pixel W1(i,j) and its four neighboring pixels with the same value of 1 are connected. All connected pixels are grouped into a small block set A. i, Each is made up of pixels of varying sizes; A group of small pixel blocks form a connected domain, denoted as the connected domain S l ; Each two S l The connected domains with common pixels are grouped as a connected domain group L q ; The connected domain group L is composed of the divided small connected domains. q For the target to be classified, the thresholds of these connected domain groups are calculated by Otsu's method and recorded. Finally, it is determined that there are q independent connected domain groups in total. Where q represents the connected domain group number.
4. The multi-target spot positioning method based on the grey wolf algorithm according to claim 1 is characterized in that: In step S3, the obtained threshold is classified using the gray wolf algorithm, each connected domain group is classified into different targets according to its threshold, and the gray wolf with higher fitness is selected as the multi-target light spot to obtain the category of the multi-target light spot; After differentiating the multiple targets, the threshold of the connected domain group where the light spot is located and the threshold U of the corresponding area caused by noise are obtained. i , and then perform threshold processing on the divided target area; The threshold processing is to judge that if the gray value in the connected domain group after classification is less than the corresponding threshold U i , it is judged as noise, and the corresponding pixel gray value is set to 0. If the gray value in the connected domain group is greater than or equal to the threshold U i , it is determined to be the target to be processed, and the grayscale value of the corresponding pixel in the connected domain group remains unchanged.
5. The multi-target spot positioning method based on the grey wolf algorithm according to claim 1 is characterized in that: In step S4, the weighted centroid method is used to obtain the center position coordinates (X) of the multi-spot target light spot I in the processed different area images. I ,Y I ),include: Among them, x i Represents the horizontal coordinate of the pixel point ij in the connected domain group after classification; y j Represents the ordinate of the pixel point ij in the connected domain group after classification; M indicates that there are M light spots in total.
6. A multi-target spot positioning system based on the grey wolf algorithm, characterized in that: include: Module M1: locates the multi-spot target and segments it into a binary image after iteration; Module M2: divide the binary image into small blocks according to the connected domain to form a connected domain group, and calculate the threshold of the connected domain group; Module M3: Threshold classification by Grey Wolf Algorithm; Module M4: Spot positioning based on different thresholds.
7. The multi-target spot positioning system based on the grey wolf algorithm according to claim 6 is characterized in that: The module M1 obtains a light spot grayscale image M of size m×n, converts the multi-target image into a grayscale image A, and then calculates the inter-class variance between the foreground and background of the grayscale image through histogram statistics for the entire light spot grayscale image, and iterates to obtain the maximum inter-class variance var and the corresponding threshold T, and performs threshold segmentation to obtain a binary image A; The traversal is to traverse possible thresholds and calculate the prospect n f and background b Number of pixels Probability Average grayscale And calculate the between-class variance var = P b ·P f ·(u b -u f ) 2 ; Wherein, H(i) represents the number of pixels with gray level i, i = 1, 2, ..., L-1; L represents the total number of gray levels; t represents a possible threshold; i represents the gray value of the image; P b Represents background n b probability; P f Represents the prospect n f The probability of N represents the total number of pixels in the image; u b Represents background n b The average grayscale of u f Represents the prospect n f The average grayscale M represents a total of M light spots.
8. The multi-target spot positioning system based on the Grey Wolf Algorithm according to claim 6, characterized in that: In the module M2, all pixels in the binary image A are scanned one by one. A certain pixel and its four neighboring pixels with the same value of 1 are connected, and all connected pixels are grouped into a small block set A. i, Each is made up of pixels of varying sizes; A group of small pixel blocks form a connected domain, denoted as the connected domain S l ; Each two S l The connected domains with common pixels are grouped as a connected domain group L q ; The connected domain group L is composed of the divided small connected domains. q For the target to be classified, the thresholds of these connected domain groups are calculated by Otsu's method and recorded. Finally, it is determined that there are q independent connected domain groups in total. Where q represents the connected domain group number.
9. The multi-target spot positioning system based on the grey wolf algorithm according to claim 6, characterized in that: In the module M3, the obtained threshold is classified using the gray wolf algorithm, each connected domain group is classified into different targets according to its threshold, and the gray wolf with higher fitness is selected as the multi-target light spot to obtain the category of the multi-target light spot; After differentiating the multiple targets, the threshold of the connected domain group where the light spot is located and the threshold U of the corresponding area caused by noise are obtained. i , and then perform threshold processing on the divided target area; The threshold processing is to judge that if the gray value in the connected domain group after classification is less than the corresponding threshold U i , it is judged as noise, and the corresponding pixel gray value is set to 0. If the gray value in the connected domain group is greater than or equal to the threshold U i , it is determined to be the target to be processed, and the grayscale value of the corresponding pixel in the connected domain group remains unchanged.
10. The multi-target spot positioning system based on the grey wolf algorithm according to claim 6, characterized in that: The module M4 uses the weighted centroid method to obtain the center position coordinates (X) of the multi-spot target light spot I in the processed different area images. I ,Y I ),include: Among them, x i Represents the horizontal coordinate of the pixel point ij in the connected domain group after classification; y j Represents the ordinate of the pixel point ij in the connected domain group after classification; M indicates that there are M light spots in total.
Citation Information
Patent Citations
Centroid identification and positioning method of infrared light spot image
CN111462225A
Laser spot centroid extraction method based on gray threshold
CN113421296A
Light spot centroid positioning method based on block threshold
CN113808193A
Centroid positioning method and related equipment
CN116109695A
Laser image small-size light spot center sub-pixel-level positioning method and system
CN117593373A