Laser light spot uniformity detection method and device and electronic equipment
By acquiring laser spot images and generating grayscale gradient maps, the uniformity of the laser spot is detected, thus solving the problem of human judgment error and achieving accuracy and consistency in laser spot uniformity detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GOERTEK OPTICAL TECH CO LTD
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-01
AI Technical Summary
Current laser spot uniformity detection relies on manual judgment, which has problems with subjective error and limited resolution, and cannot accurately identify spot uniformity defects.
By acquiring a spot image, the area to be tested is determined, a gray-level gradient map is generated, and the uniformity of the laser spot is detected by using the gray-level gradient amplitude, thus eliminating subjective human error and distinguishing spot defects from imaging device noise artifacts.
It improves the accuracy and consistency of laser spot uniformity detection, accurately identifies spot defects, separates imaging interference from actual defects, and enhances the accuracy of detection results.
Smart Images

Figure CN121962037A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of laser technology, and more specifically, to a method, apparatus, and electronic device for detecting the uniformity of laser spot. Background Technology
[0002] With the widespread application of laser technology in industrial processing, precision measurement, medical equipment, microelectronics manufacturing and other fields, the uniformity of the laser output spot has become a core indicator for measuring the performance of laser equipment and ensuring application accuracy.
[0003] In the production, debugging, daily operation and maintenance, and performance testing of laser equipment, the assessment of laser spot quality is an essential and crucial step. Currently, the traditional inspection method commonly used in the industry is a combination of camera image acquisition and manual visual inspection: that is, an image of the laser spot formed by the laser projection is acquired through an industrial camera or ordinary imaging equipment, and then the inspectors observe the image with their eyes to determine whether there are defects such as broken lines or dark areas inside the laser spot, assess the uniformity of its energy distribution, and estimate the approximate size of the laser spot.
[0004] However, this manual detection method is subject to subjective errors, resulting in inconsistent judgment results. Moreover, the human eye has limited ability to distinguish uniformity defects in low-contrast light spots, making it impossible to accurately identify uniformity defects in light spots. Summary of the Invention
[0005] One objective of this disclosure is to provide a new technical solution for detecting the uniformity of laser spot.
[0006] According to a first aspect of the present disclosure, a method for detecting the uniformity of a laser spot is provided, comprising: Acquire an image of the light spot formed by the projection of the laser under test; The area to be measured in the light spot image, representing the light spot, is determined according to the set light spot size; A grayscale gradient map of the region to be tested is generated based on the grayscale values of each pixel in the region to be tested; wherein, the grayscale gradient map includes the grayscale gradient magnitude of each pixel block in the region to be tested, and each pixel block includes multiple pixels; The uniformity of the laser spot under test is detected based on the gray-level gradient amplitude of each pixel block in the gray-level gradient map.
[0007] Optionally, determining the region to be measured representing the light spot in the light spot image based on the set light spot size includes: Obtain the first threshold; Pixels in the spot image whose grayscale value is greater than or equal to the first threshold are obtained as spot pixels; Determine the center point of the light spot pixel; The area to be tested is determined based on the center point of the light spot pixel and the set light spot size.
[0008] Optionally, obtaining the first threshold includes: For each gray value in the gray value set, obtain the gray value variance of the first pixel in the spot image corresponding to the currently traversed gray value, where the first pixel is a pixel in the spot image that is greater than or equal to the currently traversed gray value. The gray value with the largest corresponding gray-scale variance is used as the first threshold.
[0009] Optionally, determining the center point of the light spot pixel includes: Determine the grayscale change gradient of the light spot pixel, wherein the grayscale change gradient includes the grayscale change intensity value and direction; The corner points representing the edge of the light spot are obtained from the light spot pixels based on the gray-scale change gradient; The center point of the first rectangular region corresponding to the corner point is determined as the center point of the light spot pixel.
[0010] Optionally, determining the center point of the light spot pixel includes: Determine the smallest bounding rectangle containing the light spot pixels in the light spot image, and use it as the second rectangular region; The center point of the second rectangular region is determined as the center point of the light spot pixel.
[0011] Optionally, generating a grayscale gradient map of the region to be tested based on the grayscale values of each pixel in the region to be tested includes: The area to be tested is divided into multiple pixel blocks; Based on the gray values of each pixel in each pixel block, determine the first gray gradient in the width direction of the corresponding pixel block and the second gray gradient in the height direction of the corresponding spot image; The grayscale gradient map is obtained based on the first grayscale gradient and the second grayscale gradient of each pixel block.
[0012] Optionally, detecting the uniformity of the laser spot under test based on the grayscale gradient amplitude of each pixel block in the grayscale gradient image includes: Determine the first number of pixel blocks whose grayscale gradient magnitude exceeds the second threshold; Determine the ratio between the first quantity and the second quantity of pixel blocks in the grayscale gradient image; When the ratio is greater than or equal to a set third threshold, the uniformity test result of the laser spot under test is determined to be unqualified.
[0013] According to a second aspect of this disclosure, a device for detecting the uniformity of a laser spot is provided, comprising: The image acquisition module is used to acquire the image of the light spot formed by the projection of the laser under test. The region determination module is used to determine the region to be measured in the light spot image, representing the light spot, according to the set light spot size; The gradient map generation module is used to generate a grayscale gradient map of the region to be tested based on the grayscale values of each pixel in the region to be tested; wherein, the grayscale gradient map includes the grayscale gradient magnitude of each pixel block in the region to be tested, and each pixel block includes multiple pixels. The uniformity detection module is used to detect the uniformity of the laser spot under test based on the gray-level gradient amplitude of each pixel block in the gray-level gradient image.
[0014] According to a third aspect of this disclosure, an electronic device is provided, including a processor and a memory, the memory being used to store a computer program, and the processor being used to execute the method as described in the first aspect of this disclosure under the control of the computer program.
[0015] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the method described in the first aspect of this disclosure.
[0016] Through the embodiments of this disclosure, by analyzing the gray-level gradient changes in the test area of the laser spot image and using the gray-level gradient amplitude as the criterion for determining the uniformity of the laser spot, errors caused by subjective human judgment can be eliminated, improving the accuracy and consistency of detecting laser spot unevenness defects. Furthermore, traditional imaging schemes are susceptible to the influence of imaging devices, leading to artifacts in the laser spot image. This embodiment, through gray-level gradient analysis, can effectively distinguish between laser spot uniformity defects and noise artifacts introduced by the imaging device, achieving effective separation of imaging interference from real defects, resulting in more accurate detection results.
[0017] Other features and advantages of the invention will become clear from the following detailed description of exemplary embodiments of the invention with reference to the accompanying drawings. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the invention and, together with their description, serve to explain the principles of the invention.
[0019] Figure 1 This is a block diagram illustrating the hardware configuration of an electronic device that can implement embodiments of the present disclosure; Figure 2This is a flowchart of a laser spot uniformity detection method according to an embodiment of the present disclosure; Figure 3 This is a block diagram of a laser spot uniformity detection device according to an embodiment of the present disclosure; Figure 4 This is a block diagram of an electronic device according to an embodiment of the present disclosure. Detailed Implementation
[0020] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the invention.
[0021] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.
[0022] Techniques, methods, and apparatus known to those skilled in the art in the relevant field may not be discussed in detail, but where appropriate, such techniques, methods, and apparatus should be considered part of the specification.
[0023] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0024] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0025] <Hardware Configuration> Figure 1 This is a block diagram illustrating the hardware configuration of an electronic device 1000 that can implement embodiments of the present disclosure.
[0026] Electronic device 1000 can be a portable computer, desktop computer, mobile phone, tablet computer, etc. For example... Figure 1As shown, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, etc. The processor 1100 may be a CPU, a microprocessor (MCU), etc. The memory 1200 may include, for example, ROM (Read-Only Memory), RAM (Random Access Memory), or non-volatile memory such as a hard disk. The interface device 1300 may include, for example, a USB interface, a headphone jack, etc. The communication device 1400 may be capable of wired or wireless communication, specifically including Wi-Fi communication, Bluetooth communication, 2G / 3G / 4G / 5G communication, etc. The display device 1500 may be, for example, an LCD screen, a touch screen, etc. The input device 1600 may include, for example, a touch screen, a keyboard, motion input, etc. Users can input / output voice information through the speaker 1700 and the microphone 1800.
[0027] Figure 1 The electronic devices shown are merely illustrative and in no way intended to limit this disclosure, its application, or use. In embodiments applied to this disclosure, the memory 1200 of the electronic device 1000 is used to store instructions for controlling the processor 1100 to operate to perform any of the methods provided in the embodiments of this disclosure. Those skilled in the art will understand that, although... Figure 1 The electronic device 1000 is shown with multiple devices shown; however, this disclosure may relate only to some of these devices. For example, electronic device 1000 may only relate to processor 1100 and memory 1200. Those skilled in the art can design instructions based on the schemes disclosed herein. How the instructions control the processor to operate is well known in the art and will not be described in detail here.
[0028] <Method Implementation> This disclosure provides a method for detecting the uniformity of a laser spot, which can be implemented by an electronic device. Specifically, the method for detecting the uniformity of a laser spot can be implemented by, for example... Figure 1 The electronic device 1000 shown is implemented.
[0029] Figure 2 This is a flowchart of a method for detecting the uniformity of a laser spot according to an embodiment of the present disclosure.
[0030] like Figure 2 As shown, the method for detecting the uniformity of the laser spot includes the following steps S2100 to S2400: Step S2100: Obtain the image of the light spot formed by the projection of the laser under test.
[0031] In this embodiment, an image of the laser spot formed by the laser under test can be obtained by acquiring the image of the laser spot formed by the laser under test through an industrial camera or ordinary imaging equipment.
[0032] Specifically, the laser beam emitted by the laser can be used to illuminate a flat receiving screen to form a light spot. The receiving screen containing the light spot can then be photographed using an industrial camera or ordinary imaging equipment to obtain an image of the light spot of the laser under test.
[0033] Step S2200: Determine the area to be measured in the spot image representing the spot according to the set spot size.
[0034] In this embodiment, the spot size can be preset according to the type of laser under test.
[0035] In this embodiment, the area to be tested is the area where the light spot is located in the light spot image, and the size of the area to be tested matches the set light spot size.
[0036] In one example, the set spot size may include the number of pixels in the width direction and the number of pixels in the height direction of the image under test.
[0037] In another example, the set spot size may include the number of first pixels corresponding to a first direction, the number of second pixels corresponding to a second direction, the number of third pixels corresponding to a third direction, and the number of fourth pixels corresponding to a fourth direction. The first and second directions are parallel and opposite in direction, the third and fourth directions are parallel and opposite in direction, the first direction is perpendicular to both the third and fourth directions, and the second direction is perpendicular to both the third and fourth directions.
[0038] In this embodiment, the first and second directions can be parallel to the width direction of the image under test, and the third and fourth directions can be parallel to the height direction of the image under test.
[0039] In some embodiments, determining the test area representing the light spot in the light spot image based on a set light spot size can be achieved by obtaining the image area with the largest sum of gray values from the light spot image based on the set light spot size, and using it as the test area.
[0040] In some embodiments, determining the test area representing the light spot in the light spot image based on a set light spot size includes: obtaining a first threshold; obtaining pixels in the light spot image whose grayscale value is greater than or equal to the first threshold as light spot pixels; determining the center point of the light spot pixels; and determining the test area based on the center point of the light spot pixels and the set light spot size.
[0041] In this embodiment, the first threshold can be a fixed grayscale value set in advance according to the detection scenario of the laser. For example, the first threshold can be 100.
[0042] In some embodiments, obtaining the first threshold includes: for each gray value in the gray value set, obtaining the gray value variance of the first pixel in the spot image corresponding to the currently traversed gray value, wherein the first pixel is a pixel in the spot image that is greater than or equal to the currently traversed gray value; and taking the gray value with the largest corresponding gray value variance as the first threshold.
[0043] In this embodiment, the grayscale value set may include multiple grayscale values. For each grayscale value in the grayscale value set, the corresponding grayscale variance is determined. Then, the grayscale value with the largest corresponding grayscale variance is used as the first threshold.
[0044] The gray variance corresponding to the gray value being traversed can be determined through the following process: determine the first pixel in the spot image whose gray value is greater than or equal to the gray value being traversed; determine the first proportion of the first pixel in all pixels of the spot image, the first average gray value of the first pixel, and the second average gray value of all pixels of the spot image; and obtain the gray variance corresponding to the gray value being traversed based on the first proportion, the first average gray value, and the second average gray value.
[0045] Specifically, the grayscale variance corresponding to the currently traversed grayscale value can be determined according to the following formula:
[0046] Where g is the grayscale variance corresponding to the currently traversed grayscale values. As the first proportion, The first average gray value, This is the second average gray value.
[0047] In this embodiment, the larger the grayscale variance, the greater the difference between the spot pixel obtained based on the corresponding grayscale value and other pixels. Therefore, the grayscale value with the largest corresponding grayscale variance can be used as the first threshold.
[0048] This embodiment allows for the precise separation of light spot pixels from the image under test, thereby enabling the accurate determination of the test area representing the light spot, which facilitates subsequent light spot uniformity detection.
[0049] In some embodiments, determining the center point of a spot pixel may include: determining the grayscale gradient of the spot pixel, the grayscale gradient including the grayscale intensity value and direction; obtaining corner points representing the edge of the spot from the spot pixel based on the grayscale gradient; and determining the center point of the first rectangular region corresponding to the corner point as the center point of the spot pixel.
[0050] In this embodiment, the grayscale gradient of the target pixel in the spot pixel can be determined.
[0051] In one example, the target pixel can be a spot pixel that is adjacent to other pixels, including the spot pixel itself; that is, the target pixel is the spot pixel at the edge.
[0052] In another example, the target pixel could be all the light spot pixels.
[0053] For any target pixel, its grayscale gradient can include the grayscale change intensity value between the pixel and its neighboring pixels relative to at least one of the first, second, third, and fourth directions.
[0054] In this embodiment, for each of the first, second, third, and fourth directions, the spot pixel with the largest grayscale change intensity value among its neighboring pixels can be determined as the corner point of the corresponding direction.
[0055] In this embodiment, the first rectangular region is constructed based on the four corner points, which may be located on the edges of the first rectangular region.
[0056] Specifically, for a corner point corresponding to the first direction, a first straight line perpendicular to the first direction and passing through that corner point can be set; for a corner point corresponding to the second direction, a second straight line perpendicular to the second direction and passing through that corner point can be set; for a corner point corresponding to the third direction, a third straight line perpendicular to the third direction and passing through that corner point can be set; and for a corner point corresponding to the fourth direction, a fourth straight line perpendicular to the fourth direction and passing through that corner point can be set. The closed region formed by the first, second, third, and fourth straight lines is the first rectangular region.
[0057] This embodiment allows for the precise determination of the test area representing the light spot, facilitating subsequent light spot uniformity detection.
[0058] In some embodiments, determining the center point of the spot pixel may further include: determining the smallest bounding rectangle containing the spot pixel in the spot image as a second rectangular region; and determining the center point of the second rectangular region as the center point of the spot pixel.
[0059] In an embodiment where the set spot size includes the number of pixels in the width direction and the number of pixels in the height direction of the image to be tested, determining the test area based on the center point of the spot pixel and the set spot size may include: determining a rectangular area centered on the center point of the spot pixel and having the same size as the set spot size as the test area.
[0060] In embodiments where the light spot size is set to include the number of first pixels corresponding to a first direction, the number of second pixels corresponding to a second direction, the number of third pixels corresponding to a third direction, and the number of fourth pixels corresponding to a fourth direction, determining the area to be measured based on the center point of the light spot pixels and the set light spot size may include: setting a fifth straight line passing through the center point of the light spot pixels and perpendicular to the first direction, and moving the fifth straight line towards the first direction by a first pixel number; setting a sixth straight line passing through the center point of the light spot pixels and perpendicular to the second direction, and moving the sixth straight line towards the second direction by a second pixel number; setting a seventh straight line passing through the center point of the light spot pixels and perpendicular to the third direction, and moving the seventh straight line towards the third direction by a third pixel number; and setting an eighth straight line passing through the center point of the light spot pixels and perpendicular to the fourth direction, and moving the eighth straight line towards the fourth direction by a fourth pixel number. The closed area formed by the fifth, sixth, seventh, and eighth straight lines is the area to be measured.
[0061] Through this embodiment, a test area representing the light spot in the light spot image and whose size matches the set light spot size can be obtained, so as to facilitate the subsequent detection of light spot uniformity.
[0062] Step S2300: Generate a grayscale gradient map of the region to be tested based on the grayscale values of each pixel in the region to be tested; wherein, the grayscale gradient map includes the grayscale gradient magnitude of each pixel block in the region to be tested, and each pixel block includes multiple pixels.
[0063] In some embodiments, the Sobel operator can be used to calculate the grayscale of the region to be tested to obtain a grayscale gradient map.
[0064] The Sobel operator is a classic edge detection operator based on gradient calculation. Its core principle is to calculate the gray-level gradient of the pixel block in the width and height directions by performing a convolution operation between the convolution kernel and the gray-level values of the corresponding pixel block in the test area.
[0065] The Sobel operator can calculate the grayscale gradient magnitude of each pixel block using two m×n convolution kernels (corresponding to the width and height directions respectively), where m and n are both positive integers.
[0066] In this embodiment, m and n can be preset, for example, both m and n can be 3.
[0067] In this embodiment, a pixel block may include m×n pixels.
[0068] In some embodiments, generating a grayscale gradient map of the test area based on the grayscale values of each pixel in the test area includes: dividing the test area into multiple pixel blocks; determining a first grayscale gradient in the width direction and a second grayscale gradient in the height direction of the spot image corresponding to the corresponding pixel block based on the grayscale values of each pixel in each pixel block; and obtaining a grayscale gradient map based on the first grayscale gradient and the second grayscale gradient of each pixel block.
[0069] In this embodiment, the first gray-level gradient and the second gray-level gradient of the corresponding pixel block can be obtained by calculating the matrix formed by the gray-level values of each pixel in each pixel block using two m×n convolution kernels. Then, based on the first gray-level gradient and the second gray-level gradient of each pixel block, the gray-level gradient magnitude of the corresponding pixel block is determined to obtain the gray-level gradient map.
[0070] Step S2400: Detect the uniformity of the laser spot under test based on the gray-level gradient amplitude of each pixel block in the gray-level gradient image.
[0071] In some embodiments, detecting the uniformity of the laser spot under test based on the grayscale gradient amplitude of each pixel block in the grayscale gradient image may include: determining a first number of pixel blocks whose grayscale gradient amplitude exceeds a second threshold; determining a ratio between the first number and a second number of pixel blocks in the grayscale gradient image; and determining that the uniformity detection result of the laser spot under test is unqualified when the ratio is greater than or equal to a set third threshold.
[0072] In this embodiment, when the ratio is less than the third threshold, the uniformity test result of the laser spot under test can be determined to be qualified.
[0073] In this embodiment, the second threshold can be a grayscale gradient value pre-set according to the application scenario or specific requirements. The third threshold can be a ratio value set according to the application scenario or specific requirements, and the third threshold can be a positive number less than 1.
[0074] In some embodiments, detecting the uniformity of the laser spot under test based on the gray-level gradient amplitude of each pixel block in the gray-level gradient map may include: determining a first number of pixel blocks whose gray-level gradient amplitude exceeds a second threshold; and determining that the uniformity detection result of the laser spot under test is unqualified when the first number is greater than or equal to a set fourth threshold.
[0075] In this embodiment, when the first quantity is less than the fourth threshold, the uniformity detection result of the laser spot under test can be determined to be qualified.
[0076] In this embodiment, the fourth threshold can be a positive integer pre-set based on the number of pixel blocks.
[0077] Through the embodiments of this disclosure, by analyzing the gray-level gradient changes in the test area of the laser spot image and using the gray-level gradient amplitude as the criterion for determining the uniformity of the laser spot, errors caused by subjective human judgment can be eliminated, improving the accuracy and consistency of detecting laser spot unevenness defects. Furthermore, traditional imaging schemes are susceptible to the influence of imaging devices, leading to artifacts in the laser spot image. This embodiment, through gray-level gradient analysis, can effectively distinguish between laser spot uniformity defects and noise artifacts introduced by the imaging device, achieving effective separation of imaging interference from real defects, resulting in more accurate detection results.
[0078] <Device Embodiment> This embodiment provides a device for detecting the uniformity of laser spot, such as... Figure 3 As shown, the laser spot uniformity detection device 3000 includes an image acquisition module 3100, a region determination module 3200, a gradient map generation module 3300, and a uniformity detection module 3400.
[0079] The image acquisition module 3100 is used to acquire the light spot image obtained by image acquisition of the light spot formed by the projection of the laser under test.
[0080] The region determination module 3200 is used to determine the region to be measured in the light spot image representing the light spot according to the set light spot size.
[0081] The gradient map generation module 3300 is used to generate a grayscale gradient map of the region to be tested based on the grayscale values of each pixel in the region to be tested; wherein, the grayscale gradient map includes the grayscale gradient magnitude of each pixel block in the region to be tested, and each pixel block includes multiple pixels.
[0082] The uniformity detection module 3400 is used to detect the uniformity of the laser spot under test based on the gray-level gradient amplitude of each pixel block in the gray-level gradient map.
[0083] In some embodiments, determining the region to be measured representing the light spot in the light spot image based on a set light spot size includes: Obtain the first threshold; Pixels in the spot image whose grayscale value is greater than or equal to the first threshold are obtained as spot pixels; Determine the center point of the light spot pixel; The area to be tested is determined based on the center point of the light spot pixel and the set light spot size.
[0084] In some embodiments, obtaining the first threshold includes: For each gray value in the gray value set, obtain the gray value variance of the first pixel in the spot image corresponding to the currently traversed gray value, where the first pixel is a pixel in the spot image that is greater than or equal to the currently traversed gray value. The gray value with the largest corresponding gray-scale variance is used as the first threshold.
[0085] In some embodiments, determining the center point of the light spot pixel includes: Determine the grayscale change gradient of the light spot pixel, wherein the grayscale change gradient includes the grayscale change intensity value and direction; The corner points representing the edge of the light spot are obtained from the light spot pixels based on the gray-scale change gradient; The center point of the first rectangular region corresponding to the corner point is determined as the center point of the light spot pixel.
[0086] In some embodiments, determining the center point of the light spot pixel includes: Determine the smallest bounding rectangle containing the light spot pixels in the light spot image, and use it as the second rectangular region; The center point of the second rectangular region is determined as the center point of the light spot pixel.
[0087] In some embodiments, generating a grayscale gradient map of the region to be tested based on the grayscale values of each pixel in the region to be tested includes: The area to be tested is divided into multiple pixel blocks; Based on the gray values of each pixel in each pixel block, determine the first gray gradient in the width direction of the corresponding pixel block and the second gray gradient in the height direction of the corresponding spot image; The grayscale gradient map is obtained based on the first grayscale gradient and the second grayscale gradient of each pixel block.
[0088] In some embodiments, detecting the uniformity of the laser spot under test based on the grayscale gradient amplitude of each pixel block in the grayscale gradient map includes: Determine the first number of pixel blocks whose grayscale gradient magnitude exceeds the second threshold; Determine the ratio between the first quantity and the second quantity of pixel blocks in the grayscale gradient image; When the ratio is greater than or equal to a set third threshold, the uniformity test result of the laser spot under test is determined to be unqualified.
[0089] <Electronic Device Examples> This embodiment provides an electronic device, which in one aspect may include the aforementioned laser spot uniformity detection device 3000.
[0090] On the other hand, such as Figure 4 As shown, the electronic device 4000 may include a processor 4100 and a memory 4200. The memory 4200 is used to store computer programs, and the processor 4100 is used to control the electronic device to execute the methods of any embodiment of this disclosure under the control of the computer programs.
[0091] <Example of a readable storage medium> This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the methods described in any of the method embodiments of this disclosure.
[0092] This invention can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the invention.
[0093] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0094] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0095] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing state information from computer-readable program instructions. These electronic circuits can execute computer-readable program instructions to implement various aspects of the present invention.
[0096] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0097] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0098] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0099] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.
[0100] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.
Claims
1. A method for detecting the uniformity of a laser spot, characterized in that, include: Acquire an image of the light spot formed by the projection of the laser under test; The area to be measured in the light spot image, representing the light spot, is determined according to the set light spot size; A grayscale gradient map of the region to be tested is generated based on the grayscale values of each pixel in the region to be tested; wherein, the grayscale gradient map includes the grayscale gradient magnitude of each pixel block in the region to be tested, and each pixel block includes multiple pixels; The uniformity of the laser spot under test is detected based on the gray-level gradient amplitude of each pixel block in the gray-level gradient map.
2. The method according to claim 1, characterized in that, The step of determining the region to be measured representing the light spot in the light spot image according to the set light spot size includes: Obtain the first threshold; Pixels in the spot image whose grayscale value is greater than or equal to the first threshold are obtained as spot pixels; Determine the center point of the light spot pixel; The area to be tested is determined based on the center point of the light spot pixel and the set light spot size.
3. The method according to claim 2, characterized in that, The process of obtaining the first threshold includes: For each gray value in the gray value set, obtain the gray value variance of the first pixel in the spot image corresponding to the currently traversed gray value, where the first pixel is a pixel in the spot image that is greater than or equal to the currently traversed gray value. The gray value with the largest corresponding gray-scale variance is used as the first threshold.
4. The method according to claim 2, characterized in that, Determining the center point of the light spot pixel includes: Determine the grayscale change gradient of the light spot pixel, wherein the grayscale change gradient includes the grayscale change intensity value and direction; The corner points representing the edge of the light spot are obtained from the light spot pixels based on the gray-scale change gradient; The center point of the first rectangular region corresponding to the corner point is determined as the center point of the light spot pixel.
5. The method according to claim 2, characterized in that, Determining the center point of the light spot pixel includes: Determine the smallest bounding rectangle containing the light spot pixels in the light spot image, and use it as the second rectangular region; The center point of the second rectangular region is determined as the center point of the light spot pixel.
6. The method according to claim 1, characterized in that, The step of generating a grayscale gradient map of the region to be tested based on the grayscale values of each pixel in the region to be tested includes: The area to be tested is divided into multiple pixel blocks; Based on the gray values of each pixel in each pixel block, determine the first gray gradient in the width direction of the corresponding pixel block and the second gray gradient in the height direction of the corresponding spot image; The grayscale gradient map is obtained based on the first grayscale gradient and the second grayscale gradient of each pixel block.
7. The method according to claim 1, characterized in that, The step of detecting the uniformity of the laser spot under test based on the grayscale gradient amplitude of each pixel block in the grayscale gradient image includes: Determine the first number of pixel blocks whose grayscale gradient magnitude exceeds the second threshold; Determine the ratio between the first quantity and the second quantity of pixel blocks in the grayscale gradient image; When the ratio is greater than or equal to a set third threshold, the uniformity test result of the laser spot under test is determined to be unqualified.
8. A device for detecting the uniformity of a laser spot, characterized in that, include: The image acquisition module is used to acquire the image of the light spot formed by the projection of the laser under test. The region determination module is used to determine the region to be measured in the light spot image, representing the light spot, according to the set light spot size; The gradient map generation module is used to generate a grayscale gradient map of the region to be tested based on the grayscale values of each pixel in the region to be tested; wherein, the grayscale gradient map includes the grayscale gradient magnitude of each pixel block in the region to be tested, and each pixel block includes multiple pixels. The uniformity detection module is used to detect the uniformity of the laser spot under test based on the gray-level gradient amplitude of each pixel block in the gray-level gradient image.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory being used to store a computer program, and the processor being used, under the control of the computer program, to execute the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.