Image processing method and system

By embedding Alpha channel data into RGB three channels using a checkerboard pattern in an ARGB four-channel image, the problems of increased data transmission volume and image distortion are solved, achieving efficient image reconstruction and reducing color cast and uneven transparency.

CN120935340APending Publication Date: 2025-11-11BEIJING JILANG SEMICON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510847614.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

During transmission, common solutions for existing ARGB four-channel images result in increased data transmission or distortion issues in the recovered ARGB four-channel images, such as color cast and insufficient smoothness of transparency.

Method used

Three checkerboard patterns are used to encode the RGB three-channel data in the ARGB four-channel image, embedding the Alpha channel data into the RGB three channels, and reconstructing the Alpha channel data on the decoding side using the checkerboard pattern, thereby reducing the amount of data transmission and improving image distortion.

Benefits of technology

It effectively reduces the amount of data transmission and improves the distortion problem of the recovered ARGB four-channel image, especially the problems of color cast and uneven transparency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120935340A_ABST
    Figure CN120935340A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and system. The image processing method comprises the following steps of: at a coding side, respectively coding RGB (Red, Green, Blue) three-channel data in an ARGB four-channel image by adopting three patterns so as to respectively embed Alpha channel data into the RGB three-channel data to obtain a mixed RGB three-channel image; on the decoding side, the Alpha channel data is reconstructed from the mixed RGB three-channel image, the RGB three-channel data is obtained according to the Alpha channel data, and the three patterns are checkerboard patterns. According to the method, a single image is transmitted from a coding side to a decoding side, so that the data transmission quantity can be reduced, and the distortion of an ARGB four-channel image reconstructed on the decoding side can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of video image and UI interface processing, and in particular relates to an image processing method and system. Background Technology

[0002] An ARGB four-channel image adds an alpha channel to the RGB three-channel image to represent pixel transparency. Because of its transparency capability, it is very useful in scenarios requiring transparent effects and is therefore widely used in graphical user interfaces, game development, multimedia processing, web design, mobile application development, virtual reality, augmented reality, scientific visualization, and art design. In an ARGB four-channel image, the color of each pixel is typically represented by four bytes (32 bits): one byte for the alpha channel data, one byte for the red channel data, one byte for the green channel data, and one byte for the blue channel data.

[0003] However, common video transmission media (HDMI, MIPI) only support the transmission of RGB three-channel image data, not alpha channel data. One solution is to use two separate images to transmit RGB three-channel image data and alpha channel data, and then process the received images to reconstruct the ARGB four-channel image. This solution requires twice the bandwidth. Another solution is to embed the alpha channel data into the RGB channels on the encoding side through some mapping relationship, for example, by adjusting the RGB channel data to implicitly contain the alpha channel data and transmitting it. Then, on the decoding side, the alpha channel data is recovered to obtain the ARGB four-channel image. This solution reduces the amount of data transmitted, but currently, the ARGB four-channel image recovered using this solution will have varying degrees of distortion, such as color cast and insufficient smoothness in transparency.

[0004] Therefore, it is necessary to improve image processing for ARGB four-channel images to at least alleviate the aforementioned problems. Summary of the Invention

[0005] In view of this, the purpose of this disclosure is to provide an image processing method and system that can at least improve the above-mentioned problems.

[0006] In a first aspect, embodiments of this disclosure provide an image processing method, including:

[0007] On the encoding side, three patterns are used to encode the RGB three-channel data in the ARGB four-channel image respectively, so as to embed the Alpha channel data into the RGB three-channel data and obtain a mixed RGB three-channel image.

[0008] On the decoding side, Alpha channel data is obtained from the mixed RGB three-channel image, and RGB three-channel data is obtained based on the Alpha channel data. All three patterns are checkerboard patterns.

[0009] In some embodiments, two of the checkerboard patterns are identical, and another pattern is complementary to the first two patterns.

[0010] In some embodiments, the checkerboard pattern is a black and white checkerboard pattern.

[0011] In some embodiments, the following equation is used for encoding:

[0012] RGB'= (A * RGB + (maxValue-A) * Pt) / maxValue

[0013] Wherein, RGB' is the hybrid RGB three-channel image, A is the Alpha channel data, RGB is the RGB three-channel data before encoding, Pt is the checkerboard pattern, and maxValue is the maximum value of the pixel.

[0014] In some embodiments, reconstructing the alpha channel data includes:

[0015] The first candidate data of the Alpha channel data is obtained according to the first calculation method;

[0016] The second candidate data of the Alpha channel data is obtained according to the second calculation method;

[0017] The final data of the Alpha channel is obtained by weighted summation.

[0018] In some embodiments, the first calculation method includes:

[0019] Calculate the first difference drg(i,j) between the first and second channels of the mixed RGB three-channel image and the second difference dbg(i,j) between the third and second channels of the image to be processed, where the first and third channels use the same black and white checkerboard pattern.

[0020] For the points to be processed that are superimposed with black squares during encoding, the first candidate data A1(i,j) = maxValue + (drg(i,j) + dbg(i,j)) / 2, and A1 is subjected to amplitude limiting processing;

[0021] For the point to be processed that has white squares superimposed during encoding, the first candidate data A1(i,j) = maxValue - (drg(i,j) + dbg(i,j)) / 2, and A1 is subjected to amplitude limiting processing. maxValue is the maximum value of the pixel value, and (i,j) represents the coordinates of the point to be processed.

[0022] In some embodiments, the limiting process includes:

[0023] For points with superimposed black squares, A1(i,j)=min(maxValue,max(maxValue -enc_G(i,j), A1(i,j)));

[0024] For points with superimposed white squares, A1(i,j)=min(maxValue,max(maxValue-min(enc_R(i,j),enc_B(i,j)),A1(i,j))),

[0025] Where enc_R(i,j), enc_G(i,j), and enc_B(i,j) represent the data of the points to be processed in the first, second, and third channels of the encoded image, respectively.

[0026] In some embodiments, the second calculation method includes:

[0027] The DRG values ​​of multiple neighboring points of each point to be processed are calculated, and a candidate set is calculated accordingly. The DRG value of each neighboring point refers to the difference between the first and second channels of the point in the encoded image. The first and third channels use the same checkerboard pattern.

[0028] The second candidate data for the Alpha channel data of each point to be processed is obtained based on the candidate set of each point to be processed.

[0029] In some embodiments, clustering or linear combination processing is performed on the candidate set of each point to be processed to obtain the second candidate data of the Alpha channel data of each point to be processed.

[0030] In some embodiments, calculating the DRG values ​​of multiple neighboring points of each point to be processed and calculating the candidate set accordingly includes:

[0031] For points with superimposed black squares,

[0032] cand_A_Lft=(maxValue+drg(i,j)) / 2+(maxValue-drg(i,j-1)) / 2;

[0033] cand_A_Rgt=(maxValue+drg(i,j)) / 2+(maxValue-drg(i,j+1)) / 2;

[0034] cand_A_Top=(maxValue+drg(i,j)) / 2+(maxValue-drg(i-1,j)) / 2;

[0035] cand_A_Bot=(maxValue+drg(i,j)) / 2+(maxValue-drg(i+1,j)) / 2;

[0036] For points with superimposed white squares,

[0037] cand_A_Lft=(maxValue-drg(i,j)) / 2+(maxValue+drg(i,j-1)) / 2;

[0038] cand_A_Rgt=(maxValue-drg(i,j)) / 2+(maxValue+drg(i,j+1)) / 2;

[0039] cand_A_Top=(maxValue-drg(i,j)) / 2+(maxValue+drg(i-1,j)) / 2;

[0040] cand_A_Bot=(maxValue-drg(i,j)) / 2+(maxValue+drg(i+1,j)) / 2,

[0041] Where cand_A_* represents the elements in the set, maxValue is the maximum pixel value, and (i,j) represents the coordinates of the point to be processed.

[0042] In some embodiments, the weights of the first and second candidate data of the Alpha channel data are obtained in the following manner:

[0043] Calculate the first weighted component w1;

[0044] Calculate the second weighted component w2;

[0045] Calculate the third weighted component w3; and

[0046] The minimum value w among w1, w2, and w3 is used as the weight of the first candidate data for the Alpha channel, and 1-w is used as the weight of the second candidate data.

[0047] Secondly, embodiments of this disclosure provide an image processing system, characterized in that it includes:

[0048] The encoding module is used to encode the RGB three-channel data in the ARGB four-channel image using three patterns respectively, so as to embed the Alpha channel data into the RGB three-channel data and obtain a mixed RGB three-channel image.

[0049] The decoding module is used to obtain Alpha channel data from the mixed RGB three-channel image, and to obtain RGB three-channel data based on the Alpha channel data. All three patterns are checkerboard patterns.

[0050] Thirdly, embodiments of this disclosure provide an image processing chip that integrates the aforementioned image processing system.

[0051] Fourthly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, characterized in that the program, when executed by a processor, implements the steps of the image processing method described above.

[0052] The image processing method for ARGB four-channel images proposed in this disclosure uses three preset checkerboard patterns to encode the RGB three-channel data in the ARGB four-channel image respectively, embedding the Alpha channel data into the RGB three-channel data to obtain a mixed RGB three-channel image. Then, the ARGB four-channel image is reconstructed based on the mixed RGB three-channel image and the three checkerboard patterns. This method not only reduces the amount of data transmission from the encoding side to the decoding side, but also relatively improves the distortion problem of different degrees in the reconstructed ARGB four-channel image.

[0053] It should be noted that the above general description and the following detailed description are exemplary and explanatory only, and do not limit the present invention. Attached Figure Description

[0054] The above and other objects, features, and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0055] Figure 1 This is a flowchart illustrating an exemplary video image processing procedure;

[0056] Figure 2 A flowchart of the video image processing method proposed in the embodiments of this disclosure is provided;

[0057] Figure 3 Given Figure 2 Examples of black and white checkerboard patterns corresponding to the three RGB channels;

[0058] Figure 4 yes Figure 2A flowchart of a specific implementation of step S20 in the process;

[0059] Figures 5a to 5c A graph showing the mapping relationship between each weight component used to calculate the weighted sum and the corresponding feature data is provided.

[0060] Figure 6 This is a functional schematic diagram of the image processing system provided in the embodiments of this disclosure. Detailed Implementation

[0061] The present application will now be described in more detail with reference to the accompanying drawings. In the various drawings, the same elements are indicated by similar reference numerals. For clarity, the various parts in the drawings are not drawn to scale. Furthermore, some well-known parts may not be shown.

[0062] Figure 1 This is a flowchart illustrating an exemplary video image processing procedure. As shown in the figure, on the encoding side, the ARGB four-channel image is first encoded into a mixed RGB three-channel image through encoding 101. Then, the mixed RGB three-channel image is compressed and transmitted through compression 102. On the decoding side, the compressed mixed RGB three-channel image is decompressed through decompression 103, and the ARGB four-channel image is obtained from the mixed RGB three-channel image through decoding 104.

[0063] It should be noted that the encoding algorithm used in encoding 101 and the decoding algorithm used in decoding 104 are mutually corresponding. If the encoding algorithm is changed, the decoding algorithm needs to be rematched.

[0064] In some embodiments, code 101 performs an alpha blending operation on the pre-designed pattern and the RGB image in ARGB, resulting in a hybrid RGB three-channel image that incorporates alpha channel data:

[0065] RGB' = (A * RGB + (maxValue - A) * Pt) / maxValue Equation (1)

[0066] Wherein, RGB' is the mixed RGB three-channel data, A is the Alpha channel data, RGB is the RGB channel data before encoding, Pt is the pre-designed pattern, and maxValue is the maximum value of the pixel value, for example, 255 for 8 bits and 1023 for 10 bits. Then, decoding 104 derives the Alpha channel data and RGB channel data in reverse based on RGB', equation (1), and Pt.

[0067] For example, when Pt is a completely black image, substituting Pt into equation (1) yields equation (2):

[0068] BOSD=(A*RGB+(maxValue-A)*0) / maxValue =A*RGB / maxValue =A'*RGB Equation (2)

[0069] When Pt is a completely white image, substituting Pt into equation (1) yields equation (3):

[0070] WOSD = (A*RGB + (maxValue-A)*maxValue) / maxValue = A * RGB / maxValue + (1-A / maxValue)*maxValue = A'*RGB+(1-A')*maxValue (3)

[0071] Where A' is the normalized value of A, which takes a value between 0 and 1.

[0072] Then, by using WOSD-BOSD=(1-A')*maxValue, A' and A can be solved. Substituting these into WOSD or BOSD, the RGB channel data in the ARGB four-channel image can be recovered. However, this method requires transmitting both WOSD and BOSD images.

[0073] To reduce data transmission volume, this disclosure proposes an improved video image processing method. This improved method transmits only one image channel. During decoding, the alpha channel data is first reconstructed, and then RGB three-channel data is obtained based on the reconstructed alpha channel data. This optimizes the color cast and uneven transparency issues that may be caused by single-channel transmission. The method includes, for example... Figure 2 The steps are shown.

[0074] Step S10 refers to using three patterns to encode the RGB three-channel data in the ARGB four-channel image respectively, so as to embed the Alpha channel data into the RGB three-channel data and obtain a mixed RGB three-channel image.

[0075] Step S20 refers to reconstructing the Alpha channel data based on the mixed RGB three-channel image on the decoding side, and obtaining the RGB three-channel data based on the Alpha channel data.

[0076] In this embodiment, the three patterns corresponding to the RGB three channels are all checkerboard patterns. Two of the checkerboard patterns are identical, and the third pattern is complementary to the first two. Complementary patterns mean that the sum of the RGB components of the checkerboard color at the same pixel position in the two patterns equals the maximum value. For example, if the RGB value of checkerboard color A at the same pixel position in the two patterns is (R1, G1, B1), and the RGB value of checkerboard color B is (R2, G2, B2), with a maximum value of 255, then R1 + R2 = 255, G1 + G2 = 255, and B1 + B2 = 255.

[0077] Figure 3 Given Figure 2 The image shows examples of black and white checkerboard patterns corresponding to the RGB channels. As shown above, the first and third patterns correspond to the R and B channels, and the second pattern corresponds to the G channel. The first and third patterns have alternating black and white squares, the second pattern has alternating black and white squares, and the third pattern is complementary to the first two. Of course, other checkerboard pattern combinations can also be used for the RGB channels; for example, the R and G channels can use the same checkerboard pattern, while the B channel uses a checkerboard pattern complementary to the checkerboard patterns of other channels.

[0078] Figure 4 yes Figure 2 A flowchart of a specific implementation of step S20 is shown. As illustrated, it includes steps S201 to S204.

[0079] In step S201, the first candidate data of the Alpha channel data is obtained according to the first calculation method.

[0080] In step S202, second candidate data for the Alpha channel data is obtained according to the second calculation method.

[0081] In step S203, the final data of the Alpha channel is obtained by weighted summation.

[0082] In step S204, the RGB three-channel data is calculated based on the final data of the Alpha channel data.

[0083] In this embodiment, the following is typically used: Figure 3The black and white checkerboard pattern shown is used to calculate the Alpha channel data under two different assumptions. For example, the first calculation method calculates the Alpha channel data under the assumption that the R, G, and B values ​​before encoding are the same (i.e., the RGB before encoding is a grayscale image). Then, the first candidate data of the Alpha channel data is calculated based on the encoding algorithm, the RGB' of the encoding side, and the checkerboard pattern used for encoding. The second calculation method assumes that the point to be processed has the same alpha channel data as the adjacent points. The second candidate data of the Alpha channel data is derived by reverse reasoning based on the encoding algorithm, the RGB' of the encoding side, and the checkerboard pattern used for encoding.

[0084] The derivation process of the first and second calculation methods is illustrated below with examples. On the encoding side, equation (1) is used for encoding. When a black square is encountered, equation (4) is obtained:

[0085] RGB' = alpha * RGB equation (4)

[0086] When a white square is encountered, equation (5) is obtained:

[0087] RGB' = alpha * RGB + (1-alpha) * maxValue Equation (5).

[0088] Where alpha is the normalized value, which takes a value between 0 and 1, and RGB' is the corresponding value of the RGB channel obtained after encoding through the black and white checkerboard pattern.

[0089] On the decoding side, for grayscale RGB, taking black as an example, the following equation exists:

[0090] drg(i,j)+dbg(i,j)=alpha*(R+B-2*G)-2*(1-alpha)*maxValue equation (6)

[0091] For grayscale RGB, R≈G≈B, therefore R+B-2*G is approximately 0, which can be solved as follows:

[0092] alpha=1+(drg(i,j)+dbg(i,j)) / (2*maxValue) Equation (7).

[0093] alpha restored to A1 is:

[0094] A1=alpha*maxValue = maxValue+(drg(i,j)+dbg(i,j)) / 2 Equation (8)

[0095] Equation (8) can be used as the first calculation method in this embodiment. Under this constraint, the grayscale RGB (with the same R, G and B values) obtained by using A1 is almost identical to the original image, but the color RGB still shows the superimposed checkerboard pattern.

[0096] On the decoding side, for color RGB, taking a black square as an example, its four neighboring pixels (top, bottom, left, and right) are white squares. Assuming that the current black square and the white square above it have the same pixel value, that is, assuming that their alpha values ​​are equal (except at the edges, the alpha is very smooth), then the following equation holds:

[0097] Equation (9) = R' = alpha * R

[0098] G' = alpha*G + (1-alpha)*maxValue Equation (10)

[0099] B' = alpha * B Equation (11)

[0100] R_top' = alpha*R_top + (1-alpha)*maxValue Equation (12)

[0101] Equation (13) is G_top' = alpha * G_top

[0102] B_top' = alpha*B_top + (1-alpha)*maxValue Equation (14)

[0103] drg(i,j) = R-G'= alpha*(RG)-(1-alpha)*maxValue Equation (15)

[0104] drg(i-1,j)=R_top'-G_top'=alpha*(R_top-G_top)+(1-alpha)*maxValue Equation (16)

[0105] Based on the color difference constancy, we can approximate RG≈R_top-G_top, therefore the following equation exists:

[0106] drg(i,j)-dbg(i-1,j)=-2*(1-alpha)*maxValue Equation (17)

[0107] A2=alpha=maxValue+(drg(i,j)-drg(i-1,j)) / 2 Equation (18)

[0108] Equation (18) can be used as the second calculation method in this embodiment. The premise of this calculation is that adjacent alphas are equal and the color difference constancy is met. However, the alpha calculated in this way is not very friendly to the edges (the places where alpha changes abruptly), and the RGB edges solved in this way will have some color deviation. Therefore, in some embodiments, the second calculation method is to first substitute the drg of the pixels below, to the left and to the right of the point to be processed into equation (18) to obtain multiple A2s, and then merge the multiple A2s to obtain the final A2.

[0109] Based on the equations (8) and (18) derived above, the following examples illustrate the various steps of this embodiment.

[0110] Assume that the R and B channels of the chessboard pattern used in the encoding are black and white squares, and the G channel is white and black squares. The point to be processed is represented by 8 bits of data in each channel. The coordinates of the point to be processed are (i,j), where i is the row and j is the column.

[0111] Then step S201 may include the following operations:

[0112] drg(i,j)=enc_R(i,j)-enc_G(i,j) Equation (19)

[0113] dbg(i,j)=enc_B(i,j)-enc_G(i,j) Equation (20)

[0114] Where drg(i,j) represents the difference between the R and G channels of the encoded mixed RGB image, dbg(i,j) represents the difference between the B and G channels of the encoded mixed RGB image, and enc_R(i,j), enc_G(i,j) and enc_B(i,j) represent the values ​​of the R, G, and B channels of the encoded mixed RGB image, respectively.

[0115] The first candidate data A1 for the points to be processed with superimposed black grids is:

[0116] A1(i,j)=255+(drg(i,j)+dbg(i,j)) / 2 Equation (21)

[0117] Limit the value of A1 to prevent the decoded RGB value from being less than 0 or greater than 255:

[0118] A1(i,j)=min(255,max(255-enc_G(i,j),A1(i,j))) Equation (22)

[0119] The first candidate data A1 for the points to be processed with superimposed white squares is:

[0120] A1(i,j)=255-(drg(i,j)+dbg(i,j)) / 2 Equation (23)

[0121] Similarly, the value of A1 is limited to prevent the decoded RGB value from being less than 0 or more than 255:

[0122] A1(i,j)=min(255,max(255-in(enc_R(i,j),enc_B(i,j)),A1(i,j))) Equation (24)

[0123] Step S202 includes the following operations: First, using the drg values ​​of each point in the neighborhood of the point to be processed, a candidate cand_A set is calculated. Then, using clustering and the gradient of that point in the image, the second candidate data A2 of the point to be processed is calculated based on the candidate cand_A set. For example, the candidate cand_A set is calculated using the drg values ​​of the four points above, below, left, and right of the point to be processed.

[0124] The candidate set of points to be processed with superimposed black grids includes:

[0125] cand_A_Lft = 255 +(drg(i,j)-drg(i,j-1)) / 2 Equation (25)

[0126] cand_A_Rgt = 255 +(drg(i,j)-drg(i,j+1)) / 2 Equation (26)

[0127] cand_A_Top = 255 +(drg(i,j)-drg(i-1,j)) / 2 Equation (27)

[0128] cand_A_Bot = 255 +(drg(i,j)-drg(i+1,j)) / 2 Equation (28)

[0129] The calculated cand_A value is then constrained using A=min(255,max(255-enc_G(i,j), A)).

[0130] For the points to be processed that have white squares superimposed during encoding, the candidate set of cand_A includes:

[0131] cand_A_Lft = 255 -(drg(i,j)-drg(i,j-1)) / 2 Equation (29)

[0132] cand_A_Rgt = 255 -(drg(i,j)-drg(i,j+1)) / 2 Equation (30)

[0133] cand_A_Top = 255 -(drg(i,j)-drg(i-1,j)) / 2 Equation (31)

[0134] cand_A_Bot = 255 -(drg(i,j)-drg(i+1,j)) / 2 Equation (32)

[0135] The calculated value of cand_A is constrained by using A=min(255,max(255-min(enc_R,enc_B),A)).

[0136] Clustering or linear combination of cand_A_Lft, cand_A_Rgt, cand_A_Top, and cand_A_Bot yields A2.

[0137] For example, using clustering, cand_A can be clustered into two classes (i.e., all elements in the set are divided into two different categories), and the center of the class with the most elements is selected as A2; or, using the gradient of the drg image, if the point to be processed tends to be horizontal, then A2 = (cand_A_Lft + cand_A_Rgt) / 2; if it tends to be vertical, then A2 = (cand_A_Top + cand_A_Bot) / 2; if there is no obvious direction, then it is equal to the mean of the four cand_A values, or the minimum and maximum values ​​are removed and the mean of the remaining cand_A values ​​is calculated. Note that the selection of cand_A values ​​in this method is not limited to the number shown in the examples above.

[0138] Then, step S203 calculates the final data A by weighted summation as follows:

[0139] A(i,j)= w(i,j) * A1(i,j)+(1-w(i,j))*A2(i,j) Equation (33)

[0140] In some embodiments, the weight components w1, w2, and w3 are first calculated, and then the weight w is obtained as the weight of A1 according to equation (34):

[0141] w=min(w1, w2, w3) Equation (34)

[0142] w1 can use the drb feature because R and B have the same checkerboard pattern superimposed, and the difference between R' and B' can basically reflect the difference between R and B to determine whether it is a grayscale pixel. w1 is calculated based on the value of drb; the larger drb is, the smaller w1 is. The value of drb is calculated using equation (35):

[0143] drb(i,j)=enc_R(i,j)-enc_B(i,j) Equation (35).

[0144] drb(i,j) represents the difference between the point to be processed and the encoded channels R and B. The mapping relationship between the value of drb and w1 can be illustrated as follows: Figure 5a The graph shown.

[0145] Then w2 can be calculated based on the value of the drg gradient. The larger the drg gradient, the larger w2. The mapping relationship between the drg gradient and w2 can be illustrated as follows: Figure 5b The curve graph.

[0146] Then, calculate w3 based on the gradient of A2. The larger the gradient of A2, the larger w3 is. The mapping relationship between the gradient of A2 and w3 can be illustrated as follows: Figure 5c The curve graph.

[0147] It should be noted that the relationship between the weight components and features in the embodiments of this disclosure is not limited to the following. Figures 5a to 5c The curves shown can be any graph that meets the specified characteristics, and are not limited to these three characteristics. You can use only one, two, or other characteristics.

[0148] Then step S204 is to reconstruct the RGB channel data based on A, including: if the value of A(i,j) is less than the set threshold, then the reconstructed R(i,j)=G(i,j)=B(i,j)=0; otherwise, for the unprocessed points with superimposed black grids during encoding, as shown in equation (36):

[0149] C(i,j) = enc_C(i,j)*255 / A(i,j) Equation (36)

[0150] For the points to be processed that are superimposed with white squares during encoding, as shown in equation (37):

[0151] C(i,j) = enc_C(i,j)*255-255*(255-A(i,j)) / A(i,j) Equation (37)

[0152] Where C represents one of the R / G / B channels.

[0153] Figure 6 This is a functional schematic diagram of an image processing system provided in an embodiment of this disclosure. As shown in the figure, the image processing system 600 includes an encoding module 601, a decoding module 602, and a transmission module 603.

[0154] The encoding module 601 is used on the encoding side to encode the RGB three-channel data in the ARGB four-channel image using three patterns respectively, so as to embed the Alpha channel data into the RGB three-channel data and obtain a mixed RGB three-channel image. The three patterns corresponding to the RGB three channels are all checkerboard patterns.

[0155] The decoding module 602 is used on the decoding side to obtain Alpha channel data from the mixed RGB three-channel image, and to obtain RGB three-channel data based on the Alpha channel data.

[0156] The transmission module 603 is used to transmit a mixed RGB three-channel image from the encoding side to the decoding side.

[0157] In some embodiments, the three checkerboard patterns in the encoding module 601 are alternating black and white checkerboard patterns, with two of the checkerboard patterns being identical and the third pattern being complementary to the first two. Complementary means that the colors of corresponding squares in the checkerboard pattern are opposite. For example, the checkerboard patterns corresponding to the R and G channels are identical, while the checkerboard pattern corresponding to the B channel is complementary to the first two checkerboard patterns. Meanwhile, the decoding module 602 calculates the Alpha channel data based on the checkerboard patterns corresponding to the RGB channels and the received mixed RGB data, and then calculates the RGB three-channel data, for example, using the calculation method described above to calculate the Alpha channel data and the RGB three-channel data.

[0158] In some embodiments, the encoding module 601 may also send an indication flag to the decoding module 602 to indicate whether the currently transmitted image data is mixed RGB data or RGB data.

[0159] Accordingly, this disclosure also provides an image processing chip, which may include an image signal processor (ISP) capable of performing image data processing and optimization, such as depigmentation, black level correction, lens shading correction, bad pixel correction, noise reduction, automatic white balance, color correction, and gamma correction. The image processing chip may also include a processor core for executing image processing algorithms and controlling chip operation. The image processing chip also requires a memory to store image data and program code, such as SRAM (Static Random Access Memory), DDR SDRAM (Dynamic Random Access Memory), or Flash memory. The image processing chip may also be equipped with various peripheral interfaces for communication and data transmission with other devices, such as a DVP (Digital Video Parallel Interface), a UART (Universal Asynchronous Receive / Transmit Interface), an SPI (Serial Peripheral Interface), or an I2C (Two-Wire Serial Bus Interface). The image processing chip may also include... Figure 6The encoding module 601 and decoding module 602 shown are used to implement image and video encoding and decoding.

[0160] Accordingly, this disclosure also provides a computer-readable storage medium that stores one or more computer instructions, which, when executed, implement the functions of the steps or modules described in the above embodiments.

[0161] It should be understood that the methods, systems, computer-readable storage media, and image processing chips of the embodiments of this disclosure are all based on the same conceptual idea and therefore can be referenced to each other.

[0162] Although the embodiments of this application are disclosed above with reference to preferred embodiments, they are not intended to limit the claims. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application shall be determined by the scope defined by the claims of this application.

[0163] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. An image processing method, characterized in that, include: On the encoding side, three patterns are used to encode the RGB three-channel data in the ARGB four-channel image respectively, so as to embed the Alpha channel data into the RGB three-channel data respectively, so as to obtain a mixed RGB three-channel image. On the decoding side, the Alpha channel data is reconstructed from the mixed RGB three-channel image, and the RGB three-channel data is obtained based on the Alpha channel data. All three patterns are checkerboard patterns.

2. The image processing method according to claim 1, characterized in that, Two of the three checkerboard patterns are identical, and the third pattern is complementary to the first two.

3. The image processing method according to claim 2, characterized in that, All three checkerboard patterns are black and white checkerboard patterns.

4. The image processing method according to claim 1, characterized in that, The following equation is used for encoding: RGB'= (A * RGB + (maxValue-A) * Pt) / maxValue Wherein, RGB' is the hybrid RGB three-channel image, A is the Alpha channel data, RGB is the RGB three-channel data before encoding, Pt is the checkerboard pattern, and maxValue is the maximum value of the pixel.

5. The image processing method according to claim 1, characterized in that, The reconstruction of the Alpha channel data includes: The first candidate data of the Alpha channel data is obtained according to the first calculation method; The second candidate data of the Alpha channel data is obtained according to the second calculation method; The final data of the Alpha channel is obtained by weighted summation.

6. The image processing method according to claim 5, characterized in that, The first candidate data for obtaining the Alpha channel data according to the first calculation method includes: Calculate the first difference drg(i,j) between the first and second channels of the mixed RGB three-channel image and the second difference dbg(i,j) between the third and second channels of the mixed RGB three-channel image, where the first and third channels use the same black and white checkerboard pattern. For the points to be processed that are superimposed with black squares during encoding, the first candidate data A1(i,j) = maxValue + (drg(i,j) + dbg(i,j)) / 2, and A1 is subjected to amplitude limiting processing; For the point to be processed that has white squares superimposed during encoding, the first candidate data A1(i,j) = maxValue - (drg(i,j) + dbg(i,j)) / 2, and A1 is subjected to amplitude limiting processing. maxValue is the maximum value of the pixel value, and (i,j) represents the coordinates of the point to be processed.

7. The image processing method according to claim 6, characterized in that, The limiting process includes: For the point to be processed with superimposed black grids, A1(i,j)=min(maxValue,max(maxValue -enc_G(i,j), A1(i,j))); For the point to be processed with superimposed white squares, A1(i,j)=min(maxValue,max(maxValue-min(enc_R(i,j),enc_B(i,j)),A1(i,j))), Where enc_R(i,j), enc_G(i,j), and enc_B(i,j) represent the data of the first, second, and third channels of the hybrid RGB three-channel image to be processed, respectively.

8. The image processing method according to claim 5, characterized in that, The second candidate data for obtaining the Alpha channel data according to the second calculation method includes: Calculate the DRG values ​​of multiple neighboring points of each point to be processed and calculate the candidate set accordingly. The DRG value of each neighboring point refers to the difference between the corresponding points of the first and second channels of the mixed RGB three-channel image. The first and third channels of the mixed RGB three-channel image use the same black and white checkerboard pattern. The second candidate data for each point to be processed is obtained from the candidate set of each point to be processed.

9. The image processing method according to claim 8, characterized in that, The second candidate data for the Alpha channel data obtained based on the candidate set of each candidate point includes: Clustering or linear combination processing is performed on the candidate set of each point to be processed to obtain the second candidate data of the Alpha channel data of that point.

10. The image processing method according to claim 8 or 9, characterized in that, The process of calculating the DRG values ​​of multiple neighboring points of each point to be processed and calculating the candidate set accordingly includes: For points with superimposed black squares, cand_A_Lft=maxValue+(drg(i,j)-drg(i,j-1)) / 2; cand_A_Rgt=maxValue+(drg(i,j)-drg(i,j+1)) / 2; cand_A_Top=maxValue+(drg(i,j)-drg(i-1,j)) / 2; cand_A_Bot=maxValue+(drg(i,j)-drg(i+1,j)) / 2; For points with superimposed white squares, cand_A_Lft=maxValue-(drg(i,j)-drg(i,j-1)) / 2; cand_A_Rgt=maxValue-(drg(i,j)-drg(i,j+1)) / 2; cand_A_Top=maxValue-(drg(i,j)-drg(i-1,j)) / 2; cand_A_Bot=maxValue-(drg(i,j)-drg(i+1,j)) / 2, Where cand_A_* represents the elements in the set, maxValue is the maximum pixel value, and (i,j) represents the coordinates of the point to be processed.

11. The image processing method according to claim 5, characterized in that, The weights of the first and second candidate data of the Alpha channel data are obtained in the following way: Calculate the first weighted component w1; Calculate the second weighted component w2; Calculate the third weighted component w3; and The minimum value w among w1, w2, and w3 is used as the weight of the first candidate data for the Alpha channel, and 1-w is used as the weight of the second candidate data.

12. An image processing system, characterized in that, include: The encoding module is used to encode the RGB three-channel data in the ARGB four-channel image using three patterns respectively, so as to embed the Alpha channel data into the RGB three-channel data and obtain a mixed RGB three-channel image. The decoding module is used to obtain Alpha channel data from the mixed RGB three-channel image, and to obtain RGB three-channel data based on the Alpha channel data. All three patterns are checkerboard patterns.

13. An image processing chip, characterized in that, It integrates the image processing system as described in claim 12.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the image processing method according to any one of claims 1-11.