Image processing method and system based on improved double-gradient interpolation algorithm

Through the improved dual gradient interpolation algorithm, the color value of RGB pixel points is calculated using the boundary evaluation value, which solves the problem of jagged effect and interpolation direction errors in the prior art, and achieves more accurate image processing and product quality evaluation.

CN120390154APending Publication Date: 2025-07-29TRULY OPTO ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510478846.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

In the prior art, Tvline line-to-jagged effect is easily generated when processing images based on bilinear interpolation algorithm. Directly using the double-gradient interpolation algorithm will still lead to errors in determining the interpolation direction, affecting image resolution and product quality evaluation.

Method used

By obtaining the horizontal and vertical RGB pixel points in the RGB pixel array, calculate the boundary evaluation value, discard or retain the color values of adjacent green pixel points based on the boundary evaluation results, calculate the color values of the current pixel points using the principle of color difference equality in the smaller domain, and introduce all pixel points in the surrounding neighborhood to assist in determining the direction.

Benefits of technology

The accuracy of boundary judgment is improved, and good interpolation effect is achieved at the edges of the lateral line pairs with high spatial frequency of Tvline, reducing the serration effect, providing more accurate image resolution analysis materials, reflecting the quality of the module product.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120390154A_ABST
    Figure CN120390154A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and system based on an improved double-gradient interpolation algorithm. The method comprises the following steps: acquiring an RGB pixel array; obtaining a transverse boundary evaluation value and a longitudinal boundary evaluation value by using the first RGB pixel point and the second RGB pixel point, and evaluating the boundary of the current pixel point by using the transverse boundary evaluation value and the longitudinal boundary evaluation value; if yes, abandoning or reserving green pixel points adjacent to the current pixel point according to a boundary evaluation result, obtaining green values of the remaining adjacent green pixel points, calculating a green value of the current pixel point according to the green values of the remaining adjacent green pixel points, and obtaining a green value of the current pixel point by using a principle that chromatic aberration in a smaller field is equal. Obtaining a red value or a blue value of the current pixel point according to the green color value of the current pixel point, and obtaining all color values of the current pixel point; the image can be well restored into a transverse strip with uniform transition in a transverse line high-frequency area, and more accurate analysis materials are provided for a subsequent analytic power analysis algorithm, so that the quality of a module product is reflected more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of module image interpolation, and particularly relates to an image processing method and system based on an improved double-gradient interpolation algorithm. Background Art

[0002] Currently, most upstream test box suppliers of module factories, after capturing the Raw images taken by the camera module, mostly process the images based on the bilinear interpolation algorithm, which will cause the Tvline pairs to produce a sawtooth effect, reduce the image resolution, and have a certain impact on truly reflecting the resolution of the module product.

[0003] Due to the ordinary double-gradient interpolation algorithm only determining the interpolation direction based on the color differences in the horizontal and vertical directions, it is more suitable for the interpolation of Tvline drawings. However, for Tvline drawings with a relatively high spatial frequency, it will still cause incorrect judgment of the interpolation direction, resulting in abnormal color points, affecting the test results of the subsequent resolution test algorithm for the entire image and product resolution, and causing misjudgment. Summary of the Invention

[0004] In the prior art, when processing images based on the bilinear interpolation algorithm, it is easy to cause the Tvline pairs to produce a sawtooth effect. When directly using the double-gradient interpolation algorithm for processing, it will still cause incorrect judgment of the interpolation direction, resulting in abnormal color points.

[0005] To solve the above problems, an image processing method and system based on an improved double-gradient interpolation algorithm are proposed. By using an image sensor to obtain the first RGB pixel points within the horizontal M×N array range centered on the current pixel point and the second RGB pixel points within the vertical N×M array range in the RGB pixel array, obtaining the horizontal boundary evaluation value and the vertical boundary evaluation value by using the first RGB pixel points and the second RGB pixel points, evaluating the boundary of the current pixel point by using the horizontal boundary evaluation value and the vertical boundary evaluation value, obtaining the boundary evaluation result, and then according to the boundary evaluation result, discarding or retaining the colors of the adjacent pixels of the current pixel during calculation, obtaining the color values of the remaining adjacent pixel points, improving the accuracy of boundary determination. At the edge of the horizontal line pairs with a relatively high Tvline spatial frequency (i.e., a relatively small line pair width), due to introducing all pixel points in the surrounding neighborhood to assist in judging the direction, a better interpolation effect can still be achieved, and the sawtooth effect is also better than that of the ordinary double-gradient interpolation. In the high-frequency region of the horizontal lines, the image can still be better restored to a uniformly transitional horizontal strip, providing more accurate analysis materials for the subsequent resolution analysis algorithm, and thus more accurately reflecting the quality of the module product.

[0006] In a first aspect, an image processing method based on an improved double-gradient interpolation algorithm includes: Step 100: Obtain an image frame in Raw format using an imaging module, and filter the image frame using an infrared filter to obtain an RGB pixel array; Step 200: Use an image sensor to obtain first RGB pixel points within a horizontal M×N array range centered on the current pixel point and second RGB pixel points within a vertical N×M array range in the RGB pixel array. Use the first RGB pixel points and the second RGB pixel points to obtain a horizontal boundary evaluation value and a vertical boundary evaluation value, and use the horizontal boundary evaluation value and the vertical boundary evaluation value to evaluate the boundary of the current pixel point to obtain a boundary evaluation result; Step 300: If the current pixel point is a non-green pixel point, then according to the boundary evaluation result, discard or retain the adjacent green pixel points of the current pixel point, obtain the green values of the remaining adjacent green pixel points, and calculate the green value of the current pixel point according to the green values of the remaining adjacent green pixel points. Utilize the principle of equal small-area color difference, and obtain the red value or blue value of the current pixel point according to the green color value of the current pixel point to obtain all color values of the current pixel point; Wherein, N > M, N ≥ 5, M ≥ 3; Step 400: Repeat steps 200 - 300 until all color interpolations of all pixel points in the RGB pixel array are completed.

[0007] Combined with the image processing method based on the improved double-gradient interpolation algorithm described in the first aspect of the present invention, in the first possible implementation manner, the step 200 includes: Step 210: Obtain the color values of all pixel points in the first RGB pixel points; Step 220: Obtain the absolute value of the color value difference of the same color in the same row of the horizontal M×N array; Step 230: Add up all the absolute values of the color value differences to obtain a horizontal boundary evaluation value.

[0008] Combined with the first possible implementation manner of the first aspect of the present invention, in the second possible implementation manner, the step 200 further includes: Step 240: Obtain the color values of all pixel points in the second RGB pixel points; Step 250: Obtain the absolute value of the color value difference of the same color in the same column of the vertical N×M array; Step 260: Add up all the absolute values of the color value differences to obtain a vertical boundary evaluation value.

[0009] Combined with the second possible implementation manner of the first aspect of the present invention, in the third possible implementation manner, the step 200 further includes: Step 270, compare the horizontal boundary evaluation value with the vertical boundary evaluation value; Step 280, if the horizontal boundary evaluation value is greater than the vertical boundary evaluation value, it is determined that there is a horizontal boundary; Step 290, if the horizontal boundary evaluation value is equal to the vertical boundary evaluation value, it is determined that the current pixel is located at the center of the region; Step 291, if the horizontal boundary evaluation value is less than the vertical boundary evaluation value, it is determined that there is a vertical boundary.

[0010] Combined with the third possible implementation manner of the first aspect of the present invention, in the fourth possible implementation manner, the step 300 includes: Step 310, if there is a horizontal boundary, discard the green value of the vertical green pixel of the current pixel; Step 320, obtain the average value of the green values of the horizontal green pixels adjacent to the current pixel as the green value of the current pixel.

[0011] Combined with the fourth possible implementation manner of the first aspect of the present invention, in the fifth possible implementation manner, the step 300 further includes: Step 330, if there is a vertical boundary, discard the green value of the horizontal green pixel of the current pixel; Step 340, obtain the average value of the green values of the vertical green pixels adjacent to the current pixel as the green value of the current pixel.

[0012] Combined with the fifth possible implementation manner of the first aspect of the present invention, in the sixth possible implementation manner, the step 300 further includes: Step 350, if the current pixel is located at the center of the region, retain the average value of the green values of the green pixels adjacent to the current pixel; Step 360, obtain the average value of the green values of all the green pixels adjacent to the current pixel as the green value of the current pixel.

[0013] Combined with the sixth possible implementation manner of the first aspect of the present invention, in the seventh possible implementation manner, the step 300 further includes: Step 370, obtain the red value of the red pixel adjacent to the current pixel and the green value of the green pixel; Step 380, use the green color value of the current pixel, the green values of the adjacent green pixels, and the red value of the adjacent red pixel or the blue value of the adjacent blue pixel to obtain the red value or the blue value of the current pixel.

[0014] Second aspect, an image processing system based on an improved double-gradient interpolation algorithm, adopting the image processing method based on the improved double-gradient interpolation algorithm described in the first aspect, includes: An acquisition module, configured to acquire an image frame in Raw format by using an imaging module, and filter the image frame by using an infrared filter to obtain an RGB pixel array; A boundary evaluation module, configured to acquire first RGB pixel points within a horizontal M×N array range centered on the current pixel point and second RGB pixel points within a vertical N×M array range in the RGB pixel array by using an image sensor, acquire a horizontal boundary evaluation value and a vertical boundary evaluation value by using the first RGB pixel points and the second RGB pixel points, evaluate the boundary of the current pixel point by using the horizontal boundary evaluation value and the vertical boundary evaluation value, and obtain a boundary evaluation result; An interpolation module, configured to, when the channel of the current pixel point is not the green channel, discard or retain adjacent green pixel points of the current pixel point according to the boundary evaluation result, obtain the green values of the remaining adjacent green pixel points, calculate the green value of the current pixel point according to the green values of the remaining adjacent green pixel points, utilize the principle of equal color difference in a smaller area, and obtain the red value or blue value of the current pixel point according to the green color value of the current pixel point, so as to obtain all color values of the current pixel point; Wherein, N>M, N≥5, M≥3.

[0015] Combined with the image processing system based on the improved double-gradient interpolation algorithm described in the second aspect of the present invention, in a first possible implementation manner, the boundary evaluation module includes: A first calculation unit, a second calculation unit and a comparison and determination unit; The first calculation unit is configured to acquire the color values of all pixel points in the first RGB pixel points, calculate the absolute value of the color value difference of the same color in the same row of the horizontal M×N array and add up all the absolute values of the color value differences to obtain a horizontal boundary evaluation value; The second calculation unit is configured to acquire the color values of all pixel points in the second RGB pixel points, the absolute value of the color value difference of the same color in the same column of the vertical N×M array and add up all the absolute values of the color value differences to obtain a vertical boundary evaluation value; The comparison and determination unit is configured to compare and determine the horizontal boundary evaluation value and the vertical boundary evaluation value: if the horizontal boundary evaluation value is greater than the vertical boundary evaluation value, it is determined that there is a horizontal boundary; if the horizontal boundary evaluation value is equal to the vertical boundary evaluation value, it is determined that the current pixel point is located at the center of the area; if the horizontal boundary evaluation value is less than the vertical boundary evaluation value, it is determined that there is a vertical boundary.

[0016] Implementing the image processing method and system based on the improved double-gradient interpolation algorithm of the present invention, by using an image sensor to obtain the first RGB pixel points within the horizontal M×N array range centered on the current pixel point and the second RGB pixel points within the vertical N×M array range in the RGB pixel array, obtaining the horizontal boundary evaluation value and the vertical boundary evaluation value by using the first RGB pixel points and the second RGB pixel points, evaluating the boundary of the current pixel point by using the horizontal boundary evaluation value and the vertical boundary evaluation value, obtaining the boundary evaluation result, and then according to the boundary evaluation result, discarding or retaining the colors of the adjacent pixels of the current pixel point during calculation, obtaining the color values of the remaining adjacent pixel points, improving the accuracy of boundary determination. At the horizontal line pair edge where the Tvline spatial frequency is relatively high (i.e., the line pair width is relatively small), since all pixel points within the surrounding neighborhood are introduced to assist in judging the direction, a better interpolation effect can still be achieved, and the jagged effect is also better than that of ordinary double-gradient interpolation. In the high-frequency region of horizontal lines, the image can still be better restored to a horizontal strip with uniform transition, providing more accurate analysis materials for the subsequent resolution analysis algorithm, thereby more accurately reflecting the quality of the module product. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0018] Figure 1 is the RGB array diagram in this application; Figure 2 is the ordinary bilinear interpolation effect diagram in the prior art; Figure 3 is the double-gradient interpolation effect diagram in the prior art; Figure 4 is the improved double-gradient interpolation effect diagram in this application; Figure 5 is a schematic flowchart of a specific embodiment of an image processing method based on the improved double-gradient interpolation algorithm in this application; Figure 6 is Figure 5 a schematic flowchart of a specific embodiment of step 200 in; Figure 7 is Figure 6 a schematic flowchart of a specific embodiment after step 230 in; Figure 8 is Figure 7 a schematic flowchart of a specific embodiment after step 260 in; Figure 9 is Figure 5 a schematic flowchart of the first specific embodiment of step 300 in Figure 10 is Figure 5 a schematic flowchart of the second specific embodiment of step 300 in Figure 11 is Figure 5 a schematic flowchart of the third specific embodiment of step 300 in Figure 12 is Figure 5 a schematic flowchart of the fourth specific embodiment of step 300 in Figure 13 a schematic structural diagram of a specific embodiment of an image processing system based on an improved double-gradient interpolation algorithm in the present application. Specific Embodiments

[0019] Next, the technical solutions in the present invention will be clearly and completely described in conjunction with the accompanying drawings in the invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this invention belongs. The terms used in the description of the present invention in this specification are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0021] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.

[0022] It should be understood that the orientation or positional relationship indicated by the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present application.

[0023] In addition, the terms "first" and "second" are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of this application, "a plurality" means two or more unless otherwise specifically defined.

[0024] In the prior art, when processing an image based on the bilinear interpolation algorithm, it is easy to cause the Tvline pair to produce a sawtooth effect. When directly using the double-gradient interpolation algorithm for processing, it will still cause an error in judging the interpolation direction and generate abnormal color points.

[0025] The bilinear interpolation principle and effect in the prior art: As Figure 1 , Figure 1 is the RGB array diagram in this application. Let Red(B11) represent the red channel data (interpolated red color value) to be interpolated on the B11 pixel. Similarly, Blue(B11) is the blue channel data, and Green(B11) is the green channel data (interpolated green color value). Since the blue channel data does not require interpolation and the other channel data is obtained by taking the average of its adjacent pixel points, the following can be obtained: Color data (RGB) of the B11 pixel point: Red(B11) = (R00 + R02 + R20 + R22) / 4; Green(B11) = (G01 + G10 + G12 + G21) / 4; Blue(B11) = B11; Color data of the G12 pixel point: Red(G12) = (R02 + R22) / 2; Green(G12) = G12; Blue(G12) = (B11 + B13) / 2; Color data of the G21 pixel point: Red(G21) = (R20 + R22) / 2; Green(G21) = (G10 + G12 + G30 + G32) / 4; Blue(G21) = (B11 + B31) / 2; Color data of the R22 pixel point: Red(R22) = (R02 + R22) / 2; Green(R22) = G12; Blue(R22) = (B11 + B13 + B31 + B33) / 4; The image obtained using the bilinear interpolation algorithm, such as Figure 2 , Figure 2 is the ordinary bilinear interpolation effect diagram in the prior art; at the edge of the Tvline horizontal line pair, when calculating the colors of other channels, the average value of the colors of other channels of the pixel points adjacent to the current pixel point is taken. Therefore, in the black-and-white junction area, since part of the color data of the pixel points in the black area is introduced at the white junction position to calculate the average value, it will cause the value of a certain color channel of the current pixel point obtained by calculation to be abnormal. Similarly, the fitting pixel color data at the black junction position will also have corresponding abnormalities, as shown in the enlarged view in Figure 1 , resulting in a jagged effect.

[0026] In view of the above problems, an image processing method and system based on an improved double-gradient interpolation algorithm are proposed.

[0027] In a first aspect, an image processing method based on an improved double-gradient interpolation algorithm, such as Figure 5 , Figure 5 is a schematic flowchart of a specific embodiment of an image processing method based on an improved double-gradient interpolation algorithm in the present application; it includes: Step 100: Obtain an image frame in Raw format using an imaging module, and filter the image frame using an infrared filter to obtain an RGB pixel array, such as Figure 1 .

[0028] Step 200: Use an image sensor to obtain the first RGB pixel points in the horizontal M×N array range centered on the current pixel point and the second RGB pixel points in the vertical N×M array range in the RGB pixel array, obtain the horizontal boundary evaluation value and the vertical boundary evaluation value using the first RGB pixel points and the second RGB pixel points, and evaluate the boundary of the current pixel point using the horizontal boundary evaluation value and the vertical boundary evaluation value to obtain a boundary evaluation result; In a preferred embodiment, such as Figure 6 , Figure 6 is Figure 5 a schematic flowchart of a specific embodiment of step 200 in

[0029] In this embodiment, such as Figure 1, where M and N are 3 and 5 respectively. Taking the pixel point B33 as an example, the color values of all pixel points in the first RGB pixel points include: G21, G23, G25, R22, R24, R42, R44, B31, B33, B35, G32, G34, G41, G43, G45. Then, using formula (1) for the horizontal boundary evaluation value (Gh): Gh = |G21 - G23| + |R22 - R24| + |G23 - G25| + |B31 - B33| + |G32 - G34| + |B33 - B35| + |G41 - G43| + |R42 - R44| + |G43 - G45| (1) In a preferred embodiment, such as Figure 7 , Figure 7 is Figure 6 a schematic flowchart of a specific embodiment after step 230 in

[0030] In this embodiment, then using formula (2) for the vertical boundary evaluation value (Gv): Gv = |G12 - G32| + |R22 - R42| + |G32 - G52| + |B13 - B33| + |G23 - G43| + |B33 - B53| + |G14 - G34| + |R24 - R44| + |G34 - G54| (2) In a preferred embodiment, such as Figure 8 , Figure 8 is Figure 7 a schematic flowchart of a specific embodiment after step 260 in

[0031] Step 300: If the current pixel point is a non - green pixel point, then according to the boundary evaluation result, discard or retain the adjacent green pixel points of the current pixel point, obtain the green values of the remaining adjacent green pixel points, calculate the green value of the current pixel point according to the green values of the remaining adjacent green pixel points, utilize the principle of equal color difference in a smaller area, and obtain the red value or blue value of the current pixel point according to the green color value of the current pixel point, so as to obtain all the color values of the current pixel point; In a preferred embodiment, as Figure 9 , Figure 9 is Figure 5 a schematic flowchart of the first specific embodiment of step 300 in

[0032] In a preferred embodiment, as Figure 10 , Figure 10 is Figure 5 a schematic flowchart of the second specific embodiment of step 300 in

[0033] In a preferred embodiment, as Figure 11 , Figure 11 is Figure 5 a schematic flowchart of the third specific embodiment of step 300 in

[0034] In a preferred embodiment, as Figure 12 , Figure 12 is Figure 5 a schematic flowchart of the fourth specific embodiment of step 300 in

[0035] where N > M, N ≥ 5, M ≥ 3; When the current pixel is not a green pixel, taking pixel B11 as an example, where B11 is a blue pixel, first calculate the component color values of the green channels of each pixel, and then calculate the component values of the other color channels of each pixel. In the improved double-gradient algorithm in this embodiment, by comparing the horizontal boundary evaluation value with the horizontal boundary evaluation value, when at the horizontal line boundary, since the adjacent left and right pixels of the current central pixel are both black, while the upper and lower pixels are one black and one white, due to the similar colors, the absolute value of the difference in the green components (green color values) between the left and right pixels of pixel B11 is smaller. At this time, discard the green components of the green pixels adjacent to the upper and lower sides of pixel B11, and only take the green components of the left and right pixels to calculate the average value, that is: When Gh is greater than Gv, it is a horizontal boundary, and take: Green(B11) = (G10 + G12) / 2. Similarly, when Gh is less than Gv, it is a vertical boundary, and take: Green(B11) = (G01 + G21) / 2. And when Gh is equal to Gv, it is the central area, and take: Green(B11) = (G10 + G12 + G01 + G21) / 4. By analogy, the green channel values (green components / green values) of all pixels in the entire image can be calculated.

[0036] Then, according to the principle that the pixel transition is smooth and the color difference is equal in a smaller neighborhood, that is, the principle that the red-green or red-blue color differences on adjacent pixels are equal, as shown in formula (3): Green(B11) - Red(B11) = ((Green(R00) - Red(R00)) + (Green(R02) - Red(R02)) + (Green(R20) - Red(R20)) + (Green(R22) - Red(R22))) / 4 (3), Among them, the green color value Green(B11) of the current pixel has been calculated, and Green(R00), Red(R00), (Green(R02), Red(R02), (Green(R20), Red(R20), (Green(R22), Red(R22) are the color values of adjacent pixels and are known quantities. Substitute them into formula (3), and the red color value Red(B11) of the current pixel can be calculated. Among them, the blue color value B(11) is known. Thus, the color values of all current pixels are obtained.

[0037] Based on this principle, the following formula can be used to obtain the red-blue color values on each green pixel and the red values on each blue pixel: Green(G12) - Blue(G12) = ((Green(B11) - Blue(B11)) + (Green(B13) - Blue(B13))) / 2; Green(G12) - Red(G12) = ((Green(R02) - Red(R02)) + (Green(R22) - Red(R22))) / 2; Green(G21) - Blue(G21) = ((Green(B11) - Blue(B11)) + (Green(B31) - Blue(B31))) / 2; Green(G21) - Red(G21) = ((Green(R20) - Red(R20)) + (Green(R22) - Red(R22))) / 2; Green(R22) - Blue(R22) = ((Green(B11) - Blue(B11)) + (Green(B13) - Blue(B13)) + (Green(B31) - Blue(B31)) + (Green(B33) - Blue(B33))) / 4。

[0038] Step 400: Repeat steps 200 - 300 until all color interpolations of all pixel points in the RGB pixel array are completed. By using the image sensor to obtain the first RGB pixel points within the horizontal M×N array range centered on the current pixel point and the second RGB pixel points within the vertical N×M array range in the RGB pixel array, obtaining the horizontal boundary evaluation value and the vertical boundary evaluation value by using the first RGB pixel points and the second RGB pixel points, evaluating the boundary of the current pixel point by using the horizontal boundary evaluation value and the vertical boundary evaluation value, obtaining the boundary evaluation result, and then discarding or retaining the colors of the adjacent pixels of the current pixel point during calculation according to the boundary evaluation result to obtain the color values of the remaining adjacent pixel points, which improves the accuracy of boundary determination. At the horizontal line pair edge with a relatively high Tvline spatial frequency (i.e., a smaller line pair width), since all pixel points in the surrounding neighborhood are introduced to assist in judging the direction, a better interpolation effect can still be achieved, and the jagged effect is also better than that of ordinary double-gradient interpolation. In the high-frequency region of the horizontal line, the image can still be better restored to a horizontal strip with uniform transition, providing more accurate analysis materials for the subsequent resolution analysis algorithm, and thus more accurately reflecting the quality of the module product.

[0039] Such as Figure 3 , Figure 3It is the double-gradient interpolation effect diagram in the prior art; for the image obtained by the double-gradient interpolation algorithm, at the horizontal line pair edge with a relatively low Tvline spatial frequency (i.e., a relatively large line pair width), since the direction judgment is not so difficult, a better interpolation effect can still be achieved. For example, Figure 3 on the left side, the sawtooth effect is significantly better than bilinear interpolation, showing a uniformly transitional horizontal strip in the horizontal line area. However, when the spatial frequency is relatively high (the line width is small), such as Figure 3 on the right side, since only the adjacent pixel points in the horizontal and vertical neighboring areas are introduced to judge the boundary direction of the current pixel, when the frequency is relatively high, it is difficult to judge the boundary direction, and there will still be abnormal sawtooth effect points caused by wrong directions.

[0040] Figure 4 It is the improved double-gradient interpolation effect diagram in this application. For example, Figure 4 as shown, for the image interpolated using the algorithm of this application, at the horizontal line pair edge with a relatively high Tvline spatial frequency (i.e., a relatively small line pair width), since all pixel points in the surrounding neighborhood are introduced to assist in direction judgment, a better interpolation effect can still be achieved. For example, Figure 4 the enlarged image on the right side, the sawtooth effect is better than the above-mentioned ordinary double-gradient interpolation, and the image can still be better restored to a uniformly transitional horizontal strip in the high-frequency area of the horizontal line, so it can effectively improve the image quality accuracy for various spatial frequencies of the Tvline image, providing more accurate analysis materials for the subsequent resolution analysis algorithm to more accurately reflect the quality of the product.

[0041] In the second aspect, an image processing system based on an improved double-gradient interpolation algorithm adopts the image processing method based on the improved double-gradient interpolation algorithm in the first aspect. For example, Figure 13 , Figure 13 It is a schematic structural diagram of a specific embodiment of an image processing system based on an improved double-gradient interpolation algorithm in this application, including: An acquisition module 501, configured to use an imaging module to acquire an image frame in Raw format, and use an infrared filter to filter the image frame to obtain an RGB pixel array; A boundary evaluation module 502, configured to use an image sensor to obtain first RGB pixel points in a horizontal M×N array range centered on the current pixel point and second RGB pixel points in a vertical N×M array range in the RGB pixel array, obtain a horizontal boundary evaluation value and a vertical boundary evaluation value by using the first RGB pixel points and the second RGB pixel points, evaluate the boundary of the current pixel point by using the horizontal boundary evaluation value and the vertical boundary evaluation value, and obtain a boundary evaluation result; The interpolation module 503 is configured to, when the current pixel point channel is not the green channel, discard or retain the green pixel points adjacent to the current pixel point according to the boundary evaluation result, obtain the green values of the remaining adjacent green pixel points, calculate the green value of the current pixel point according to the green values of the remaining adjacent green pixel points, utilize the principle of equal small-area color difference, and obtain the red value or blue value of the current pixel point according to the green color value of the current pixel point, so as to obtain all color values of the current pixel point; where N > M, N ≥ 5, and M ≥ 3.

[0042] Further, the boundary evaluation module includes a first calculation unit, a second calculation unit, and a comparison and determination unit; the first calculation unit is configured to obtain the color values of all pixel points in the first RGB pixel points, calculate the absolute value of the color value difference of the same color in the same row of the horizontal M×N array and add up all the absolute values of the color value differences to obtain a horizontal boundary evaluation value; the second calculation unit is configured to obtain the color values of all pixel points in the second RGB pixel points, calculate the absolute value of the color value difference of the same color in the same column of the vertical N×M array and add up all the absolute values of the color value differences to obtain a vertical boundary evaluation value; the comparison and determination unit is configured to compare the horizontal boundary evaluation value with the vertical boundary evaluation value and make a determination: if the horizontal boundary evaluation value is greater than the vertical boundary evaluation value, it is determined that there is a horizontal boundary; if the horizontal boundary evaluation value is equal to the vertical boundary evaluation value, it is determined that the current pixel point is located at the center of the region; if the horizontal boundary evaluation value is less than the vertical boundary evaluation value, it is determined that there is a vertical boundary.

[0043] Implementing a method and system for an image processing system based on an improved double-gradient interpolation algorithm of the present invention, by using an image sensor to obtain a first RGB pixel point within the range of a horizontal M×N array centered on the current pixel point and a second RGB pixel point within the range of a vertical N×M array in the RGB pixel array, obtaining a horizontal boundary evaluation value and a vertical boundary evaluation value by using the first RGB pixel point and the second RGB pixel point, evaluating the boundary of the current pixel point by using the horizontal boundary evaluation value and the vertical boundary evaluation value to obtain a boundary evaluation result, and then discarding or retaining the colors of the adjacent pixels of the current pixel point during calculation according to the boundary evaluation result to obtain the color values of the remaining adjacent pixel points, which improves the accuracy of boundary determination. At the horizontal line pair edge with a relatively high Tvline spatial frequency (i.e., a relatively small line pair width), since all pixel points within the surrounding neighborhood are introduced to assist in determining the direction, a better interpolation effect can still be achieved, and the sawtooth effect is also better than that of ordinary double-gradient interpolation. In the high-frequency region of horizontal lines, the image can still be better restored to a horizontal strip with uniform transition, providing more accurate analysis materials for the subsequent resolution analysis algorithm, and thus more accurately reflecting the quality of the module product.

[0044] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. An image processing method based on an improved double-gradient interpolation algorithm, characterized in that, Including: Step 100: Obtain an image frame in Raw format using an imaging module, and filter the image frame using an infrared filter to obtain an RGB pixel array; Step 200: Use an image sensor to obtain first RGB pixel points within a horizontal M×N array range centered on the current pixel point and second RGB pixel points within a vertical N×M array range in the RGB pixel array. Use the first RGB pixel points and the second RGB pixel points to obtain a horizontal boundary evaluation value and a vertical boundary evaluation value. Use the horizontal boundary evaluation value and the vertical boundary evaluation value to evaluate the boundary of the current pixel point and obtain a boundary evaluation result; Step 300: If the current pixel point is a non-green pixel point, then according to the boundary evaluation result, discard or retain the green pixel points adjacent to the current pixel point, obtain the green values of the remaining adjacent green pixel points, and calculate the green value of the current pixel point according to the green values of the remaining adjacent green pixel points. Use the principle of equal small-area color difference, and obtain the red value or blue value of the current pixel point according to the green color value of the current pixel point to obtain all color values of the current pixel point; Wherein, N > M, N ≥ 5, M ≥ 3; Step 400: Repeat steps 200-300 until all color interpolations of all pixel points in the RGB pixel array are completed.

2. The image processing method based on the improved double-gradient interpolation algorithm according to claim 1, characterized in that, The step 200 includes: Step 210: Obtain the color values of all pixel points in the first RGB pixel points; Step 220: Obtain the absolute value of the color value difference of the same color in the same row of the horizontal M×N array; Step 230: Add up all the absolute values of the color value differences to obtain a horizontal boundary evaluation value.

3. The image processing method based on the improved double-gradient interpolation algorithm according to claim 2, wherein, The step 200 further includes: Step 240: Obtain the color values of all pixel points in the second RGB pixel points; Step 250: Obtain the absolute value of the color value difference of the same color in the same column of the vertical N×M array; Step 260: Add up all the absolute values of the color value differences to obtain a vertical boundary evaluation value.

4. The image processing method based on the improved double-gradient interpolation algorithm according to claim 3, characterized in that, The step 200 further includes: Step 270: Compare the horizontal boundary evaluation value with the vertical boundary evaluation value; Step 280: If the horizontal boundary evaluation value is greater than the vertical boundary evaluation value, then determine that there is a horizontal boundary; Step 290: If the horizontal boundary evaluation value is equal to the vertical boundary evaluation value, then determine that the current pixel point is located at the center of the region; Step 291: If the horizontal boundary evaluation value is less than the vertical boundary evaluation value, then determine that there is a vertical boundary.

5. The image processing method based on the improved double-gradient interpolation algorithm according to claim 4, characterized in that, The step 300 includes: Step 310: If there is a horizontal boundary, then discard the green values of the vertical green pixel points of the current pixel point; Step 320: Obtain the average value of the green values of the horizontal green pixel points adjacent to the current pixel point as the green value of the current pixel point.

6. The image processing method based on the improved double-gradient interpolation algorithm according to claim 5, characterized in that, The step 300 further includes: Step 330: If there is a vertical boundary, then discard the green values of the horizontal green pixel points of the current pixel point; Step 340: Obtain the average value of the green values of the vertical green pixel points adjacent to the current pixel point as the green value of the current pixel point.

7. The image processing method based on the improved double-gradient interpolation algorithm according to claim 6, characterized in that, The step 300 further includes: Step 350: If the current pixel is located at the center of the region, retain the average value of the green values of the green pixels adjacent to the current pixel. Step 360: Obtain the average value of the green values of all the green pixels adjacent to the current pixel as the green value of the current pixel.

8. The image processing method based on the improved double-gradient interpolation algorithm according to claim 7, characterized in that, The step 300 further includes: Step 370: Obtain the red values of the red pixels adjacent to the current pixel and the green values of the green pixels. Step 380: Use the green color value of the current pixel, the green values of the adjacent green pixels, and the red value of the adjacent red pixel or the blue value of the adjacent blue pixel to obtain the red value or the blue value of the current pixel.

9. An image processing system based on an improved double-gradient interpolation algorithm, which adopts the image processing method based on the improved double-gradient interpolation algorithm according to any one of claims 1-8, characterized in that, It includes: An acquisition module, configured to use an imaging module to acquire an image frame in Raw format, filter the image frame with an infrared filter to obtain an RGB pixel array. A boundary evaluation module, configured to use an image sensor to obtain a first RGB pixel within a horizontal M×N array range centered on the current pixel and a second RGB pixel within a vertical N×M array range in the RGB pixel array, obtain a horizontal boundary evaluation value and a vertical boundary evaluation value by using the first RGB pixel and the second RGB pixel, evaluate the boundary of the current pixel by using the horizontal boundary evaluation value and the vertical boundary evaluation value, and obtain a boundary evaluation result. An interpolation module, configured to, when the channel of the current pixel is not the green channel, discard or retain the green pixels adjacent to the current pixel according to the boundary evaluation result, obtain the green values of the remaining adjacent green pixels, calculate the green value of the current pixel according to the green values of the remaining adjacent green pixels, use the principle of equal small-domain color differences, and obtain the red value or the blue value of the current pixel according to the green color value of the current pixel to obtain all the color values of the current pixel. Wherein, N > M, N ≥ 5, and M ≥ 3.

10. The image processing system based on the improved double-gradient interpolation algorithm according to claim 9, wherein, The boundary evaluation module includes: A first calculation unit, a second calculation unit, and a comparison and determination unit. The first calculation unit is configured to obtain the color values of all the pixels in the first RGB pixel, calculate the absolute value of the color value difference of the same color in the same row of the horizontal M×N array, and add up all the absolute values of the color value differences to obtain a horizontal boundary evaluation value. The second calculation unit is configured to obtain the color values of all the pixels in the second RGB pixel, the absolute value of the color value difference of the same color in the same column of the vertical N×M array, and add up all the absolute values of the color value differences to obtain a vertical boundary evaluation value. The comparison and determination unit is configured to compare and determine the horizontal boundary evaluation value and the vertical boundary evaluation value: if the horizontal boundary evaluation value is greater than the vertical boundary evaluation value, it is determined that there is a horizontal boundary; if the horizontal boundary evaluation value is equal to the vertical boundary evaluation value, it is determined that the current pixel is located at the center of the region; if the horizontal boundary evaluation value is less than the vertical boundary evaluation value, it is determined that there is a vertical boundary.