A light spot quality detection method, system and electronic device

CN116678591BActive Publication Date: 2026-10-23HUIZHOU UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310665536.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2023-03-15
Filing Date
2023-06-06
Publication Date
2026-10-23
Estimated Expiration
2043-06-06

AI Technical Summary

Technical Problem

但是人眼判定的效率低,成本高且容易伤人眼;而积分球、照度计等专业设备的技术要求高,成本高,在生产线实现智能检测会受到制约

Benefits of technology

[0037]1.本发明通过获取光斑图像,并根据预设阈值对该光斑图像进行量化判定,算法效率高,且方便实现智能化检测与信息化管理;同时实现成本较低;解决了现有技术中因通过人眼检测而导致的效率低,成本高和伤人眼的技术问题;还解决了现有技术中因采用积分球、照度计等专业设备而导致的技术要求高和成本高的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116678591B_ABST
    Figure CN116678591B_ABST
Patent Text Reader

Abstract

The application provides a light spot quality detection method, system and electronic equipment; the light spot quality detection method comprises the following steps: projecting a light beam emitted by a current product to be tested onto a plane at a preset distance to form a light spot on the plane, and acquiring a first light spot image by shooting the light spot through a camera; then sequentially performing light spot deformation degree analysis, light spot dispersion degree analysis, light spot gradient analysis and light spot trailing degree analysis on the first light spot image; further obtaining the quality condition of the current product to be tested according to the analysis result, forming a second light spot image according to the first light spot image after the image analysis is completed, and storing the first light spot image and the second light spot image and each analysis parameter into the system. The application can quantitatively determine according to the standard value set by the product, has high algorithm efficiency, and is convenient for realizing intelligent detection and information management; and the cost is relatively low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of light spot quality analysis technology, and in particular to a light spot quality detection method, system, and electronic equipment. Background Technology

[0002] A crucial component of flashlights and similar lighting devices, such as mining lamps, is the LED chip and the lamp reflector. During the manufacturing process, the LED chip and lamp reflector need to be assembled together, and after being powered on, the beam emitted must undergo rigorous testing to ensure that the light spot meets the required standards.

[0003] In theory, the ideal spot shape is a perfect circle with the center of the spot as the center, and any aperture is a concentric circle, with the spot brightness being high at the center and gradually decreasing evenly outwards. However, in actual production, the spot shape of the product will exhibit different deformations, the main representative deformations being elliptical, hollow, trailing, unfocused, and distorted, etc.

[0004] The production of flashlights must meet the QB / T2198-1996 "Flashlight" standard. Beam measurement can be determined based on actual conditions, such as projecting the flashlight beam horizontally onto a neat wall and observing the characteristics of the light spot with the human eye. Alternatively, an integrating sphere or lux meter can be used to test the illuminance at various points on the light spot. However, human judgment is inefficient, costly, and can easily damage the eyes; while specialized equipment such as integrating spheres and lux meters have high technical requirements and are expensive, hindering the implementation of intelligent detection on the production line. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention provides a method, system, and electronic device for detecting light spot quality; by analyzing the light spot image formed on the product under test, the quality status of the product under test can be obtained.

[0006] Specifically, the present invention provides a method for detecting light spot quality, comprising the following steps:

[0007] S100: Acquire the first spot image formed by the current product under test.

[0008] S200: Perform image analysis on the first spot image to determine the quality of the product under test; and form a second spot image based on the first spot image after image analysis, and store the first spot image, the second spot image, and the corresponding parameter values ​​into the system.

[0009] Step S100 includes:

[0010] The light beam emitted by the product under test is projected onto a plane at a preset distance to form a light spot on the plane; the light spot is then photographed by a camera to obtain a first light spot image.

[0011] The image analysis in step S200 is as follows: sequentially perform spot deformation analysis, spot dispersion analysis, spot gradient analysis, and spot trailing analysis on the first spot image.

[0012] The specific analysis of the light spot deformation is as follows:

[0013] S201: Obtain the pixel value range of the first spot image.

[0014] S202: Obtain a first pixel value and a second pixel value according to the pixel value range; the first pixel value is greater than the second pixel value.

[0015] S203: Divide the difference between the first pixel value and the second pixel value into N equal parts to obtain N equal pixel value intervals.

[0016] S204: Replace all pixel values ​​in each pixel value range with the left endpoint pixel value of the corresponding pixel value range to divide the first spot image into N spot layers.

[0017] S205: Calculate the perimeter of the first edge of each light spot layer, and the perimeter of the second edge of a circle with the same area as each light spot layer.

[0018] S206: Calculate the quotient of the perimeter of the first edge and the perimeter of the second edge corresponding to each spot layer to obtain N spot deformation coefficients, and compare each spot deformation coefficient with the first standard deformation threshold and the second standard deformation threshold respectively. If the spot deformation coefficient of a spot layer is greater than the first standard deformation threshold or less than the second standard deformation threshold, it is determined that the current product under test does not meet the preset quality requirements; otherwise, it is determined that the current product under test meets the preset quality requirements; N is a positive integer greater than or equal to 2.

[0019] The specific analysis of the light spot dispersion is as follows:

[0020] S211: Obtain the coordinates of the first center point of each light spot layer.

[0021] S212: Calculate the coordinates of the second center point based on the coordinates of the first center point. The corresponding point of the second center point coordinates is the center of all corresponding points of the first center point coordinates.

[0022] S213: Calculate the first distance from the coordinates of each first center point to the coordinates of the second center point, and calculate the second distance based on the first distance; the second distance is the average of all the first distances.

[0023] S214: Calculate the spot dispersion coefficient based on the first distance and the second distance, and compare the spot dispersion coefficient with the standard dispersion threshold. If the spot dispersion coefficient is greater than the standard dispersion threshold, it is determined that the current product under test does not meet the preset quality requirements; otherwise, it is determined that the current product under test meets the preset quality requirements.

[0024] The light spot gradient analysis specifically refers to:

[0025] Obtain the right endpoint pixel value of each pixel value range. If the right endpoint pixel value gradually decreases from the center spot layer to the edge spot layer, the current product under test is determined to meet the preset quality requirements. If the right endpoint pixel value gradually increases from the center spot layer to the edge spot layer or has no change pattern, the current product under test is determined to not meet the preset quality requirements.

[0026] The specific analysis of the light spot trailing is as follows:

[0027] The second pixel value of the first spot image is obtained, and the pixels within the preset range of the second pixel value are divided into the (N+1)th spot layer. The coordinates of the third center point of the (N+1)th spot layer are obtained. The third distance is obtained based on the coordinates of the third center point and the second center point, and the third distance is compared with the standard distance threshold. If the third distance is greater than the standard distance threshold, it is determined that the current product under test does not meet the preset quality requirements; otherwise, it is determined that the current product under test meets the preset quality requirements.

[0028] Step S200 further includes:

[0029] When the analysis results of spot deformation analysis, spot dispersion analysis, spot gradient analysis, and spot trailing analysis are all that the current product under test meets the preset quality requirements, the quality inspection of the current product under test is deemed qualified; when at least one of the analysis results of spot deformation analysis, spot dispersion analysis, spot gradient analysis, and spot trailing analysis is that the current product under test does not meet the preset quality requirements, the quality inspection of the current product under test is deemed unqualified; after completing the quality determination of the current product under test, a first spot image that has completed the image analysis is obtained to form a second spot image; and the first spot image, the second spot image, the spot deformation coefficient, the spot dispersion coefficient, and the pixel value range of the first spot image are stored in the system.

[0030] Based on the same inventive concept, the present invention also provides a spot quality detection system, the system comprising:

[0031] First acquisition module: used to capture the light spot formed when the light beam emitted by the product under test is projected onto a plane at a preset distance, so as to obtain the first light spot image.

[0032] Analysis module: used to sequentially perform spot deformation analysis, spot dispersion analysis, spot gradient analysis and spot trailing analysis on the first spot image to determine whether the current product under test meets the preset quality requirements.

[0033] The second acquisition module is used to acquire the first spot image after it has been processed by the analysis module, so as to form the second spot image.

[0034] Storage module: used to store the first spot image and the second spot image, as well as the spot deformation coefficient, the spot dispersion coefficient and the pixel value range of the first spot image, to facilitate subsequent tracking, analysis and processing.

[0035] Based on the same inventive concept, the present invention also provides an electronic device, including: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the spot quality detection method.

[0036] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0037] 1. This invention acquires light spot images and quantifies and judges the light spot images according to preset thresholds. The algorithm is highly efficient and facilitates intelligent detection and information management. At the same time, the implementation cost is low. It solves the technical problems of low efficiency, high cost and eye injury caused by detection by human eyes in the prior art. It also solves the technical problems of high technical requirements and high cost caused by the use of professional equipment such as integrating spheres and illuminometers in the prior art.

[0038] 2. After completing the detection, this invention stores the various analysis parameters and spot images into the system, which facilitates subsequent tracking and analysis, real-time viewing, visualization, and big data analysis and management; it solves the technical problem of limited intelligent detection in the prior art. Attached Figure Description

[0039] Figure 1 This is a flowchart of the spot quality detection method described in this invention.

[0040] Figure 2 This is a flowchart of the light spot deformation analysis described in this invention.

[0041] Figure 3 This is a flowchart of the spot dispersion analysis described in this invention.

[0042] Figure 4 for Figure 1 The system flowchart of the light spot quality detection method is shown below. Detailed Implementation

[0043] This invention provides a method, system, and electronic device for detecting light spot quality, which solves the technical problems of low efficiency, high cost, and eye injury caused by detection by human eyes in the prior art; it also solves the technical problems of high technical requirements, high cost, and limited intelligent detection caused by the use of professional equipment such as integrating spheres and illuminometers in the prior art.

[0044] This invention provides a method for detecting light spot quality, the general idea of ​​which is as follows:

[0045] The light beam emitted by the product under test is projected onto a plane at a preset distance to form a light spot on the plane, and a first light spot image is obtained by capturing the light spot with a camera; then, the first light spot image is sequentially subjected to light spot deformation analysis, light spot dispersion analysis, and light spot gradient analysis; further, the quality status of the product under test is obtained based on the analysis results, and a second light spot image is formed based on the first light spot image after image analysis is completed; the first light spot image, the second light spot image, and each analysis parameter are stored in the system.

[0046] The following describes in further detail a spot quality detection method, system, and electronic device of the present invention with reference to specific embodiments and accompanying drawings.

[0047] Specifically, this invention provides a method for detecting light spot quality; please refer to [link / reference]. Figure 1 This includes the following steps:

[0048] S100: Acquire the first spot image formed by the current product under test.

[0049] In one feasible implementation, assuming the product under test is a flashlight reflector, the beam emitted by the flashlight reflector is projected onto a vertical plane with a clear white effect at a preset distance to form a light spot on the plane; and the light spot is photographed by an industrial camera to obtain a first light spot image.

[0050] It should be noted that the preset distance can be selected between 3 meters and 10 meters, or it can be set according to the actual requirements of the product being tested. There is no limit to the projection distance here.

[0051] The reason for projecting the beam onto a vertical plane where the white effect is obvious is to obtain a clear and complete image of the light spot.

[0052] Industrial cameras were chosen for shooting because they can achieve 10 Gigabit fiber optic communication, facilitating real-time detection; moreover, industrial cameras are stable and reliable in performance, easy to install, have a compact and robust structure that is not easily damaged, can work continuously for a long time, and can work in harsh environments, all of which are difficult for ordinary cameras to do.

[0053] For example, some industrial cameras are installed on industrial inspection production lines to perform visual measurement and defect screening of products. This requires the cameras to operate continuously on the production line without failure, otherwise the production line will stop or even be paralyzed, which means irreparable economic losses for enterprises.

[0054] After obtaining the first spot image, step S200 can be executed.

[0055] S200: Sequentially perform spot deformation analysis, spot dispersion analysis, spot gradient analysis, and spot trailing analysis on the first spot image to determine the quality of the current product under test; and form a second spot image based on the first spot image after image analysis, and store the first spot image, the second spot image, and the corresponding parameter values ​​into the system.

[0056] Please see below. Figure 2 The specific analysis of the light spot deformation is as follows:

[0057] S201: Obtain the pixel value range of the first spot image.

[0058] It should be noted that, theoretically, the pixel value distribution range of a light spot image is 0 to 255, but the pixel value of an actual light spot image is generally slightly smaller than this range, for example, 5 to 225.

[0059] S202: Obtain a first pixel value and a second pixel value according to the pixel value range; the first pixel value is greater than the second pixel value.

[0060] It should be noted that the first pixel value is defined as the maximum pixel value 'a' in the pixel value range, and the second pixel value is defined as the minimum pixel value 'b' in the pixel value range.

[0061] S203: Divide the difference between the first pixel value and the second pixel value into N equal parts to obtain N equal pixel value intervals.

[0062] In one feasible implementation, the pixel value range of the light spot image formed by the beam emitted by the flashlight is 5 to 204. At this time, the maximum pixel value a is 204 and the minimum pixel value b is 5. The difference between the maximum pixel value a and the minimum pixel value b is divided into 5 equal parts, that is, the equal part c = [(ab) / 5] = [(205-5) / 5] = 40, and the pixel value ranges of the 5 equal parts are obtained as 5 to 44, 45 to 84, 85 to 124, 125 to 164, and 165 to 204.

[0063] It should be noted that if it is necessary to increase the detection accuracy of the light spot quality, this can be achieved by increasing the number of layers; the equal score c is the value obtained by rounding after calculating based on the maximum and minimum pixel values.

[0064] S204: Replace all pixel values ​​in each pixel value range with the left endpoint pixel value of the corresponding pixel value range to divide the first spot image into N spot layers.

[0065] Replace all pixel values ​​in each of the above pixel value ranges with the smallest pixel value in that range, that is, replace all pixel values ​​in the five pixel value ranges of 5-44, 45-84, 85-124, 125-164, and 165-204 with 5, 45, 85, 125, and 165 respectively to form five levels of light spot images.

[0066] S205: Calculate the perimeter of the first edge of each light spot layer, and the perimeter of the second edge of a circle with the same area as each light spot layer.

[0067] Specifically, when performing calculations using Python programming, the cv2.contourArea and cv2.arcLength functions in OpenCV can be called. These functions can directly calculate the area and perimeter of any shape.

[0068] It should be noted that in addition to Python, other languages ​​such as C, C++, and Java can also be used for programming. No limitation is made on the programming language here, and those skilled in the art can choose according to their actual needs.

[0069] The `cv2.contourArea` function can be used to calculate the area of ​​any shape, including irregular shapes. This function accepts a first contour array as an argument, containing the coordinates of all points of the shape, and a boolean value indicating whether to calculate the absolute value of the area.

[0070] The `cv2.arcLength` function can be used to calculate the perimeter of any shape, including irregular shapes. This function accepts a first contour array as an argument, and a boolean value indicating whether the shape is closed.

[0071] The specific process for calculating the area and perimeter of the light spot layer is as follows:

[0072] First, the first spot image is read using the `cv2.imread` function, and then converted into a grayscale spot image using the `cv2.cvtColor` function. Next, the grayscale spot image is thresholded using the `cv2.threshold` function to divide it into N spot layers. Each spot layer is then binarized, and the contours of each layer are found using the `cv2.findContours` function. The area of ​​each contour is calculated using the `cv2.contourArea` function, and the perimeter of each contour is calculated using the `cv2.arcLength` function.

[0073] The perimeter of each contour obtained above is the perimeter of the first edge; then, based on the area of ​​each contour calculated above, the perimeter of the perfect circle under the condition of equal area is the perimeter of the second edge.

[0074] S206: Calculate the quotient of the perimeter of the first edge and the perimeter of the second edge corresponding to each spot layer to obtain N spot deformation coefficients, and compare each spot deformation coefficient with the standard deformation threshold. If the spot deformation coefficient of a spot layer is greater than the first standard deformation threshold or less than the second standard deformation threshold, it is determined that the current product under test does not meet the preset quality requirements; otherwise, it is determined that the current product under test meets the preset quality requirements; N is a positive integer greater than or equal to 2.

[0075] If the pixel distribution of the light spot images in each layer is uneven, the layered structure will be deformed. There are obvious edges between the layers, and the perimeter of these edges is assumed to be d. If the layered structure is deformed, the edges of the layers will appear curved. Theoretically, the pixel distribution of the light spot image should be that the light spot images of any layer are uniformly distributed concentric circles. Under the condition of equal area, the larger the ratio of the edge perimeter d to the perimeter e of the concentric circles, the greater the deformation of the light spot image of that layer.

[0076] The ratio k = d / e is set. The larger the k value, the greater the distortion of the light spot image. There are 5 k values ​​for the 5-level light spot image, namely k1, k2, k3, k4, and k5. The k1, k2, k3, k4, and k5 are compared with the first standard distortion threshold and the second standard distortion threshold, respectively. If any k value is greater than the first standard distortion threshold or less than the second standard distortion threshold, it is determined that the current flashlight reflector does not meet the preset quality requirements; otherwise, it is determined that the current flashlight reflector meets the preset quality requirements.

[0077] Please see Figure 3 The spot dispersion analysis specifically includes:

[0078] S211: Obtain the coordinates of the first center point (x) of each light spot layer. i ,y i ).

[0079] S212: Calculate the coordinates of the second center point (x) based on the coordinates of the first center point. c ,y c The specific calculation formula is as follows:

[0080]

[0081]

[0082] It should be noted that the point corresponding to the second center point coordinates is the center of the point corresponding to all the first center point coordinates.

[0083] S213: Calculate the first distance d from the coordinates of the first center point to the coordinates of the second center point for each of the following: i And based on the first distance d i Calculate the second distance The specific calculation formula is as follows:

[0084]

[0085]

[0086] It should be noted that the second distance For all first distances d i The average value.

[0087] S214: Based on the first distance d i Second distance The specific formula for calculating the spot dispersion coefficient D is as follows:

[0088]

[0089] The light spot dispersion coefficient D is compared with the standard dispersion threshold. If the light spot dispersion coefficient D is greater than the standard dispersion threshold, it is determined that the current flashlight lamp does not meet the preset quality requirements; otherwise, it is determined that the current flashlight lamp meets the preset quality requirements.

[0090] It should be noted that, This represents the standard deviation of the distances from the coordinates of the first center point to the coordinates of the second center point, i.e., the dispersion of the light spot set. If the point set is more dispersed, the standard deviation will be larger, and the dispersion will be higher.

[0091] The light spot gradient analysis specifically refers to:

[0092] Obtain the right endpoint pixel value of each pixel value range. If the right endpoint pixel value gradually decreases from the center spot layer to the edge spot layer, the current product under test is determined to meet the preset quality requirements. If the right endpoint pixel value gradually increases from the center spot layer to the edge spot layer or there is no change pattern, the current flashlight lamp cup is determined to not meet the preset quality requirements.

[0093] In one feasible implementation, it is assumed that the right endpoint pixel values ​​of the five pixel value intervals are 44, 84, 124, 164, and 204, respectively; where pixel value 204 is the pixel value of the central light spot layer. It can be seen that the pixel value gradually decreases from the central light spot layer to the edge light spot layer, and it is determined that the current flashlight lamp cup meets the preset quality requirements.

[0094] If pixel value 44 is the pixel value of the central light spot layer and 204 is the pixel value of the outermost light spot layer, it can be seen that the pixel value gradually increases from the central light spot layer to the edge light spot layer. It is determined that the light spot is a hollow light spot, and the current flashlight lamp does not meet the preset quality requirements.

[0095] The specific analysis of the light spot trailing is as follows:

[0096] Obtain the second pixel value of the first light spot image, divide the pixels within a preset range of the second pixel value into the 6th light spot layer, and obtain the coordinates (x, y) of the third center point of the 6th light spot layer. j ,y j According to the coordinates of the third center point (x) j ,y j ) and the coordinates of the second center point (x) c ,y c Obtain the third distance d j The specific calculation formula is as follows:

[0097]

[0098] The third distance d j Compared with the standard distance threshold d, if the third distance d j If the distance is greater than the standard distance threshold d, the current flashlight reflector is determined to not meet the preset quality requirements; otherwise, the current flashlight reflector is determined to meet the preset quality requirements.

[0099] It should be noted that when the analysis results of spot deformation, spot dispersion, spot gradient, and spot trailing are all in the current flashlight reflector, the current flashlight reflector is deemed to have passed the quality inspection; when at least one of the analysis results of spot deformation, spot dispersion, spot gradient, and spot trailing is in the current flashlight reflector, the current flashlight reflector is deemed to have failed the quality inspection.

[0100] Suppose that the results of the current flashlight reflector's beam distortion, beam dispersion, and beam trailing analysis all indicate that the flashlight reflector meets the preset quality requirements; however, the beam gradient analysis result indicates that the flashlight reflector does not meet the preset quality requirements. In this case, the flashlight reflector is still considered to fail the quality inspection and is a defective product, unsuitable for market use. Only when the results of the beam distortion, beam dispersion, beam gradient, and beam trailing analysis all indicate that the flashlight reflector meets the preset quality requirements can it be considered to pass the quality inspection and be a good product, suitable for market use.

[0101] After completing the quality assessment of the current product under test, the first spot image after the image analysis is completed is obtained to form the second spot image; and the first spot image and the second spot image, as well as the spot deformation coefficient, the spot dispersion coefficient and the pixel value range of the first spot image are stored in the system.

[0102] Based on the same inventive concept, please refer to Figure 4 The present invention also provides a spot quality detection system, the system comprising:

[0103] First acquisition module: used to capture the light spot formed when the light beam emitted by the product under test is projected onto a plane at a preset distance, so as to obtain the first light spot image.

[0104] It should be noted that the first acquisition module uses an industrial camera to capture the light spot, making the acquired first light spot image clear and complete, thereby further improving the accuracy of subsequent image analysis.

[0105] Analysis module: used to sequentially perform spot deformation analysis, spot dispersion analysis, spot gradient analysis and spot trailing analysis on the first spot image to determine whether the current product under test meets the preset quality requirements.

[0106] It should be noted that the spot deformation coefficient, spot dispersion coefficient, and pixel value range of the first spot image can be obtained through spot deformation analysis, spot dispersion analysis, spot gradient analysis, and spot trailing analysis. The above parameters are compared with their corresponding standard thresholds to determine the quality of the product under test.

[0107] Furthermore, the quality inspection of the current product can only be determined to be passed if the results of the spot deformation analysis, spot dispersion analysis, spot gradient analysis, and spot trailing analysis all indicate that the current product meets the preset quality requirements.

[0108] The second acquisition module is used to acquire the first spot image after it has been processed by the analysis module, so as to form the second spot image.

[0109] Storage module: used to store the first spot image and the second spot image, as well as the spot deformation coefficient, the spot dispersion coefficient and the pixel value range of the first spot image, to facilitate subsequent tracking, analysis and processing.

[0110] Based on the same inventive concept, the present invention also provides an electronic device, including: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the spot quality detection method.

[0111] In summary, this invention provides a method, system, and electronic device for detecting light spot quality. By analyzing the light spot image formed on the product under test, the quality of the product is obtained. This invention can perform quantitative judgment based on standard values ​​set for the product, has high algorithm efficiency, and facilitates intelligent detection and information management; at the same time, it has low implementation cost.

[0112] Although exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above exemplary embodiments are merely illustrative and are not intended to limit the scope of the invention. Various changes and modifications can be made therein by those skilled in the art without departing from the scope and spirit of the invention. All such changes and modifications are intended to be included within the scope of the invention as claimed in the appended claims.

[0113] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0114] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.

[0115] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules according to embodiments of the present invention. The present invention can also be implemented as an apparatus program (e.g., a computer program and computer program product) for performing some or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0116] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0117] Although the invention has been described in conjunction with the specific embodiments described above, it will be apparent to those skilled in the art that many substitutions, modifications, and variations can be made based on the foregoing. Therefore, all such substitutions, modifications, and variations are included within the spirit and scope of the appended claims.

Claims

1. A method for detecting the quality of a light spot, characterized in that, Includes the following steps: S100: Project the light beam emitted by the product under test onto a plane at a preset distance to form a light spot on the plane, and capture the light spot with a camera to obtain a first light spot image; S200: Perform image analysis on the first light spot image to determine the quality of the current product under test; A second spot image is generated based on the first spot image after image analysis, and the first spot image, the second spot image, and the corresponding parameter values ​​are stored in the system. The image analysis includes: sequentially performing spot deformation analysis, spot dispersion analysis, spot gradient analysis, and spot trailing analysis on the first spot image; The specific analysis of the light spot deformation is as follows: S201: Obtain the pixel value range of the first light spot image; S202: Obtain a first pixel value and a second pixel value according to the pixel value range; the first pixel value is greater than the second pixel value; S203: Divide the difference between the first pixel value and the second pixel value into N equal parts to obtain N equal pixel value intervals; S204: Replace all pixel values ​​in each pixel value range with the left endpoint pixel value of the corresponding pixel value range to divide the first spot image into N spot layers. S205: Calculate the perimeter of the first edge of each light spot layer, and the perimeter of the second edge of a circle with the same area as each light spot layer; S206: Calculate the quotient of the perimeter of the first edge and the perimeter of the second edge corresponding to each spot layer to obtain N spot deformation coefficients. Compare each spot deformation coefficient with the first standard deformation threshold and the second standard deformation threshold respectively. If the spot deformation coefficient of a spot layer is greater than the first standard deformation threshold or less than the second standard deformation threshold, it is determined that the current product under test does not meet the preset quality requirements; otherwise, it is determined that the current product under test meets the preset quality requirements. N is a positive integer greater than or equal to 2. The specific analysis of the light spot dispersion is as follows: S211: Obtain the coordinates of the first center point of each light spot layer; S212: Calculate the coordinates of the second center point based on the coordinates of the first center point, where the corresponding point of the second center point coordinates is the center of all corresponding points of the first center point coordinates; S213: Calculate the first distance from the coordinates of each first center point to the coordinates of each second center point, and calculate the second distance based on the first distance; the second distance is the average of all the first distances; S214: Calculate the spot dispersion coefficient based on the first distance and the second distance, and compare the spot dispersion coefficient with the standard dispersion threshold. If the spot dispersion coefficient is greater than the standard dispersion threshold, it is determined that the current product under test does not meet the preset quality requirements; otherwise, it is determined that the current product under test meets the preset quality requirements. The light spot gradient analysis specifically refers to: Obtain the right endpoint pixel value of each pixel value range. If the right endpoint pixel value gradually decreases from the center spot layer to the edge spot layer, the current product under test is determined to meet the preset quality requirements. If the right endpoint pixel value gradually increases from the center spot layer to the edge spot layer or has no change pattern, the current product under test is determined to not meet the preset quality requirements. The specific analysis of the light spot trailing is as follows: Obtain the second pixel value of the first spot image, divide the pixels within a preset range of the second pixel value into the N+1th spot layer, and obtain the coordinates of the third center point of the N+1th spot layer; The third distance is obtained based on the coordinates of the third center point and the second center point, and the third distance is compared with the standard distance threshold. If the third distance is greater than the standard distance threshold, it is determined that the current product under test does not meet the preset quality requirements; otherwise, it is determined that the current product under test meets the preset quality requirements. When the analysis results of spot deformation analysis, spot dispersion analysis, spot gradient analysis and spot trailing analysis are all that the current product under test meets the preset quality requirements, the quality inspection of the current product under test is deemed qualified. When at least one of the following analyses—spot deformation analysis, spot dispersion analysis, spot gradient analysis, and spot trailing analysis—results in the current product under test not meeting the preset quality requirements, the quality inspection of the current product under test is deemed unqualified.

2. The method for detecting light spot quality according to claim 1, characterized in that, Step S200 further includes: After completing the quality assessment of the current product under test, the first spot image after the image analysis is completed is obtained to form the second spot image; and the first spot image and the second spot image, as well as the spot deformation coefficient, the spot dispersion coefficient and the pixel value range of the first spot image are stored in the system.

3. A system employing the spot quality detection method as described in any one of claims 1-2, characterized in that, The system includes: First acquisition module: used to capture the light spot formed when the beam emitted by the product under test is projected onto a plane at a preset distance, so as to acquire the first light spot image; Analysis module: used to sequentially perform spot deformation analysis, spot dispersion analysis, spot gradient analysis and spot trailing analysis on the first spot image to determine whether the current product under test meets the preset quality requirements; The second acquisition module is used to acquire the first spot image after it has been processed by the analysis module, so as to form the second spot image. Storage module: used to store the first spot image and the second spot image, as well as the spot deformation coefficient, the spot dispersion coefficient and the pixel value range of the first spot image, to facilitate subsequent tracking, analysis and processing.

4. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the spot quality detection method according to any one of claims 1-2 by executing the computer instructions.

Citation Information

Patent Citations

  • Method and system for detecting uniformity of light source

    CN109186941A