Coaxial light source control device, method and equipment and computer readable storage medium
Through coaxial light source device and iterative grayscale complementation technology, the problem of uneven light illumination of coaxial light source imaging is solved, and the stability and consistency of visual measurement and detection are achieved.
Patent Information
- Application Number
- CN202510429141.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-04
AI Technical Summary
The uniformity of the existing coaxial light source imaging light cannot guarantee the stability of visual measurement and detection, especially when the large field of view and the brightness of the light source changes, the imaging effect is inconsistent, resulting in missed detection and misdetection.
A device composed of a coaxial light source, a scattering plate, a semi-transmissive reflective film and a coaxial camera is used to iteratively calculate the grayscale complement, and the light source is automatically calibrated to adjust the image, so that the light intensity received by the camera photosensitive chip is consistent with the light intensity reflected at each position of the product in the field of view.
The uniformity of imaging light is achieved, the uniformity of images is improved from the source, the stability of visual measurement and detection is enhanced, and the imaging distortion caused by uneven light is avoided.
Smart Images

Figure CN120264122A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine vision, and particularly to a coaxial light source control device, method, equipment and computer-readable storage medium. Background Art
[0002] In the field of machine vision, the illumination uniformity of imaging is of great significance for the recognition, positioning, measurement and detection of products to be inspected. The coaxial light source is a common light source, which can illuminate the object from the front without blocking the light path, and is widely used in many vision application scenarios such as die cutting and FPC (Flexible Printed Circuit) inspection.
[0003] However, due to many constraints such as cost and installation space during actual use, the coaxial light source often needs to be used in cooperation with a FA (Factory Automation) lens, and it is easy to appear dark corners around. When the product infeed cannot ensure that it appears at the same position in the image each time, the imaging effect on the surface cannot be guaranteed to be consistent, and it is easy to miss or misdetect.
[0004] To solve the above technical problems, there are usually two methods at present:
[0005] 1. Expand the light-emitting area of the coaxial light source: By increasing the distance between the light-emitting surface of the coaxial light source and the width of the field of view to be inspected by more than twice, only the part with uniform reflected light intensity is used to irradiate the product. Although this solution can keep the illumination in the central area uniform, in order to ensure uniformity, the volume is relatively large, and when shooting large-field products, the volume increases cubically with the size of the field of view, the processing difficulty is large and the economy drops rapidly. Moreover, this solution can only ensure the illumination uniformity and cannot ensure the uniformity after the light passes through the FA lens. The final image may still have dark corners. Especially when a certain brightness needs to be maintained around, the brightness in the middle area is prone to overexposure.
[0006] II. Add a shadow correction function to the camera SDK (Software Development Kit): Take a photo of a white paper, and perform gray-scale compensation calibration according to the gray-scale distribution of the white paper in the image. This solution solves the problem from the firmware. Although the gray-scale consistency is very good after shadow correction of the images of products with a uniform background, and the uneven illumination caused by the field angle of the FA lens is corrected, however, after shadow correction of real product pictures, the gray-scale distortion of the product surface imaging is serious. When the product is moved within the field of view, the gray-scale change of the product surface is large, and the imaging consistency within the field of view cannot be guaranteed. In particular, different calibration files are required for different products, and when the light source brightness changes, the uniformity of the image after algorithmic shadow correction deteriorates rapidly due to different algorithm compensation values. Therefore, re-calibration is required every time the product or light source brightness is changed, which is cumbersome to use.
[0007] Therefore, how to effectively improve the illumination uniformity of coaxial light source imaging, ensure that the light intensities of the light reflected from each position of the product within the field of view reach the camera sensor chip are consistent, and guarantee the stability of visual measurement and detection has become an urgent technical problem to be solved at present. Summary of the Invention
[0008] In order to overcome the deficiencies in the prior art, the purpose of the present invention is to provide a coaxial light source control method, device, equipment and computer-readable storage medium to solve the problem that the illumination uniformity of the current coaxial light source imaging cannot guarantee the stability of visual measurement and detection.
[0009] The present invention proposes a coaxial light source device, which includes: a coaxial light source, a diffuser plate, a semi-transparent reflective film, a coaxial camera and a processor, wherein:
[0010] The coaxial light source is used to emit light and display a light source adjustment image. The light passes through the light source adjustment image, and after being homogenized, it irradiates the diffuser plate;
[0011] The diffuser plate is used to perform scattering processing on the received light and irradiate the semi-transparent reflective film;
[0012] The semi-transparent reflective film is used to reflect the received light and irradiate a white reference plane;
[0013] The coaxial camera is used to photograph the white reference plane to obtain a reference image;
[0014] The processor is used to calculate the gray-scale complement set of the reference image as the light source adjustment image;
[0015] The processor is further configured to iteratively calculate the grayscale complement set to update the light source adjustment image until the white reference plane photographed by the coaxial camera is evenly illuminated when the updated light source adjustment image is loaded onto the coaxial light source.
[0016] Optionally, the coaxial light source is a direct display light-emitting panel;
[0017] The direct display light-emitting panel is configured to display the light source adjustment image at a preset brightness. The light emitted by the direct display light-emitting panel first undergoes homogenization processing through the light source adjustment image, then undergoes scattering processing through the scattering plate, and finally is reflected onto the white reference plane through the semi-transparent reflective film.
[0018] Optionally, the coaxial light source is a liquid crystal light-emitting panel, and the liquid crystal light-emitting panel includes a backlight panel and a display film;
[0019] The backlight panel is configured to emit light at a preset brightness;
[0020] The display film is configured to display the light source adjustment image. The light emitted by the backlight panel passes through the display film, undergoes homogenization processing, then undergoes scattering processing through the scattering plate, and finally is reflected onto the white reference plane through the semi-transparent reflective film.
[0021] The present invention also provides a coaxial light source control method applied to the above coaxial light source device. The method includes:
[0022] After turning on the coaxial light source, in a preset full-transmission mode, control the coaxial camera to photograph the white reference plane to obtain a first reference image;
[0023] Find the complement set of the grayscale image of the first reference image to obtain a first light source adjustment image;
[0024] Switch the coaxial light source from the full-transmission mode to a semi-transmission mode for displaying the first light source adjustment image, and again control the coaxial camera to photograph the white reference plane to obtain a second reference image;
[0025] If the uniformity of the second reference image is higher than a preset value, then use the first light source adjustment image as the final light source adjustment image; otherwise,
[0026] Iteratively find the complement set to update the first light source adjustment image until the uniformity of the second reference image is higher than the preset value when the updated first light source adjustment image is loaded onto the coaxial light source.
[0027] Optionally, the coaxial light source is a liquid crystal light-emitting panel, and the liquid crystal light-emitting panel includes a backlight panel and a display film;
[0028] After turning on the coaxial light source, in a preset full-transmission mode, control the coaxial camera to capture a white reference plane to obtain a first reference image, specifically including:
[0029] After turning on the backlight panel, configure the backlight panel to a preset initial brightness;
[0030] Configure the display film to the full-transmission mode and control the coaxial camera to capture the white reference plane to obtain the first reference image.
[0031] Optionally, switch the coaxial light source from the full-transmission mode to a semi-transmission mode for displaying the first light source adjustment image, and then control the coaxial camera to capture the white reference plane again to obtain a second reference image, specifically including:
[0032] Keep the backlight panel at the initial brightness and configure the display film to the display mode;
[0033] Control the display film to display the first light source adjustment image.
[0034] Optionally, the coaxial light source is a direct display light-emitting panel;
[0035] After turning on the coaxial light source, in a preset full-transmission mode, control the coaxial camera to capture a white reference plane to obtain a first reference image, specifically including:
[0036] After turning on the direct display light-emitting panel, configure the direct display light-emitting panel to a preset initial brightness;
[0037] Control the direct display light-emitting panel to display a preset pure color image, and control the coaxial camera to capture the white reference plane to obtain the first reference image.
[0038] Optionally, switch the coaxial light source from the full-transmission mode to a semi-transmission mode for displaying the first light source adjustment image, and then control the coaxial camera to capture the white reference plane again to obtain a second reference image, specifically including:
[0039] Keep the direct display light-emitting panel at the initial brightness;
[0040] Control the direct display light-emitting panel to display the first light source adjustment image.
[0041] The present invention also provides a coaxial light source control device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the coaxial light source control method described in any one of the above are implemented.
[0042] The present invention also provides a computer-readable storage medium, on which a coaxial light source control program is stored. When the coaxial light source control program is executed by a processor, the steps of the coaxial light source control method described in any one of the above are implemented.
[0043] Implementing the coaxial light source control device, method, equipment and computer-readable storage medium of the present invention, the device includes: a coaxial light source, a scattering plate, a semi-transparent reflective film, a coaxial camera and a processor, wherein: the coaxial light source is used to emit light and display a light source adjustment image, and the light passes through the light source adjustment image and is irradiated onto the scattering plate after being homogenized; the scattering plate is used to scatter the received light and irradiate it onto the semi-transparent reflective film; the semi-transparent reflective film is used to reflect the received light and irradiate it onto a white reference plane; the coaxial camera is used to photograph the white reference plane to obtain a reference image; the processor is used to calculate the gray complement set of the reference image as the light source adjustment image; the processor is further used to iteratively calculate the gray complement set to update the light source adjustment image until when the updated light source adjustment image is loaded onto the coaxial light source, the illumination of the white reference plane photographed by the coaxial camera is uniform. Thus, automatic calibration of the coaxial light source is achieved, so that the illumination intensity received by the camera's photosensitive chip is consistent with the light intensity reflected by each position of the product within the field of view, improving the uniformity of the image from the imaging source and enhancing the stability of visual measurement and visual inspection. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The present invention will be further described below in conjunction with the drawings and embodiments. In the drawings:
[0045] Figure 1 is the first module block diagram of the coaxial light source control device of the present invention;
[0046] Figure 2 is the second module block diagram of the coaxial light source control device of the present invention;
[0047] Figure 3 is the third module block diagram of the coaxial light source control device of the present invention;
[0048] Figure 4 is the first flow chart of the coaxial light source control method of the present invention;
[0049] Figure 5 is the second flow chart of the coaxial light source control method of the present invention;
[0050] Figure 6 is the third flow chart of the coaxial light source control method of the present invention;
[0051] Figure 7 is the fourth flow chart of the coaxial light source control method of the present invention;
[0052] Figure 8 This is the fifth flowchart of the coaxial light source control method of the present invention. Detailed implementation manners
[0053] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0054] In the following description, suffixes such as "module", "component", or "unit" used to represent elements are only for the convenience of explaining the present invention, and they have no specific meaning in themselves. Therefore, "module", "component", or "unit" can be used interchangeably.
[0055] Figure 1 This is the first module block diagram of the coaxial light source control device of the present invention. In this embodiment, a coaxial light source device is proposed, and the device includes: a coaxial light source 10, a diffuser plate 20, a semi-transparent reflective film 30, a coaxial camera 40, and a processor 50, where:
[0056] The coaxial light source 10 is used to emit light and display a light source adjustment image, and the light passes through the light source adjustment image and is irradiated onto the diffuser plate 20 after being homogenized;
[0057] The diffuser plate 20 is used to scatter the received light and irradiate it onto the semi-transparent reflective film 30;
[0058] The semi-transparent reflective film 30 is used to reflect the received light and irradiate it onto a white reference plane;
[0059] The coaxial camera 40 is used to photograph the white reference plane to obtain a reference image;
[0060] The processor 50 is used to calculate the grayscale complement of the reference image as the light source adjustment image;
[0061] The processor 50 is further used to iteratively calculate the grayscale complement to update the light source adjustment image until the illumination of the white reference plane photographed by the coaxial camera 40 is uniform when the updated light source adjustment image is loaded onto the coaxial light source 10.
[0062] In this embodiment, it is considered that the imaging uniformity is affected by three parts: the light source illumination uniformity, the lens light incident uniformity, and the image preprocessing. That is, essentially, the light intensity of the light reflected from each position of the product within the field of view remains consistent when reaching the camera sensor chip. For this reason, this embodiment proposes a coaxial light source control device capable of adjusting the imaging illumination uniformity, aiming to make the original illumination intensity received on the camera photosensitive chip consistent.
[0063] Specifically, the coaxial light source 10 of this embodiment is used to emit light and display a light source adjustment image. The light passes through the light source adjustment image, and after being homogenized, irradiates the diffuser plate 20. The diffuser plate 20 of this embodiment is used to perform a scattering process on the received light and irradiate the semi-transparent reflective film 30. The semi-transparent reflective film 30 of this embodiment is used to reflect the received light and irradiate the white reference plane. The coaxial camera 40 of this embodiment is used to photograph the white reference plane to obtain a reference image. The processor 50 of this embodiment is used to calculate the gray complement set of the reference image as the light source adjustment image. The processor 50 of this embodiment is further used to iteratively calculate the gray complement set to update the light source adjustment image until when the updated light source adjustment image is loaded onto the coaxial light source 10, the illumination of the white reference plane photographed by the coaxial camera 40 is uniform.
[0064] Specifically, when adjusting the imaging uniformity by applying the above device in this embodiment, the process includes: using a given camera lens and the coaxial light source 10, and using the initial light source configuration to take a photo of the white reference plane without obtaining or enabling the light source adjustment image; taking the collected image with uneven brightness as the original image, calculating the complement of its gray value, and then multiplying it by the brightness adjustment coefficient to obtain the light source adjustment image; displaying this light source display image on the coaxial light source 10, so that the light emitted by the coaxial light source 10 changes the light intensity of each point after passing through the above light source adjustment image. Thus, the bright part of the target plane was previously weakened by the shadow pattern displayed thereon; further, determining whether the illumination uniformity of the imaging is higher than the preset value; if not, iterating the above process and stopping the iteration when the illumination consistency of the imaging meets the standard.
[0065] The beneficial effects of this embodiment are as follows. By proposing a coaxial light source device, the device includes: a coaxial light source, a scattering plate, a semi-transparent reflective film, a coaxial camera, and a processor, where: the coaxial light source is used to emit light and display a light source adjustment image, and the light passes through the light source adjustment image and is irradiated onto the scattering plate after being homogenized; the scattering plate is used to scatter the received light and irradiate it onto the semi-transparent reflective film; the semi-transparent reflective film is used to reflect the received light and irradiate it onto a white reference plane; the coaxial camera is used to capture the white reference plane to obtain a reference image; the processor is used to calculate the gray complement of the reference image as the light source adjustment image; the processor is also used to iteratively calculate the gray complement to update the light source adjustment image until when the updated light source adjustment image is loaded onto the coaxial light source, the illumination of the white reference plane captured by the coaxial camera is uniform. Thus, automatic calibration of the coaxial light source is achieved, enabling the illumination intensity received by the camera's photosensitive chip to be consistent with the light intensity reflected by each position of the product within the field of view, improving the uniformity of the image from the imaging source and enhancing the stability of visual measurement and visual detection.
[0066] Figure 2 It is the second module block diagram of the coaxial light source 10 control device of the present invention. The coaxial light source 10 in this embodiment is a direct display light-emitting panel 11.
[0067] In this embodiment, the direct display light-emitting panel 11 is used to display the light source adjustment image according to a preset brightness. The light emitted by the direct display light-emitting panel 11 first undergoes homogenization processing through the light source adjustment image, then undergoes scattering processing through the scattering plate 20, and finally is reflected onto the white reference plane through the semi-transparent reflective film 30.
[0068] The beneficial effects of this embodiment are as follows. By using a direct display light-emitting panel as the coaxial light source and utilizing the display function and light-emitting function of the direct display light-emitting panel, automatic calibration of the coaxial light source is jointly achieved, enabling the illumination intensity received by the camera's photosensitive chip to be consistent with the light intensity reflected by each position of the product within the field of view, improving the uniformity of the image from the imaging source and enhancing the stability of visual measurement and visual detection.
[0069] Figure 3 It is the third module block diagram of the coaxial light source 10 control device of the present invention. The coaxial light source 10 in this embodiment is a liquid crystal light-emitting panel 12, and the liquid crystal light-emitting panel 12 includes a backlight panel 121 and a display film 122;
[0070] In this embodiment, the backlight panel 121 is used to emit light according to a preset brightness;
[0071] In this embodiment, the display film 122 is used to display the light source adjustment image. The light emitted by the backlight panel 121 passes through the display film 122, and after being homogenized, it is then scattered by the diffuser plate 20 and finally reflected by the semi-transmissive reflective film 30 onto the white reference plane.
[0072] The beneficial effect of this embodiment is that by using a liquid crystal light-emitting panel as the coaxial light source and utilizing the light-emitting function of the backlight panel and the display function of the display film, the coaxial light source is automatically calibrated jointly, so that the light intensity received by the camera photosensitive chip is consistent with the light intensity reflected by each position of the product within the field of view, improving the uniformity of the image from the imaging source and enhancing the stability of visual measurement and visual inspection.
[0073] Figure 4 It is the first flowchart of the coaxial light source control method of the present invention. This embodiment proposes an application to the above coaxial light source device, and this method includes:
[0074] S1. After turning on the coaxial light source, in a preset full-transmission mode, control the coaxial camera to photograph the white reference plane to obtain a first reference image;
[0075] S2. Take the complement of the grayscale image of the first reference image to obtain a first light source adjustment image;
[0076] S3. Switch the coaxial light source from the full-transmission mode to a semi-transmissive mode for displaying the first light source adjustment image, and again control the coaxial camera to photograph the white reference plane to obtain a second reference image;
[0077] S4. If the uniformity of the second reference image is higher than a preset value, then use the first light source adjustment image as the final light source adjustment image; otherwise, iteratively take the complement to update the first light source adjustment image until the uniformity of the second reference image is higher than the preset value when the updated first light source adjustment image is loaded onto the coaxial light source.
[0078] In this embodiment, considering that the imaging uniformity is affected by three parts: the uniformity of the light source illumination, the uniformity of the light entering the lens, and the image preprocessing, that is, essentially, the light intensity is kept consistent when the light reflected by each position of the product within the field of view reaches the camera sensing chip. For this reason, this embodiment proposes a coaxial light source control method for adjusting the imaging illumination uniformity, aiming to make the original light intensity received on the camera photosensitive chip consistent.
[0079] Specifically, in this embodiment, first, after turning on the coaxial light source, in the preset full-transmission mode, control the coaxial camera to capture a white reference plane to obtain a first reference image; then, find the complement of the grayscale image of the first reference image to obtain a first light source adjustment image; then, switch the coaxial light source from the full-transmission mode to a semi-transmission mode for displaying the first light source adjustment image, and control the coaxial camera to capture the white reference plane again to obtain a second reference image; finally, if the uniformity of the second reference image is higher than the preset value, use the first light source adjustment image as the final light source adjustment image; otherwise, iteratively find the complement to update the first light source adjustment image until the uniformity of the second reference image is higher than the preset value when the updated first light source adjustment image is loaded onto the coaxial light source.
[0080] In this embodiment, when applying the above method to adjust the imaging uniformity, the process includes: using a given camera lens and coaxial light source, with the initial light source configuration, taking a picture of a white reference plane without obtaining or enabling a light source adjustment image; using the captured image with uneven brightness as the original image, finding the complement of its grayscale, and then multiplying by a brightness adjustment coefficient to obtain a light source adjustment image; displaying this light source display image on the coaxial light source, so that the light emitted by the coaxial light source changes the light intensity of each point after passing through the above light source adjustment image. As a result, the bright part of the target plane was previously weakened by the shadow pattern shown; further, determine whether the illumination uniformity of the imaging is higher than the preset value; if not, iterate the above process and stop iterating when the illumination consistency of the imaging meets the standard.
[0081] The beneficial effect of this embodiment is that after turning on the coaxial light source, in the preset full-transmission mode, control the coaxial camera to capture a white reference plane to obtain a first reference image; then, find the complement of the grayscale image of the first reference image to obtain a first light source adjustment image; then, switch the coaxial light source from the full-transmission mode to a semi-transmission mode for displaying the first light source adjustment image, and control the coaxial camera to capture the white reference plane again to obtain a second reference image; finally, if the uniformity of the second reference image is higher than the preset value, use the first light source adjustment image as the final light source adjustment image; otherwise, iteratively find the complement to update the first light source adjustment image until the uniformity of the second reference image is higher than the preset value when the updated first light source adjustment image is loaded onto the coaxial light source. Thus, the coaxial light source is automatically calibrated, enabling the light intensity received by the camera's photosensitive chip to be consistent with the light intensity reflected by each position of the product within the field of view, improving the uniformity of the image from the imaging source and enhancing the stability of visual measurement and visual inspection.
[0082] Figure 5This is the second flowchart of the coaxial light source control method of the present invention. In this embodiment, the coaxial light source is a liquid crystal light-emitting panel, and the liquid crystal light-emitting panel includes a backlight panel and a display film;
[0083] After turning on the coaxial light source, in the preset full-transparency mode, control the coaxial camera to photograph a white reference plane to obtain a first reference image, specifically including:
[0084] S11. After lighting the backlight panel, configure the backlight panel to a preset initial brightness;
[0085] S12. Configure the display film to the full-transparency mode, and control the coaxial camera to photograph the white reference plane to obtain the first reference image.
[0086] In this embodiment, based on the configuration of the above device, the lamp beads on the backlight panel emit light. After passing through the display film, it is homogenized by a diffuser plate and irradiated onto the product through a semi-transparent reflective film. Among them, the above display film is a liquid crystal display film.
[0087] In this embodiment, first, do not start the display film, that is, the display film is completely transparent. The lamp beads evenly distributed on the backlight panel provide light in a uniform brightness manner, and then after being reflected by the semi-transparent reflective film, it illuminates the white reference plane on the detection platform. At this time, take a picture of the uniform white reference plane to obtain the initial image under the coaxial light source and the FA lens configuration; it can be understood that due to the influence of the light source intensity and the FA optical path, the gray-scale distribution of the picture obtained at this time is uneven, that is, bright in the middle and dark around.
[0088] In this embodiment, after obtaining the initial image, calculate the gray-scale distribution of the picture through software, multiply by the intensity adjustment coefficient a after taking the complement according to the gray scale, and generate the gray-scale picture that the display film needs to display. It can be understood that the characteristic of this gray-scale picture is that the middle area is darker, and the resulting effect is to weaken the light transmittance of the middle area.
[0089] In this embodiment, to obtain a good uniform illumination effect subsequently, the light source brightness, that is, the above initial brightness, can be adjusted so that the brightness of the initial picture is between 120 and 160 lumens.
[0090] In this embodiment, the required brightness of the actual pictures for subsequent visual measurement and visual inspection is obtained in advance, and this is used as the initial brightness of the adjustable light source above.
[0091] In this embodiment, the size of the actual material for subsequent visual measurement and visual inspection is obtained in advance, and the lowest threshold in the preset range of the uniformity is adjusted according to the size.
[0092] In this embodiment, if the above size is smaller, the lowest threshold is higher, so as to ensure higher uniformity and improve the recognition and detection accuracy of small-size materials.
[0093] In this embodiment, the interval of the actual material for subsequent visual measurement and visual inspection is obtained in advance, and the lowest threshold value in the preset range of the uniformity is adjusted according to the interval.
[0094] In this embodiment, if the above interval is smaller, the lowest threshold value is higher, so as to ensure higher uniformity and improve the recognition and detection accuracy of dense materials.
[0095] In this embodiment, the morphological characteristics of the actual material for subsequent visual measurement and visual inspection are obtained in advance, and the lowest threshold value in the preset range of the uniformity is adjusted according to the morphological characteristics.
[0096] In this embodiment, if the above morphological characteristics are irregular patterns, the lowest threshold value is higher, so as to ensure higher uniformity and improve the recognition and detection accuracy of irregular materials.
[0097] In this embodiment, the color characteristics of the actual material for subsequent visual measurement and visual inspection are obtained in advance, and the lowest threshold value in the preset range of the uniformity is adjusted according to the color characteristics.
[0098] In this embodiment, if the above color characteristics are light-colored patterns, the lowest threshold value is higher, so as to ensure higher uniformity and improve the recognition and detection accuracy of light-colored materials.
[0099] The beneficial effect of this embodiment is that after lighting the backlight panel, the backlight panel is configured to a preset initial brightness, then the display film is configured to a fully transparent mode, and the coaxial camera is controlled to photograph the white reference plane to obtain the first reference image, thereby providing an effective data basis for iteratively calibrating the grayscale image.
[0100] Figure 6 This is the third flowchart of the coaxial light source control method of the present invention. In this embodiment, the step of switching the coaxial light source from the fully transparent mode to the semi-transparent mode for displaying the first light source adjustment image and then controlling the coaxial camera to photograph the white reference plane again to obtain the second reference image specifically includes:
[0101] S31. Keep the backlight panel at the initial brightness and configure the display film to the display mode;
[0102] S32. Control the display film to display the first light source adjustment image.
[0103] In this embodiment, first, the display film is started, and a grayscale picture generated by calculation is displayed on the display film; then, light is emitted by the backlight panel, and after being filtered by the display film, the light intensity of the strong light part is weakened, thereby improving the uniformity of the overall light entering the FA lens.
[0104] In this embodiment, the camera is triggered by software to take pictures again, and the above process is iterated until the imaging gray level is uniform; the final picture displayed on the display film is saved as the calibration display picture under the cooperation of this light source and lens.
[0105] In this embodiment, when photographing a product, the previously generated calibration display picture is loaded onto the display film, and the brightness of the light source is adjusted to make the imaging illumination uniform; it can be understood that since the camera captures the actual light imaging, in addition to improving the uniformity of the imaging within the field of view, the product image will not be distorted due to algorithm problems.
[0106] The beneficial effect of this embodiment is that by keeping the backlight panel at the initial brightness and configuring the display film in the display mode, and then controlling the display film to display the first light source adjustment image, the illumination uniformity of the captured image is better, enhancing the stability of visual measurement and visual detection.
[0107] Figure 7 It is the fourth flowchart of the coaxial light source control method of the present invention. In this embodiment, the coaxial light source is a direct display light-emitting panel;
[0108] After the coaxial light source is turned on, in the preset full-transmission mode, the coaxial camera is controlled to photograph the white reference plane to obtain a first reference image, which specifically includes:
[0109] S13. After lighting the direct display light-emitting panel, configure the direct display light-emitting panel to the preset initial brightness;
[0110] S14. Control the direct display light-emitting panel to display a preset pure color image, and control the coaxial camera to photograph the white reference plane to obtain the first reference image.
[0111] In this embodiment, another configuration of the coaxial light source includes: a direct display light-emitting panel, a diffuser plate, and a semi-transparent reflective film. Based on the above configuration, the direct display light-emitting panel emits light, which is homogenized by the diffuser plate and reflected through the semi-transparent reflective film to irradiate the product.
[0112] In this embodiment, first, a pure color image is used to display an image on the direct display panel, and a uniform white reference plane is photographed to obtain an initial image under the configuration of the coaxial light source and the FA lens; due to the influence of the light intensity of the light source and the FA optical path, the gray level distribution of the obtained picture is uneven, bright in the middle and dark around.
[0113] In this embodiment, after obtaining the initial image, the gray level distribution of the picture is calculated by software, and after taking the complement according to the gray level and multiplying by the intensity adjustment coefficient a, a gray level picture to be displayed on the direct display panel is generated, which is characterized in that the gray level in the original strong light area becomes darker, reducing the irradiation light intensity, while the gray level in the original weak light area is weakened, increasing the light intensity.
[0114] In this embodiment, to obtain a good uniform illumination effect subsequently, the brightness of the light source can be adjusted, that is, the above-mentioned initial brightness, so that the brightness of the initial picture is between 120 and 160 lumens.
[0115] In this embodiment, the size of the actual material for subsequent visual measurement and visual inspection is obtained in advance, and the lowest threshold in the preset range of the uniformity is adjusted according to the size.
[0116] In this embodiment, if the above size is smaller, the lowest threshold is higher, so as to ensure higher uniformity and improve the recognition and detection accuracy of small-sized materials.
[0117] In this embodiment, the interval of the actual material for subsequent visual measurement and visual inspection is obtained in advance, and the lowest threshold in the preset range of the uniformity is adjusted according to the interval.
[0118] In this embodiment, if the above interval is smaller, the lowest threshold is higher, so as to ensure higher uniformity and improve the recognition and detection accuracy of dense materials.
[0119] In this embodiment, the morphological characteristics of the actual material for subsequent visual measurement and visual inspection are obtained in advance, and the lowest threshold in the preset range of the uniformity is adjusted according to the morphological characteristics.
[0120] In this embodiment, if the above morphological characteristic is an irregular pattern, the lowest threshold is higher, so as to ensure higher uniformity and improve the recognition and detection accuracy of irregular materials.
[0121] In this embodiment, the color characteristics of the actual material for subsequent visual measurement and visual inspection are obtained in advance, and the lowest threshold in the preset range of the uniformity is adjusted according to the color characteristics.
[0122] In this embodiment, if the above color characteristic is a light-colored pattern, the lowest threshold is higher, so as to ensure higher uniformity and improve the recognition and detection accuracy of light-colored materials.
[0123] In this embodiment, the above-mentioned light-emitting panel, display film, scattering plate, and semi-transparent reflective film are used as the first configuration, and the above-mentioned direct-view light-emitting panel, scattering plate, and semi-transparent reflective film are used as the second configuration; based on this, the first difference between the initial brightness and its actual application brightness in the first configuration is less than the second difference between the initial brightness and its actual application brightness in the second configuration; further, the lowest threshold in the first configuration is higher than the lowest threshold in the second configuration.
[0124] In this embodiment, the required brightness of the actual picture for subsequent visual measurement and visual inspection is obtained in advance, and this is used as the initial brightness of the above-mentioned adjustable light source.
[0125] The beneficial effect of this embodiment is that after lighting the direct display light-emitting panel, the direct display light-emitting panel is configured to a preset initial brightness, and then the direct display light-emitting panel is controlled to display a preset solid-color image, and the coaxial camera is controlled to photograph the white reference plane to obtain the first reference image, thereby providing an effective data basis for iteratively calibrating the grayscale image.
[0126] Figure 8 It is the fifth flowchart of the coaxial light source control method of the present invention. In this embodiment, the process of switching the coaxial light source from the fully transparent mode to the semi-transparent mode for displaying the first light source adjustment image and then controlling the coaxial camera to photograph the white reference plane again to obtain the second reference image specifically includes:
[0127] S33. Keep the direct display light-emitting panel at the initial brightness;
[0128] S34. Control the direct display light-emitting panel to display the first light source adjustment image.
[0129] In this embodiment, first, the software triggers the camera to take a picture again, and iterates the above process until the imaging grayscale is uniform; then, save the final picture displayed on the direct display panel as the calibration display picture under the cooperation of this light source and lens.
[0130] In this embodiment, when photographing a product, load the previously generated calibration display picture onto the direct display panel and adjust the light source brightness; it can be understood that since the camera captures the actual light imaging, in addition to improving the uniformity of the imaging within the field of view, the product image will not be distorted due to algorithm problems.
[0131] The beneficial effect of this embodiment is that by keeping the direct display light-emitting panel at the initial brightness and then controlling the direct display light-emitting panel to display the first light source adjustment image, the lighting uniformity of the collected image is better, and the stability of visual measurement and visual detection is enhanced.
[0132] Based on the above embodiments, the present invention also proposes a coaxial light source control device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the coaxial light source control method described in any one of the above.
[0133] It should be noted that the above device embodiment and method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment, and the technical features in the method embodiment are correspondingly applicable in the device embodiment, which will not be elaborated here.
[0134] Based on the above embodiments, the present invention further provides a computer-readable storage medium, on which a coaxial light source control program is stored. When the coaxial light source control program is executed by a processor, the steps of the coaxial light source control method described in any one of the above are implemented.
[0135] It should be noted that the above medium embodiment and the method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment, and the technical features in the method embodiment are correspondingly applicable in the medium embodiment, which will not be elaborated here.
[0136] Implementing the coaxial light source control method, device, equipment and computer-readable storage medium of the present invention, after turning on the coaxial light source, in the preset full-transmission mode, control the coaxial camera to photograph a white reference plane to obtain a first reference image; then, find the complement of the grayscale image of the first reference image to obtain a first light source adjustment image; then, switch the coaxial light source from the full-transmission mode to a semi-transmission mode for displaying the first light source adjustment image, and control the coaxial camera to photograph the white reference plane again to obtain a second reference image; finally, if the uniformity of the second reference image is higher than a preset value, use the first light source adjustment image as the final light source adjustment image; otherwise, iteratively find the complement to update the first light source adjustment image until the uniformity of the second reference image is higher than the preset value when the updated first light source adjustment image is loaded onto the coaxial light source. Thus, the coaxial light source is automatically calibrated, so that the light intensity received by the camera's photosensitive chip is consistent with the light intensity reflected by each position of the product within the field of view, improving the uniformity of the image from the imaging source and enhancing the stability of visual measurement and visual inspection.
[0137] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), including several instructions for causing a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0138] It should be noted that in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent in such a process, method, article or device. Without further limitations, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including that element.
[0139] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the purpose of the present invention and the scope protected by the claims. All of these fall within the protection scope of the present invention.
Claims
1. A coaxial light source device, characterized in that, The device includes: a coaxial light source, a diffuser plate, a semi-transparent reflective film, a coaxial camera, and a processor, where: The coaxial light source is used to emit light and display a light source adjustment image. The light passes through the light source adjustment image, and after being homogenized, irradiates the diffuser plate; The diffuser plate is used to scatter the received light and irradiate the semi-transparent reflective film; The semi-transparent reflective film is used to reflect the received light and irradiate a white reference plane; The coaxial camera is used to capture the white reference plane to obtain a reference image; The processor is used to calculate the gray complement of the reference image as the light source adjustment image; The processor is further used to iteratively calculate the gray complement to update the light source adjustment image until when the updated light source adjustment image is loaded onto the coaxial light source, the illumination of the white reference plane captured by the coaxial camera is uniform.
2. The coaxial light source device according to claim 1, wherein The coaxial light source is a direct display light-emitting panel; The direct display light-emitting panel is used to display the light source adjustment image at a preset brightness. The light emitted by the direct display light-emitting panel first passes through the light source adjustment image for homogenization, then passes through the diffuser plate for scattering, and finally is reflected by the semi-transparent reflective film onto the white reference plane.
3. The coaxial light source device according to claim 1, characterized in that, The coaxial light source is a liquid crystal light-emitting panel, and the liquid crystal light-emitting panel includes a backlight panel and a display film; The backlight panel is used to emit light at a preset brightness; The display film is used to display the light source adjustment image. The light emitted by the backlight panel passes through the display film, is homogenized, then passes through the diffuser plate for scattering, and finally is reflected by the semi-transparent reflective film onto the white reference plane.
4. A coaxial light source control method, applied to a coaxial light source device according to any one of claims 1-3, characterized in that, The method includes: After turning on the coaxial light source, in a preset full-transparency mode, control the coaxial camera to capture the white reference plane to obtain a first reference image; Find the complement of the gray image of the first reference image to obtain a first light source adjustment image; Switch the coaxial light source from the full-transparency mode to a semi-transparency mode for displaying the first light source adjustment image, and again control the coaxial camera to capture the white reference plane to obtain a second reference image; If the uniformity of the second reference image is higher than a preset value, then use the first light source adjustment image as the final light source adjustment image; otherwise, Iteratively find the complement to update the first light source adjustment image until when the updated first light source adjustment image is loaded onto the coaxial light source, the uniformity of the second reference image is higher than the preset value.
5. The coaxial light source control method according to claim 4, wherein The coaxial light source is a liquid crystal light-emitting panel, and the liquid crystal light-emitting panel includes a backlight panel and a display film; After turning on the coaxial light source, in a preset full-transparency mode, control the coaxial camera to capture the white reference plane to obtain a first reference image, specifically including: After lighting the backlight panel, configure the backlight panel to a preset initial brightness; Configure the display film to the full-transparency mode and control the coaxial camera to capture the white reference plane to obtain the first reference image.
6. The coaxial light source control method according to claim 5, wherein Switching the coaxial light source from the fully transparent mode to the semi-transparent mode for displaying the first light source adjustment image, and then controlling the coaxial camera to capture the white reference plane again to obtain a second reference image, specifically includes: Keeping the backlight panel at the initial brightness and configuring the display film to the display mode; Controlling the display film to display the first light source adjustment image.
7. The coaxial light source control method according to claim 4, characterized in that The coaxial light source is a direct display light-emitting panel; After turning on the coaxial light source, in a preset fully transparent mode, controlling the coaxial camera to capture the white reference plane to obtain a first reference image, specifically includes: After lighting up the direct display light-emitting panel, configuring the direct display light-emitting panel to a preset initial brightness; Controlling the direct display light-emitting panel to display a preset solid color image, and controlling the coaxial camera to capture the white reference plane to obtain the first reference image.
8. The coaxial light source control method according to claim 7, wherein, Switching the coaxial light source from the fully transparent mode to the semi-transparent mode for displaying the first light source adjustment image, and then controlling the coaxial camera to capture the white reference plane again to obtain a second reference image, specifically includes: Keeping the direct display light-emitting panel at the initial brightness; Controlling the direct display light-emitting panel to display the first light source adjustment image.
9. A coaxial light source control device, characterized in that, The device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the coaxial light source control method according to any one of claims 4 to 8.
10. A computer-readable storage medium, characterized in that, A coaxial light source control program is stored on the computer-readable storage medium. When the coaxial light source control program is executed by the processor, it implements the steps of the coaxial light source control method according to any one of claims 4 to 8.