A dispersion correction method, system and multi-line true color camera
By using a linear interpolation model and a color difference-color ratio interpolation algorithm in a multi-line true color camera, the pixel value missing components of R lines, G lines, and B lines in a multi-line true color camera are calculated and weighted to correct the dispersion problem caused by the mismatch between the object movement rate and the camera line frequency in a high-speed detection scene, and efficient color image acquisition is achieved.
Patent Information
- Application Number
- CN202411476756.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-10-22
AI Technical Summary
In high-speed detection scenarios, the object movement rate does not match the camera line frequency, resulting in abnormal compression, extreme blur and dispersion problems in the longitudinal direction of the image.
The linear interpolation model is used to calculate the missing components corresponding to the pixel values of R lines, G lines, and B lines in the multi-line true color camera respectively, and weighted calculations are performed through the color difference-color ratio interpolation algorithm to obtain the color difference and color ratio of the reference row, and then the correction components are calculated to correct the dispersion.
It realizes the acquisition of real color images under any rate matching, effectively suppresses edge dispersion problems, is small in calculation overhead, is easy to hardware, has superior performance and hardware resource consumption.
Smart Images

Figure CN119012021B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial cameras, and in particular to a dispersion correction method, system and a multi-line true color camera. Background Art
[0002] With the continuous improvement of detection efficiency in the field of machine vision, on the one hand, the data output rate of the front-end image sensor is required to continue to increase, and on the other hand, the movement rate of the product assembly line (i.e., the target object) is also required to continue to increase. The two need to meet a matching relationship to ensure that the collected image maintains a normal aspect ratio. However, in some special application fields such as printing / banknote detection, the target object moves very fast, and the camera output line frequency is far from reaching the (i.e., target object) movement rate. There is an obvious mismatch between the two. At this time, the collected image will be abnormally compressed in the longitudinal direction, and the image will be extremely blurred and dispersed.
[0003] Time delay integration uses a multi-line image sensor to work in a linear array push-scan mode. Through relative movement, multi-level pixel units are used to expose the same shooting target multiple times, and the multiple exposure results are accumulated. A shorter exposure time is used to achieve higher responsiveness and signal-to-noise ratio. Therefore, time delay integration technology is widely used in high-speed detection and production fields.
[0004] In addition, in order to meet the urgent demand for color in high-speed detection scenarios, the time delay integration technology is combined with the color image sensor.
[0005] Common multi-line color image sensors can be divided into true color and pseudo color. True color multi-line image sensors generally have 3 or more rows of pixel units. The color filter array covered by each row of pixel units has the same color and includes at least one row of red, one row of green, and one row of blue color filter arrays. The system of true color multi-line image sensors is simple and low cost. Therefore, the practical application of true color multi-line image sensor systems has received great attention. However, in high-speed detection applications, edge dispersion problems still occur due to the mismatch between the object movement rate and the camera line frequency.
[0006] Chinese patent CN116866726B proposes a TDI camera integration method, a color TDI camera integration method, a TDI camera and a medium. In this patent, for a color TDI camera, the dispersion problem is corrected by using the RGB delay relationship and a weighted interpolation algorithm to solve the image dispersion problem caused by rate mismatch. This patent has different technical means from this solution.
[0007] Chinese patent CN113824935B proposes a time delay integration method, device and apparatus for a pseudo color line scan camera to solve the problem that time delay integration in the prior art cannot be applied to pseudo color multi-line image sensors. The technical problem of this patent is different from that of this solution.
[0008] Chinese patent CN113824934B proposes a color interpolation method, device, equipment and storage medium for line scan cameras. The patent obtains red and green channel data or blue and green channel data of each pixel by superimposing two lines of image data; performs color interpolation processing on the red and green channel data or blue and green channel data of each pixel to obtain the missing blue channel data or red channel data to output complete RGB data; so that the color of the edge of the interpolated image in the vertical direction is accurate, eliminating the dispersion problem. This solution does not involve the relevant operation steps of superimposing pixels, which is different from the technical means of the patent.
[0009] CN113824936B discloses a color interpolation method, device, equipment and storage medium for a color filter array line scan camera. The patent superimposes two lines of image data to obtain red and green channel data or blue and green channel data for each pixel; for each pixel, the red and green channel data or blue and green channel data of the left and right pixels are used to perform color interpolation processing to obtain the missing blue channel data or red channel data to output complete RGB data. The present invention effectively improves the restoration degree of the interpolation result to the actual image. This solution does not involve the relevant operation steps of superimposing pixels using time delay integration, which is different from the technical means of the patent. Summary of the invention
[0010] The present invention provides a dispersion correction method, system and multi-line true color camera, which can solve at least one of the above technical problems.
[0011] To achieve the above object, the present invention proposes the following technical solutions:
[0012] A dispersion correction method, the method is applicable to a multi-line true color camera, the camera comprises at least one group of R line, G line, and B line for responding to red light, green light, and blue light respectively, the method comprising:
[0013] A linear interpolation model is used to calculate the missing components corresponding to the pixel values of the R row, G row, and B row in any group; any pixel value corresponds to two missing components; any row among the R row, G row, and B row is selected as the reference row;
[0014] Except for the reference row, based on the pixel value of each row and the two missing components corresponding to the pixel value, two color differences and two color ratios of each row are calculated respectively;
[0015] Select the color difference and color ratio of the same color, and weight the color difference and color ratio of the reference row respectively; calculate the color difference estimation component and color ratio estimation component of the reference row respectively based on the pixel value of the reference row and the color difference and color ratio of the reference row;
[0016] The missing component, the color difference estimation component, and the color ratio estimation component corresponding to the reference row of the same color are weightedly calculated to obtain two correction components of the reference row. The two correction components and the pixel value of the reference row are used as the dispersion correction result.
[0017] Furthermore, the camera includes two or more groups of R rows, G rows, and B rows for responding to red light, green light, and blue light, respectively, and also includes: performing weighted calculations on several original pixels of R rows, original pixels of G rows, and original pixels of B rows to obtain an R row pixel, a G row pixel, and a B row pixel as a group of pixel rows.
[0018] Furthermore, the linear interpolation model is used to calculate the missing components corresponding to the pixel values of the R row, the G row, and the B row in any group, respectively, including:
[0019] During continuous exposure, the camera performs weighted interpolation on the pixel values of the Mth row of pixels obtained after the tth exposure and the pixel values of the Mth row of pixels obtained after the t+1th exposure along the moving direction of the scanned object to obtain missing components corresponding to the interpolation reference row pixels; wherein the interpolation reference row is any row of the R row, the G row, and the B row, and M is any row except the interpolation reference row.
[0020] Furthermore, the calculation of the two color differences of each row includes: in any row except the reference row, taking the difference between the missing component corresponding to the reference color in the current row and the pixel value of the current row as the first color difference of the current pixel value; taking the difference between the missing component corresponding to the reference color in the current row and another missing component as the second color difference of the current pixel value; and taking the color corresponding to the reference row as the reference color.
[0021] Furthermore, the two color ratios of each row include: in any row except the reference row, the ratio of the missing component corresponding to the reference color in the current row divided by the pixel value of the current row is used as the first color ratio of the current pixel value; the ratio of the missing component corresponding to the reference color in the current row divided by another missing component is used as the second color ratio of the current pixel value; and the color corresponding to the reference row is used as the reference color.
[0022] Furthermore, before adopting the linear interpolation model, the method further includes: delaying each row of original pixels rows, realizing integer-level delay of original pixels, and obtaining pixels of R row, G row, and B row; wherein, there are a pixels between any two adjacent rows, and the rate ratio between the scanning line frequency of the camera and the movement rate of the scanned object is 1:N.
[0023] Based on the same inventive concept, the present invention also proposes a dispersion correction system, which is applicable to a multi-line true color camera, and the system comprises:
[0024] The linear interpolation module uses a linear interpolation model to calculate the missing components corresponding to the pixels in the R row, G row, and B row respectively; any row of pixels corresponds to two missing components;
[0025] The color difference and color ratio module is used to select any one of the R row, G row and B row as the reference row; except for the reference row, based on the pixel value of each row and the two missing components corresponding to the pixel value, two color differences and two color ratios of each row are calculated respectively; the color difference and color ratio of the same color are selected, and the color difference and color ratio of the reference row are weightedly calculated respectively;
[0026] An estimation component module, used to calculate a color difference estimation component and a color ratio estimation component of the reference row based on the pixel value of the reference row and the color difference and color ratio of the reference row;
[0027] The correction module is used to weightedly calculate the missing component, color difference estimation component and color ratio estimation component corresponding to the reference row of the same color to obtain two correction components of the reference row, and use the two correction components and the pixel value of the reference row as the dispersion correction result.
[0028] Furthermore, it also includes:
[0029] Delay module, used to delay the original pixels of R row, G row and B row respectively rows, realizing integer-level delay of original pixels, and obtaining pixels of R row, G row, and B row; wherein, there are a pixels between any two adjacent rows, and the rate ratio between the scanning line frequency of the camera and the movement rate of the scanned object is 1:N.
[0030] Furthermore, it also includes:
[0031] The pixel group acquisition module includes two or more groups of R rows, G rows, and B rows for responding to red light, green light, and blue light respectively, and is used to perform weighted calculations on several original pixels of R rows, original pixels of G rows, and original pixels of B rows respectively to obtain an R row pixel, a G row pixel, and a B row pixel as a group of pixel rows.
[0032] Based on the same inventive concept, the present invention also proposes a multi-line true color camera, comprising:
[0033] An image sensor is used to collect original pixels of the R row, the G row, and the B row; the image sensor includes at least one group of R row, G row, and B row for responding to red light, green light, and blue light, respectively.
[0034] Memory for storing computer programs;
[0035] A processor is configured to run the computer program to perform the dispersion correction method as described above.
[0036] The beneficial effects of the present invention are as follows:
[0037] The dispersion correction method disclosed in the present invention adopts a simple linear interpolation combined with a color difference-color ratio interpolation algorithm, can support the acquisition of real color images under any rate matching conditions, and fully suppress the edge dispersion problem.
[0038] The dispersion correction method proposed in this application only uses four simple arithmetic operations to complete the calculation process of the true color output result. The calculation overhead is very small, it is easy to hardware, and it has advantages in performance and hardware resource consumption.
[0039] The dispersion correction method proposed in the present application, when the camera includes two or more groups of R rows, G rows, and B rows for responding to red light, green light, and blue light respectively, that is, when multiple groups of RGB row pixel values are obtained, in order to improve the calculation efficiency, a pre-processing of grouping optimization of the multiple groups of RGB row pixels is also proposed. According to actual needs and current resource configuration, multiple groups of RGB or a new group of R', G', B' row pixel data can be selected as the data basis to realize the dispersion correction calculation.
[0040] The dispersion correction method proposed in the present application also proposes integer-level delay preprocessing of the data to solve the problem of delay in pixel values of each row caused by inconsistent speed between the linear array camera and the scanned object, so as to reduce the amount of calculation and improve the calculation efficiency.
[0041] In addition, by utilizing the above-mentioned dispersion correction method, a multi-line true color line array camera with lower cost can be realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a schematic flow chart of the dispersion correction method in the present invention;
[0043] Figure 2 is a schematic diagram of the method flow of Example 1 of the present invention;
[0044] Figure 3 is a schematic diagram of an original pixel in Example 1 of the present invention;
[0045] Figure 4 is a schematic diagram of the original pixel after integer level delay in Example 1 of the present invention;
[0046] Figure 5 is G of Example 1 of the present invention R3.9 Schematic diagram of interpolation calculation;
[0047] Figure 6is a schematic diagram of an original pixel in Example 2 of the present invention;
[0048] Figure 7 It is a schematic diagram of the original pixels after superposition in Example 2 of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0050] like Figure 1 As shown, the present invention proposes a dispersion correction method, which is applicable to a multi-line true color camera, wherein the camera includes at least one group of R lines, G lines, and B lines for responding to red light, green light, and blue light respectively, and the method includes:
[0051] A linear interpolation model is used to calculate the missing components corresponding to the pixel values of the R row, G row, and B row in any group; any pixel value corresponds to two missing components; any row among the R row, G row, and B row is selected as the reference row;
[0052] Except for the reference row, two color differences and two color ratios of each row are calculated based on the pixel value of each row and the two missing components corresponding to the pixel value; the color difference and color ratio of the same color are selected to weight the color difference and color ratio of the reference row; the color difference estimation component and color ratio estimation component of the reference row are calculated based on the pixel value of the reference row and the color difference and color ratio of the reference row;
[0053] The missing component, the color difference estimation component, and the color ratio estimation component corresponding to the reference row of the same color are weightedly calculated to obtain two correction components of the reference row. The two correction components and the pixel value of the reference row are used as the dispersion correction result.
[0054] Preferably, the camera includes two or more groups of R rows, G rows, and B rows for responding to red light, green light, and blue light, respectively, and also includes: performing weighted calculations on several original pixels of R rows, original pixels of G rows, and original pixels of B rows, respectively, to obtain an R row pixel, a G row pixel, and a B row pixel as a group of pixel rows. Example 1
[0055] like Figure 2 As shown, a dispersion correction method is proposed in this embodiment. The method is applicable to a multi-line true color camera, which includes a group of R lines, G lines, and B lines for responding to red light, green light, and blue light respectively.
[0056] In this embodiment, the color array of the multi-line true color image sensor in the camera is distributed in the order of R row, G row, and B row from top to bottom. Preferably, the color array can also be distributed in the order of R row, B row, G row, or other distributions such as B row, R row, and G row.
[0057] In this embodiment, a preprocessing method for the original pixels collected by the multi-line true color camera is proposed:
[0058] Delay for each row of raw pixels rows to achieve integer-level delay of RGB row pixels; wherein, there are a pixels between any two adjacent rows, and the rate ratio between the scanning line frequency of the camera and the movement rate of the scanned object is 1:N.
[0059] Preferably, the above preprocessing may not be used, and the collected original pixels may be used as the pixel values of the R row, the G row, and the B row to perform the following calculations.
[0060] In this embodiment, a=1, N=1.3, that is, there is one pixel between any two adjacent rows, and the ratio between the scanning line frequency of the camera and the movement rate of the scanned object is 1:1.3, so each row of original pixels is delayed by one row.
[0061] During the continuous exposure process, along the moving direction of the scanned object, the original pixels collected by the multi-line true color camera are as follows: Figure 3 As shown, after the integer level delay obtained by the above preprocessing, the obtained pixel is as follows Figure 4 shown.
[0062] S100 In this embodiment, based on the above preprocessing, pixels in the R row, pixels in the G row, and pixels in the B row are obtained.
[0063] A linear interpolation model is used to calculate the missing components corresponding to the pixel values of the R row, G row, and B row in any group; any pixel value corresponds to two missing components.
[0064] A linear interpolation model is adopted, including: during the continuous exposure process, the camera performs weighted interpolation on the pixel values obtained after the t-th exposure of the pixels in the M-th row and the pixel values obtained after the t+1-th exposure of the pixels in the M-th row along the moving direction of the scanned object, to obtain the missing components corresponding to the pixels in the interpolation reference row; wherein the interpolation reference row is any row of the R row, the G row, and the B row, and M is any row except the interpolation reference row.
[0065] In this embodiment, the above linear interpolation process is explained by taking row R as an interpolation reference row as an example.
[0066] Taking the 3.9 position in row R as the reference, R 3.9 The corresponding two missing components are G R3.9, B R3.9 .
[0067] like Figure 5 As shown, the pixel value G at position 3.3 obtained after the 3tth exposure of the G row of pixels is 3.3 , and the pixel value G at position 4.6 obtained after the 4tth exposure of the G row of pixels 4.6 After weighted interpolation, the missing component G corresponding to the R row pixels is obtained. R3.9 The specific formula is as follows: , where α is the linear interpolation weight coefficient. Here, ;but .
[0068] The pixel value B at position 2.7 obtained after the 2tth exposure of row B pixels is 2.7 , and the pixel value B4 at position 4 obtained after the 3tth exposure of the pixel in row B, the missing component B corresponding to the pixel in row R is obtained. R3.9 The specific formula is as follows: , where β is the linear interpolation weight coefficient. Here, ;but .
[0069] Similarly, the two missing components corresponding to any pixel in the R row, the G row, and the B row are obtained in sequence.
[0070] S200 selects any one of the R row, the G row, and the B row as a reference row, and calculates two color differences and two color ratios of the reference row;
[0071] Except for the reference row, two color differences and two color ratios of each row are calculated based on the pixel value of each row and the two missing components corresponding to the pixel value.
[0072] Select the color difference and color ratio of the same color, and weight the color difference and color ratio of the reference row respectively; calculate the color difference estimation component and color ratio estimation component of the reference row respectively based on the reference row pixel value and the color difference and color ratio of the reference row.
[0073] In any row except the reference row, the difference between the missing component corresponding to the reference color in the current row and the pixel value in the current row is used as the first color difference of the current pixel value; the difference between the missing component corresponding to the reference color in the current row and the other missing component is used as the second color difference of the current pixel value; the color corresponding to the reference row is used as the reference color.
[0074] In any row except the reference row, the ratio of the missing component corresponding to the reference color in the current row divided by the pixel value of the current row is used as the first color ratio of the current pixel value; the ratio of the missing component corresponding to the reference color in the current row divided by another missing component is used as the second color ratio of the current pixel value; the color corresponding to the reference row is used as the reference color.
[0075] The pixel value at any position in the reference row, that is, the two missing components corresponding to the reference pixel value, are respectively a first color missing component (of the reference pixel value) and a second color missing component (of the reference pixel value).
[0076] Taking the pixel row where the first color is located (first color pixel row) as an example, the calculation process of the color difference and color ratio is explained.
[0077] It can be known from the calculation in S100 that the pixel value at any position in the first color pixel row, that is, the two missing components corresponding to the first color pixel value, are respectively the reference color missing component (of the first color pixel value) and the second color missing component (of the first color pixel value).
[0078] Two color differences of the first color pixel value are calculated respectively: a difference value obtained by subtracting the first color pixel value from the reference color missing component (of the first color pixel value) is used as the first color difference of the first color pixel value; a difference value obtained by subtracting the second color missing component (of the first color pixel value) from the reference color missing component (of the first color pixel value) is used as the second color difference of the first color pixel value.
[0079] Two color ratios of the first color pixel value are calculated respectively: a ratio of a reference color missing component (of the first color pixel value) divided by the first color pixel value is used as the first color ratio of the first color pixel value; a ratio of a reference color missing component (of the first color pixel value) divided by a second color missing component (of the first color pixel value) is used as the second color ratio of the first color pixel value.
[0080] Similarly, the pixel value at any position in the second color pixel row, that is, the two color differences and the color ratio of the second color pixel value, are obtained.
[0081] The difference between the reference color missing component (of the second color pixel value) and the second color pixel value is used as the first color difference of the second color pixel value; the difference between the reference color missing component (of the second color pixel value) and the first color missing component (of the second color pixel value) is used as the second color difference of the second color pixel value.
[0082] The ratio of the reference color missing component (of the second color pixel value) divided by the second color pixel value is used as the first color ratio of the second color pixel value; the ratio of the reference color missing component (of the second color pixel value) divided by the first color missing component (of the second color pixel value) is used as the second color ratio of the second color pixel value.
[0083] The color difference and color ratio of the same color are selected, and the first color color difference, the second color color difference, the first color color ratio, and the second color color ratio of the reference row are weightedly calculated respectively.
[0084] Calculate the color difference of the first color of the reference row: select two color differences of the first color, which are the first color difference of the first color pixel value and the second color difference of the second color pixel value; perform weighted calculation on the two color differences of the first color to obtain the color difference of the first color of the reference row. Selecting the color difference of the same color means that the minuend color of the first color pixel value and the second color difference of the second color pixel value are the same (both are the reference color) and the subtrahend color are the same (both are the first color).
[0085] Similarly, calculate the color ratio of the first color of the reference row: select two color ratios of the first color, which are the first color ratio of the first color pixel value and the second color ratio of the second color pixel value; perform weighted calculation on the two color ratios of the first color to obtain the color ratio of the first color of the reference row. Selecting the color ratio of the same color means that the dividend color of the first color pixel value and the second color ratio of the second color pixel value are the same (both are the reference color) and the divisor color are the same (both are the first color).
[0086] Similarly, the second color color difference and the second color color ratio of the reference row are calculated.
[0087] In order to further illustrate the calculation process of color difference and color ratio, this embodiment takes row G as the reference row and row G as the reference row. 4.6 Take for example (i.e. the pixel value of row G at position 4.6).
[0088] After selecting the delay and G 4.6 The pixel value R of row R at the same exposure time 3.9 , pixel value B in row B 5.3 , as G 4.6 The basis for calculating color difference and color ratio.
[0089] S201 color difference calculation process:
[0090] The R row selects the pixel value R at position 3.9 3.9 , R can be obtained by S100 calculation 3.9 The missing component G R3.9 , B R3.9 .
[0091] Color difference of R line , .
[0092] Row B selects pixel value B at position 5.3 5.3 , calculated by S100, we can get B 5.3 The missing component RB5.3 , G B5.3 .
[0093] Color difference of row B , .
[0094] Select the color difference of the same color and calculate G by weight 4.6 Two color differences.
[0095]
[0096]
[0097] Where γ is the color difference interpolation coefficient. Here, ;but .
[0098] In summary, get G 4.6 The two color differences G_R G4.6 , G_B G4.6 .
[0099] S202 color ratio calculation process:
[0100] The R row selects the pixel value R at position 3.9 3.9 , R can be obtained by S100 calculation 3.9 The missing component G R3.9 , B R3.9 .
[0101] Color ratio of R row , .
[0102] Row B selects pixel value B at position 5.3 5.3 , calculated by S100, we can get B 5.3 The missing component R B5.3 , G B5.3 .
[0103] Color ratio of row B , .
[0104] Select the color ratio with the same color and calculate G by weight 4.6 Two color ratios.
[0105]
[0106]
[0107] Where δ is the color ratio interpolation coefficient. Here, ;but .
[0108] In summary, get G 4.6 Two color ratios G_GR G4.6 、G_GB G4.6 .
[0109] S300 Calculate two color difference estimation components and two color ratio estimation components based on the two color differences, the two color ratios and the pixel values of the reference row.
[0110] After the above calculation process, two color differences of the reference row (the first color color difference of the reference row, the second color color difference of the reference row) and two color ratios (the first color color ratio of the reference row, the second color color ratio of the reference row) are obtained. The pixel value of the reference row is known. By using the calculation principle of color difference and color ratio, we can reversely obtain the pixel value of the reference row and the estimated components corresponding to the two colors other than the reference color, namely, two color difference estimation components and two color ratio estimation components.
[0111] Two color difference estimation components are calculated: the difference of the first color color difference of the reference row minus the pixel value of the reference row is used as the first color color difference estimation component (first color difference estimation component); the difference of the second color color difference of the reference row minus the pixel value of the reference row is used as the first color color difference estimation component (second color difference estimation component).
[0112] Two color ratio estimation components are calculated: the first color ratio estimation component (first color ratio estimation component) is obtained by dividing the pixel value of the reference row by the ratio of the first color ratio of the reference row; the second color ratio estimation component (second color ratio estimation component) is obtained by dividing the pixel value of the reference row by the ratio of the second color ratio of the reference row.
[0113] S301 Based on the two color differences G_R calculated in S201 G4.6 , G_B G4.6 , and G 4.6 , calculate the color difference estimation component R1(G 4.6 )=G 4.6 -G_R G4.6 , B1(G 4.6 )=G 4.6 -G_B G4.6 .
[0114] S302 Based on the two color ratios G_GR calculated in S202 G4.6 、G_GB G4.6 , and G 4.6 , calculate the color ratio estimation component RG2(G 4.6 )=G 4.6 / G_GR G4.6 , BG2(G 4.6 )=G 4.6 / G_GB G4.6 .
[0115] S400 Weighted calculation of the missing component, the color difference estimation component, and the color ratio estimation component corresponding to the reference row of the same color to obtain the correction component of the color; to obtain two correction components.
[0116] After calculation in S100, two missing components corresponding to the reference row pixel value are obtained. After calculation in S200-S300, two color difference estimation components and two color ratio estimation components corresponding to the reference row pixel value are obtained by using color difference and color ratio interpolation calculation.
[0117] Among them, the two missing components are respectively the first color missing component and the second color missing component; the two color difference estimation components are respectively the first color difference estimation component and the second color difference estimation component; and the two color ratio estimation components are respectively the first color ratio estimation component and the second color ratio estimation component.
[0118] Three components with the same color, namely, the first color missing component, the first color difference estimation component, and the first color ratio estimation component, are selected for weighted calculation to obtain a first color correction component; similarly, a second color correction component is calculated.
[0119] The S100 calculation can give G 4.6 The corresponding two missing components are R G4.6 , B G4.6 After S200-S300 calculation, using color difference and color ratio interpolation calculation, two color difference estimation components are obtained: R1(G 4.6 )、B1(G 4.6 ), two color ratio estimation components RG2(G 4.6 )、BG2(G 4.6 ).
[0120] Calculate G 4.6 The corresponding R correction component
[0121] Calculate G 4.6 The corresponding B correction component
[0122] In this embodiment, G 4.6 The corresponding R correction component, G 4.6 The corresponding B correction components are obtained by weighted average calculation. Preferably, weight coefficients can be set in the calculation of the correction components according to factors such as the spatial position or order of the missing components, color difference estimation components, and color ratio estimation components in the row to meet the accuracy requirements for the calculation of the correction components in different scenarios.
[0123] Finally, the two calculated correction components and the pixel value of the reference row are output as the dispersion correction result. Example 2
[0124] In this embodiment, a dispersion correction method is proposed, and the method is applicable to a multi-line true color camera. The camera includes two groups of R lines, G lines, and B lines for responding to red light, green light, and blue light respectively. That is, this embodiment takes a six-line true color camera as an example to illustrate its dispersion correction method.
[0125] In this embodiment, the color array of the multi-line true color image sensor in the camera is distributed in the order of R row, R row, G row, G row, B row, and B row from top to bottom.
[0126] In this embodiment, a=1, N=2, that is, there is one pixel between any two adjacent rows, and the rate ratio between the scanning line frequency of the camera and the movement rate of the scanned object is 1:2.
[0127] In this embodiment, during the continuous exposure process of the six-line true color camera, along the moving direction of the scanned object, the original pixels collected by the six-line true color camera are as follows: Figure 6 shown.
[0128] In this embodiment, R row, G row, and B row are used as a group of pixel units, and the collected original pixels are used as the pixel values of R row, G row, and B row. The pixel values included in the two groups of pixel units are respectively calculated using the method described in S100-S400 in Embodiment 1 to obtain two correction components corresponding to any reference row pixel value.
[0129] Finally, the two correction components of the pixel value of any reference row and the pixel value of the reference row are output as the dispersion correction result of the group of pixel units.
[0130] In addition, before using the original pixels to calculate the correction components, each pixel row may be delayed using the preprocessing method (S0) as described in Example 1 to reduce the computational resource consumption of the correction components in this embodiment and improve computational efficiency.
[0131] like Figure 6 As shown, the distribution order of RGB in the six-line true color camera in the prior art is RRGGBB, and there is a pixel between any two adjacent rows, and a=1.
[0132] In this embodiment, if the delay calculation is performed with the R row, G row, and B row as a group of pixel units, then the interval between any two adjacent rows in the group of pixel units is 3 pixels, and a1=3 in the group of pixel units. rows to achieve integer level delay of RGB row pixels. Example 3
[0133] On the basis of the second embodiment, this embodiment performs fusion processing on the pixel row data before performing calculation on each group of pixel unit data.
[0134] During the continuous exposure process, the original pixels collected by the six-line true color camera along the moving direction of the scanned object are as follows: Figure 6 shown.
[0135] Before adopting the dispersion correction method described in Example 1 or Example 2, weighted calculations are performed on a number of original pixels in R rows, original pixels in G rows, and original pixels in B rows to obtain an R row pixel, a G row pixel, and a B row pixel as a group of pixel rows.
[0136] In this embodiment, the original pixel data collected by the six-line true color camera is averaged, and the data of the pixel rows with the same color are formed to form new pixel data of R', G', and B' rows to form a group of RGB pixel units, such as Figure 7 shown.
[0137] In this embodiment, a new group of pixel rows (R', G', B' rows) is obtained by only simple averaging calculation.
[0138] In addition, a simple weighted average may be performed on the superposition results, or other weighted calculation methods may be used to obtain pixel values corresponding to a new set of pixel rows (R', G', B' rows).
[0139] The dispersion correction method described in Example 1 or Example 2 is used for the pixel data of the R', G', and B' rows to obtain a dispersion correction result. Example 4
[0140] Based on the same inventive concept, the present invention also proposes a dispersion correction system, which is applicable to a multi-line true color camera, and the system comprises:
[0141] The linear interpolation module uses a linear interpolation model to calculate the missing components corresponding to the pixels in the R row, G row, and B row respectively; any row of pixels corresponds to two missing components;
[0142] The color difference and color ratio module is used to select any one of the R row, the G row, and the B row as a reference row; in any row other than the reference row, the color difference and the color ratio of the current row are calculated respectively based on the pixel value of the current row and the two missing components of the row; so as to obtain two color differences and two color ratios;
[0143] An estimation component module, used to calculate two color difference estimation components based on two color differences and pixel values of a reference row; and to calculate two color ratio estimation components based on two color ratios and pixel values of a reference row;
[0144] The correction module is used to weightedly calculate the missing component, color difference estimation component, and color ratio estimation component corresponding to the reference row of the same color to obtain the correction component of the color; until the two correction components of the reference row are obtained, the two correction components and the pixel value of the reference row are used as the dispersion correction result. Example 5
[0145] Based on Example 4, this embodiment proposes a dispersion correction system, further comprising:
[0146] Delay module, used to delay the original pixels of R row, G row and B row respectively rows, realizing integer-level delay of original pixels, and obtaining pixels of R row, G row, and B row; wherein, there are a pixels between any two adjacent rows, and the rate ratio between the scanning line frequency of the camera and the movement rate of the scanned object is 1:N. Example 6
[0147] Based on Embodiment 4 or 5, this embodiment provides a dispersion correction system, further comprising:
[0148] The pixel group acquisition module includes two or more groups of R rows, G rows, and B rows for responding to red light, green light, and blue light respectively, and is used to perform weighted calculations on several original pixels of R rows, original pixels of G rows, and original pixels of B rows respectively to obtain an R row pixel, a G row pixel, and a B row pixel as a group of pixel rows.
[0149] The present invention also provides a multi-line true color camera, comprising:
[0150] The image sensor is used to collect the original pixels of the R row, the G row, and the B row; the image sensor includes at least one group of R row, G row, and B row for responding to red light, green light, and blue light respectively.
[0151] Memory for storing computer programs;
[0152] A processor is configured to run the computer program to perform the above-mentioned dispersion correction method.
[0153] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the dispersion correction method as described above is implemented.
[0154] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0155] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A dispersion correction method, characterized in that: The method is applicable to a multi-line true color camera, wherein the camera comprises at least one group of R lines, G lines, and B lines for responding to red light, green light, and blue light respectively, and the method comprises: A linear interpolation model is used to calculate the missing components corresponding to the pixel values of the R row, G row, and B row in any group; any pixel value corresponds to two missing components; any row among the R row, G row, and B row is selected as the reference row; Except for the reference row, based on the pixel value of each row and the two missing components corresponding to the pixel value, two color differences and two color ratios of each row are calculated respectively; Select the color difference and color ratio of the same color, and weight the color difference and color ratio of the reference row respectively; calculate the color difference estimation component and color ratio estimation component of the reference row respectively based on the pixel value of the reference row and the color difference and color ratio of the reference row; The missing component, the color difference estimation component, and the color ratio estimation component corresponding to the reference row of the same color are weightedly calculated to obtain two correction components of the reference row. The two correction components and the pixel value of the reference row are used as the dispersion correction result.
2. The dispersion correction method according to claim 1, characterized in that: The camera includes two or more groups of R rows, G rows, and B rows for responding to red light, green light, and blue light respectively, and also includes: performing weighted calculations on several original pixels of the R rows, the original pixels of the G rows, and the original pixels of the B rows to obtain an R row pixel, a G row pixel, and a B row pixel as a group of pixel rows.
3. The dispersion correction method according to claim 1 or 2, characterized in that: The linear interpolation model is used to calculate the missing components corresponding to the pixel values of the R row, the G row, and the B row in any group, respectively, including: During continuous exposure, the camera performs weighted interpolation on the pixel values of the Mth row of pixels obtained after the tth exposure and the pixel values of the Mth row of pixels obtained after the t+1th exposure along the moving direction of the scanned object to obtain missing components corresponding to the interpolation reference row pixels; wherein the interpolation reference row is any row of the R row, the G row, and the B row, and M is any row except the interpolation reference row.
4. The dispersion correction method according to claim 1 or 2, characterized in that: The calculation of the two color differences of each row includes: in any row except the reference row, taking the difference between the missing component corresponding to the reference color in the current row and the pixel value of the current row as the first color difference of the current pixel value; taking the difference between the missing component corresponding to the reference color in the current row and another missing component as the second color difference of the current pixel value; and taking the color corresponding to the reference row as the reference color.
5. The dispersion correction method according to claim 1 or 2, characterized in that: The two color ratios of each row include: in any row except the reference row, the ratio of the missing component corresponding to the reference color in the current row divided by the pixel value of the current row is used as the first color ratio of the current pixel value; the ratio of the missing component corresponding to the reference color in the current row divided by another missing component is used as the second color ratio of the current pixel value; and the color corresponding to the reference row is used as the reference color.
6. The dispersion correction method according to any one of claims 1 or 2, characterized in that: Before adopting the linear interpolation model, the method further includes: delaying each row of original pixels rows, realizing integer-level delay of original pixels, and obtaining pixels of R row, G row, and B row; wherein, there are a pixels between any two adjacent rows, and the rate ratio between the scanning line frequency of the camera and the movement rate of the scanned object is 1:N.
7. A dispersion correction system, the system being applicable to a multi-line true color camera, characterized in that: The system comprises: The linear interpolation module uses a linear interpolation model to calculate the missing components corresponding to the pixels in the R row, G row, and B row respectively; any row of pixels corresponds to two missing components; The color difference and color ratio module is used to select any one of the R row, G row and B row as the reference row; except for the reference row, based on the pixel value of each row and the two missing components corresponding to the pixel value, two color differences and two color ratios of each row are calculated respectively; the color difference and color ratio of the same color are selected, and the color difference and color ratio of the reference row are weightedly calculated respectively; An estimation component module, used to calculate a color difference estimation component and a color ratio estimation component of the reference row based on the pixel value of the reference row and the color difference and color ratio of the reference row; The correction module is used to weightedly calculate the missing component, color difference estimation component and color ratio estimation component corresponding to the reference row of the same color to obtain two correction components of the reference row, and use the two correction components and the pixel value of the reference row as the dispersion correction result.
8. The dispersion correction system according to claim 7, characterized in that: Also includes: Delay module, used to delay the original pixels of R row, G row and B row respectively rows, realizing integer-level delay of original pixels, and obtaining pixels of R row, G row, and B row; wherein, there are a pixels between any two adjacent rows, and the rate ratio between the scanning line frequency of the camera and the movement rate of the scanned object is 1:N.
9. The dispersion correction system according to claim 7, characterized in that: Also includes: The pixel group acquisition module includes two or more groups of R rows, G rows, and B rows for responding to red light, green light, and blue light respectively, and is used to perform weighted calculations on several original pixels of R rows, original pixels of G rows, and original pixels of B rows respectively to obtain an R row pixel, a G row pixel, and a B row pixel as a group of pixel rows.
10. A multi-line true color camera, characterized in that: include: An image sensor is used to collect original pixels of the R row, the G row, and the B row; the image sensor includes at least one group of R row, G row, and B row for responding to red light, green light, and blue light, respectively. Memory for storing computer programs; A processor, configured to run the computer program to perform the dispersion correction method as described in any one of claims 1-6.
Citation Information
Patent Citations
Line scan camera color interpolation method, device, equipment and storage medium
CN113824934B
Time delay integration method, device and equipment for pseudo-color line scan camera
CN113824935B
Color filter array line scan camera color interpolation method, device and equipment
CN113824936B
Integration methods for TDI cameras, integration methods for color TDI cameras, TDI cameras and media
CN116866726B
Image processing method and device and movable platform
CN112640424A