Image scaling methods, apparatus, display devices, and storage media

By using an interpolation method that directly stitches together and calculates weights for RGBG arranged images, the problems of complex scaling and color distortion of RGBG screen images in existing technologies are solved, achieving simplified processing and better color reproduction.

CN119863357BActive Publication Date: 2025-10-31SHENZHEN AIXIESHENG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411923312.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-10-31
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

Existing image scaling methods are not applicable to Pentile RGBG screens, leading to increased processing complexity and color distortion.

Method used

By acquiring an RGBG-arranged image, extracting the R and B channel data, rearranging and merging them into a matrix M, calculating the target point position based on the scaling factor, selecting a reference point and calculating the weight value, and directly performing interpolation and scaling to avoid additional data conversion.

Benefits of technology

It simplifies the processing flow, improves processing efficiency, accurately preserves the color information of RGBG arranged images, reduces color distortion and confusion, and achieves better color reproduction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863357B_ABST
    Figure CN119863357B_ABST
Patent Text Reader

Abstract

This application relates to an image scaling method, system, display device, and storage medium. The method includes: acquiring an RGBG-arranged image; extracting first data corresponding to the R channel and second data corresponding to the B channel from the RGBG-arranged image, rearranging the first and second data respectively, and merging the data; denoting the merged data matrix as matrix M; calculating the position of a target point in matrix M based on a scaling factor; selecting reference points based on the position of the target point in matrix M; calculating the weight values ​​of the reference points based on the number and position of the reference points; and calculating the sum of the products of the reference points and their corresponding weight values ​​to obtain the target value. This method directly interpolates and scales the RGBG data, simplifying the processing flow, improving processing efficiency, and fully considering the unique arrangement and color characteristics of RGBG-arranged image data. It can accurately estimate and retain color information in the original image, reducing color distortion and confusion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image scaling method, apparatus, display device, and storage medium. Background Technology

[0002] Pentile alignment is a widely used technology in OLED screens. Compared to the traditional RGB alignment, pentile alignment reduces the number of subpixels by having adjacent pixels share subpixels. In the traditional RGB alignment, a pixel consists of three subpixels: red (R), green (G), and blue (B). In the pentile alignment, a pixel consists of red (R) and green (G), or blue (B) and green (G). Therefore, only images using the RGBG alignment can be displayed correctly on a pentile screen.

[0003] In the field of image processing technology, image scaling is a fundamental and crucial technique. With the rapid development of display technology and multimedia applications, the demand for image size and resolution is becoming increasingly diverse, especially in mobile devices, high-definition displays, and virtual reality, where image scaling technology is of paramount importance.

[0004] Existing image scaling methods are inadequate for processing RGBG-arranged image data due to its unique arrangement and color characteristics. RGBG-arranged image data, as a special type of image data, features a sub-pixel arrangement of one red, one blue, and two green pixels. This arrangement gives the image unique advantages in color reproduction and resolution. An illustration of the RGBG screen sub-pixel arrangement is shown below. Figure 1 As shown. Currently, image scaling techniques mainly rely on interpolation methods. Commonly used interpolation methods include nearest neighbor interpolation, bilinear interpolation, and bicubic interpolation, which estimate the value of a new pixel by calculating the values ​​of neighboring pixels, thus achieving image scaling. The aforementioned common image scaling methods require converting RGBG image data to the standard RGB format before processing, which not only increases processing complexity but may also cause color distortion. Therefore, existing interpolation methods are not suitable for scaling image data arranged in RGBG.

[0005] In conclusion, there is an urgent need for an image scaling method that is simple to process, requires no conversion, and produces excellent colors. Summary of the Invention

[0006] Therefore, it is necessary to provide an image scaling method, apparatus, display device, and storage medium that is simple to process, requires no conversion, and produces excellent colors, in order to address the aforementioned technical problems.

[0007] An image scaling method, the method comprising:

[0008] Obtain an image with RGBG arrangement;

[0009] Extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG arranged image, and rearrange the first data and the second data respectively and perform data merging. The merged data matrix is ​​denoted as matrix M.

[0010] Calculate the position of the target point in matrix M based on the scaling factor;

[0011] Based on the position of the target point in matrix M, a reference point is selected;

[0012] Calculate the weight value of each reference point based on the number of reference points and their positions;

[0013] The target value is obtained by summing the products of the reference point and its corresponding weight value.

[0014] In one embodiment, the calculation of the target point's position in matrix M based on the scaling factor specifically involves:

[0015]

[0016] Wherein, the target point is the data in the i-th row and j-th column, x and y are the position coordinates of the target point in the matrix M, and α and β represent the scaling factor of the row and the scaling factor of the column, respectively.

[0017] In one embodiment, the reference point is the position of the target point in the matrix M, obtained by rounding down the row and column coordinates of the target point in the matrix M.

[0018] M(x′,y')=(floor(x),floor(y))

[0019] Where x and y are the position coordinates of the target point in matrix M, and floor(·) represents rounding down.

[0020] In one embodiment, selecting a reference point based on the position of the target point in the matrix M includes:

[0021] If the reference point and the target point are data from the same channel, both being B-channel data or both being R-channel data, calculate the offset of the reference point relative to the target point:

[0022] offset c =yy′

[0023] offset t =xx′

[0024] If offset c <offset r When the reference points are selected, they are M(x′,y′), M(x′+1,y′-1) and M(x′+1,y′+1).

[0025] If offset c >offset r When the reference points are selected, M(x′,y′), M(x′+1,y′+1) and M(x′,y′+2).

[0026] If offset c =offset r At that time, the reference points are selected as M(x′, y′) and M(x′+1, y′+1);

[0027] If the reference point is B-channel data and the target point is R-channel data, or if the reference point is R-channel data and the target point is B-channel data, calculate the sum of the offsets of the reference point relative to the target point:

[0028] offset t =offset r +offset c

[0029] If offset t When <1, the reference points are selected as M(x′,y′+1), M(x′+1,y′) and M(x′,y′-1);

[0030] If offset t When the value is greater than 1, the reference points are selected as M(x′,y′+1), M(x′+1,y′) and M(x′+1,y′+2);

[0031] If offset t When =1, the reference points are selected as M(x′+1,y′) and M(x′,y′+1).

[0032] In one embodiment, calculating the sum of the products of the reference point and its corresponding weight value to obtain the target value includes:

[0033] If the reference points are M(x′,y′) and M(x′+1,y′+1) respectively, calculate the distance between the target point and the reference points M(x′,y′) and M(x′+1,y′+1) respectively, use the ratio of the two distances as the first weight, and sum the product of the pixel values ​​corresponding to the reference points M(x′,y′) and M(x′+1,y′+1) with the first weight to obtain the target value;

[0034] If the reference points are M(x′+1, y′) and M(x′, y′+1), respectively, the distances between the target point and the reference points M(x′+1, y′) and M(x′, y′+1) are calculated. The ratio of the two distances is used as the second weight. The pixel values ​​corresponding to the reference points M(x′+1, y′) and M(x′, y′+1) are multiplied by the second weight and summed to obtain the target value.

[0035] In one embodiment, calculating the sum of the products of the reference point and its corresponding weight value to obtain the target value further includes:

[0036] If there are three reference points, namely M(x′+1, y′-1), M(x′, y′) and M(x′+1, y′+1), the ratio of the area of ​​the triangle formed by any two reference points and pixel point R′ to the area of ​​the triangle formed by the three reference points is used as the third weight. The sum of the products of the pixel values ​​of the three reference points M(x′+1, y′-1), M(x′, y′) and M(x′+1, y′+1) and the third weight is calculated to obtain the target value.

[0037] An image scaling device, the device comprising:

[0038] The image acquisition unit is used to acquire images arranged in RGBG order.

[0039] The data processing unit is used to extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG arranged image, and rearrange the first data and the second data respectively and perform data merging. The merged data matrix is ​​denoted as matrix M.

[0040] A position mapping unit is used to calculate the position of the target point in the matrix M based on a scaling factor.

[0041] A reference unit is selected to select a reference point based on the position of the target point in the matrix M.

[0042] The weight calculation unit is used to calculate the weight value of the reference point based on the number of reference points and the position of the reference points;

[0043] The target acquisition unit is used to calculate the sum of the products of the reference point and its corresponding weight value to obtain the target value.

[0044] A display device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0045] Obtain an image with RGBG arrangement;

[0046] Extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG arranged image, and rearrange the first data and the second data respectively and perform data merging. The merged data matrix is ​​denoted as matrix M.

[0047] Calculate the position of the target point in matrix M based on the scaling factor;

[0048] Based on the position of the target point in matrix M, a reference point is selected;

[0049] Calculate the weight value of each reference point based on the number of reference points and their positions;

[0050] The target value is obtained by summing the products of the reference point and its corresponding weight value.

[0051] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0052] Obtain an image with RGBG arrangement;

[0053] Extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG arranged image, and rearrange the first data and the second data respectively and perform data merging. The merged data matrix is ​​denoted as matrix M.

[0054] Calculate the position of the target point in matrix M based on the scaling factor;

[0055] Based on the position of the target point in matrix M, a reference point is selected;

[0056] Calculate the weight value of each reference point based on the number of reference points and their positions;

[0057] The target value is obtained by summing the products of the reference point and its corresponding weight value.

[0058] The aforementioned image scaling method, apparatus, display device, and storage medium acquire an RGBG-arranged image; extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG-arranged image, rearrange the first and second data respectively, and perform data merging, with the merged data matrix denoted as matrix M; calculate the position of the target point in matrix M according to the scaling factor; select a reference point according to the position of the target point in matrix M; calculate the weight value of the reference point according to the number and position of the reference point; and calculate the sum of the products of the reference point and the corresponding weight value to obtain the target value. This directly interpolates and scales the RGBG data without requiring additional data conversion steps, greatly simplifying the processing flow and improving processing convenience and efficiency. Furthermore, it fully considers the unique arrangement and color characteristics of red, green, and blue sub-pixels in the RGBG-arranged image data, enabling more accurate estimation and preservation of color information in the original image, reducing color distortion and confusion, thereby achieving a superior color reproduction effect. Attached Figure Description

[0059] Figure 1 This is a schematic diagram of the sub-pixel arrangement of an RGBG screen in a background technology.

[0060] Figure 2 This is a flowchart illustrating an image scaling method in one embodiment;

[0061] Figure 3 This is a schematic diagram of the data arrangement of the R and B channels in one embodiment;

[0062] Figure 4 This is a schematic diagram of interpolation between two reference points in one embodiment;

[0063] Figure 5 This is a schematic diagram of interpolation of three reference points in one embodiment;

[0064] Figure 6 This is a schematic diagram illustrating the calculation of weight values ​​in one embodiment;

[0065] Figure 7 This is a structural block diagram of an image scaling device in one embodiment;

[0066] Figure 8 This is a diagram showing the internal structure of a display device in one embodiment. Detailed Implementation

[0067] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0068] The image scaling method provided in this application can be applied to smart display devices. These display devices can be, but are not limited to, various personal computers, laptops, smartphones, tablets, portable wearable devices, and virtual reality devices.

[0069] In one embodiment, such as Figure 2 As shown, an image scaling method is provided. Taking the application of this method to a display device as an example, the method includes the following steps:

[0070] Step S201: Obtain an image with RGBG arrangement.

[0071] In this embodiment, the RGBG-arranged image is the original image data. Each pixel of the RGBG-arranged image is composed of R, G, and B components. Hereinafter, R represents the intensity of the red channel, B represents the intensity of the blue channel, and G represents the intensity of the green channel. It should be noted that since the G channel has complete data, conventional methods such as bilinear interpolation can be used; therefore, this application will not discuss methods for scaling the G channel.

[0072] Step S202: Extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG arranged image, and rearrange the first data and the second data respectively and perform data merging. The merged data matrix is ​​denoted as matrix M.

[0073] In this embodiment, the first data corresponding to the R channel and the second data corresponding to the B channel are extracted from the RGBG arranged image. The data of the R and B channels are rearranged, with the arrangement in odd-numbered rows being RRBRBRBRB… and the arrangement in even-numbered rows being BRBRBRBR…. The R and B data are then combined to obtain a matrix M of a single-channel image with the same size as the G channel, as detailed below. Figure 3 As shown, the unique arrangement and color characteristics of red, green, and blue subpixels in RGBG-arranged image data are fully considered.

[0074] Step S203: Calculate the position of the target point in the matrix M according to the scaling factor.

[0075] In this embodiment, the calculation of the target point's position in matrix M based on the scaling factor specifically involves:

[0076]

[0077] Wherein, the target point is the data in the i-th row and j-th column, x and y are the position coordinates of the target point in the matrix M, and α and β represent the scaling factor of the row and the scaling factor of the column, respectively.

[0078] Step S204: Select a reference point based on the position of the target point in matrix M.

[0079] After obtaining the position coordinates (x, y) of the target point in the matrix M, due to the special arrangement of the RGBG panel, the most commonly used bilinear interpolation algorithm selects reference points and obtains the coordinates of four reference points. However, only two of these four reference points are the values ​​of the R channel. In this case, the bilinear interpolation method cannot be used. Therefore, an additional reference point needs to be selected to help select the correct reference point in order to ensure the stability and accuracy of the calculation results.

[0080] In this embodiment, the reference point is the position of the target point in matrix M. The reference point M(x′, y′) for the corresponding channel is obtained by rounding down the row and column coordinates of the target point in matrix M.

[0081] M(x',y')=(floor(x),floor(y))

[0082] Where x and y are the position coordinates of the target point in matrix M, and floor(·) represents rounding down. In the original RGBG data, the data at position (x′, y′) could be either the R channel or the B channel. Therefore, it is necessary to accurately select a reference point at position (x, y) of the target point in matrix M by rounding down the row and column coordinates. For example, to calculate the R channel data, the nearest R channel data needs to be selected. Specifically, selecting the reference point based on the position of the target point in matrix M includes:

[0083] If the reference point and the target point are data from the same channel, both being B-channel data or both being R-channel data, calculate the offset of the reference point relative to the target point. c offset r :

[0084] offset c =yy′

[0085] offset r =xx′

[0086] If offset c <offset r When the reference points are selected, they are M(x′,y′), M(x′+1,y′-1) and M(x′+1,y′+1);

[0087] If offset c >offset r When the reference points are selected, M(x′,y′), M(x′+1,y′+1) and M(x′,y′+2).

[0088] If offset c =offset r When selecting reference points, M(x′,y′) and M(x′+1,y′+1) are chosen; specifically, the two reference points are selected as follows: Figure 4 As shown, the three reference points are selected as follows: Figure 5 As shown.

[0089] If the reference point is B-channel data and the target point is R-channel data, or if the reference point is R-channel data and the target point is B-channel data, calculate the sum of the offsets of the reference point relative to the target point: offset. t :

[0090] offset t =offset r +offset c

[0091] If offset t When <1, the reference points are selected as M(x′,y′+1), M(x′+1,y′) and M(x′,y′-1);

[0092] If offset t When the value is greater than 1, the reference points are selected as M(x′,y′+1), M(x′+1,y′) and M(x′+1,y′+2);

[0093] If offset t When =1, the reference points are selected as M(x′+1,y′) and M(x′,y′+1).

[0094] Step S205: Calculate the weight value of the reference point based on the number of reference points and the position of the reference points.

[0095] like Figure 6 As shown, when there are three reference points, the area of ​​the graphic corresponding to any two of the reference points and pixel point R′ is calculated and denoted as S. A S C and S D Any two reference points are two reference points other than the current reference point. For example, any two reference points of A are C and D, any two reference points of C are A and D, and any two reference points of D are A and D, with S... A S C and S D Respectively with the total area S ΔACD The proportion of [a certain value] is used as the third weight, and the third weight corresponding to point A is obtained as W. A The third weight corresponding to point C is W. C The third weight corresponding to point D is W.D Among them, S ΔACD Let S be the area of ​​the triangle formed by the three reference points A, C, and D. A =S ΔCR′D S C =S ΔAR′D S D =S ΔAR′C ,but

[0096] When there are two reference points, it is only necessary to calculate the distance between the target point and the two reference points, and use the ratio of the distances as the weight.

[0097] Step S206: Calculate the sum of the products of the reference point and its corresponding weight value to obtain the target value.

[0098] In this embodiment, the target value is the scaled R and B channel data. When there are three reference points, the step of calculating the sum of the products of the reference points and their corresponding weight values ​​to obtain the target value further includes:

[0099] If there are three reference points, namely M(x′+1, y′-1), M(x′, y′) and M(x′+1, y′+1), the ratio of the area of ​​the triangle formed by any two reference points and pixel point R′ to the area of ​​the triangle formed by the three reference points is used as the third weight. The sum of the products of the pixel values ​​of the three reference points M(x′+1, y′-1), M(x′, y′) and M(x′+1, y′+1) and the third weight is calculated to obtain the target value.

[0100] For ease of explanation, such as Figure 6 As shown, let A(x1, y1), C(x3, y3), and D(x4, y4) represent three reference points M(x′+1, y′-1), M(x′, y′), and M(x′+1, y′+1), respectively. The coordinates of pixel R′ are (x, y), and its pixel value is the target value f(R'). Then:

[0101] f(R') = W A *f(A)+W C *f(C)+W D *f(D)

[0102] Where f(A), f(C), and f(D) represent the pixel values ​​corresponding to the three reference points, respectively.

[0103] When there are two reference points, the step of calculating the sum of the products of the reference points and their corresponding weight values ​​to obtain the target value includes:

[0104] If the reference points are M(x′, y′) and M(x′+1, y′+1), calculate the distances between the target point and the reference points M(x′, y′) and M(x′+1, y′+1), respectively. Use the ratio of the two distances as the first weight, and sum the products of the pixel values ​​corresponding to the reference points M(x′, y′) and M(x′+1, y′+1) with the first weight to obtain the target value.

[0105] If the reference points are M(x′+1, y′) and M(x′, y′+1), respectively, the distances between the target point and the reference points M(x′+1, y′) and M(x′, y′+1) are calculated. The ratio of the two distances is used as the second weight. The pixel values ​​corresponding to the reference points M(x′+1, y′) and M(x′, y′+1) are multiplied by the second weight and summed to obtain the target value.

[0106] This step directly interpolates and scales the RGBG data without requiring additional data conversion steps, greatly simplifying the processing flow and improving the convenience and efficiency of processing. It can more accurately estimate and retain the color information in the original image, reduce color distortion and confusion, and thus achieve a better color reproduction effect.

[0107] In the above image scaling method, an RGBG-arranged image is acquired; the first data corresponding to the R channel and the second data corresponding to the B channel are extracted from the RGBG-arranged image, and the first and second data are rearranged and combined, with the combined data matrix denoted as matrix M; the position of the target point in matrix M is calculated according to the scaling factor; a reference point is selected according to the position of the target point in matrix M; the weight value of the reference point is calculated according to the number and position of the reference point; the sum of the products of the reference point and the corresponding weight value is calculated to obtain the target value. This method directly interpolates and scales the RGBG data without additional data conversion steps, greatly simplifying the processing flow and improving the convenience and efficiency of processing. Furthermore, it fully considers the unique arrangement and color characteristics of red, green, and blue sub-pixels in the RGBG-arranged image data, enabling more accurate estimation and preservation of color information in the original image, reducing color distortion and confusion, and thus achieving a better color restoration effect.

[0108] It should be understood that, although Figure 3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 3At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0109] In one embodiment, such as Figure 7 As shown, an image scaling device is provided, including: an image acquisition unit 71, a data processing unit 72, a position mapping unit 73, a reference selection unit 74, a weight calculation unit 75, and a target acquisition unit 76, wherein:

[0110] Image acquisition unit 71 is used to acquire images arranged in RGBG.

[0111] The data processing unit 72 is used to extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG arranged image, and rearrange the first data and the second data respectively and perform data merging. The merged data matrix is ​​denoted as matrix M.

[0112] The position mapping unit 73 is used to calculate the position of the target point in the matrix M according to the scaling factor;

[0113] The reference unit 74 is selected to select a reference point based on the position of the target point in the matrix M;

[0114] The weight calculation unit 75 is used to calculate the weight value of the reference point based on the number of reference points and the position of the reference points;

[0115] The target acquisition unit 76 is used to calculate the sum of the products of the reference point and the corresponding weight value to obtain the target value.

[0116] Furthermore, the position mapping unit 73 is specifically used for

[0117]

[0118] Wherein, the target point is the data in the i-th row and j-th column, x and y are the position coordinates of the target point in the matrix M, and α and β represent the scaling factor of the row and the scaling factor of the column, respectively.

[0119] Furthermore, the reference point is the position of the target point in the matrix M, which is a distance from the target point. The reference point M(x′, y′) is obtained by rounding down the row and column coordinates of the target point in the matrix M. Then, M(xx′, y′) = (floor(x), floor(y)).

[0120] Where x and y are the position coordinates of the target point in matrix M, and floor(·) represents rounding down.

[0121] Furthermore, the selected reference unit 74 is used to calculate the offset of the reference point relative to the target point if the reference point and the target point are data from the same channel, both being B-channel data or both being R-channel data. c ,offste r :

[0122] offset c =yy′

[0123] offset r =xx′

[0124] If offset c <offset r When the reference points are selected, they are M(x′,y′), M(x′+1,y′-1) and M(x′+1,y′-1).

[0125] If offset c >offset r When the reference points are selected, M(x′,y′), M(x′+1,y′+1) and M(x′,y′+2).

[0126] If offset c =offset r At that time, the reference points are selected as M(x′, y′) and M(x′+1, y′+1);

[0127] If the reference point is in channel B, calculate the sum of the offsets relative to the target point's position in matrix M: offset t :

[0128] offset t =offset r +offset c

[0129] If offset t When <1, the reference points are selected as M(x′,y′+1), M(x′+1,y′) and M(x′,y′-1);

[0130] If offset t When the value is greater than 1, the reference points are selected as M(x′,y′+1), M(x′+1,y′) and M(x′+1,y′+2).

[0131] If offset tWhen =1, the reference points are selected as M(x′+1,y′) and M(x′,y′+1).

[0132] Furthermore, the target acquisition unit 76 is used for

[0133] If the reference points are M(x′, y′) and M(x′+1, y′+1) respectively, calculate the distance between the target point and the reference points M(x′, y′) and M(x′+1, y′+1) respectively, use the ratio of the two distances as the first weight, and sum the product of the pixel values ​​corresponding to the reference points M(x′, y′) and M(x′+1, y′+1) with the first weight to obtain the target value;

[0134] If the reference points are M(x′+1, y′) and M(x′, y′+1), respectively, the distances between the target point and the reference points M(x′+1, y′) and M(x′, y′+1) are calculated. The ratio of the two distances is used as the second weight. The pixel values ​​corresponding to the reference points M(x′+1, y′) and M(x′, y′+1) are multiplied by the second weight and summed to obtain the target value.

[0135] Furthermore, the target acquisition unit 76 is also used for:

[0136] If there are three reference points, namely M(x′+1, y′-1), M(x′, y′) and M(x′+1, y′+1), the ratio of the area of ​​the triangle formed by any two reference points and pixel point R′ to the area of ​​the triangle formed by the three reference points is used as the third weight. The sum of the products of the pixel values ​​of the three reference points M(x′+1, y′+1), M(x′, y′) and M(x′+1, y′+1) and the third weight is calculated to obtain the target value.

[0137] For specific limitations regarding the image scaling device, please refer to the limitations of the image scaling method above, which will not be repeated here. Each module in the aforementioned image scaling device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the display device, or stored in software in the memory of the display device, so that the processor can call and execute the corresponding operations of each module.

[0138] In one embodiment, a display device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown, the display device includes a processor and a memory connected via a system bus. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores a computer program. The internal memory provides an environment for the execution of the computer program in the non-volatile storage medium. When executed by the processor, the computer program implements an image scaling method.

[0139] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the display device to which the present application is applied. A specific display device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0140] In one embodiment, a display device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to perform the following steps:

[0141] Obtain an image with RGBG arrangement;

[0142] Extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG arranged image, and rearrange the first data and the second data respectively and perform data merging. The merged data matrix is ​​denoted as matrix M.

[0143] Calculate the position of the target point in matrix M based on the scaling factor;

[0144] Based on the position of the target point in matrix M, a reference point is selected;

[0145] Calculate the weight value of each reference point based on the number of reference points and their positions;

[0146] The target value is obtained by summing the products of the reference point and its corresponding weight value.

[0147] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0148] Obtain an image with RGBG arrangement;

[0149] Extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG arranged image, and rearrange the first data and the second data respectively and perform data merging. The merged data matrix is ​​denoted as matrix M.

[0150] Calculate the position of the target point in matrix M based on the scaling factor;

[0151] Based on the position of the target point in matrix M, a reference point is selected;

[0152] Calculate the weight value of each reference point based on the number of reference points and their positions;

[0153] The target value is obtained by summing the products of the reference point and its corresponding weight value.

[0154] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0155] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.

[0156] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. An image scaling method, characterized in that, The method includes: Obtain an image with RGBG arrangement; Extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG arranged image, and rearrange the first data and the second data respectively and combine the data. The combined data matrix is ​​denoted as matrix M. Calculate the position of the target point in matrix M based on the scaling factor; Based on the position of the target point in matrix M, a reference point is selected. The reference point is the position of the target point in matrix M. By rounding down the row and column coordinates of the target point in matrix M, the reference point M(x′, y′) for the corresponding channel is obtained. Then: M(x′,y′)=(floor(x),floor(y)) Where x and y are the position coordinates of the target point in matrix M, and floor(·) represents rounding down; Specifically, if the reference point and the target point are data from the same channel, both being B-channel data or both being R-channel data, calculate the offset of the reference point relative to the target point: offset c =y-y′ offset r =x-x′ If offset c <offset r When the reference points are selected, they are M(x′, y′), M(x′+1, y′-1) and M(x′+1, y′+1); If offset c offset t At that time, select reference points M(x′, y′), M(x′+1, y′+1) and M(x′, y′+2); If offset c =offset r At that time, the reference points are selected as M(x′, y′) and M(x′+1, y′+1); If the reference point is B-channel data and the target point is R-channel data, or if the reference point is R-channel data and the target point is B-channel data, calculate the sum of the offsets of the reference point relative to the target point: offset t =offset r +offset c If offset t When <1, the reference points are selected as M(x′,y′+1), M(x′+1,y′), and M(x′,y′-1); If offset t When the value is greater than 1, the reference points are selected as M(x′,y′+1), M(x′+1,y′), and M(x′+1,y′+2). If offset t When = 1, the reference points are selected as M(x′+1, y′) and M(x′, y′+1); Calculate the weight value of each reference point based on the number of reference points and their positions; The target value is obtained by summing the products of the reference point and its corresponding weight value.

2. The method according to claim 1, characterized in that, The position of the target point in matrix M is calculated based on the scaling factor, specifically: Wherein, the target point is the data in the i-th row and j-th column, x and y are the position coordinates of the target point in the matrix M, and α and β represent the scaling factor of the row and the scaling factor of the column, respectively.

3. The method according to claim 1, characterized in that, The step of calculating the sum of the products of the reference point and its corresponding weight value to obtain the target value includes: If the reference points are M(x′, y′) and M(x′+1, y′+1) respectively, calculate the distance between the target point and the reference points M(x′, y′) and M(x′+1, y′+1) respectively, use the ratio of the two distances as the first weight, and sum the product of the pixel values ​​corresponding to the reference points M(x′, y′) and M(x′+1, y′+1) with the first weight to obtain the target value; If the reference points are M(x′+1, y′) and M(x′, y′+1), respectively, the distances between the target point and the reference points M(x′+1, y′) and M(x′, y′+1) are calculated. The ratio of the two distances is used as the second weight. The pixel values ​​corresponding to the reference points M(x′+1, y′) and M(x′, y′+1) are multiplied by the second weight and summed to obtain the target value.

4. The method according to claim 1, characterized in that, If there are three reference points, the process of calculating the sum of the products of the reference points and their corresponding weight values ​​to obtain the target value further includes: If the reference points are M(x′+1, y′-1)), M(x′, y′) and M(x′+1, y′+1), the ratio of the area of ​​the triangle formed by any two reference points and pixel point R′ to the area of ​​the triangle formed by the three reference points is used as the third weight. The sum of the products of the pixel values ​​of the three reference points M(x′+1, y′-1), M(x′, y′) and M(x′+1, y′+1) and the third weight is calculated to obtain the target value.

5. An image scaling device, characterized in that, The device includes: The image acquisition unit is used to acquire images arranged in RGBG order. The data processing unit is used to extract the first data corresponding to the R channel and the second data corresponding to the B channel from the RGBG arranged image, and rearrange the first data and the second data respectively and perform data merging. The merged data matrix is ​​denoted as matrix M. A position mapping unit is used to calculate the position of the target point in the matrix M based on a scaling factor. A reference unit is selected to select a reference point based on the position of the target point in matrix M. The reference point is the position of the target point in matrix M. The reference point M(x′, y′) for the corresponding channel is obtained by rounding down the row and column coordinates of the target point in matrix M. M(x′,y′)=(floor(x),floor(y)) Where x and y are the position coordinates of the target point in matrix M, and floor(·) represents rounding down; Specifically, if the reference point and the target point are data from the same channel, both being B-channel data or both being R-channel data, calculate the offset of the reference point relative to the target point: offset c =y-y′ offset r =x-x′ If offset c <offset r When the reference points are selected, they are M(x′, y′), M(x′+1, y′-1) and M(x′+1, y′+1); If offset c offset r At that time, select reference points M(x′, y′), M(x′+1, y′+1) and M(x′, y′+2); If offset c =offset r At that time, the reference points are selected as M(x′, y′) and M(x′+1, y′+1); If the reference point is B-channel data and the target point is R-channel data, or if the reference point is R-channel data and the target point is B-channel data, calculate the sum of the offsets of the reference point relative to the target point: offset t =offset r +offset c If offset t When <1, the reference points are selected as M(x′,y′+1), M(x′+1,y′), and M(x′,y′-1); If offset t When the value is greater than 1, the reference points are selected as M(x′,y′+1), M(x′+1,y′), and M(x′+1,y′+2). If offset t When = 1, the reference points are selected as M(x′+1, y′) and M(x′, y′+1); The weight calculation unit is used to calculate the weight value of the reference point based on the number of reference points and the position of the reference points; The target acquisition unit is used to calculate the sum of the products of the reference point and its corresponding weight value to obtain the target value.

6. The apparatus according to claim 5, characterized in that, The position mapping unit is specifically used for Wherein, the target point is the data in the i-th row and j-th column, x and y are the position coordinates of the target point in the matrix M, and α and β represent the scaling factor of the row and the scaling factor of the column, respectively.

7. A display device comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

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

Citation Information

Patent Citations

  • Improved video image scaling method based on bilinear interpolation

    CN111275615A

  • Image zooming method and device, electronic equipment and storage medium

    CN114140328A