Pulse laser spot center positioning method and computer program product
By a method of acquiring and processing pulsed laser spot images in the photoelectric pod and determining the spot center is solved, and the problem of spot center positioning is improved in the optical axis parallelism calibration accuracy and efficiency.
Patent Information
- Application Number
- CN202411939940.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-27
AI Technical Summary
In the photoelectric pod, it is difficult for the prior art to accurately locate the center of the pulsed laser spot under complex backgrounds, especially affected by background spots, which affects the efficiency and accuracy of the parallelism of the optical axis.
By using a visible light camera to obtain the pulsed laser spot image, crop and preprocess it into a binary spot image, find the communication domain larger than the preset area, use the centroid method to determine the spot center, and collect the coordinates of the spot center multiple times, remove the outliers and take the average value to determine the final pulsed laser spot center.
This method can effectively eliminate the influence of background spots, improve the positioning accuracy of the center of the pulsed laser spot, enhance the anti-interference ability, and improve the detection efficiency of optical axis parallelism calibration in the photoelectric pod.
Smart Images

Figure CN120047531A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing and detection, and particularly relates to a method for detecting and locating the center of a pulsed laser spot under a complex background. Background Art
[0002] In order to improve the accuracy of the optoelectronic pod in tracking and positioning a target, it is necessary to calibrate the parallelism of the optical axes of the visible light camera and the laser in the pod. However, during the optical axis calibration process, when the image obtained by the calibration system is a large spot where the pulsed laser shines, the spot image is not necessarily a standard circle, and it is affected by the spot scars burned on the bottom plate during the previous calibration process, making it difficult to accurately locate the center of the laser spot. Summary of the Invention
[0003] The technical problem solved by this application is: overcoming the deficiencies of the prior art, providing a method for locating the center of a pulsed laser spot to solve the above problems, which can eliminate the influence of background scars and automatically locate the center of the pulsed laser spot, thereby improving the calibration efficiency and accuracy of the multi-optical axis parallelism of the optoelectronic pod.
[0004] The technical solution provided by this application is as follows:
[0005] A method for locating the center of a pulsed laser spot, which is applied to the calibration of the optical axes of the laser and the visible light camera in an optoelectronic pod, includes:
[0006] S1. Using a visible light camera to obtain and store the pulsed laser spot image generated by the laser;
[0007] S2. Reading the pulsed laser spot image and cropping and preprocessing it into a binary spot image;
[0008] S3. Finding the connected regions in the binary spot image that are larger than a preset area, obtaining the center coordinates of the connected regions by the centroid method, and determining them as the centers of the large spots when the laser shines;
[0009] S4. Reading the next binary spot image that does not have a connected region larger than the preset area, and determining the center coordinates of the connected regions within a limited area closest to the center of the large spot as the center of the scar left during the laser flashing interval;
[0010] S5. Repeating S4 to obtain five scar center coordinates, removing outliers and taking the average value to determine the final center of the pulsed laser spot.
[0011] Preferably, the step of using a visible light camera to obtain and store the pulsed laser spot image generated by the laser includes:
[0012] The optical axis of the visible light camera has been adjusted to coincide with the standard optical axis;
[0013] The laser emits a continuously flashing pulsed laser that strikes the target bottom plate, burning a scar on the bottom plate;
[0014] The visible light camera records the images presented on the bottom plate at a frequency of 18 photos per second and stores them in a computer.
[0015] Preferably, reading the pulsed laser spot image, cropping, and preprocessing it into a binary spot image includes:
[0016] Reading the pulsed laser spot image and reading it in the storage order of the pulsed laser spot image;
[0017] The preprocessing includes a grayscale image and a binary image.
[0018] Preferably, the preprocessing including a grayscale image and a binary image includes:
[0019] The grayscale image is to convert the cropped image into a grayscale image that only contains pixel brightness information (no color).
[0020] The binary image is to change the part of all pixel values in the grayscale image that are greater than or equal to the set threshold to white (255), and the rest to black (0), to achieve binary processing and obtain a binary spot image.
[0021] Preferably, finding the connected regions in the binary spot image that are larger than a preset area, using the centroid method to obtain the center coordinates of the connected regions, and determining them as the center of the large spot when the laser shines, includes:
[0022] Traversing all the connected regions in the binary spot image and determining whether there are connected regions larger than a preset area;
[0023] Using the centroid method to find the weighted average position of all pixels in the largest connected region, obtaining the center coordinates (x, y) of the connected region, and determining them as the center coordinates of the large spot when the pulsed laser shines.
[0024] Preferably, traversing all the connected regions in the binary spot image and determining whether there are connected regions larger than a preset area includes:
[0025] Determining whether there are connected regions larger than a preset area. If there are connected regions larger than a preset area, using the centroid method to obtain the center coordinates of the connected region;
[0026] Determining whether there are connected regions larger than a preset area. If there are no connected regions larger than a preset area, reading the next binary spot image in the image storage order and finding the connected regions larger than a preset area.
[0027] Preferably, finding the weighted average position of all pixels in the largest connected region using the centroid method to obtain the center coordinates (x, y) of the connected region, and determining them as the center coordinates of the large light spot when the pulsed laser shines, includes:
[0028] The center coordinate x is the ratio of the first-order moment m x about the x-axis to the area m 0 of the connected region:
[0029] where the first-order moment m x about the x-axis: is the weighted sum of the x coordinates of all pixel points in the connected region.
[0030] The center coordinate y is the ratio of the first-order moment m y about the y-axis to the area m 0 of the connected region:
[0031] where the first-order moment m y about the y-axis: is the weighted sum of the y coordinates of all pixel points in the connected region.
[0032] Preferably, reading the next binary light spot image without a connected region larger than the preset area, and determining the center coordinates of the connected region within the limited area closest to the center of the large light spot as the center of the scar left during the laser flashing interval, includes:
[0033] Read the next binary light spot image in the image storage order, and determine whether there is a connected region larger than the preset area. If so, continue to read the next image;
[0034] If the read image does not have a connected region larger than the preset area, calculate the distances between the centroids of all connected regions and the center coordinates of the large light spot;
[0035] Determine the centroid coordinates of the connected region within the limited area closest to the center coordinates of the large light spot as the center of the scar left during the pulsed laser flashing interval, and obtain the preliminary center of the pulsed laser light spot.
[0036] Preferably, repeating S4 to obtain five scar center coordinates, removing outliers and taking the average to determine the final center of the pulsed laser light spot, includes:
[0037] Repeat step S4 5 times to obtain five laser scar center coordinates, and calculate the average centroid "center point" of these five points;
[0038] Remove the scar center coordinates whose distance from the average centroid is greater than 0.2 pixels, and calculate the average centroid again to obtain the final center coordinates of the pulsed laser light spot.
[0039] A computer program product includes a computer program / instructions. When the computer program / instructions are executed by a processor, the steps of any one of the above-mentioned pulse laser spot center positioning methods are implemented.
[0040] The present invention has at least the following technical effects or advantages:
[0041] The present invention provides a method for detecting the center position of a pulse laser spot in a complex background, which can be applied to the calibration of the optical axis parallelism of a laser in an optoelectronic pod. The method includes: obtaining and storing the pulse laser spot generated by the laser using a visible light camera; reading the image and cropping and preprocessing it into a binary spot image; finding the connected regions in the binary image that are larger than a preset area, obtaining the center coordinates of the connected regions by the centroid method, and determining them as the center of the large spot when the laser shines; reading the next binary spot image that does not have a connected region larger than the preset area, and determining the center coordinates of the connected region within a limited area closest to the center of the large spot as the center of the scar left during the laser flicker interval; repeating to obtain five sets of scar center coordinates, removing outliers and taking the average value to determine the final center of the pulse laser spot. The present invention is not affected by the frequent flicker of the pulse laser and the scars of the old spots on the bottom plate, has high positioning accuracy, strong anti-interference ability, and can effectively improve the detection efficiency of the optical axis parallelism calibration. Description of the Drawings
[0042] Figure 1 is a schematic diagram of the pulse laser spot center positioning process in an embodiment of the present invention;
[0043] Figure 2 is a schematic diagram of the image cropping area in an embodiment of the present invention;
[0044] Figure 3 is a schematic diagram of the large laser spot after binarization in an embodiment of the present invention;
[0045] Figure 4 is a schematic diagram of the laser spot scar after binarization in an embodiment of the present invention;
[0046] Figure 5 is a schematic diagram of the preliminary pulse laser spot center obtained in an embodiment of the present invention. Detailed Embodiments
[0047] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will further describe in detail the disclosed embodiments of the present invention with reference to the accompanying drawings.
[0048] The embodiments of the present application disclose a method for positioning the center of a pulse laser spot, as Figure 1 shown, including:
[0049] S1. Obtaining and storing the pulse laser spot generated by the laser using a visible light camera;
[0050] S2. Read the image, crop it, and preprocess it into a binary spot image;
[0051] S3. Find the connected regions in the binary image that are larger than a preset area, obtain the center coordinates of the connected regions using the centroid method, and determine them as the center of the large spot when the laser flashes;
[0052] S4. Read the next binary spot image that does not have a connected region larger than the preset area, and determine the center coordinates of the connected region within a limited area closest to the center of the large spot as the center of the scar left during the laser flashing interval;
[0053] S5. Repeat S4 to obtain the center coordinates of five scars, remove the outliers, and take the average value to determine the center of the final pulsed laser spot.
[0054] In a specific implementation, in S1, a visible light camera is used to obtain the pulsed laser spot generated by the laser and store it.
[0055] Before calibrating the optical axis of the laser, the optical axis of the visible light camera has been adjusted to coincide with the standard optical axis.
[0056] The laser emits a continuously flashing pulsed laser that hits the target bottom plate and burns a scar on the bottom plate.
[0057] The visible light camera records the images presented on the bottom plate at a frequency of 18 photos per second and stores them in a computer.
[0058] Execute S2, read the image, crop it, and preprocess it into a binary spot image.
[0059] Read the pictures one by one in the order of the images stored by the visible light camera to ensure that the large spot when the laser flashes corresponds to the scar of the ablated spot.
[0060] Crop the image, remove the invalid image information around the perimeter, and only retain the central region of the image. As Figure 2 shown, the area boxed by the square.
[0061] Preprocess the cropped image, including converting it to a grayscale image and binarizing the image.
[0062] Among them, the grayscale image is to convert the cropped image into a grayscale image that only contains pixel brightness information (no color).
[0063] The binarized image is to change the part of all pixel values in the grayscale image that are greater than or equal to the threshold of 225 to white (255), and the rest to black (0), to achieve binarization processing and obtain the binarized spot image. Specifically, as Figure 3 shown.
[0064] Perform S3 on the binary image, find the connected components in the binary image with an area greater than the preset area of 50,000, obtain the center coordinates of the connected component using the centroid method, and determine them as the center of the large light spot when the laser shines.
[0065] Specifically, it is known that the area of the pixel points of the large light spot when the laser shines is greater than 50,000.
[0066] Traverse all the connected components in the binary light spot image and determine whether there is a connected component with an area greater than 50,000; if there is a connected component with an area greater than 50,000, find the largest connected component and obtain the center coordinates of the connected component using the centroid method; if there is no connected component with an area greater than 50,000, continue to read the next image in the image storage order for cropping, preprocessing, and determine whether there is a connected component with an area greater than 50,000.
[0067] The centroid method is to find the weighted average position of all the pixels in the connected component to obtain the center coordinates (x, y) of the connected component. Determine this coordinate as the center coordinate of the large light spot when the pulsed laser shines.
[0068] Among them, the center coordinate x is the ratio of the first-order moment m x about the x-axis to the area m 0 of the connected component:
[0069]
[0070] The center coordinate y is the ratio of the first-order moment m y about the y-axis to the area m 0 of the connected component:
[0071]
[0072] After finding the center coordinates of the large light spot, perform S4, read the next binary light spot image in order that does not have a connected component with an area greater than 50,000, and determine the center coordinates of the connected component within the limited area closest to the center of the large light spot as the center of the scar left during the laser flashing interval.
[0073] Specifically, read the next image in the image storage order for cropping and preprocessing into a binary image as shown in Figure 4 and determine whether there is a connected component with an area greater than 50,000. If there is, continue to read the next image; if there is no connected component with an area greater than 50,000, calculate the distance between the centroid of all the connected components with an area in the range of 2,000 to 5,000 and the center coordinates (x, y) of the large light spot.
[0074]
[0075] The centroid coordinates of the connected region within the defined area closest to the center coordinates of the large light spot, that is, the centroid coordinates of the connected region when the r value is the smallest, are determined as the center of the scar left by the pulsed laser flashing gap, and the preliminary center of the pulsed laser light spot is obtained. As Figure 5 shown by the red dot in
[0076] Finally, execute S5, repeat S4 to obtain the coordinates of five scar centers, remove the outliers, and take the average value to determine the final center of the pulsed laser light spot.
[0077] Specifically, repeat step S4 five times to obtain the coordinates of five laser scar centers, and calculate the average centroid "center point" of these five points.
[0078] Remove the scar center coordinates whose distance from the average centroid is greater than 0.2 pixels, and calculate the average centroid again to obtain the coordinates of the final center of the pulsed laser light spot.
[0079] In summary, the method for detecting the center position of the pulsed laser light spot provided in this embodiment can be applied to the calibration of the optical axis parallelism of the laser in the optoelectronic pod; use a visible light camera to obtain the pulsed laser light spot generated by the laser and store it; read the image, crop and preprocess it into a binary light spot image; find the connected regions in the binary image that are larger than the preset area, use the centroid method to obtain the center coordinates of the connected regions, and determine them as the center of the large light spot when the laser flashes; read the next binary light spot image that does not have a connected region larger than the preset area, and determine the center coordinates of the connected region within the defined area closest to the center of the large light spot as the center of the scar left by the laser flashing gap; repeat to obtain the coordinates of five scar centers, remove the outliers, and take the average value to determine the final center of the pulsed laser light spot. The present invention is not affected by the frequent flashing of the pulsed laser and the scar of the old light spot on the bottom plate, has high positioning accuracy and strong anti-interference ability, and can effectively improve the detection efficiency of the optical axis parallelism calibration.
[0080] The content not described in detail in the specification of this application belongs to the well-known technology of those skilled in the art.
[0081] The above has described this application in detail in combination with specific implementation manners and exemplary examples, but these descriptions should not be construed as limiting this application. Those skilled in the art understand that without departing from the spirit and scope of this application, various equivalent replacements, modifications or improvements can be made to the technical solutions and their implementation manners of this application, and these all fall within the scope of this application. The protection scope of this application is subject to the appended claims.
Claims
1. A pulse laser spot center positioning method, characterized in that: Used for calibration of the laser optical axis and visible light camera optical axis in the optoelectronic pod, including: S1. Using a visible light camera to obtain and store the pulse laser spot image generated by the laser; S2, reading all pulse laser spot images and cutting and preprocessing them into binary spot images; S3, searching for a connected domain larger than a preset area in the binary spot image, obtaining the center coordinates of the connected domain using the centroid method, and determining it as the center of the large spot when the laser is flashing; S4, reading a binary spot image without a connected domain larger than a preset area, and determining the center coordinate of the connected domain within a limited area closest to the center of the large spot as the center of the spot left by the laser flashing gap; S5, repeat S4, read other binary spot images without connected domains larger than the preset area in turn, obtain at least five spot center coordinates, remove abnormal values and take the average value to determine the final pulse laser spot center.
2. A pulse laser spot center positioning method according to claim 1, characterized in that: In S1, a pulsed laser spot image generated by a laser is acquired and stored using a visible light camera, including: The optical axis of the visible light camera is adjusted to coincide with the standard optical axis; The laser emits a continuous flash of pulsed laser light that hits the target base plate and burns a mark on the base plate; The visible light camera records the image presented on the base plate at a frequency of taking multiple photos per second, obtains the pulsed laser spot image and stores it.
3. A pulse laser spot center positioning method according to claim 1, characterized in that: In S2, the pulsed laser spot image is read and cropped and preprocessed into a binary spot image, including: Read the pulse laser spot images in sequence according to their storage order; Crop out invalid image information, retain the laser spot image including the central area of the laser spot, and obtain a cropped image; The preprocessing includes grayscale image and binary image. The cropped image is processed with grayscale image and binary image in sequence to obtain a binary spot image.
4. A pulse laser spot center positioning method according to claim 3, characterized in that: The grayscale image is a grayscale image obtained by converting the cropped image into a grayscale image containing only pixel brightness information; the binary image is a grayscale image in which all pixel values greater than or equal to a set threshold are changed to white and the remaining parts are changed to black to achieve binarization processing and obtain a binary spot image.
5. A pulse laser spot center positioning method according to claim 1, characterized in that: In S3, searching for a connected domain larger than a preset area in the binary spot image, obtaining the center coordinates of the connected domain using the centroid method, and determining the center of the large spot when the laser flashes, includes: S31: traverse all connected domains in the binary spot image, and determine whether there is a connected domain larger than a preset area; If there is a connected domain larger than the preset area, the connected domain larger than the preset area is taken as the maximum connected domain, and S33 is performed; If there is no connected domain larger than the preset area, read the next binary spot image in the image storage order and proceed to S32; S32: performing S31 on the binary spot image until a connected domain with a larger area than a preset area is found in a read binary spot image, as the maximum connected domain; S33: The center coordinates (x, y) of the maximum connected domain are obtained by using the centroid method, and are determined as the center coordinates of the large light spot when the pulse laser flashes.
6. A pulse laser spot center positioning method according to claim 5, characterized in that: For the center coordinates (x, y), where Among them, m x is the weighted sum of the x coordinates of all pixels in the connected domain; m0 is the maximum connected domain area; m y It is the weighted sum of the y coordinates of all pixels in the connected domain.
7. A pulse laser spot center positioning method according to claim 1, characterized in that: In S4, a binary spot image without a connected domain larger than a preset area is read, and the center coordinate of the connected domain within a limited area closest to the center of the large spot is determined as the center of the spot left by the laser flashing gap, including: S41: read the next binary spot image, and traverse all connected domains in the binary spot image; S42: Determine whether there is a connected domain larger than the preset area; if there is a connected domain larger than the preset area, proceed to S41; if there is no binary spot image of a connected domain larger than the preset area, calculate the distance between the centroid of all connected domains and the center coordinates of the large spot, and determine the centroid coordinates of the connected domain within the limited area closest to the center coordinates of the large spot as the center of the spot left by the pulse laser flashing gap, and obtain a preliminary pulse laser spot center.
8. A pulse laser spot center positioning method according to claim 7, characterized in that: In S5, S4 is repeated to sequentially read other binary spot images without a connected domain larger than a preset area, obtain at least five spot center coordinates, remove outliers and take the average value to determine the final pulse laser spot center, including: Sequentially read each binary spot image without a connected domain larger than a preset area, and repeat S4 for each binary spot image without a connected domain larger than a preset area, to obtain at least 5 preliminary pulsed laser spot centers; For at least 5 preliminary pulsed laser spot centers, the average value is taken after removing the outliers and determined as the final pulsed laser spot center.
9. A pulse laser spot center positioning method according to claim 1, characterized in that: The method of removing outliers from at least 5 preliminary pulse laser spot centers and taking an average value to determine the final pulse laser spot center includes: Calculate the average centroid of at least 5 preliminary pulsed laser spot centers; The preliminary pulse laser spot centers whose distance from the average centroid is greater than 0.2 pixels are eliminated, and the average centroid is calculated based on the remaining multiple preliminary pulse laser spot centers to obtain the final pulse laser spot center coordinates.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of a pulse laser spot center positioning method described in any one of claims 1-9 are implemented.