Three-dimensional measurement method, device and storage medium with automatic brightness adjustment function
By extracting the grayscale value and row coordinates of the center pixel of the region of interest in the image of the object under test using 3D measurement technology, and dynamically adjusting the brightness, the problems of low brightness adjustment accuracy and slow speed in existing technologies are solved, and efficient and fast 3D measurement is achieved.
Patent Information
- Application Number
- CN202410236657.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2044-03-01
AI Technical Summary
In existing 3D measurement technologies, images acquired by image sensors contain many background points and relatively few light points, resulting in low accuracy in calculating average grayscale values, susceptibility to interference, and slow feedback speed, which affects the accuracy of measurement results.
By extracting the grayscale value and row coordinates of the center pixel of the region of interest in the image of the object to be tested, setting a grayscale threshold to filter background points, and dynamically adjusting the brightness of the lighting device until the average grayscale value of the region of interest meets the threshold, fast and accurate brightness adjustment is achieved.
It achieves fast and accurate brightness adjustment, reduces interference from background and non-target light, improves the accuracy and response speed of 3D measurement, is suitable for hardware implementation, and has low resource consumption.
Smart Images

Figure CN118067031B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a three-dimensional measurement method, device, and storage medium with automatic brightness adjustment function. Background Technology
[0002] Measurement technology, as an essential skill, is becoming increasingly important in industrial production processes. Compared to traditional contact measurement techniques, non-contact measurement using machine vision offers advantages such as higher measurement accuracy, avoidance of damage to the measured object, and greater ease of use, leading to its wider application. For example, spectral confocal microscopy uses polychromatic light to illuminate the object under test through a dispersive lens. Different colors of light are focused at different positions on the axis. A spectrometer separates the reflected light of different wavelengths focused on the object's surface, and a conventional image sensor captures the position of the reflected light to obtain the object's three-dimensional measurement information. Similarly, line laser displacement sensors use an image sensor to capture the laser line information projected onto the object's surface by a line laser generator. Based on the principle of laser triangulation, they obtain the object's three-dimensional measurement information.
[0003] In a 3D measurement system, in order to maintain a suitable grayscale value for the light signal generated by the surface of the object of interest and prevent it from being too dark or too exposed, it is necessary to adjust the brightness of the illumination device in real time and quickly based on the brightness of the light signal generated by the surface of the object acquired by the image sensor, so as to avoid measurement errors.
[0004] Currently, most existing solutions rely on the average grayscale value of the entire image captured by the image sensor as feedback to dynamically adjust the brightness of the lighting device. For example, Chinese Patent CN 111366104 A discloses a scanning method, device, and electronic device with automatic brightness adjustment function. The method includes: acquiring an image of the object to be scanned under the current ambient brightness; calculating the image brightness of the object image according to a preset calculation strategy, and determining whether the image brightness is within a preset brightness range; if the image brightness is within the preset brightness range, calculating a brightness adjustment value for the ambient brightness; adjusting the ambient brightness according to the brightness adjustment value and the preset adjustment strategy; and scanning the object to be scanned based on the adjusted ambient brightness.
[0005] In practical applications, on the one hand, most of the area in the image acquired by the image sensor is the background. On the other hand, if there are multiple reflective surfaces other than the object being measured, several additional layers of reflected light will be acquired, significantly affecting the reflected light from the surface of the object of interest. Therefore, using the average grayscale value of the entire image to evaluate the brightness of the lighting device will result in low accuracy and susceptibility to interference, leading to inaccurate 3D measurement results.
[0006] Furthermore, existing techniques for analyzing the center of light rays in images have several drawbacks. First, there is the issue of accuracy in extracting the center of light rays. Second, as disclosed in Chinese Patent CN 116051454 A, a method, apparatus, device, and storage medium for extracting the center of a laser line uses software processing, which involves a large and complex computational load, consumes a lot of resources, and cannot achieve rapid feedback, ultimately affecting the three-dimensional measurement results.
[0007] Chinese patent CN 112689097A discloses an automatic brightness control method, system, and storage medium for a line laser. The method includes: acquiring a digital signal of a scanned image, where the digital signal is obtained by photoelectric conversion of reflected light by a CCD / CMOS image sensor in a 3D contour scanning camera; filtering the acquired digital signal to obtain a histogram; extracting information of interest from the histogram and calculating a current brightness evaluation value; determining the target laser power of the line laser based on the current brightness evaluation value, and driving a change in the output power of the line laser. This patented method is applicable to industrial laser 3D contour scanning cameras, but the data processed is massive, generally requiring software statistical processing, and cannot provide timely feedback.
[0008] In summary, the shortcomings of existing technologies are as follows: (1) The background points are numerous and account for a large proportion, while the light points account for a relatively small proportion. They contribute little to the calculation of the average gray value, and the feedback value is affected by a large number of background points, resulting in low accuracy. (2) There may be light reflected from other reflective surfaces, which will also be involved in the calculation of the average gray value, causing the average gray value of the feedback to deviate. In the end, the gray value of the light reflected from the surface of the object of interest is not near the expected value. (3) Software is often used for statistics and calculations, resulting in a delay in feedback speed and slow adjustment speed. Summary of the Invention
[0009] This invention proposes a three-dimensional measurement method, device, and storage medium with automatic brightness adjustment function, which can at least solve one of the above-mentioned technical problems.
[0010] To achieve the above objectives, this invention proposes a three-dimensional measurement method with automatic brightness adjustment function, comprising: A three-dimensional measurement method with automatic brightness adjustment function, comprising acquiring an image of the object to be measured, including: Store the grayscale value and row coordinates of the center pixel of several light regions in the image, and use the column coordinates of the center pixel as the storage address of the center pixel; If the average gray value of the area of interest is outside the second gray threshold, adjust the brightness of the light source until the new average gray value is within the second gray threshold. Obtain the row and column coordinates of the center pixel corresponding to the new average gray value, reconstruct and output the three-dimensional measurement results of the object under test.
[0011] Furthermore, the storage of the grayscale value and row coordinates of the center pixel of several light regions in the image includes: storing the grayscale value and row coordinates of the pixel of any light region, and extracting the grayscale value and row coordinates of the center pixel of the current light region.
[0012] Furthermore, storing the grayscale value and row coordinates of pixels in any light region includes: setting a first grayscale threshold; comparing the grayscale value of any pixel with the first grayscale threshold sequentially according to the arrival order of row data in the image; if it is lower than the first grayscale threshold, it is determined to be background and background pixels are filtered out; otherwise, it is determined to be a light region, and the grayscale value and row coordinates of the pixel are stored in the corresponding storage unit, with the column coordinates of the pixel as the storage address.
[0013] Further, the step of extracting the gray value and row coordinates of the center pixel of the current light region includes: comparing the gray value of each column of pixels with the gray value of the already stored pixels according to the arrival order of the row data of the light region, so that the current storage unit only retains the gray value and row coordinates of the pixels with high gray values; based on the arrival order of the row data in the image, when the gray value of the arriving pixel is less than the first gray value threshold, the storage update of the current light region ends.
[0014] Furthermore, the grayscale value and row coordinates of the center pixel of the current light region are extracted. Then, based on the arrival order of the row data in the image, when the grayscale value of the arriving pixel is again within the first grayscale threshold, it is determined to enter the next light region. The above operation is repeated, and the center pixel of the next light region is stored.
[0015] Furthermore, the region of interest is the region of light in the image containing the central pixel of the object to be measured.
[0016] On the other hand, the present invention also proposes a three-dimensional measuring device with automatic brightness adjustment function, comprising: An image acquisition device acquires image data of the object under test based on the brightness conditions set by the lighting device. The processing device is used to receive image data of the object under test, acquire an image of the object under test; store the gray value and row coordinates of the center pixels of several light regions in the image, and use the column coordinates of the center pixels as the storage address of the center pixels; select the center pixels of the light regions of interest and calculate the average gray value; determine whether the average gray value meets the brightness requirements, and if it does not meet the brightness requirements, feed back the judgment result to the image acquisition device and the illumination device; if it meets the brightness requirements, reconstruct and output the three-dimensional measurement result of the object under test. Lighting device, used to set the brightness conditions for image acquisition of the object under test.
[0017] Further, the storage of the grayscale value and row coordinates of the center pixels of several light regions in the image includes: setting a first grayscale threshold; comparing the grayscale value of any pixel with the first grayscale threshold sequentially according to the arrival order of row data in the image; if it is lower than the first grayscale threshold, it is determined to be background and the background pixels are filtered out; otherwise, it is determined to be a light region, and the grayscale value and row coordinates of the pixels in the current light region are stored in the corresponding storage unit, and the column coordinates of the pixel are used as the storage address.
[0018] Furthermore, it also includes: comparing the gray value of each column of pixels with the gray value of the already stored pixels according to the arrival order of the row data of the light region, so that the current storage unit only retains the gray value and row coordinate of the pixel with the higher gray value; based on the arrival order of the row data in the image, when the gray value of the arriving pixel is less than the first gray value threshold, the storage update of the current light region ends, and the extraction of the gray value and row coordinate of the center pixel of the current light region is completed.
[0019] Furthermore, after extracting the grayscale value and row coordinates of the center pixel of the current light region, the process also includes: based on the arrival order of row data in the image, when the grayscale value of the arriving pixel is again within the first grayscale threshold, it is determined to enter the next light region, the above operation is repeated, and the center pixel of the next light region is stored.
[0020] In another aspect, the present invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the three-dimensional measurement method with automatic brightness adjustment function as described above.
[0021] The beneficial effects of this invention are as follows: This invention proposes a three-dimensional measurement method with automatic brightness adjustment function, which is suitable for hardware implementation, has a fast implementation speed, requires little storage space, and occupies few resources.
[0022] The method described in this invention extracts the grayscale value of the surface reflected light of the object of interest in the image of the object under test, and uses this as feedback to dynamically adjust the brightness conditions during the three-dimensional measurement process. This minimizes interference from background and other non-target light sources, allowing the brightness of the reflected light from the object under test to quickly stabilize within the expected range, thus acquiring an image of the object under test that meets the brightness requirements. Furthermore, by combining it with a high frame rate image acquisition device, rapid and real-time automatic adjustment of brightness conditions can be achieved.
[0023] Furthermore, this invention simultaneously retains the row and column coordinates of pixels during the brightness adjustment process and updates them in real time to obtain the row and column coordinates of the object under test. Based on the principle of three-dimensional reconstruction, it reconstructs the three-dimensional information of the object under test, thereby achieving high responsiveness and high-speed real-time three-dimensional measurement. Attached Figure Description
[0024] Figure 1 This is a flowchart of the three-dimensional measurement method with automatic brightness adjustment function in this invention; Figure 2 This is a schematic diagram of the image of the object to be tested in this invention; Figure 3 This is a schematic diagram of the process for extracting the center pixel in this invention; Figure 4 This is a schematic diagram of the structure of the three-dimensional measuring device with automatic brightness adjustment function in this invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0026] like Figure 1 As shown, this invention proposes a three-dimensional measurement method with automatic brightness adjustment function, comprising: S1 acquires an image of the object to be tested.
[0027] S101 acquires image data of the object under test based on the brightness conditions set by the light source. The image data is 2D image data generated by light reflected from the surface of the object under test. In this embodiment, the light source is an illumination device used to set the brightness when acquiring image data of the object under test.
[0028] S102 acquires an image of the object under test based on the image data of the object under test.
[0029] like Figure 2As shown, the image data of the object under test is decoded and rearranged to reconstruct a 2D image, i.e., the image of the object under test. The image of the object under test displays several bright rays reflected from the surface of the object under test or other interfering objects. Each ray of light produces a relatively bright area on the 2D image, which is the ray region. The central pixel of the ray region is the pixel with the largest gray value at the location illuminated by the ray, that is, the pixel with the maximum gray value in any column within the ray region. The distribution of the central pixels of the ray region follows a normal distribution law, that is, the gray value gradually decreases from the center to the edge of the ray region until it matches the gray value of the background. In this embodiment, the "center of the ray region" is not equivalent to the center position of the ray region in the image, but is only used to refer to the position with the largest gray value in the ray region.
[0030] The images of the object under test arrive sequentially from left to right, line by line, following the output data order of a conventional image sensor.
[0031] S2 stores the grayscale value and row coordinates of the center pixels of several light regions in the image, and uses the column coordinates of any center pixel as the storage address of that point.
[0032] The storage of grayscale values and row coordinates of the center pixels of several light regions in the image includes: storing the grayscale values and row coordinates of pixels in any light region, and extracting the grayscale values and row coordinates of the center pixels of the current light region.
[0033] like Figure 3 As shown, the details are as follows: S201 stores the grayscale value and row coordinates of pixels in any light-emitting region: sets a first grayscale threshold, filters background pixels, and stores the grayscale value of pixels in any light-emitting region. According to the arrival order of row data in the image, compares the grayscale value of any pixel with the first grayscale threshold in turn; if it is lower than the first grayscale threshold, it is determined to be the background and the background pixels are filtered out; otherwise, it is determined to be a light-emitting region, and the grayscale value and row coordinates of the pixel are stored in the corresponding storage unit, with the column coordinates of the pixel as the storage address.
[0034] S202 extracts the grayscale value and row coordinates of the center pixel of the current light region: according to the arrival order of the row data of the light region, the grayscale value of each column of pixels is compared with the grayscale value of the already stored pixels, so that the current storage unit only retains the grayscale value and row coordinates of the pixels with higher grayscale values.
[0035] In this embodiment, under the same column coordinates, the pixels with higher gray values are retained by comparing the gray values of the pixels in order to extract the center pixel in any light region.
[0036] Based on the arrival order of row data in the image, when the gray value of the arriving pixel is less than the first gray value threshold, the storage update of the current light area ends.
[0037] S203 is based on the arrival order of row data in the image. When the gray value of the arriving pixel is again within the first gray value threshold, it is determined to enter the next light area. S201-S202 are repeated to store the gray value of the pixel in the next light area. This continues until the gray value and row coordinates of the center pixel of all light areas in the image are extracted and stored at the column coordinates.
[0038] S3 selects the center pixel of the region of interest (ROI). The ROI is the area of light in the image containing the center pixel of the object under test. Selection strategies include, but are not limited to, the top layer, the bottom layer, and the brightest layer. The features and position of the object under test are adjusted, and an appropriate selection strategy is chosen to preserve the data of pixels reflecting light from the surface of the object of interest.
[0039] S4 calculates the average grayscale value of the region of interest. Based on the number of center pixels and the grayscale values of each pixel in the selected region of interest, the average grayscale value of the center pixels in the region of interest is obtained.
[0040] S5 sets a second grayscale threshold and determines whether the average grayscale value meets the brightness requirements. If the average grayscale value of the area of interest is outside the second grayscale threshold, it is determined that it does not meet the requirements. The light source brightness is adjusted, and the above operation (S1-S4) is repeated until the new average grayscale value is within the second grayscale threshold. If it does meet the requirements, proceed to S6. In this embodiment, the feedback adjustment of the light source brightness condition can adopt a conventional feedback adjustment algorithm, including but not limited to PID control algorithm.
[0041] The specific range of the second grayscale threshold is set according to the application scenario and user needs of the method, and is not specifically limited in this embodiment.
[0042] S6 acquires an image that meets the brightness requirements, obtains the row and column coordinates of the center pixel corresponding to the new average gray value, reconstructs and outputs the three-dimensional measurement results of the object under test.
[0043] Based on the principle of three-dimensional measurement, three-dimensional depth information is converted into row coordinates on a two-dimensional image. Based on the acquired row and column coordinates, the three-dimensional information of the light reflected from the surface of the object under test is reconstructed, thereby realizing three-dimensional measurement.
[0044] The three-dimensional measurement results output by this implementation include, but are not limited to, the size information of the object under test obtained by direct measurement, or the area, volume and other information obtained by calculation, or other measurement and calculation results.
[0045] like Figure 4 As shown, based on the same inventive concept, the present invention also proposes a three-dimensional measuring device with automatic brightness adjustment function, applicable to the above-mentioned three-dimensional measuring method with automatic brightness adjustment function, as detailed below: An image acquisition device acquires image data of an object under test based on the brightness conditions set by a lighting device. In this embodiment, the image acquisition device includes an image sensor, which receives and acquires light reflected from the surface of the object under test, generates 2D image data, and sends it to a processing device.
[0046] The processing device is used to receive image data of the object under test, acquire an image of the object under test; store the gray values and row coordinates of the center pixels of several light regions in the image, and use the column coordinates of any center pixel as the storage address of that point; select the center pixel of the light region of interest and calculate the average gray value; if the average gray value of the light region of interest is outside the second gray threshold, adjust the brightness of the illumination device until the new average gray value is within the second gray threshold; acquire the row coordinates and column coordinates of the center pixel corresponding to the new average gray value, reconstruct and output the three-dimensional measurement result of the object under test.
[0047] In this embodiment, the processing device is the main control chip. The main control chip is generally an FPGA, or an ASIC or other similar device.
[0048] In this embodiment, the main control chip has multiple processing modules internally, including: The data receiving module receives 2D image data sent by the image sensor, and after decoding and rearrangement, restores the 2D image, thus acquiring the image of the object under test.
[0049] The 2D image acquired in this embodiment displays bright light reflected from the surfaces of several objects under test or other interfering objects. Each ray of light produces a relatively bright area on the 2D image, which is called the ray region. The central pixel of the ray region is the pixel with the highest gray value at the location illuminated by the light, that is, the pixel with the highest gray value in any column within the ray region. The distribution of the central pixels of the ray region follows a normal distribution law, that is, the gray value gradually decreases from the center to the edge of the ray region until it matches the gray value of the background. The "center of the ray region" mentioned in this embodiment is not equivalent to the center position of the ray region in the image, but is only used to refer to the position with the highest gray value in the ray region.
[0050] The image of the object under test arrives from left to right, line by line, following the output data sequence of a conventional image sensor.
[0051] The ray center point extraction module is used to store the grayscale value and row coordinates of the center pixels of several ray regions in an image, using the column coordinates of the center pixels as their storage address. Storing the grayscale value and row coordinates of the center pixels of several ray regions in the image includes: storing the grayscale value and row coordinates of pixels in any ray region, and extracting the grayscale value and row coordinates of the center pixel of the current ray region.
[0052] In this implementation, hardware is used to extract the center pixels of several light regions in the image of the object under test in real time.
[0053] This module includes several storage units for storing data of the center pixels of several light-emitting regions in the image of the object under test. Each storage unit corresponds one-to-one with a light-emitting region in the image of the object under test, and the depth of any storage unit is equal to the number of pixels in any row of the image. This embodiment does not limit the number or depth of the storage units; their specific values are determined by considering the application scenario and available resources. In this embodiment, the storage units are implemented using the BRAM resources of the FPGA.
[0054] Specifically, storing the grayscale value and row coordinates of the center pixels of several light regions in the image includes: A first grayscale threshold is set. Based on the arrival order of row data in the image, the grayscale value of any pixel is sequentially compared with the first grayscale threshold. If the value is lower than the first grayscale threshold, it is determined to be background, and background pixels are filtered out. Conversely, if the value is higher, it is determined to be a light area, and the data of that pixel is stored in the corresponding storage unit, with the column coordinate of that pixel as the storage address. The data of that pixel includes the grayscale value and the row coordinate.
[0055] Based on the arrival order of row data in the light region, the gray value of each column of pixels is compared with the gray values of already stored pixels, so that the current storage unit only retains the data of pixels with higher gray values.
[0056] In this embodiment, under the same column coordinates, the pixels with higher gray values are retained by comparing the gray values of the pixels in order to extract the center pixel in any light region.
[0057] Based on the arrival order of row data in the image, when the gray value of the arriving pixel is less than the first gray value threshold, the storage update of the current light region ends, and the gray value and row coordinates of the center pixel of the current light region are extracted.
[0058] Based on the arrival order of row data in the image, when the gray value of an arriving pixel falls within the first gray threshold again, it is determined to enter the next light region. A new storage unit is then used to store the center pixel of the next light region.
[0059] Repeat the above operation until the storage unit contains data on the center pixels of all light regions in the image.
[0060] The ray center point filtering module selects the center pixel of the ray region of interest. The ray region of interest is the area in the image containing the center pixel of the object under test. Selection strategies for this module include, but are not limited to, the top layer, bottom layer, and brightest layer. The features and position of the object under test are adjusted, and an appropriate selection strategy is chosen to retain the data of pixels reflecting light from the surface of the object of interest.
[0061] The average grayscale value calculation module calculates the average grayscale value of the center pixel of the region of interest. Based on the number of center pixels in the selected region of interest and the grayscale values of each pixel, the average grayscale value of the center pixel of the region of interest is obtained.
[0062] The module control and logic judgment module sets a second grayscale threshold and determines whether the average grayscale value meets the brightness requirements. If the average grayscale value of the region of interest is outside the second grayscale threshold, it is determined that it does not meet the requirements, and the judgment result is fed back to the image acquisition device and the lighting device; if the average grayscale value of the region of interest is within the second grayscale threshold, it is determined that it meets the requirements, and the image that meets the brightness requirements is sent to the 3D reconstruction module.
[0063] The specific range of the second grayscale threshold is set according to the application scenario of the device and user needs, and is not specifically limited in this embodiment.
[0064] The 3D reconstruction module acquires an image that meets the brightness requirements. Based on the row and column coordinates of the center pixel of the extracted region of interest, it reconstructs the 3D information of the reflected light from the surface of the object under test and outputs the 3D measurement results of the object. The 3D measurement results output in this implementation include, but are not limited to, the directly measured size information of the object under test, or the calculated area, volume, or other measurement and calculation results.
[0065] The lighting device sets the brightness conditions for the image of the object to be measured; based on the feedback judgment results from the module control and logic judgment module, the brightness conditions are adjusted. In this embodiment, the feedback adjustment of the brightness conditions of the lighting device can employ conventional feedback adjustment algorithms, including but not limited to PID control algorithms.
[0066] Preferably, if the image acquisition device acquires image data using the principle of spectral confocality, then the lighting device includes an LED light source and an LED light source driving module. The LED light source driving module is connected to the module control and logic judgment module. Based on the judgment results fed back by the module control and logic judgment module, the power of the LED light source is adjusted, the brightness conditions are updated, and the LED light source is lit.
[0067] Preferably, if the image acquisition device uses the laser triangulation principle to acquire image data, the lighting device includes a line laser generator and a laser driving module. The line laser driving module is connected to the module control and logic judgment module. Based on the judgment results fed back by the module control and logic judgment module, it adjusts the output power of the line laser generator and updates the brightness conditions of the line laser emitted by the line laser generator.
[0068] In another aspect, the present invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the three-dimensional measurement method with automatic brightness adjustment function as described above.
[0069] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0070] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A three-dimensional measurement method with automatic brightness adjustment function, for acquiring an image of the object to be measured, characterized in that, include: Store the grayscale value and row coordinates of the center pixel of several light regions in the image, and use the column coordinates of the center pixel as the storage address of the center pixel; If the average gray value of the area of interest is outside the second gray threshold, adjust the brightness of the light source until the new average gray value is within the second gray threshold. Obtain the row and column coordinates of the center pixel corresponding to the new average gray value, reconstruct and output the three-dimensional measurement results of the object under test; The storage of the grayscale value and row coordinates of the center pixel of several light regions in the image includes: storing the grayscale value and row coordinates of the pixel of any light region, and extracting the grayscale value and row coordinates of the center pixel of the current light region; The extraction of the grayscale value and row coordinates of the center pixel of the current light region is as follows: Based on the arrival order of the row data of the light region, the grayscale value of each column of pixels is compared with the grayscale value of the already stored pixels, so that the current storage unit only retains the grayscale value and row coordinates of the pixels with higher grayscale values; based on the arrival order of the row data in the image, when the grayscale value of the arriving pixel is less than the first grayscale threshold, the storage update of the current light region ends.
2. The three-dimensional measurement method with automatic brightness adjustment function according to claim 1, characterized in that, The process of storing the grayscale value and row coordinates of pixels in any light region includes: setting a first grayscale threshold; comparing the grayscale value of any pixel with the first grayscale threshold sequentially according to the arrival order of row data in the image; if the grayscale value is lower than the first grayscale threshold, it is determined to be background and background pixels are filtered out; otherwise, it is determined to be a light region, and the grayscale value and row coordinates of the pixel are stored in the corresponding storage unit, with the column coordinates of the pixel as the storage address.
3. The three-dimensional measurement method with automatic brightness adjustment function according to claim 1, characterized in that, Extract the grayscale value and row coordinates of the center pixel of the current light region. Then, based on the arrival order of row data in the image, when the grayscale value of the arriving pixel is again within the first grayscale threshold, it is determined to enter the next light region. Repeat the above operation and store the center pixel of the next light region.
4. The three-dimensional measurement method with automatic brightness adjustment function according to claim 1, characterized in that, The region of interest is the ray region in the image containing the measurement information of the central pixel of the object to be measured.
5. A three-dimensional measuring device with automatic brightness adjustment function, characterized in that, include: An image acquisition device acquires image data of the object under test based on the brightness conditions set by the lighting device. The processing device is used to receive image data of the object to be tested, acquire the image of the object to be tested, store the gray value and row coordinates of the center pixel of several light regions in the image, and use the column coordinates of the center pixel as the storage address of the center pixel. Select the center pixel of the region of interest and calculate the average gray value; determine whether the average gray value meets the brightness requirements. If it does not meet the brightness requirements, the judgment result is fed back to the image acquisition device and the lighting device; if it meets the brightness requirements, reconstruct and output the three-dimensional measurement result of the object under test. The storage of the grayscale value and row coordinates of the center pixel of several light regions in the image includes: storing the grayscale value and row coordinates of the pixel of any light region, and extracting the grayscale value and row coordinates of the center pixel of the current light region; The extraction of the grayscale value and row coordinates of the center pixel of the current light region is as follows: Based on the arrival order of the row data of the light region, the grayscale value of each column of pixels is compared with the grayscale value of the already stored pixels, so that the current storage unit only retains the grayscale value and row coordinates of the pixels with higher grayscale values; Based on the arrival order of the row data in the image, when the grayscale value of the arriving pixel is less than the first grayscale threshold, the storage update of the current light region ends. Lighting device, used to set the brightness conditions for image acquisition of the object under test.
6. The three-dimensional measuring device with automatic brightness adjustment function according to claim 5, characterized in that, The storage of the grayscale value and row coordinates of the center pixels of several light regions in the image includes: setting a first grayscale threshold; comparing the grayscale value of any pixel with the first grayscale threshold according to the arrival order of row data in the image; if it is lower than the first grayscale threshold, it is determined to be the background and the background pixels are filtered out; otherwise, it is determined to be a light region, and the grayscale value and row coordinates of the pixels in the current light region are stored in the corresponding storage unit, and the column coordinates of the pixel are used as the storage address.
7. The three-dimensional measuring device with automatic brightness adjustment function according to claim 6, characterized in that, Also includes: Based on the arrival order of row data in the light region, the gray value of each column of pixels is compared with the gray value of the already stored pixels, so that the current storage unit only retains the gray value and row coordinate of the pixel with the higher gray value; Based on the arrival order of row data in the image, when the gray value of the arriving pixel is less than the first gray value threshold, the storage update of the current light region ends, and the gray value and row coordinates of the center pixel of the current light region are extracted.
8. The three-dimensional measurement method with automatic brightness adjustment function according to claim 7, characterized in that, After extracting the grayscale value and row coordinates of the center pixel of the current light region, the process also includes: based on the arrival order of row data in the image, when the grayscale value of the arriving pixel is again within the first grayscale threshold, it is determined to enter the next light region, the above operation is repeated, and the center pixel of the next light region is stored.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the three-dimensional measurement method with automatic brightness adjustment function as described in any one of claims 1-4.
Citation Information
Patent Citations
Scanning method and device with automatic brightness adjusting function and electronic device
CN111366104A
Laser ray center extraction method and device, equipment and storage medium
CN116051454A
Surface structured light based dynamic detection and compensation method for highlight or too-dark area in 3D measurement
CN107917679A
Line laser automatic brightness control method and system and storage medium
CN112689097A
