A laser scanning sensor and its dynamic adjustment method and device
By analyzing the initial image information and grayscale distribution of the laser scanning sensor, adjusting the scanning parameters to solve the problem of unreasonable image brightness, the reliability and consistency of detection results for different materials and colors are achieved.
Patent Information
- Application Number
- CN202210392122.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-14
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2042-04-14
AI Technical Summary
When traditional laser scanning sensors detect complex situations, the image brightness is unreasonable, resulting in false detection and unreliable detection results.
By acquiring the image information of the initial image and the grayscale distribution of pixel grayscale values, it is determined whether there is an area where the pixel grayscale value exceeds the standard grayscale range. If it exists, the scanning parameters are adjusted to obtain a reasonable detection image.
It effectively reduces the sensitivity of the laser scanning sensor to the material and color of the workpiece to be tested, and ensures that the detection image with reasonable brightness is obtained under different reflectivity conditions.
Smart Images

Figure CN114723798B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of laser scanning, and particularly to a laser scanning sensor and a method and device for dynamically adjusting the same. Background Art
[0002] Laser scanning sensors can detect object contours and 3D object shapes and are widely used in industrial automation. However, with the diverse changes in the materials, colors, and inclinations of the detected objects faced by the sensors, as well as harsh working environments such as strong light and strong noise, traditional laser line scanning sensors will have problems such as false detection and unreliable detection results, and gradually cannot meet the application requirements.
[0003] The current camera dynamic adjustment technology mainly focuses on adjusting the exposure time at the receiving end. By adjusting the length of the exposure time, the amount of charge accumulated at the CMOS end is controlled, and an automatic brightness adjustment algorithm is used to adjust the brightness of the entire image. By adjusting the exposure time to adjust the brightness of the entire image, the means are single and the dynamic range is limited. It is easy to make the area with a higher reflectivity too bright and the area with a too low reflectivity too dark. Moreover, the judgment criteria for automatic brightness adjustment are single and not applicable to complex situations. Summary of the Invention
[0004] The present invention provides a laser scanning sensor and a method and device for dynamically adjusting the same to solve the problem of unreasonable image brightness obtained by the laser scanning sensor for complex situations.
[0005] According to one aspect of the present invention, a method for dynamically adjusting a laser scanning sensor is provided, including:
[0006] When the scanning parameters of the laser scanning sensor are initial scanning parameters, obtaining image information of an initial image scanned by the laser scanning sensor for a workpiece to be measured;
[0007] According to the image information, determining the gray distribution of the pixel gray values in the initial image;
[0008] Based on the gray distribution of the pixel gray values, determining whether there is a first region in the initial image; the first region is a region where the pixel gray values exceed the standard gray range;
[0009] If so, determining an adjustment parameter of the scanning parameters of the laser scanning sensor according to the pixel gray values of the first region;
[0010] When the scanning parameters of the laser scanning sensor are adjustment parameters, obtaining image information of an adjustment image scanned by the laser scanning sensor for the workpiece to be measured;
[0011] Determine the detection image of the workpiece to be measured according to the image information of the initial image and the image information of the adjusted image.
[0012] According to another aspect of the present invention, there is provided a dynamic adjustment device for a laser scanning sensor, including:
[0013] An initial image information acquisition module, configured to acquire the image information of the initial image of the workpiece to be measured scanned by the laser scanning sensor when the scanning parameter of the laser scanning sensor is the initial scanning parameter;
[0014] A gray-scale distribution determination module, configured to determine the gray-scale distribution of the pixel gray-scale values in the initial image according to the image information;
[0015] A region judgment module, configured to judge whether there is a first region in the initial image based on the gray-scale distribution of the pixel gray-scale values; the first region is a region where the pixel gray-scale value exceeds the standard gray-scale range;
[0016] An adjustment parameter determination module, configured to determine the adjustment parameter of the scanning parameter of the laser scanning sensor according to the pixel gray-scale value of the first region when there is a first region;
[0017] An adjusted image information acquisition module, configured to acquire the image information of the adjusted image of the workpiece to be measured scanned by the laser scanning sensor when the scanning parameter of the laser scanning sensor is the adjustment parameter;
[0018] A detection image determination module, configured to determine the detection image of the workpiece to be measured according to the image information of the original image and the image information of the adjusted image.
[0019] According to another aspect of the present invention, there is provided a laser scanning sensor, including a laser emission module, a light sensing receiving module, and a dynamic adjustment device for the laser scanning sensor, where the dynamic adjustment device is configured to execute any one of the dynamic adjustment methods of the laser scanning sensor in the embodiments of the present invention.
[0020] In the technical solution of the embodiment of the present invention, by obtaining the image information of the initial image and the gray distribution of the pixel gray values, it is possible to determine whether there is a first area in the initial image where the pixel gray value exceeds the standard gray range, that is, to determine whether there is an area with too high and / or insufficient brightness in the initial image. If there is an area with unreasonable brightness, the scanning parameters can be adjusted according to the brightness situation in the area with unreasonable brightness, the image information of the adjusted image after adjustment is obtained, and the image information of the initial image is combined to obtain a detection image with reasonable brightness in each area. In this way, when the laser scanning sensor scans the workpiece to be measured with different materials, different colors and other different reflectivities, a detection image with reasonable brightness can be obtained, effectively reducing the sensitivity of the laser scanning sensor to the material and color of the workpiece to be measured.
[0021] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0023] Figure 1 It is a flowchart of a dynamic adjustment method for a laser scanning sensor provided in Embodiment 1 of the present invention;
[0024] Figure 2 It is a schematic structural diagram and a scanned image of a workpiece to be measured provided in Embodiment 1 of the present invention;
[0025] Figure 3 It is a flowchart of a dynamic adjustment method for a laser scanning sensor provided in Embodiment 2 of the present invention;
[0026] Figure 4 It is a schematic diagram of the pixel matrix of an initial image provided in Embodiment 2 of the present invention;
[0027] Figure 5 It is a schematic structural diagram of a workpiece to be measured and the distribution of pixel gray values of an initial image provided in Embodiment 2 of the present invention;
[0028] Figure 6 It is a flowchart of a dynamic adjustment method for a laser scanning sensor provided in Embodiment 3 of the present invention;
[0029] Figure 7Flowchart of a dynamic adjustment method for a laser scanning sensor provided in Embodiment 4 of the present invention;
[0030] Figure 8 Flowchart of a dynamic adjustment method for a laser scanning sensor provided in Embodiment 5 of the present invention;
[0031] Figure 9 Flowchart of a dynamic adjustment method for a laser scanning sensor provided in Embodiment 6 of the present invention;
[0032] Figure 10 Schematic structural diagram of a dynamic adjustment device for a laser scanning sensor provided in Embodiment 7 of the present invention;
[0033] Figure 11 Shows a structural block diagram of a laser scanning sensor that can be used to implement the embodiments of the present invention. Detailed implementation manners
[0034] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or devices.
[0036] Embodiment 1
[0037] Figure 1 Flowchart of a dynamic adjustment method for a laser scanning sensor provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of parameter adjustment for unreasonable brightness of a laser scanner. This method can be executed by a dynamic adjustment device of the laser scanning sensor. The dynamic adjustment device can be implemented in the form of hardware and / or software, and the dynamic adjustment device can be configured in the laser scanning sensor. AsFigure 1 As shown, the method includes:
[0038] S1001. When the scanning parameters of the laser scanning sensor are initial scanning parameters, obtain the image information of the initial image obtained by the laser scanning sensor scanning the workpiece to be measured.
[0039] Among them, the scanning parameters include but are not limited to the laser power of the laser emission module and the exposure time of the light-sensing receiving module. The image information includes but is not limited to the pixel matrix and the pixel gray values of each pixel. The value range of the pixel gray value is 0 - 255. Specifically, according to the initial scanning parameters, the laser emission module of the laser scanning sensor emits laser with an initial power, and the light-sensing receiving module of the laser scanning sensor receives the laser reflected by the workpiece to be measured with the initial exposure time and forms an initial image. The image information of the initial image is obtained according to the initial image in the light-sensing receiving module.
[0040] S1002. According to the image information, determine the gray distribution of the pixel gray values in the initial image.
[0041] Specifically, according to the image information of the initial image, count the gray values of each pixel in the pixel matrix. The image displayed by pixels of different grays is a gray image. Methods such as the average brightness method, the weighted mean method, and the brightness histogram method can be used to count the distribution of the gray values of the gray image. Among them, the average brightness method is to calculate the average value of the gray values of all pixels in the image; the weighted mean method is to set different weights for different regions of the image to calculate the pixel gray values of the image. For example, the selection of various photometric modes in the camera is to change the weights of different regions; the brightness histogram method is to calculate the pixel gray values of the image by assigning different weights to the peaks in the histogram.
[0042] It should be noted that the image brightness and the pixel gray values in the pixel matrix mentioned in the implementation of the present invention especially refer to the brightness and pixel gray values of the pixel region corresponding to the component to be measured. The regions outside the pixel region corresponding to the component to be measured are mainly invalid background regions. When counting the pixel gray values of the image, the pixel gray values of the invalid background regions can be ignored.
[0043] S1003. Based on the gray distribution of the pixel gray values, determine whether there is a first region in the initial image. If so, execute S1004; if not, execute S1007.
[0044] Among them, the standard gray range is the reasonable range of the pixel gray values and also the reasonable range of the image brightness. When the pixel gray values of each pixel in the pixel matrix are all within the standard gray range, it is considered that the brightness of the image is reasonable, that is, the size of the pixel gray values is reasonable; the first region is the region where the pixel gray values exceed the standard gray range. In the first region, the gray value of the pixel is greater than the upper limit of the standard gray range and / or less than the lower limit of the standard gray range.
[0045] Exemplarily, 18% gray scale (gray scale value 128) is adopted as the gray scale standard value, and the pixel gray scale value range is divided into three sub-ranges. The pixel gray scale range of 0 - 95 indicates insufficient brightness, the pixel gray scale range of 96 - 159 indicates reasonable brightness, and the pixel gray scale range of 160 - 255 indicates excessive brightness. If the pixel gray scale value in the pixel matrix of the initial image is within the range of 96 - 159, it is considered that the pixel gray scale values of the initial image are all within the standard gray scale range, and there is no first region. If in a certain region, the pixel gray scale values are all within the range of 0 - 95 and / or 160 - 255, then this region is the first region, and the pixel gray scale value is less than the lower limit 96 of the standard gray scale range, and / or greater than the upper limit 159 of the standard gray scale range.
[0046] S1004. Determine the adjustment parameter of the scanning parameter of the laser scanning sensor according to the pixel gray scale value of the first region.
[0047] Among them, the adjustment parameter of the scanning parameter of the laser scanning sensor includes but is not limited to the laser power of the laser emission module and the exposure time of the light sensing receiving module
[0048] Exemplarily, if the pixel gray scale value of the first region is less than the lower limit of the standard gray scale range, it indicates that the brightness of the first region is insufficient, and the exposure time of the light sensing receiving module can be appropriately increased, and / or the laser power of the laser emission module can be appropriately increased. If the pixel gray scale value of the first region is greater than the upper limit of the standard gray scale range, it indicates that the brightness of the first region is excessive, and the exposure time of the light sensing receiving module can be appropriately reduced, and / or the laser power of the laser emission module can be appropriately reduced. It should be noted that the first region can be a continuous region or a discontinuous region. When the first region is discontinuous, the first region includes multiple sub-regions, and the ranges where the pixel gray scale values of the sub-regions are located can be different.
[0049] S1005. When the scanning parameter of the laser scanning sensor is the adjustment parameter, obtain the image information of the adjustment image obtained by the laser scanning sensor scanning the workpiece to be measured.
[0050] Exemplarily, when changing the scanning parameter of the laser scanning sensor to the adjustment parameter, the laser emission module scans the workpiece to be measured again, the light sensing receiving module receives the laser reflected by the workpiece to be measured and forms an adjustment image, and the image information of the adjustment image is obtained according to the adjustment image. It can be understood that the brightness of the adjustment region corresponding to the first region in the initial image in the adjustment image obtained by changing the scanning parameter to the adjustment parameter should be reasonable, that is, the pixel gray scale value of the adjustment region is within the standard gray scale range. It should be noted that the adjustment parameter includes at least one set of adjustment data, and the adjustment parameter can include multiple sets of adjustment data. The embodiments of the present invention do not make specific limitations on this.
[0051] S1006. Determine the detection image of the workpiece to be measured according to the image information of the initial image and the image information of the adjusted image.
[0052] Specifically, perform image fusion on the initial image and the adjusted image to obtain the final detection image, so that the brightness of the detection image is reasonable. It can be understood that the adjusted image may include multiple images. When the adjustment parameters include multiple sets of adjustment data, the adjusted image also includes multiple images.
[0053] Optionally, determining the detection image of the workpiece to be measured according to the image information of the initial image and the image information of the adjusted image includes: combining the area where the pixel gray value in the original image is within the standard gray range and the corresponding area in the adjusted image corresponding to the first area to determine the detection image of the workpiece to be measured. Exemplarily, Figure 2 The following is a schematic structural diagram and a scanned image of a workpiece to be measured provided in Embodiment 1 of the present invention, as Figure 2 shown, Figure 2 a is a schematic structural diagram of a workpiece to be measured, Figure 2 b is an initial image of a workpiece to be measured, Figure 2 c is an adjusted image after adjusting the first area with too high brightness, Figure 2 d is an adjusted image after adjusting the first area with insufficient brightness, Figure 2 e is a detection image of a workpiece to be measured. Place Figure 2 the black workpiece in a on a white bottom plate. When the scanning parameters of the laser scanning sensor are the initial scanning parameters, obtain the image information of the initial image of the workpiece to be measured scanned by the laser scanning sensor, which is Figure 2 b, including the corresponding area of the white bottom plate with too high brightness (the first area with too high brightness) and the corresponding area of the black workpiece with insufficient brightness (the first area with insufficient brightness). For the pixel gray values of the corresponding area of the white bottom plate with too high brightness and the corresponding area of the black workpiece with insufficient brightness, respectively determine the adjustment parameters of the scanning parameters of the laser scanning sensor to obtain Figure 2 c and Figure 2 d. Extract Figure 2 the first reasonable area with reasonable brightness in b, extract Figure 2 the first adjustment area in c corresponding to the first area with too high brightness in Figure 2 b, extract Figure 2 the second adjustment area in d corresponding to the first area with insufficient brightness in Figure 2 b, and splice the first reasonable area, the first adjustment area and the second adjustment area to obtain a detection image with reasonable brightness, as Figure 2 shown in e.
[0054] S1007. Determine the initial image as the detection image of the workpiece to be measured.
[0055] Exemplarily, if there is no first region in the initial image, it indicates that the pixel gray values in the pixel matrix of the initial image are all within the standard gray range, the brightness of the initial image is reasonable, or the pixel gray values in the pixel region corresponding to the component to be measured are reasonable in magnitude, and there is no need to adjust the scanning parameters. The initial image can be output as the detection image directly.
[0056] Exemplarily, the dynamic adjustment device first controls the laser scanning sensor to scan the component to be measured with the initial scanning parameters to obtain the initial image. Then, the dynamic adjustment device can obtain the image information of the initial image and determine and count the gray values of each pixel in the pixel matrix according to the image information. The dynamic adjustment device can judge whether the brightness of the initial image is all reasonable based on the statistical result. That is, it can judge whether the pixel gray values of the initial image are all within the standard gray range. If the brightness is all reasonable, it indicates that there is no need to adjust the scanning parameters, and the initial image can be output as the detection image directly. If there is a region with unreasonable brightness in the initial image, this region is the first region. The dynamic adjustment device then adjusts the exposure time of the light-sensing receiving module and / or the laser power of the laser emitting module according to the pixel gray values of the first region, and controls the laser scanning sensor to scan the component to be measured with the adjusted parameters to obtain the adjusted image. The dynamic adjustment device can perform image fusion according to the image information of the initial image and the image information of the adjusted image to obtain a detection image in which all pixel gray values are within the standard gray range.
[0057] In the implementation of the present invention, by obtaining the image information of the initial image and the gray distribution of the pixel gray values, it can be judged whether there is a first region in the initial image where the pixel gray values exceed the standard gray range, that is, it can be judged whether there is a region with too high and / or insufficient brightness in the initial image. If there is a region with unreasonable brightness, the scanning parameters can be adjusted according to the brightness situation in the region with unreasonable brightness, the image information of the adjusted image after adjustment is obtained, and combined with the image information of the initial image, a detection image with reasonable brightness in each region is obtained. In this way, when the laser scanning sensor scans workpieces to be measured with different materials, different colors, etc., that is, workpieces with different reflectivities, detection images with reasonable brightness can be obtained, effectively reducing the sensitivity of the laser scanning sensor to the material and color of the workpiece to be measured.
[0058] Embodiment 2
[0059] Figure 3 The figure is a flowchart of a dynamic adjustment method for a laser scanning sensor provided in Embodiment 2 of the present invention. In this embodiment, the step of determining the gray distribution of the pixel gray values in the initial image according to the image information in the above embodiment is refined. As Figure 3 shown, the method includes:
[0060] S2001. When the scanning parameters of the laser scanning sensor are the initial scanning parameters, obtain the image information of the initial image of the workpiece to be measured scanned by the laser scanning sensor.
[0061] S2002. Divide the pixels in the initial image into multiple pixel columns, and each pixel column includes multiple pixels arranged in sequence along the column direction.
[0062] Wherein, the column direction refers to the scanning direction of the laser scanning sensor for scanning the workpiece to be measured, and it can be parallel to the moving direction of the workpiece or the moving direction of the laser scanning sensor.
[0063] S2003. According to the image information, determine the maximum gray value of the gray values of the pixels in each pixel column.
[0064] It can be understood that the laser emission module of the laser scanning sensor emits laser light, and the light-sensing receiving module of the laser scanning sensor receives the laser light reflected by the workpiece to be measured and forms an initial image and / or an adjusted image. In the initial image and / or adjusted image collected by the laser scanning sensor, the area where the reflected laser light is imaged is the effective area, which only accounts for a small number of pixels, and most of the remaining areas are invalid background areas. Therefore, the reasonableness of the image brightness can be judged only by the gray value distribution of the pixels in the effective area, and the interference of the invalid background area on the gray value statistics of the pixels can be avoided.
[0065] S2004. Statistically analyze the histogram of the maximum gray values of each pixel column as the gray value distribution of the pixels in the initial image.
[0066] Wherein, the brightness state of the maximum gray value of each pixel column represents the brightness state of each pixel column. The histogram of the maximum gray values of each pixel column is a function of the distribution of the maximum gray values of each pixel column, which is a statistical analysis of the distribution of the maximum gray values of each pixel column in the image and also a statistical analysis of the brightness distribution of each pixel column in the image. The histogram of the maximum gray values of each pixel column is to count the frequency of occurrence of the maximum gray values of each pixel column in the image according to their magnitudes. Exemplarily, if the proportion of the maximum gray values of each pixel column in the initial image that is within the reasonable brightness range reaches the preset probability threshold, it can be considered that the initial image brightness is reasonable and there is no problem of overbrightness and / or insufficient brightness, and / or, if the proportion of the maximum gray values of each pixel column in a certain area of the initial image that is within the reasonable brightness range reaches the preset probability threshold, it can be considered that the brightness of this area is reasonable and there is no problem of overbrightness and / or insufficient brightness. Among them, the preset probability threshold can be set according to the scanning accuracy in the actual use process.
[0067] S2005. Based on the gray value distribution of the pixels, judge whether there is a first area in the initial image. If so, execute S2006.
[0068] S2006. Determine the adjustment parameter of the scanning parameter of the laser scanning sensor according to the pixel gray value of the first area.
[0069] S2007. When the scanning parameter of the laser scanning sensor is the adjustment parameter, obtain the image information of the adjustment image obtained by the laser scanning sensor scanning the workpiece to be measured.
[0070] S2008. Determine the detection image of the workpiece to be measured according to the image information of the initial image and the image information of the adjustment image.
[0071] Exemplarily, Figure 4 FIG. is a schematic diagram of the pixel matrix of an initial image provided in the second embodiment of the present invention. Figure 5 FIG. is a schematic diagram of the structure of a workpiece to be measured and the distribution of pixel gray values of the initial image provided in the second embodiment of the present invention, as Figure 5 shown. Figure 5 a is a schematic diagram of the structure of a workpiece to be measured. Figure 5 b is an initial image of a workpiece to be measured. Figure 5 c is a schematic diagram of the three-gradient histogram of an initial image. As Figure 4 shown, most of the initial image is an invalid background area with a very small pixel gray value, and the pixel area corresponding to the component to be measured is the effective area. The brightness of the initial image can be represented by extracting the maximum gray value of each pixel column, and the brightness distribution of the initial image can be obtained by statistically analyzing the gray value distribution of the maximum gray value of each pixel column. As Figure 5As shown, the workpiece to be measured has a structure with a middle convexity on a plane. Therefore, in the initial image obtained by the laser scanning sensor scanning the component to be measured, the position of the middle convexity of the workpiece to be measured has a higher brightness, the inclined surface has insufficient brightness, and the brightness of the plane is normal. The dynamic adjustment device can obtain the pixel matrix of the initial image and the pixel gray values of each pixel in the pixel matrix, extract and count the maximum gray values of the pixel gray values in each pixel column, and perform statistics using the three-gradient gray histogram statistical method. The gray range is divided into a range of insufficient brightness, a range of reasonable brightness, and a range of excessive brightness. If in a certain area of the initial image, among the maximum gray values of each pixel column, the proportion of pixel grays in a certain gray range (range of insufficient brightness, range of reasonable brightness, or range of excessive brightness) meets a certain threshold, it is considered that this area is within a certain gray range. Assuming the threshold is 80%, if 80% or more of the pixel grays in the maximum gray values of each pixel column in the initial image are within the range of reasonable brightness, it is considered that the pixel gray values of the initial image are all within the standard gray range and there is no first area; if in a certain area, 80% or more of the pixel grays in the maximum gray values of each pixel column are within the range of insufficient brightness and / or excessive brightness, and / or, the proportion of those within the range of reasonable brightness in the maximum gray values of each pixel column is less than 80%, then this area is the first area. If there is an area with unreasonable brightness in the initial image, the dynamic adjustment device can adjust the scanning parameters of the laser scanning sensor according to the area of insufficient brightness and / or excessive brightness, so that the two unreasonable areas become areas with reasonable brightness and obtain an adjusted image. Then, the dynamic adjustment device can perform image fusion based on the image information of the initial image and the image information of the adjusted image to obtain a detection image with reasonable brightness.
[0072] In the embodiment of the present invention, by extracting the maximum gray values of the pixel gray values in each pixel column in the initial image, the invalid background area can be ignored, reducing its interference with the statistics of pixel gray values. And by using the histogram of the maximum gray values of each pixel column as the gray distribution of the pixel gray values in the initial image, the interference of noise on the statistical results can be effectively reduced, and the brightness of the initial image can be judged more accurately, improving the reliability of scanning parameter adjustment.
[0073] Embodiment III
[0074] Figure 6 It is a flowchart of a dynamic adjustment method for a laser scanning sensor provided by Embodiment III of the present invention. In this embodiment, the step of determining the adjustment parameter of the scanning parameter of the laser scanning sensor according to the pixel gray value of the first area in the above embodiment is refined. As Figure 6 shown, the method includes:
[0075] S3001. When the scanning parameter of the laser scanning sensor is the initial scanning parameter, obtain the image information of the initial image obtained by the laser scanning sensor scanning the workpiece to be measured.
[0076] S3002. Determine the gray level distribution of the pixel gray levels in the initial image according to the image information.
[0077] S3003. Based on the gray level distribution of the pixel gray levels, determine whether there is a first region in the initial image. If so, execute S3004.
[0078] S3004. Through a first calculation formula, according to the average gray level M of the maximum gray levels of the pixel columns in the first region 1 , the gray level standard value M 0 and the exposure time T of the initial scanning parameters 1 obtain the exposure time T of the adjustment parameter.
[0079] Among them, the first calculation formula is:
[0080]
[0081] It can be understood that the light injection charge formula of the light sensing receiving module is:
[0082] Q IP = ηqΔn eo AT
[0083] In the formula, η is the quantum efficiency of the material; q is the electron charge; Δn eo is the photon flux rate of the incident light; A is the light receiving area of the photosensitive unit; Tc is the exposure time. It can be seen from the above formula that when the light sensing receiving module is determined, for each pixel, η, q, and A are all constants. On the premise that the illumination condition remains unchanged, Δn eo is also a constant, so Q IP has a linear relationship with Tc; and because Q IP has a linear relationship with the output amplitude of the corresponding pixel of the light sensing receiving module, so T C also has a linear relationship with the output amplitude, that is:
[0084] U ∝ T C
[0085] In the formula, U is the output signal amplitude of the light sensing receiving module. It can be known from the above formula that under the same illumination condition, there is:
[0086]
[0087] In the formula, T C1 , T C2 are the exposure times, and U 1 , U 2 are respectively the values corresponding to T C1 , T C2The corresponding signal output amplitude, and the output signal amplitude of the light sensor module is positively correlated with the pixel gray value, so there is: That is the first calculation formula, where M 1 is the average gray value of the maximum gray values of each pixel column in the first region, M 0 is the gray standard value, T 1 is the exposure time of the initial scanning parameter, and T is the exposure time of the adjustment parameter. Among them, the gray standard value is the standard brightness reference. Exemplarily, 18% gray (gray value 128) can be used as the standard brightness reference.
[0088] S3005. When the scanning parameter of the laser scanning sensor is the adjustment parameter, obtain the image information of the adjustment image of the laser scanning sensor scanning the workpiece to be measured.
[0089] S3006. Determine the detection image of the workpiece to be measured according to the image information of the initial image and the image information of the adjustment image.
[0090] Exemplarily, after obtaining the image information of the initial image, the dynamic adjustment device can determine and count the maximum gray values of each pixel gray value in each pixel column according to the image information. For the area with insufficient brightness, the average gray value of the maximum gray values of each pixel column in this area can be calculated first, and then, with the gray standard value as the target, the scanning parameter of the laser scanning sensor is adjusted so that the average gray value of the maximum gray values of each pixel column in this area after adjustment reaches the gray standard value. At this time, the brightness of this area will probably return to a reasonable state; the adjustment of the area with too high brightness is the same and will not be elaborated. Finally, image fusion is performed according to the image information of the initial image and the image information of the adjustment image to obtain a detection image with reasonable brightness.
[0091] In the embodiment of the present invention, the exposure time of the adjustment parameter is obtained through the first calculation formula, so that the average gray value of the maximum gray values of each pixel column in the adjusted first region reaches the gray standard value, and a first region with reasonable brightness can be quickly obtained, improving the efficiency of dynamic adjustment.
[0092] Embodiment 4
[0093] Figure 7 This is a flowchart of a dynamic adjustment method for a laser scanning sensor provided by Embodiment 4 of the present invention. In this embodiment, a step of verifying the adjusted adjustment image is added before the step of determining the detection image of the workpiece to be measured according to the image information of the initial image and the image information of the adjustment image. As Figure 7 shown, the method includes:
[0094] S4001. When the scanning parameter of the laser scanning sensor is the initial scanning parameter, obtain the image information of the initial image of the laser scanning sensor scanning the workpiece to be measured.
[0095] S4002. Determine the gray level distribution of the pixel gray levels in the initial image according to the image information.
[0096] S4003. Based on the gray level distribution of the pixel gray levels, determine whether there is a first region in the initial image. If so, execute S4004.
[0097] S4004. Determine the adjustment parameter of the scanning parameter of the laser scanning sensor according to the pixel gray levels of the first region.
[0098] S4005. When the scanning parameter of the laser scanning sensor is the adjustment parameter, obtain the image information of the adjusted image obtained by the laser scanning sensor scanning the workpiece to be measured.
[0099] S4006. According to the image information of the adjusted image, determine the pixel gray levels of the adjusted region corresponding to the first region in the initial image in the adjusted image.
[0100] S4007. Determine whether the pixel gray levels of the adjusted region are within the standard gray level range. If not, execute S4008; if so, execute S4009.
[0101] S4008. Determine the adjustment parameter of the laser scanning sensor again according to the pixel gray levels of the adjusted region. Then return to execute S4005.
[0102] S4009. Determine the detection image of the workpiece to be measured according to the image information of the initial image and the image information of the adjusted image.
[0103] Exemplarily, if there is a first region with unreasonable brightness in the initial image, an adjustment parameter can be obtained based on the average gray value of the maximum gray values of each pixel column in the first region and the gray standard value. When the scanning parameter of the laser scanning sensor is the adjustment parameter, obtain the image information of the adjustment image and the pixel gray values of the adjustment region corresponding to the first region in the initial image in the adjustment image; count the histogram of the maximum gray values of each pixel column in the adjustment image, and determine whether the proportion of the maximum gray values of each pixel column in the adjustment image in a reasonable brightness state reaches a preset probability threshold, that is, determine whether the pixel gray values of the adjustment region are within the standard gray range. If so, it means that the pixel gray values of the adjustment region are within the standard gray range, and the scanning after this adjustment has successfully adjusted the first region with too high or too low brightness in the initial image to the adjustment region with reasonable brightness in the adjustment image; if not, it means that the pixel gray values of the adjustment region are not within the standard gray range, and the scanning after this adjustment has not successfully adjusted the adjustment region in the image to a region with reasonable brightness, and it is necessary to continue to adjust the scanning parameter. Obtain a new adjustment parameter based on the average gray value of the maximum gray values of each pixel column in the adjustment region with unreasonable brightness and the gray standard value, re-obtain the image information of the adjustment image and the pixel gray values of the adjustment region corresponding to the first region in the initial image in the adjustment image, determine whether the brightness of the adjustment region in the re-adjusted adjustment image is reasonable, and if not, make another adjustment until the brightness of the adjustment region in the adjustment image is reasonable, and then image fusion can be performed to obtain a detection image with reasonable brightness.
[0104] In the embodiment of the present invention, by determining whether the pixel gray values of the adjustment region corresponding to the first region in the initial image in the adjustment image are within the standard gray range, when the brightness of the adjustment region is still unreasonable, the scanning parameter of the laser scanning sensor can be continuously adjusted until the brightness of the adjustment region is reasonable. In this way, the brightness of the obtained detection image is more uniform, and the image quality of the detection image is improved.
[0105] Embodiment Five
[0106] Figure 8 It is a flowchart of a dynamic adjustment method for a laser scanning sensor provided in Embodiment Five of the present invention. In this embodiment, steps related to the adjustment order of the adjustment parameter are added before returning to execute the step of obtaining the image information of the adjustment image when the scanning parameter of the laser scanning sensor is the adjustment parameter. As Figure 8 shown, the method includes:
[0107] S5001. When the scanning parameter of the laser scanning sensor is the initial scanning parameter, obtain the image information of the initial image obtained by the laser scanning sensor scanning the workpiece to be measured.
[0108] S5002. Determine the gray-scale distribution of the pixel gray-scale values in the initial image according to the image information.
[0109] S5003. Based on the gray-scale distribution of the pixel gray-scale values, determine whether there is a first region in the initial image. If so, execute S5004.
[0110] S5004. Determine the adjustment parameter of the scanning parameter of the laser scanning sensor according to the pixel gray-scale values of the first region.
[0111] S5005. When the scanning parameter of the laser scanning sensor is the adjustment parameter, obtain the image information of the adjusted image obtained by the laser scanning sensor scanning the workpiece to be measured.
[0112] S5006. According to the image information of the adjusted image, determine the pixel gray-scale values of the adjusted region corresponding to the first region in the initial image.
[0113] S5007. Determine whether the pixel gray-scale values of the adjusted region are within the standard gray-scale range. If not, execute S5008; if so, execute S5015.
[0114] S5008. Re-determine the adjustment parameter of the laser scanning sensor according to the pixel gray-scale values of the adjusted region.
[0115] S5009. Determine whether the exposure time is greater than the upper limit value of the exposure time. If so, execute S5010.
[0116] S5010. Use the upper limit value of the exposure time as the adjustment parameter of the scanning parameter of the laser scanning sensor.
[0117] S5011. When the exposure time of the laser scanning sensor is the upper limit value of the exposure time, obtain the image information of the maximum exposure image obtained by the laser scanning sensor scanning the workpiece to be measured.
[0118] S5012. According to the image information of the maximum exposure image, determine whether the pixel gray-scale values of the exposure region corresponding to the first region in the initial image are within the standard gray-scale range. If not, execute S5013; if so, execute S5014.
[0119] S5013. After increasing the laser power of the laser scanning sensor by a preset power increment, re-obtain the image information of the maximum exposure image obtained by the laser scanning sensor scanning the workpiece to be measured. Then return to execute S5012.
[0120] S5014. Determine the maximum exposure image as the adjusted image. Then return to execute S5005.
[0121] S5015. Determine the detection image of the workpiece to be measured based on the image information of the initial image and the image information of the adjusted image.
[0122] Exemplarily, if the pixel gray value of the adjustment area corresponding to the first area in the initial image in the adjusted image is not within the standard gray range, it indicates that the brightness of the adjustment area is inappropriate. Then, continue to adjust the scanning parameters of the laser scanning sensor and re-determine the adjustment parameters. During the previous adjustment, the exposure time has been increased according to the pixel gray value of the first area. In this adjustment, the exposure time may continue to increase, and there is a possibility that the exposure time of the adjustment parameters is too long. Therefore, it is necessary to determine whether the exposure time of the adjustment parameters exceeds the exposure adjustable time of the light-sensing receiving module, that is, to determine whether the exposure time of the adjustment parameters is greater than the upper limit value of the exposure time. If the exposure time of the adjustment parameters is less than or equal to the upper limit value of the exposure time, it indicates that the exposure time of the re-determined adjustment parameters does not exceed the exposure adjustable time of the light-sensing receiving module. Then, return to execute the step of obtaining the image information of the adjustment image obtained by the laser scanning sensor scanning the workpiece to be measured when the scanning parameters of the laser scanning sensor are the adjustment parameters. If the exposure time of the adjustment parameters is greater than the upper limit value of the exposure time, it indicates that the exposure time of the re-determined adjustment parameters exceeds the exposure adjustable time of the light-sensing receiving module, that is, it exceeds the adjustment range of the light-sensing receiving module. On the premise of not exceeding the adjustment range of the light-sensing receiving module, use the upper limit value of the exposure time as the adjustment parameter of the scanning parameters of the laser scanning sensor, re-scan the component to be measured, obtain the image information of the maximum exposure image after adjustment, and determine whether the pixel gray value of the exposure area corresponding to the first area in the initial image in the maximum exposure image is within the standard gray range, that is, to determine whether the brightness of the exposure area is reasonable. If the brightness of the exposure area is reasonable, it indicates that this adjustment is successful, and the maximum exposure image is the adjustment parameter. If the brightness of the exposure area is unreasonable, it indicates that this adjustment is not successful. Limited by the adjustment range of the laser scanning sensor, especially, limited by the adjustment range of the light-sensing receiving module, the adjustment range of the laser scanning sensor can be expanded by increasing the laser power of the laser emission module. After expanding the adjustment range of the laser scanning sensor, that is, after increasing the laser power of the laser emission module, continue to use the upper limit value of the exposure time as the adjustment parameter of the scanning parameters of the laser scanning sensor, re-scan the component to be measured, obtain the image information of the maximum exposure image after adjusting the laser power, and determine whether the pixel gray value of the exposure area corresponding to the first area in the initial image in the maximum exposure image at this time is within the standard gray range, that is, to determine whether the brightness of the exposure area is reasonable. If not, continue to increase the laser power of the laser emission module to further expand the adjustment range of the laser scanning sensor until the pixel gray value of the exposure area corresponding to the first area in the initial image in the maximum exposure image is within the standard gray range. Then, determine the maximum exposure image after adjusting the laser power as the adjustment image. Finally, perform image fusion based on the image information of the initial image and the image information of the adjustment image to obtain a detection image with reasonable brightness.
[0123] It can be understood that if the brightness of the first area is insufficient, after the exposure time is adjusted to the upper limit and the brightness of the first area is still insufficient, the laser power is increased. If the brightness of the first area is too high after the laser power is increased, the exposure time of the adjustment parameter can be re-determined.
[0124] Optionally, before increasing the laser power of the laser scanning sensor by a preset power increment, it includes: determining whether the laser power of the laser scanning sensor reaches the maximum laser power; if so, using the maximum laser power as the adjustment parameter of the laser scanning parameter, and then obtaining the image information of the maximum laser power image of the laser scanning sensor scanning the workpiece to be measured with this adjustment parameter, and combining the image information of the initial image to determine the detection image of the workpiece to be measured; if not, continue to increase the laser power of the laser scanning sensor by a preset power increment until the pixel gray value of the exposure area corresponding to the first area in the initial image in the maximum exposure image is within the standard gray range, and / or the laser power of the laser scanning sensor reaches the maximum laser power.
[0125] By adopting the dual adjustment method of exposure time and laser power in the embodiments of the present invention, the adjustment range of the laser scanning sensor is doubled. After adjustment, the reflectivity range of the workpiece to be measured that the laser scanning sensor can scan is greatly broadened, and high-brightness objects and extremely black objects can be detected simultaneously, and the detection result is better; adopting the dual adjustment method of exposure time and laser power can also effectively reduce the influence of environmental interference on the detection result. For example, when the environmental light interference is strong, the laser tube power can be increased, the exposure time can be reduced, and the influence of environmental light on the imaging quality can be reduced; when the environmental noise interference is large, the laser tube power and integration time can be increased to increase the image signal-to-noise ratio.
[0126] Embodiment Six
[0127] Figure 9 It is a flowchart of a dynamic adjustment method of a laser scanning sensor provided in Embodiment Six of the present invention. In this embodiment, steps related to the adjustment order of the adjustment parameter are added before returning to execute the step of obtaining the image information of the adjustment image of the laser scanning sensor scanning the workpiece to be measured when the scanning parameter of the laser scanning sensor is the adjustment parameter. As Figure 9 shown, the method includes:
[0128] S6001. When the scanning parameter of the laser scanning sensor is the initial scanning parameter, obtain the image information of the initial image of the laser scanning sensor scanning the workpiece to be measured.
[0129] S6002. According to the image information, determine the gray distribution of the pixel gray values in the initial image.
[0130] S6003. Based on the gray-scale distribution of pixel gray-scale values, determine whether there is a first region in the initial image. If so, execute S6004.
[0131] S6004. Determine the adjustment parameter of the scanning parameter of the laser scanning sensor according to the pixel gray-scale values of the first region.
[0132] S6005. When the scanning parameter of the laser scanning sensor is the adjustment parameter, obtain the image information of the adjusted image obtained by the laser scanning sensor scanning the workpiece to be measured.
[0133] S6006. Determine the pixel gray-scale values of the adjusted region corresponding to the first region in the initial image in the adjusted image according to the image information of the adjusted image.
[0134] S6007. Determine whether the pixel gray-scale values of the adjusted region are within the standard gray-scale range. If not, execute S6008; if so, execute S6015.
[0135] S6008. Re-determine the adjustment parameter of the laser scanning sensor according to the pixel gray-scale values of the adjusted region.
[0136] S6009. Determine whether the exposure time is less than the lower limit value of the exposure time. If so, execute S6010.
[0137] S6010. Use the lower limit value of the exposure time as the adjustment parameter of the scanning parameter of the laser scanning sensor.
[0138] S6011. When the exposure time of the laser scanning sensor is the lower limit value of the exposure time, obtain the image information of the minimum exposure image obtained by the laser scanning sensor scanning the workpiece to be measured.
[0139] S6012. According to the image information of the minimum exposure image, determine whether the pixel gray-scale values of the exposure region corresponding to the first region in the initial image in the minimum exposure image are within the standard gray-scale range. If not, execute S6013; if so, execute S6014.
[0140] S6013. After reducing the laser power of the laser scanning sensor by a preset power reduction amount, re-obtain the image information of the minimum exposure image obtained by the laser scanning sensor scanning the workpiece to be measured. Then return to execute S6012.
[0141] S6014. Determine the minimum exposure image as the adjusted image. Then return to execute S6005.
[0142] S6015. Determine the detection image of the workpiece to be measured according to the image information of the initial image and the image information of the adjusted image.
[0143] Exemplarily, if the pixel grayscale value of the adjustment area in the adjustment image corresponding to the first area in the initial image is no longer within the standard grayscale range, it means that the brightness of the adjustment area is not appropriate, and the scanning parameters of the laser scanning sensor are continued to be adjusted to redefine the adjustment parameters. In the previous adjustment, the exposure time has been reduced according to the pixel grayscale value of the first area. This adjustment may continue to reduce the exposure time. The exposure time of the adjustment parameter may be too short. Therefore, it is necessary to determine whether the exposure time of the adjustment parameter exceeds the adjustable exposure time of the light-sensing receiving module, that is, to determine whether the exposure time of the adjustment parameter is less than the lower limit of the exposure time. If the exposure time of the adjustment parameter is greater than or equal to the lower limit of the exposure time, it means that the exposure time of the re-determined adjustment parameter does not exceed the adjustable exposure time of the light-sensing receiving module, and then return to the step of obtaining the image information of the adjustment image of the workpiece to be measured scanned by the laser scanning sensor when the scanning parameter of the laser scanning sensor is the adjustment parameter. If the exposure time of the adjustment parameter is less than the lower limit of the exposure time, it means that the exposure time of the re-determined adjustment parameter exceeds the adjustable exposure time of the light-sensitive receiving module, that is, it exceeds the adjustment range of the light-sensitive receiving module. Under the premise of not exceeding the adjustment range of the light-sensitive receiving module, the lower limit of the exposure time is used as the adjustment parameter of the scanning parameter of the laser scanning sensor, and the component to be tested is rescanned to obtain the image information of the adjusted minimum exposure image, and it is determined whether the pixel grayscale value of the exposure area corresponding to the minimum exposure image and the first area in the initial image is within the standard grayscale range, that is, whether the brightness of the exposure area is reasonable. If the brightness of the exposure area is reasonable, it means that the adjustment is successful, and the minimum exposure image is the adjustment parameter. If the brightness of the exposure area is unreasonable, it means that the adjustment is unsuccessful. Due to the limitation of the adjustment range of the laser scanning sensor, especially the limitation of the adjustment range of the light-sensitive receiving module, the adjustment range of the laser scanning sensor can be expanded by reducing the laser power of the laser emitting module. After expanding the adjustment range of the laser scanning sensor, that is, after reducing the laser power of the laser emission module, continue to use the lower limit value of the exposure time as the adjustment parameter of the scanning parameter of the laser scanning sensor, re-scan the component to be tested, obtain the image information of the minimum exposure image after adjusting the laser power, and judge whether the pixel grayscale value of the exposure area corresponding to the first area in the initial image in the minimum exposure image at this time is within the standard grayscale range, that is, judge whether the brightness of the exposure area is reasonable; if not, continue to reduce the laser power of the laser emission module to further expand the adjustment range of the laser scanning sensor, until the pixel grayscale value of the exposure area corresponding to the first area in the initial image in the maximum exposure image is within the standard grayscale range, and then determine the minimum exposure image after adjusting the laser power as the adjustment image; finally, perform image fusion based on the image information of the initial image and the image information of the adjustment image to obtain a detection image with reasonable brightness.
[0144] It can be understood that if the brightness of the first area is too high, after adjusting the exposure time to reach the lower limit and the brightness of the first area is still too high, the laser power is reduced. If the brightness of the first area is insufficient after reducing the laser power, the exposure time of the adjustment parameter can be re-determined.
[0145] Optionally, before reducing the laser power of the laser scanning sensor in a preset power increment, it includes: determining whether the laser power of the laser scanning sensor reaches the minimum laser power; if so, taking the minimum laser power as the adjustment parameter of the laser scanning parameter, and then obtaining the image information of the minimum laser power image of the laser scanning sensor scanning the workpiece to be measured with this adjustment parameter, and combining the image information of the initial image to determine the detection image of the workpiece to be measured; if not, continue to reduce the laser power of the laser scanning sensor in a preset power increment until the pixel gray value of the exposure area corresponding to the first area in the initial image in the minimum exposure image is within the standard gray range, and / or the laser power of the laser scanning sensor reaches the minimum laser power.
[0146] By adopting the dual adjustment method of exposure time and laser power in the embodiments of the present invention, the adjustment range of the laser scanning sensor is doubled. After adjustment, the reflectivity range of the workpiece to be measured that the laser scanning sensor can scan is greatly broadened, and high-brightness objects and extremely black objects can be detected simultaneously, and the detection result is better; adopting the dual adjustment method of exposure time and laser power can also effectively reduce the influence of environmental interference on the detection result. For example, when the environmental light interference is strong, the laser tube power can be increased and the exposure time can be reduced to reduce the influence of environmental light on the imaging quality; when the environmental noise interference is large, the laser tube power and integration time can be increased to increase the image signal-to-noise ratio.
[0147] Embodiment Seven
[0148] Based on the same inventive concept, Figure 10 is a schematic structural diagram of a dynamic adjustment device for a laser scanning sensor provided in Embodiment Six of the present invention. As Figure 10 shown, the device includes:
[0149] An initial image information acquisition module 910, configured to acquire the image information of the initial image of the laser scanning sensor scanning the workpiece to be measured when the scanning parameter of the laser scanning sensor is the initial scanning parameter;
[0150] A gray level distribution determination module 920, configured to determine the gray level distribution of the pixel gray values in the initial image according to the image information;
[0151] A region determination module 930, configured to determine whether there is a first region in the initial image based on the gray level distribution of the pixel gray values; the first region is a region where the pixel gray value exceeds the standard gray range;
[0152] An adjustment parameter determination module 940, configured to determine an adjustment parameter of a scanning parameter of the laser scanning sensor according to pixel gray values of the first region when the first region exists;
[0153] An adjusted image information acquisition module 950, configured to acquire image information of an adjusted image obtained by scanning a workpiece to be measured by the laser scanning sensor when a scanning parameter of the laser scanning sensor is the adjustment parameter;
[0154] An inspection image determination module 960, configured to determine an inspection image of the workpiece to be measured according to the image information of the original image and the image information of the adjusted image.
[0155] The dynamic adjustment device of the laser scanning sensor provided by an embodiment of the present invention can execute the dynamic adjustment method of the laser scanning sensor provided by any embodiment of the present invention, and has function modules and beneficial effects corresponding to the execution of the method.
[0156] Embodiment VIII
[0157] Figure 11 The block diagram of the laser scanning sensor shows the structure of the laser scanning sensor that can be used to implement the embodiments of the present invention. The laser scanning sensor is intended to represent various forms of laser scanning sensors. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0158] As Figure 11 shown, the laser scanning sensor 100 includes at least one laser emission module 120, at least one light sensing and receiving module 130, and a dynamic adjustment device 110 of the laser scanning sensor. Among them, the acquisition device 110 of the laser scanning sensor is configured to execute the dynamic adjustment method of the laser scanning sensor of any embodiment of the present invention, and the dynamic adjustment device 110 of the laser scanning sensor can be, for example, various general and / or special processing components with processing and computing capabilities. Some examples of the dynamic adjustment device 110 of the optical scanning sensor include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The laser emission module 120 is configured to emit laser to the surface of the workpiece to be measured, and the light sensing and receiving module 130 is configured to receive the laser reflected by the surface of the workpiece to be measured. The light sensing and receiving module 130 includes, but is not limited to, photosensitive devices such as CMOS, CCD, and PD arrays.
[0159] Optionally, continue to refer to Figure 10, the laser scanning sensor 100 further includes a host computer 140. The host computer 140 can be used to display the detection results of the laser scanning sensor and can also be used to adjust scanning parameters and other operations on the laser scanning sensor. Exemplarily, the host computer can be a graphical user interface (Graphical User Interface, abbreviated as GUI, also known as graphical user interface), or it can be other devices with display and operation functions.
[0160] The laser scanning sensor provided by the embodiment of the present invention can execute the dynamic adjustment method of the laser scanning sensor provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0161] It should be understood that various forms of processes shown above can be used, steps can be reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0162] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub - combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A dynamic adjustment method for a laser scanning sensor, characterized in that, it includes: When the scanning parameters of the laser scanning sensor are initial scanning parameters, obtaining the image information of the initial image of the laser scanning sensor scanning a workpiece to be measured; According to the image information, determining the gray distribution of the pixel gray values in the initial image; Based on the gray distribution of the pixel gray values, determining whether there is a first region in the initial image; the first region is a region where the pixel gray values exceed the standard gray range; If so, determining an adjustment parameter of the scanning parameters of the laser scanning sensor according to the pixel gray values of the first region; When the scanning parameters of the laser scanning sensor are adjustment parameters, obtaining the image information of the adjusted image of the laser scanning sensor scanning the workpiece to be measured; Combining the region where the pixel gray values are within the standard gray range in the initial image and the region corresponding to the first region in the adjusted image to determine the detection image of the workpiece to be measured.
2. The dynamic adjustment method for a laser scanning sensor according to claim 1, characterized in that, Determining the gray distribution of the pixel gray values in the initial image according to the image information includes: Dividing the pixels in the initial image into multiple pixel columns; each pixel column includes multiple pixels arranged in sequence along the column direction; the column direction is the scanning direction of the laser scanning sensor scanning the workpiece to be measured; According to the image information, determining the maximum gray value of each pixel gray value in each pixel column; Counting the histogram of the maximum gray values of each pixel column as the gray distribution of the pixel gray values in the initial image.
3. The dynamic adjustment method for a laser scanning sensor according to claim 1, characterized in that, The scanning parameters include exposure time; Determining the adjustment parameter of the scanning parameters of the laser scanning sensor according to the pixel gray values of the first region includes: According to the first calculation formula, obtain the exposure time T of the adjustment parameter based on the average gray value M of the maximum gray values of each pixel column in the first region 1 , the gray standard value M 0 and the exposure time T of the initial scanning parameter 1 ; Wherein, each pixel column includes multiple pixels arranged in sequence along the column direction; the column direction is the scanning direction of the laser scanning sensor scanning the workpiece to be measured; The first calculation formula is:
4. The dynamic adjustment method for a laser scanning sensor according to claim 1, characterized in that, Before combining the region where the pixel gray values are within the standard gray range in the initial image and the region corresponding to the first region in the adjusted image to determine the detection image of the workpiece to be measured, it further includes: According to the image information of the adjusted image, determining the pixel gray values of the adjusted region corresponding to the first region in the initial image in the adjusted image; Judging whether the pixel gray values of the adjusted region are within the standard gray range; If not, re-determining the adjustment parameters of the laser scanning sensor according to the pixel gray values of the adjusted region, and returning to execute the step of obtaining the image information of the adjusted image of the laser scanning sensor scanning the workpiece to be measured when the scanning parameters of the laser scanning sensor are adjustment parameters; If so, perform the step of combining the pixel gray values in the initial image in the standard gray range area and the area corresponding to the first area in the adjusted image to determine the detection image of the workpiece to be measured.
5. The dynamic adjustment method of the laser scanning sensor according to claim 4, wherein, the adjustment parameters include exposure time and laser power; before returning to execute the step of obtaining the image information of the adjusted image obtained by scanning the workpiece to be measured by the laser scanning sensor when the scanning parameter of the laser scanning sensor is the adjustment parameter, further comprising: judging whether the exposure time is greater than the upper limit value of the exposure time; if so, taking the upper limit value of the exposure time as the adjustment parameter of the scanning parameter of the laser scanning sensor; when the exposure time of the laser scanning sensor is the upper limit value of the exposure time, obtaining the image information of the maximum exposure image obtained by scanning the workpiece to be measured by the laser scanning sensor; judging whether the pixel gray value of the exposure area corresponding to the first area in the initial image in the maximum exposure image is within the standard gray range according to the image information of the maximum exposure image; if not, after increasing the laser power of the laser scanning sensor by a preset power increment, re-obtaining the image information of the maximum exposure image obtained by scanning the workpiece to be measured by the laser scanning sensor, and returning to execute the step of judging whether the pixel gray value of the exposure area corresponding to the first area in the initial image in the maximum exposure image is within the standard gray range according to the image information of the maximum exposure image; if so, determining the maximum exposure image as the adjusted image.
6. The dynamic adjustment method of the laser scanning sensor according to claim 4, wherein, the adjustment parameters include exposure time and laser power; before returning to execute the step of obtaining the image information of the adjusted image obtained by scanning the workpiece to be measured by the laser scanning sensor when the scanning parameter of the laser scanning sensor is the adjustment parameter, further comprising: judging whether the exposure time is less than the lower limit value of the exposure time; if so, taking the lower limit value of the exposure time as the adjustment parameter of the scanning parameter of the laser scanning sensor; when the exposure time of the laser scanning sensor is the lower limit value of the exposure time, obtaining the image information of the minimum exposure image obtained by scanning the workpiece to be measured by the laser scanning sensor; judging whether the pixel gray value of the exposure area corresponding to the first area in the initial image in the minimum exposure image is within the standard gray range according to the image information of the minimum exposure image; if not, after reducing the laser power of the laser scanning sensor by a preset power reduction amount, re-obtaining the image information of the minimum exposure image obtained by scanning the workpiece to be measured by the laser scanning sensor, and returning to execute the step of judging whether the pixel gray value of the exposure area corresponding to the first area in the initial image in the minimum exposure image is within the standard gray range according to the image information of the minimum exposure image; if so, determining the minimum exposure image as the adjusted image.
7. The dynamic adjustment method of the laser scanning sensor according to claim 1, characterized in that, further comprising: If the first region does not exist in the initial image, the initial image is determined as the detection image of the workpiece to be measured.
8. A dynamic adjustment device for a laser scanning sensor, characterized in that, comprising: An initial image information acquisition module, configured to acquire the image information of the initial image obtained by the laser scanning sensor scanning the workpiece to be measured when the scanning parameter of the laser scanning sensor is the initial scanning parameter; A gray-scale distribution determination module, configured to determine the gray-scale distribution of the pixel gray-scale values in the initial image according to the image information; A region judgment module, configured to judge whether a first region exists in the initial image based on the gray-scale distribution of the pixel gray-scale values; the first region is a region where the pixel gray-scale value exceeds the standard gray-scale range; An adjustment parameter determination module, configured to determine the adjustment parameter of the scanning parameter of the laser scanning sensor according to the pixel gray-scale value of the first region when the first region exists; An adjusted image information acquisition module, configured to acquire the image information of the adjusted image obtained by the laser scanning sensor scanning the workpiece to be measured when the scanning parameter of the laser scanning sensor is the adjustment parameter; A detection image determination module, configured to splice the region where the pixel gray-scale value is within the standard gray-scale range in the initial image and the region corresponding to the first region in the adjusted image to determine the detection image of the workpiece to be measured.
9. A laser scanning sensor, comprising a laser emission module, a light sensing and receiving module, and a dynamic adjustment device for the laser scanning sensor, characterized in that, the dynamic adjustment device is configured to execute the dynamic adjustment method of the laser scanning sensor according to any one of claims 1 to 7.
Citation Information
Patent Citations
Detection method for identifying surface quality of continuous laser seam of metal workpiece online
CN106442543A
Exposure adjustment method and device, computer equipment and storage medium
CN109510948A