Method and system for acquiring color image based on black and white line scanning camera in combined light field

By adjusting the white balance gain in the black and white line scanning camera and combining multiple acquisition modes of the three-color light source, the problems of low resolution and high cost of obtaining color images in the prior art are solved, and high efficiency under the combined light field is achieved Color image acquisition and detection.

CN119155560AInactive Publication Date: 2024-12-17ELEMENTARY OPTOMATION CO LTD

Patent Information

Application Number
CN202411642141.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2024-12-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing machine vision detection system, black and white cameras and color cameras cannot have both, and cannot meet the detection needs of defects, color types, and product depth of field at the same time. Especially in the process of obtaining color images under a combined light field, traditional methods have differentiation. Low rate, halo effect and high cost problems.

Method used

By adjusting the white balance gain of the black and white line scanning camera under three primary colors, combining three sets of three-color light sources in multi-light field, high dynamic range and composite field acquisition mode, a photo acquisition light field environment suitable for different scenarios is constructed, and the light source control is used. The machine and data processor realize the recombination and color restoration of image data to obtain color images.

Benefits of technology

It realizes efficient acquisition of color images under a combined light field, solves the resolution problem of traditional methods, reduces costs, expands the scope of detection application, and can accurately detect defects such as defects, deformation, dirt and color difference on the surface of the product.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155560A_ABST
    Figure CN119155560A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image detection, in particular to a method for acquiring a color image based on a black-and-white line-scan camera under a combined light field, which comprises the following steps: adjusting the white balance gain of the black-and-white line-scan camera under three primary colors to enable the black-and-white line-scan camera to reach white balance; the three groups of three-color light sources construct image acquisition light fields suitable for different scenes according to a preset opening rule, and when the multi-color light source is opened every time, the black-and-white line scanning camera exposes and acquires a row of image data; and synthesizing and restoring the images acquired by the black-and-white line scanning camera into one or more color images. According to the method, exposure of the camera and turn-on of the three groups of light sources are accurately and synchronously controlled, exposure and acquisition are performed for multiple times in a product movement process, and image data are recombined and subjected to color reproduction after acquisition is completed, so that a color image can be accurately restored; the system supports a plurality of light field modes, is suitable for a detected object with a high height angle difference and a high brightness-darkness contrast ratio, can meet the requirements of detecting product flaws, defects, colors and the like, and effectively improves the application range of an acquisition system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image detection technology, and in particular to a method and system for acquiring color images based on a black and white line scan camera under a combined light field. Background Art

[0002] Computer vision and image processing technologies are widely used in automated quality inspection, and can quickly and accurately detect the shape, size, color, texture and other characteristics of objects, as well as any possible defects. From the perspective of image output color, the industrial camera selection of machine vision systems includes black and white industrial cameras and color industrial cameras. Compared with the two, color cameras are more expensive, and the color filters in color cameras will reduce the sensitivity of the camera. If the object to be tested does not need to check color difference, black and white cameras will be a better choice, especially for object surface inspection. The accuracy and detail of the images taken by black and white cameras are usually much higher than those of color cameras.

[0003] In the current machine vision inspection system, for some defects of products, it is necessary to use the high detection accuracy of black and white cameras to collect image information of the object to be inspected under various light source angles to form a data set in order to highlight the contrast and accurately capture defects and flaws. How to provide a color light field environment for black and white line scan cameras so that color images can be restored after acquisition is an important issue in obtaining color images.

[0004] Currently, in the process of capturing color images, a three-color environment is generated by a combination of sensors and filters or prism splitting. There are three ways to obtain the color environment. One is based on the Bayer type CMOS / CCD chip; another is to use an image sensor, a combination of each row with a specific color filter; the third is a combination of line scanning image sensor and prism splitting.

[0005] However, the three current image acquisition methods all have obvious disadvantages. The presence of filters in color cameras will reduce the camera resolution and affect the restoration effect. The second method uses sensors and filters. When collecting and restoring products with height differences, there is a halo effect, and the installation angle needs to meet the installation requirements of being perpendicular to the product. The third method uses three image sensors, which are realized by the prism splitting white light and irradiating it to three sensors respectively. The cost of this method is often more than three times that of conventional color cameras, and it will reduce the sensitivity. The acquisition effect and restoration effect are not good.

[0006] Therefore, in existing machine vision, the selection of industrial cameras cannot be between black and white cameras and color cameras to simultaneously meet the detection needs of defects, color types, and product depth of field.

[0007] Based on the problems in the prior art, the present invention provides a method and system for acquiring a color image based on a black and white line scan camera under a combined light field. Summary of the invention

[0008] The purpose of the present invention is to provide a method for acquiring color images based on a black and white line scan camera under a combined light field, so as to solve the technical problem that color cameras or black and white cameras in the prior art cannot simultaneously meet the requirements of detecting product flaws, defects, color types, and high color contrast.

[0009] The technical solution of the present invention is: a method for acquiring a color image based on a black and white line scan camera under a combined light field, comprising: Adjusting the white balance gain of the black-and-white line scan camera under the three primary colors so that the black-and-white line scan camera reaches white balance and obtains the grayscale of the image; Three groups of three-color light sources are irradiated on the measured area, and each of the three-color light sources can be used alone or in combination to construct a light field environment suitable for different scenes; the light field environment includes a multi-light field acquisition mode, a high dynamic range mode, and a composite field acquisition mode; in the corresponding mode, the three groups of three-color light sources are turned on in combination according to a preset opening rule, and each time the multi-color light source is turned on, the black and white line scan camera exposes and collects a line of image data; The images captured by the black and white line scan camera are synthesized to restore one or more color images.

[0010] Preferably, each of the three-color light sources has three brightness levels, namely high brightness, medium brightness and low brightness; the three groups of three-color light sources are distributed at different positions according to the inclination angle of the light, and are respectively configured as bright field lighting, dark field lighting and coaxial lighting, and the light field environment is provided by a single group of three-color light sources at different positions selecting one of the red, green and blue color channels.

[0011] Preferably, when the black-and-white line scan camera collects a line of image information, one of the three groups of three-color light sources is turned on or a combination of multiple light sources is turned on simultaneously to provide a light field environment; In the multi-light field acquisition mode: a single light source is turned on separately, and each time the light source is turned on, the black-and-white line scan camera acquires one line; then, in one acquisition process, the three three-color light sources are turned on in sequence; the three three-color light sources are turned on three times respectively, and the acquired image data is reorganized and the color is restored to obtain three color images; High dynamic range mode: three light sources are turned on at the same time in the same color channel. Each time the light source is turned on, the black and white line scan camera collects one line correspondingly; The three colors are turned on in cycles and configured with different degrees of brightness. Three groups of three-color light sources are turned on nine times simultaneously in one acquisition process. The acquired image data is reorganized and the colors are restored to obtain an HDR color image. Composite field acquisition mode: three light sources are turned on at the same time with the same color channel. Each time the light source is turned on, the black and white line scan camera collects one line, and each of the three colors is collected once; the image data is reorganized and the color is restored to obtain a color image.

[0012] Preferably, when the three groups of three-color light sources are turned on, the same color channels of the three-color light sources at three different positions are turned on at the same time, and the light field environment in the same detection area is obtained by superimposing the same color monochromatic light sources at three different positions, and the red, green and blue images collected under the superimposed light field are merged to restore a color image.

[0013] Preferably, in the multi-light field acquisition mode, the cycle rule of turning on the light source is: In one acquisition process, first, the red channels of the three groups of three-color light sources are controlled to be turned on in sequence, then the green channels of the three groups of three-color light sources are controlled to be turned on in sequence, and finally, the blue channels of the three groups of three-color light sources are controlled to be turned on in sequence; Each time the three-color light source is turned on, the black-and-white line scan camera exposes and collects one line. One collection process can realize the collection of color data under the light field constructed by three lighting modes. For images with more than one line, the collection process is repeated.

[0014] Preferably, in the high dynamic range mode, the cycle rule of turning on the multi-color light source is: In one acquisition process, the red, green and blue color channels of the same color of the three groups of three-color light sources are controlled to be turned on at the same time, and are turned on 3 times with different brightness: the three groups of three-color light sources are turned on simultaneously for a total of 9 times, and the camera is exposed to collect one line each time the light source is turned on. One acquisition process realizes the acquisition of 1 line of HDR color data; for images with multiple lines, the operation process is repeated.

[0015] Preferably, the cycle rule of turning on the light source in the composite field acquisition mode is: In one acquisition process, the color channels of the same colors of red, green and blue of the three groups of three-color light sources are controlled to be turned on at the same time, and the red, green and blue colors are exposed once each, for a total of 3 times. Each time the light source is turned on, the black and white line scan camera exposes and collects a line of data; for multiple lines of images, the operation process is repeated.

[0016] Preferably, when the three groups of three-color light sources are used separately, the low-angle lighting method provides a light field for detecting scratches on the surface of the object under test, the high-angle lighting method provides a light field for detecting deformation of the object under test, and the coaxial lighting method provides a light field for detecting dirt or color difference of the object under test.

[0017] Preferably, when three groups of the three-color light sources are used in combination, the composite field acquisition mode is suitable for objects with weak reflection, the high dynamic range mode is suitable for detection scenes where the surface of the object is dirty, bright, with high contrast and large color difference, and the multi-light field acquisition image mode is suitable for detection scenes where the object is deformed and has a dirty surface.

[0018] A color image acquisition system based on a black-and-white line scan camera, used to implement the color image acquisition method, comprises a black-and-white line scan camera, three groups of three-color light sources, a light source controller, a data processor and a spectroscope; The black and white line scan camera is arranged above the measured area, and the three three-color light sources are respectively configured as coaxial lighting, high-angle lighting and low-angle lighting according to the inclination angle of the light source; Each group of three-color light sources has three color channels: red, green, and blue, and provides illumination one by one; The beam splitter is used to redirect the light of the coaxial lighting light source, the light source controller is used to control the start time and sequence of the three-color light sources, and control the exposure time of the black and white line scan camera; the data processor is used to reorganize the image data and restore the color.

[0019] Compared with the prior art, the advantages of the present invention are: (1) This application uses a light source controller to precisely and synchronously control the exposure of the camera and the opening of three groups of light sources, thereby achieving multiple exposures and acquisitions during the movement of the product. After the acquisition is completed, the image data is reorganized and the color is reproduced, which can accurately restore the color and realize the acquisition of color images. This not only solves the resolution problem of traditional methods, but also reduces costs.

[0020] (2) A set of acquisition systems supports multiple acquisition modes, including multi-light field acquisition mode, high dynamic range mode and composite field acquisition mode. In the combined light field mode, the acquired images carry more information. By reading the light intensity distribution, the light reflection characteristics of the object surface are obtained, and then the three-dimensional characteristics of the object surface are characterized. It can adapt to objects with high and low angle differences, detect scratches, deformation, dirt and color difference on the product surface, and is also suitable for products with high light-dark contrast, effectively improving the scope of application of the acquisition system.

[0021] (3) This application uses a black-and-white line scan camera with three sets of light sources. Compared with the Bayer format color line scan camera in the prior art, the color reproduction is higher; compared with the color scan camera with a combination of three-line sensors and filters, the installation is more convenient, the scene is not limited, and the cost is lower; compared with the prism color line scan camera, the cost is lower, the light utilization rate is higher, and the dynamic range is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The present invention will be further described below in conjunction with the accompanying drawings and embodiments: Figure 1 This is a flow chart of the color image acquisition method based on a black and white line scan camera according to the present invention; Figure 2 It is a flowchart of data acquisition by a black and white line scan camera in the multi-light field acquisition mode of the present invention; Figure 3 It is a flowchart of a black and white line scan camera collecting data in the high dynamic range acquisition mode of the present invention; Figure 4 It is a flowchart of the black and white line scan camera collecting data in the composite field collection mode of the present invention; Figure 5 This is a system schematic diagram of a color image acquisition system based on a black and white line scan camera according to the present invention; Figure 6 A schematic diagram of the collected image and the restored color image in the composite field collection mode of the present invention; Wherein: 1. first light source; 2. second light source; 3. third light source; 4. spectroscope; 5. object to be measured; 6. black and white line scan camera. DETAILED DESCRIPTION

[0023] The present invention is further described in detail below in conjunction with specific embodiments: The color image acquisition method provided in this application is realized by a collection system composed of a black and white line scan camera and a three-color light source. Figure 5 The system includes a black-and-white line scan camera 6, three groups of three-color light sources (a first light source 1, a second light source 2, and a third light source 3), a spectroscope 4, a light source controller, and a data processor.

[0024] During the acquisition process, high-speed and high-precision timing control technology is used to simultaneously turn on the light source and expose the camera, so that during the high-speed line scanning acquisition process, multiple red, green and blue data can be collected within the tiny displacement of the product. After the scan is completed, the image data can be recombined to restore the color.

[0025] like Figure 1 As shown, the method for acquiring a color image based on a black and white line scan camera under a combined light field includes the following steps: S1: Adjust the white balance gain of the black-and-white line scan camera under the three primary colors so that the black-and-white line scan camera reaches white balance and obtains the grayscale of the image.

[0026] S2: Three groups of three-color light sources are irradiated on the measured area. Each of the three-color light sources can be used alone or in combination to construct a light field environment suitable for different scenes. The light field environment includes multi-light field acquisition mode, high dynamic range mode and composite field acquisition mode. In the corresponding mode, the three groups of three-color light sources are turned on in combination according to the preset opening rules. Each time the multi-color light source is turned on, the black and white line scan camera exposes and collects a line of image data.

[0027] S3: The images captured by the black-and-white line scan camera are synthesized to restore one or more color images.

[0028] The camera uses a black and white line scan camera. A line scan camera is an image acquisition device that is often used in high-resolution applications to capture continuous objects in motion, such as cloth, film, steel coils, etc. Line scan cameras have the advantages of high resolution and fast acquisition speed compared to area scan cameras, and can meet the needs of detecting coil products during movement.

[0029] The black and white line scan camera is set above the measured area. According to the inclination angle of the light source, the three three-color light sources are configured as coaxial lighting, high-angle lighting and low-angle lighting respectively; the three-color light source adopts RGB three-color light source, which has three color channels of red, green and blue. At the specific start, one is selected to provide lighting. No filter or spectroscope is required for sorting, and it is directly illuminated within the area where the measured object is located, which will not reduce the resolution of the camera.

[0030] The beam splitter 4 is used to redirect the light source used for coaxial illumination. The light source controller is used to control the start time and sequence of the three-color light sources and the exposure time of the black-and-white line scan camera. The data processor is used to reorganize the image data and restore the color.

[0031] Each of the three-color light sources has three levels of brightness, namely high brightness, medium brightness and low brightness. Figure 5 As shown, the three groups of three-color light sources are arranged according to the positions and the inclination angles of their light rays. The inclination angle of the first light source 1 is greater than 45 degrees, and it is configured as bright field illumination. The inclination angle of the light rays of the second light source 2 is less than 45 degrees, and it is configured as dark field illumination. The third light source 3 is located so that the light rays are parallel to the plane of the object to be measured, and the light rays are deflected and reflected by the beam splitter 4 and irradiated onto the object to be measured, and it is arranged as coaxial illumination.

[0032] The light field environment used by the black-and-white line scan camera to capture images is composed of the color channel selection of three groups of three-color light sources, the brightness of the light sources, the order in which the light sources are turned on, and whether the light sources are turned on simultaneously or individually.

[0033] When the three groups of three-color light sources are used separately, the low-angle lighting method provides a light field for detecting scratches on the surface of the object being measured, the high-angle lighting method provides a light field for detecting deformation of the object being measured, and the coaxial lighting method provides a light field for detecting dirt or color difference of the object being measured.

[0034] Different light source combination rules construct different light field environments, which can be used to detect different product defects in different environments. This embodiment mainly introduces three working modes, namely multi-light field acquisition mode, high dynamic range mode and composite field acquisition mode.

[0035] For the convenience of description, the three color channels of the first light source 1, the second light source 2, and the third light source 3 are simply recorded as R1, G1, B1, R2, G2, B2, R3, G3, and B3.

[0036] In the multi-light field acquisition mode: the three groups of three-color light sources are turned on in sequence, and the black-and-white line scan camera collects one line correspondingly. The three three-color light sources are turned on three times in one acquisition process, and the collected image data are reorganized and the color is restored to obtain three color images.

[0037] For example, refer to the attached Figure 2 In the process cycle mode, in the multi-light field acquisition mode, the cycle rule of the light source is: In one acquisition process, first control the red channels of the three groups of three-color light sources to be turned on in sequence, then control the green channels of the three groups of three-color light sources to be turned on in the same order, and finally control the blue channels of the three groups of three-color light sources to be turned on in the same order, which is R1-R2-R3-G1-G2-G3-B1-B2-B3. Each time the three-color light sources are turned on, the black and white line scan camera 6 exposes and collects one line. One acquisition process can realize the acquisition of color data of three lighting modes (bright field-dark field and coaxial); for multiple lines of images, repeat the acquisition process. The collected image data is reorganized and color restored to obtain three color images.

[0038] For example, refer to the attached Figure 3 , In high dynamic range mode: three groups of three-color light sources are turned on at the same time with the same color channel, the three colors are turned on in a cycle, and different degrees of brightness are configured; the order of turning on the three groups of three-color light sources in one acquisition process is: R1, R2, and R3 are turned on at high brightness at the same time, G1, G2, and G3 are turned on at high brightness at the same time, B1, B2, and B3 are turned on at high brightness at the same time, R1, R2, and R3 are turned on at medium brightness at the same time, G1, G2, and G3 are turned on at medium brightness at the same time, B1, B2, and B3 are turned on at medium brightness at the same time, R1, R2, and R3 are turned on at low brightness at the same time, G1, G2, and G3 are turned on at low brightness at the same time, and B1, B2, and B3 are all turned on at low brightness at the same time.

[0039] Each time the light source is turned on, the black and white line scan camera 6 collects one line of data, and one collection process realizes the collection of one line of HDR color data; for multiple lines of images, the operation process is repeated. The collected image data is reorganized and the color is restored to obtain an HDR color image.

[0040] For example, refer to the attached Figure 4 In the composite field acquisition mode: three groups of three-color light sources are turned on at the same time with the same color channel, and one line is collected each time, and each of the three colors is collected once; the order of turning on the light sources is R1, R2, R3 at the same time, G1, G2, G3 at the same time, and B1, B2, B3 at the same time; each time the light source is turned on, the black and white line scan camera 6 collects a line of data. For multiple lines of images, the acquisition process is repeated. After the acquisition is completed, the image data is reorganized and the color is restored to obtain a color image.

[0041] Refer to the attached Figure 6 ,In the composite field acquisition mode, the process of acquiring and restoring color images is shown. The leftmost picture is the image acquired by alternating RGB cycles. The three middle pictures from top to bottom are the pictures composed of R, G, and B extracted from the original picture respectively. The rightmost picture is the final restored color image.

[0042] In the light source composite superposition mode, when the three groups of three-color light sources are turned on, the same color channels of the three-color light sources at three different positions are turned on at the same time, and the light field environment in the same detection area is obtained by superimposing the same color monochromatic light sources at three different positions. The red, green and blue images collected under the superimposed light field are merged to restore a color image.

[0043] The composite field acquisition mode is suitable for objects with weak reflectivity, such as dark fabrics. In this mode, three groups of three-color light sources are turned on at the same time to increase the light intensity and ensure the acquisition of high-quality images. The high dynamic range mode is suitable for detection scenes with dirt and foreign matter on the surface of the object being measured, high bright contrast, and large color difference. The multi-light field acquisition mode is suitable for detection scenes with deformation of the object being measured and dirt on the surface. The deformation state of the object being measured can be such as scratches, burrs, bumps, pits, dents, pits, welding pits, etc.

[0044] Different defects reflect light differently, resulting in different changes in image brightness. When light sources from different angles are irradiated on the same inspection area, the images presented will be different. Under three different angles of illumination, the black and white line scan camera collects images and conducts a comprehensive analysis of the collected images with different brightness changes. This can realize defect detection in the area to be inspected, which is different from 3D scanning and does not require 3D data.

[0045] Two-dimensional images can detect defects such as scratches, bumps, etc. caused by three-dimensional deformation.

[0046] Due to the deformation of the object, the surface defects will show different reflection states to light sources at different angles. For example, scratches appear bright under dark field (low angle) lighting, while the normal part is dark. Therefore, the position and two-dimensional size of the scratches can be seen from the two-dimensional image. For example, bumps and concaves, under bright field (high angle) lighting, the slope of the bumps and concaves will reflect light to places that the camera cannot capture, appearing dark, while the concave surface will reflect light into the camera and appear bright. Therefore, bumps and concaves will appear as light and dark shadows under high-angle lighting. Therefore, defects caused by three-dimensional deformation can be realized through two-dimensional images.

[0047] Regarding the balanced gain operation process of black and white line scan cameras under three primary colors and data reorganization and color restoration to obtain color images. The Chinese patent application number CN202211059127.1 (CN115460386B) discloses a method and system for obtaining color images using a black and white line scan camera, and discloses the conversion principle between the grayscale gain between the black and white line scan camera and the three primary colors in the process of obtaining color images with a black and white line scan camera. The principle process is: Take images of the calibration plate under red, green and blue illumination respectively, compare the grayscales of the images under the three illuminations, and select the illumination corresponding to the highest grayscale of the image as the reference illumination; set the gain coefficient of the black-and-white line scan camera under the reference illumination, and take images of the calibration plate (usually a standard white plate or a medium gray plate) under the reference illumination so that the grayscale of the image reaches the preset value, and adjust the gain coefficient of the black-and-white line scan camera so that the grayscale of the image when taking images of the calibration plate under the other two illuminations also reaches the preset value; The preset value of the image grayscale includes multiple step values ​​increasing by a fixed step length, specifically 40, 80, 120, 160 and 200. The average value of the gain coefficient corresponding to each step value when the image grayscale reaches the other two illuminations is calculated as the gain coefficient of the black-and-white line scan camera under the illumination. Thus, the black-and-white line scan camera reaches white balance. Under the reference illumination, the gain coefficient of the black-and-white line scan camera is set to the minimum value.

[0048] Based on the gain coefficients of red, green and blue light during white balance, three grayscale images of the object to be tested under corresponding light are obtained respectively; the data processor synthesizes the three grayscale images of the object to be tested into a color image.

[0049] Exemplarily, the process of the data processor synthesizing three grayscale images of the object to be tested into a color image includes the following steps: In specific implementation, because red, green and blue primary colors are used for illumination, when the three color light sources are turned on in sequence, the image captured by the black and white line scan camera mainly contains the brightness information of one color component. Therefore, when restoring the image, based on the gain coefficients of red, green and blue illumination during white balance, the grayscale of three grayscale images under the same brightness conditions of red, green and blue corresponding illumination are mapped to the R, G and B channels of the preset color image, thereby restoring a color image.

[0050] The mapping method is implemented by table lookup or linear conversion, which converts the input grayscale value into the grayscale output of the target color channel. Finally, the grayscale of the three channels is superimposed to form a visible color effect. Through a simple and fast image processing algorithm, the image information under different lighting conditions is effectively utilized to reconstruct an equivalent color two-dimensional image for subsequent defect detection and analysis.

[0051] When the three-color light sources are turned on in sequence, the images captured by the black and white line scan camera are converted into grayscale images containing only brightness information using the grayscale conversion tool in the image processing software. The grayscale image reflects the reflection of the surface of each part of the object under the corresponding color of light. The grayscale image conversion is performed because the image captured by the camera contains color components generated by the pigments of the specific light source. In order to extract the brightness information of the light, color interference needs to be eliminated. The grayscale image only records the information of the brightness of the image, that is, the intensity distribution of the corresponding light. By reading this light intensity distribution, the light reflection characteristics of the object surface are obtained, and then the three-dimensional characteristics of the object surface are characterized.

[0052] Through the image processing algorithm, the restored color image is preprocessed, including denoising, contrast enhancement, etc., to improve the image quality. Through the selected image processing algorithm, edge detection and shape segmentation are performed on the image to extract the color block area and edge contour of the object. According to the theoretical model of the object and the set color parameters, the color value of each color block and the gradient smoothness of the edge are analyzed to judge the color consistency between the color blocks, whether there is block peeling, and whether there are jagged edges and burrs on the edge, so as to determine whether there are defects on the product surface. In this way, through the analysis of the color image, it is effective to detect whether there are defects such as color shedding and burrs on the product surface, which provides support for the result judgment, expands the detection coverage, and improves the detection quality.

[0053] When the three groups of three-color light sources are turned on at the same time, the images collected by the black-and-white line scan camera carry richer information, and the three groups of three-color light sources provide light at different positions. According to the grayscale mapping, the defect characteristics of the inspection area can be mapped and reflected. Therefore, in the combined light field mode, the two-dimensional image can be used to represent the three-dimensional defect characteristics of the object surface. There is no need to construct a three-dimensional image based on the collected image through an algorithm, and then analyze the deep structural defects based on the three-dimensional image.

[0054] The color adjustment of the restored color image is carried out by adjusting the light source brightness and image gain: first set the three-color light source with the same brightness, collect a white reference target, and perform white balance coefficients based on the collected image, that is, the gain coefficients of the three channels R, G, and B. According to this coefficient, increase the light source brightness, or adjust the digital gain during image reconstruction to achieve the purpose of color adjustment.

[0055] This application uses a black and white line scan camera with three sets of three-color light sources to achieve color image acquisition, which not only solves the resolution problem of the traditional method, but also reduces the cost. By changing the lighting order and lighting brightness of the three sets of light sources, three different working modes can be combined to provide a light field environment for image acquisition.

[0056] When three groups of three-color light sources are turned on at the same time for compounding, the brightness, opening order and combination of the three groups of three-color light source images are changed to provide a light field environment with monochrome superposition at different angles. Under the condition of superimposed light field, the black and white line scan camera can capture images carrying more information. There is no need for two-dimensional color image processing or calculation to obtain three-dimensional image features. The two-dimensional image captured by this application can represent the three-dimensional information features, which simplifies the image processing steps, saves costs and improves the processing speed.

[0057] Effectively improve the scope of application of the acquisition system, that is, it can be applied to products of different materials and different surface morphologies, and can detect multiple defects. For example, it can simultaneously detect different defects on the surface of coils and large pieces of objects, such as surface scratches, deformation bumps, surface dirt and color difference; it is also suitable for products with high light-dark contrast, and adjusts and sets different light source brightness sequences to collect high dynamic range HDR color images; and this technology can be extended to a single set of hardware to collect color images of multiple light source scenes at one time.

[0058] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with this technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the scope of protection of the present invention. For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is limited by the attached claims rather than the above description, and it is intended to include all changes within the meaning and scope of the equivalent elements of the claims in the present invention.

Claims

1. A method for acquiring a color image based on a black and white line scan camera under a combined light field, characterized in that: include Adjusting the white balance gain of the black-and-white line scan camera under the three primary colors so that the black-and-white line scan camera reaches white balance and obtains the grayscale of the image; Three groups of three-color light sources are irradiated on the measured area. Each three-color light source can be used alone or in combination to construct a light field environment suitable for different scenes. The light field environment includes multi-light field acquisition mode, high dynamic range mode and composite field acquisition mode. In the corresponding mode, the three groups of three-color light sources are turned on in combination according to a preset turning-on rule, and each time the multi-color light source is turned on, the black-and-white line scan camera exposes and collects a line of image data; The images captured by the black and white line scan camera are synthesized to restore one or more color images.

2. The method for acquiring a color image based on a black and white line scan camera under a combined light field according to claim 1, characterized in that: Each of the three-color light sources has three brightness levels, namely high brightness, medium brightness and low brightness; the three groups of three-color light sources are distributed at different positions according to the inclination angle of the light, and are respectively configured as bright field lighting, dark field lighting and coaxial lighting, and the light field environment is provided with illumination by a single group of three-color light sources at different positions selecting one of the red, green and blue color channels.

3. The method for acquiring a color image based on a black and white line scan camera under a combined light field according to claim 2, characterized in that: When the black-and-white line scan camera collects a line of image information, one of the three groups of three-color light sources is turned on or a combination of multiple light sources is turned on simultaneously to provide a light field environment; In the multi-light field acquisition mode: a single light source is turned on separately, and each time the light source is turned on, the black-and-white line scan camera acquires one line; then, in one acquisition process, the three three-color light sources are turned on in sequence; the three three-color light sources are turned on three times respectively, and the acquired image data is reorganized and the color is restored to obtain three color images; High dynamic range mode: three light sources are turned on at the same time in the same color channel. Each time the light source is turned on, the black and white line scan camera collects one line correspondingly; The three colors are turned on in cycles and configured with different degrees of brightness. Three groups of three-color light sources are turned on nine times simultaneously in one acquisition process. The acquired image data is reorganized and the colors are restored to obtain an HDR color image. Composite field acquisition mode: three light sources are turned on at the same time with the same color channel. Each time the light source is turned on, the black and white line scan camera collects one line, and each of the three colors is collected once; the image data is reorganized and the color is restored to obtain a color image.

4. The method for acquiring a color image based on a black and white line scan camera under a combined light field according to claim 3, characterized in that: When the three groups of three-color light sources are turned on, the same color channels of the three-color light sources at three different positions are turned on at the same time. The light field environment in the same detection area is obtained by superimposing the same color monochromatic light sources at three different positions. The red, green and blue images collected under the superimposed light field are combined to restore a color image.

5. The method for acquiring a color image based on a black and white line scan camera under a combined light field according to claim 3, characterized in that: In the multi-light field acquisition mode, the cycle rule of turning on the light source is: In one acquisition process, first, the red channels of the three groups of three-color light sources are controlled to be turned on in sequence, then the green channels of the three groups of three-color light sources are controlled to be turned on in sequence, and finally, the blue channels of the three groups of three-color light sources are controlled to be turned on in sequence; Each time the three-color light source is turned on, the black-and-white line scan camera exposes and collects one line. One collection process can realize the collection of color data under the light field constructed by three lighting modes. For images with more than one line, the collection process is repeated.

6. The method for acquiring a color image based on a black and white line scan camera under a combined light field according to claim 3, characterized in that: In the high dynamic range mode, the cycle rule of turning on the multi-color light source is: In one acquisition process, the red, green and blue color channels of the same color of the three groups of three-color light sources are controlled to be turned on at the same time, and are turned on 3 times with different brightness: the three groups of three-color light sources are turned on simultaneously for a total of 9 times, and the camera is exposed to collect one line each time the light source is turned on. One acquisition process realizes the acquisition of 1 line of HDR color data; for images with multiple lines, the operation process is repeated.

7. The method for acquiring a color image based on a black and white line scan camera under a combined light field according to claim 3, characterized in that: The cycle rule of turning on the light source in the composite field acquisition mode is: In one acquisition process, the color channels of the same colors of red, green and blue of the three groups of three-color light sources are controlled to be turned on at the same time, and the red, green and blue colors are exposed once each, for a total of 3 times. Each time the light source is turned on, the black and white line scan camera exposes and collects a line of data; for multiple lines of images, the operation process is repeated.

8. The method for acquiring a color image based on a black and white line scan camera under a combined light field according to claim 2, characterized in that: When the three groups of three-color light sources are used separately, the dark field illumination method provides a light field for detecting scratches on the surface of the object under test, the bright field illumination method provides a light field for detecting deformation of the object under test, and the coaxial illumination method provides a light field for detecting dirt or color difference of the object under test.

9. The method for acquiring a color image based on a black and white line scan camera under a combined light field according to claim 3, characterized in that: When the three groups of three-color light sources are used in combination, the composite field acquisition mode is suitable for objects with weak reflection, the high dynamic range mode is suitable for detection scenes where the surface of the object is dirty, bright, with high contrast and large color difference, and the multi-light field acquisition mode is suitable for detection scenes where the object is deformed and has a dirty surface.

10. A color image acquisition system based on a black-and-white line scan camera, used to implement the method for acquiring a color image based on a black-and-white line scan camera under a combined light field as claimed in any one of claims 1 to 8, characterized in that: It includes a black and white line scan camera, three sets of three-color light sources, a light source controller, a data processor and a spectroscope; The black and white line scan camera is arranged above the measured area, and the three three-color light sources are respectively configured as coaxial lighting, high-angle lighting and low-angle lighting according to the inclination angle of the light source; Each group of three-color light sources has three color channels: red, green, and blue, and provides illumination one by one; The beam splitter is used to redirect the light of the coaxial lighting light source, the light source controller is used to control the start time and sequence of the three-color light sources, and control the exposure time of the black and white line scan camera; the data processor is used to reorganize the image data and restore the color.

Citation Information

Patent Citations

  • A method and system for acquiring color images using a black and white camera

    CN115460386B

  • Method and system for colorizing black and white picture

    CN101299277A

  • Multi-angle lighting device and collecting system

    CN108535265A

  • Method and system for acquiring color image by using black and white camera

    CN115460386A

  • Image acquisition system and image acquisition method

    CN116346999A

Cited By

  • Image processing method and system, color image acquisition method and storage medium

    CN121174049A

  • An image processing method and system, a color image acquisition method and a storage medium

    CN121174049B