Image zooming method and device, equipment and storage medium

By only the calculated intermediate variable values ​​are cached in the image scaling process, rather than the original image data, the problem of excessive data cache in the prior art is solved, and the effect of reducing the number of FPGA chips and reducing production costs is achieved.

CN119449977APending Publication Date: 2025-02-14XIAN QINGSONG PHOTOELECTRIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310927021.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-26
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In the image scaling processing of video sources, a large amount of original image data is required to cache, resulting in excessive resource consumption and multiple FPGA chips need to be set up to meet data cache requirements.

Method used

The intermediate variable value is calculated by the k-th line image data in the received image data and stored the intermediate variable value instead of storing the original image data. The interpolated image points are calculated based on the intermediate variable value and the k+1th row image data at the next moment, and a new image is generated by combining the kth row image data and k+1th row image data.

Benefits of technology

It effectively reduces the amount of data storage, reduces the number of FPGA chips used, and reduces production costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449977A_ABST
    Figure CN119449977A_ABST
Patent Text Reader

Abstract

The invention discloses an image scaling method and device, equipment and a storage medium, the image scaling method is used for processing at least two rows of image data of an image, and the method comprises the following steps: obtaining the kth row of image data in the at least two rows of image data; obtaining an intermediate variable value based on a preset scaling and the k-th row of image data, and storing the intermediate variable value; acquiring the (k + 1) th line of image data in the at least two lines of image data; obtaining interpolation image points based on the (k + 1) th row of image data and the intermediate variable value; and generating a new image based on the at least two rows of image data and the interpolation image points. According to the method, the intermediate variable value is calculated through the kth row of image data in the received image data, the interpolation image point is calculated based on the intermediate variable value and the (k + 1) th row of image data received at the next moment, and then the new image is generated, so that only the calculated intermediate variable value needs to be cached, the image data does not need to be stored, and the image processing efficiency is improved. The data storage amount can be effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image scaling method, device, equipment and storage medium. Background Art

[0002] At present, video playback has become an important part of life, including using video playback for entertainment or training, etc. The video source is usually sent by an electronic device to the corresponding display device for playback. Among them, there are many electronic devices that send video sources, including computers, tablets, set-top boxes, etc., and their output resolutions can all be standard resolutions, such as 2k (1920×1080), 4k (3840×2160), etc. The display device that receives the video source and plays it can be a LED display screen of various specifications, and its output resolution can be a non-standard resolution, which is specifically related to its individual specifications, such as 2660×1128, 4000×4000, etc.

[0003] Therefore, when the resolution of the video source is inconsistent with the resolution of the LED display, video processing is required to enlarge or reduce the image data of the input source to make it consistent with the resolution of the LED display. In the prior art, an FPGA (Field-Programmable Gate Array) chip is usually used to scale the original image data of the video source. Specifically, the scaling of the original image data can be completed by programming the FPGA chip to design a scaling algorithm.

[0004] Among them, the existing scaling algorithm needs to cache all the original image data of the video source, resulting in a huge consumption of cache resources. However, the number of caches in the FPGA chip is very limited, so multiple FPGA chips need to be set up to cope with the scaling of video sources with a large amount of cache data. Summary of the invention

[0005] The present application provides an image scaling method, apparatus, device and storage medium, which can reduce the problem of excessive data cache in image scaling processing.

[0006] In a first aspect, the present application provides an image scaling method, the image scaling method is used to process at least two lines of image data of an image, the image scaling method comprising:

[0007] Obtaining the kth line of image data from at least two lines of image data; wherein k is an integer greater than 0;

[0008] Obtaining an intermediate variable value based on a preset scaling ratio and the kth row of image data, and storing the intermediate variable value;

[0009] Obtaining the k+1th row of image data from at least two rows of image data;

[0010] Obtain interpolated image points based on the k+1th row of image data and the intermediate variable value;

[0011] A new image is generated based on at least two lines of image data and interpolated image points.

[0012] Optionally, the intermediate variable value includes a first variable value and a second variable value, and the k-th row of image data includes a first pixel point and a second pixel point input sequentially;

[0013] The steps of obtaining an intermediate variable value based on a preset scaling ratio and the kth row of image data and storing the intermediate variable value include:

[0014] Determining a first weight value based on a preset scaling ratio;

[0015] Obtaining a first variable value based on the first pixel point and the first weight value;

[0016] Obtain a second variable value based on the second pixel point and the first weight value;

[0017] A first variable value and a second variable value are stored.

[0018] Optionally, the k+1th row of image data includes a third pixel point and a fourth pixel point input sequentially;

[0019] The steps of obtaining the interpolated image point based on the k+1th row of image data and the intermediate variable value include:

[0020] Obtaining a second weight value based on a preset scaling ratio;

[0021] Obtain a third variable value based on the second weight value, the third pixel point and the first variable value;

[0022] Obtain a fourth variable value based on the second weight value, the fourth pixel point and the second variable value;

[0023] Determining a third weight value and a fourth weight value based on a preset scaling ratio;

[0024] An interpolated image point is obtained based on the third weight value, the fourth weight value, the third variable, and the fourth variable.

[0025] Optionally, the step of obtaining an interpolated image point based on the third weight value, the fourth weight value, the third variable, and the fourth variable includes:

[0026] Obtaining a first component based on the third variable and a fourth weight value;

[0027] obtaining a second component based on a fourth variable and a third weight value;

[0028] An interpolated image point is obtained based on the first component and the second component.

[0029] Optionally, the sum of the first weight value and the second weight value is a first unit length, the sum of the third weight value and the fourth weight value is a second unit length, and the direction of the first unit length is perpendicular to the direction of the second unit length.

[0030] Optionally, the size of the preset scaling ratio in the direction of the first unit length is equal to the size of the second weight value, and the size of the preset scaling ratio in the direction of the second unit length is equal to the size of the third weight value.

[0031] Optionally, the step of determining the first weight value based on a preset scaling ratio includes:

[0032] Get the sum of the ratios based on k preset scaling ratios;

[0033] A second weight value is obtained based on the proportional sum; wherein the second weight value is equal to a value obtained by subtracting an integer part of the proportional sum.

[0034] A second aspect of the present application provides an image scaling device, the image scaling device comprising:

[0035] An acquisition module, used to acquire the kth row of image data, the k+1th row of image data and a preset zoom ratio among at least two rows of image data;

[0036] A calculation module, used for obtaining an intermediate variable value based on a preset scaling ratio and the kth row of image data;

[0037] A storage module, used to store intermediate variable values;

[0038] The calculation module is also used to obtain an interpolated image point based on the k+1th row of image data and the intermediate variable value;

[0039] The output module is used to generate a new image based on the k-th row of image data, the k+1-th row of image data and the interpolated image points.

[0040] A third aspect of the present application provides an electronic device, including a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the image scaling method as described above.

[0041] A fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the image scaling method as described above is implemented.

[0042] Different from the prior art, the present application obtains the intermediate variable value by calculating the kth row of image data in the received image data, and stores the intermediate variable value at the same time; further, the interpolated image point is calculated based on the intermediate variable value and the k+1th row of image data received at the next moment; the interpolated image point can be output after being calculated, and a new image is generated by combining the kth row of image data and the k+1th row of image data. Among them, the present application only needs to cache the calculated intermediate variable value, and does not need to store the original image data, which can effectively reduce the amount of data storage, thereby reducing the number of FPGA chips used and reducing production costs.

[0043] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0045] Figure 1 It is a flowchart of an embodiment of the image scaling method of the present application;

[0046] Figure 2 yes Figure 1 Specific flow diagram of step S12;

[0047] Figure 3 yes Figure 1 Specific flow diagram of step S14;

[0048] Figure 4 yes Figure 3 Specific flow diagram of step S141;

[0049] Figure 5 yes Figure 4 Specific flow diagram of step S145;

[0050] Figure 6 It is a schematic diagram of the distribution of image data of this application;

[0051] Figure 7 It is a schematic diagram of the framework of an embodiment of the image scaling device of the present application;

[0052] Figure 8 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;

[0053] Fig. 9 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0054] In order to enable those skilled in the art to better understand the technical solution of the present application, the image scaling method, device, equipment and storage medium provided by the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It can be understood that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative efforts are within the scope of protection of the present application.

[0055] The terms "first", "second", etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0056] The entire process of video transmission can be regarded as a video source being sent to the LED sending card of the display device. The controller in the LED sending card processes the video source, that is, performs scaling processing through the FPGA chip. The LED sending card further sends the scaled video to the LED receiving card, and the LED receiving card further displays the corresponding video image through the LED display.

[0057] Among them, the present application provides an image scaling method to reduce the amount of image data cached by the FPGA chip, thereby reducing the number of FPGA chips to be set and reducing production costs. Figure 1 , Figure 1 It is a flowchart of an embodiment of the image scaling method of the present application.

[0058] The image scaling method of the present application may be implemented by an LED sending card. In some possible implementations, the image scaling method may be implemented by a processor calling computer-readable instructions stored in a memory.

[0059] Specifically, the image scaling method of the embodiment of the present disclosure may include the following steps:

[0060] Step S11: Acquire the kth line of image data among at least two lines of image data.

[0061] Wherein, a video includes at least one frame of image, and one frame of image includes at least two lines of image data. When the video is sent to the LED sending card, the LED sending card receives at least one frame of image of the video in sequence, and at least two lines of image data in each frame of image are input into the LED sending card in sequence.

[0062] Optionally, k described in this embodiment may be an integer greater than 0. For example, when a frame of image includes two lines of image data, the k-th line of image data described in this embodiment may be the first line of image data. When a frame of image includes three lines of image data, the k-th line of image data described in this embodiment may be the first line of image data, or the second line of image data.

[0063] Optionally, each line of image data may include at least two pixel points that are sequentially input into the LED sending card in a time sequence, and the number of pixel points included in each line of image data in the k lines of image data is the same.

[0064] Step S12: obtaining an intermediate variable value based on a preset scaling ratio and the kth row of image data, and storing the intermediate variable value.

[0065] Among them, since the resolution of the LED display screen is known, the preset scaling ratio can be determined based on the resolution of the LED display screen and the resolution of the video source.

[0066] For example, when the resolution of the video source is 1920×1080 and the resolution of the LED display is 4000×4000, the preset scaling ratio may be (1920 / 4000)×(1080 / 4000), that is, the preset scaling ratio includes a row scaling ratio and a column scaling ratio. Optionally, in different embodiments, the row scaling ratio and the column scaling ratio may be the same or different.

[0067] Specifically, when the row scaling ratio and the column scaling ratio are greater than 0 and less than 1, it proves that the LED sending card needs to enlarge the video sent by the video source; when the row scaling ratio and the column scaling ratio are greater than 1, it proves that the LED sending card needs to reduce the video sent by the video source.

[0068] When the LED sending card determines the preset scaling ratio, the intermediate variable value corresponding to the k-th row of image data is calculated by the FPGA chip based on the preset scaling ratio and the k-th row of image data obtained in step S11, and the intermediate variable value is stored at the same time.

[0069] Step S13: Acquire the k+1th line of image data among at least two lines of image data.

[0070] The LED sending card sequentially receives the next line of image data sent by the video source, that is, the k+1th line of image data.

[0071] For example, when a frame image includes two lines of image data, the k+1th line of image data described in this embodiment may be the second line of image data. When a frame image includes three lines of image data, the kth line of image data is the second line of image data, and the k+1th line described in this embodiment may be the third line of image data.

[0072] Step S14: obtaining interpolated image points based on the image data of the k+1th row and the intermediate variable value.

[0073] The LED sending card can calculate the interpolated image point through a preset calculation formula based on the intermediate variable value calculated in step S12 and the k+1th row of image data obtained in step S13.

[0074] Optionally, all calculation formulas pre-stored in the LED sending card, including calculation formulas for intermediate variable values ​​and calculation formulas for interpolated image points, can be determined according to different scaling algorithms.

[0075] Furthermore, while calculating the interpolated image points, the LED sending card can also calculate the intermediate variable value corresponding to the k+1th row of image data based on the preset scaling ratio and the k+1th row of image data, and store the intermediate variable value at the same time, that is, execute steps S12-S14 with the k+1th row of image data as the new kth row of image data, until the k+1th row of image data is the last row of image data in the image data, and then execute step S15.

[0076] Step S15: Generate a new image based on at least two lines of image data and interpolated image points.

[0077] The LED sending card generates a new image based on the received k-th row image data, k+1-th row image data and the calculated interpolated image points, and outputs it to the LED display screen. Specifically, the k-th row image data and the k+1-th row image data referred to in this embodiment are all the original image data received by the LED sending card; the interpolated image points referred to in this embodiment are the interpolated image points corresponding to the k-th row calculated by the LED sending card based on the k-th row image data.

[0078] The LED sending card of the present application calculates the intermediate variable value corresponding to the kth row by using the kth row of image data in the received image data, and stores the intermediate variable value at the same time; further, the LED sending card calculates the interpolated image point based on the intermediate variable value and the k+1th row of image data received at the next moment; the interpolated image point can be output after being calculated, and a new image is generated by combining the kth row of image data and the k+1th row of image data.

[0079] Among them, the LED sending card of the present application, especially the FPGA chip, only needs to cache the calculated intermediate variable values, and does not need to store the original image data, which can effectively reduce the amount of data storage, thereby reducing the number of FPGA chips used and reducing production costs.

[0080] Optionally, the present application also provides another embodiment for implementing step S12 to obtain and store the corresponding intermediate variable value. Specifically, this embodiment takes the second-order bilinear scaling as an example, please refer to Figure 6 , Figure 6 It is a schematic diagram of the distribution of image data of this application.

[0081] like Figure 6 As shown, the image data of this embodiment includes two rows of image data, wherein the kth row of image data is the first row of image data, including the first pixel point P1 and the second pixel point P2 input in sequence; the k+1th row of image data is the second row of image data, including the third pixel point P3 and the fourth pixel point P4 input in sequence.

[0082] The horizontal distance from the interpolated image point P5 to the first pixel point P1 is x, the vertical distance from the interpolated image point P5 to the first pixel point P1 is y, the distance from the first pixel point P1 to the second pixel point P2 is unit length 1, and the distance from the first pixel point P1 to the third pixel point P3 is unit length 1.

[0083] The calculation formula for the interpolated image point P5 can be expressed as formula (1):

[0084] P5=P1(1-x)(1-y)+P2x(1-y)+P3(1-x)y+P4xy (1)

[0085] Simplifying formula (1), it can be expressed as formula (2):

[0086] P5=a(1-x)+bx (2)

[0087] Among them, a=P1(1-y)+P3y, b=P2(1-y)+P4y.

[0088] By increasing the value of the intermediate variable, a and b can be further simplified to obtain formula (3) and formula (4):

[0089] a=E+P3y (3)

[0090] b=F+P4y (4)

[0091] Among them, E=P1(1-y), F=P2(1-y). That is, the intermediate variable value includes the first variable value E and the second variable value F.

[0092] Please continue reading Figure 2, Figure 2 yes Figure 1 The specific flow diagram of step S12 in FIG. Specifically, the following steps are included:

[0093] Step S121: determining a first weight value based on a preset scaling ratio.

[0094] The first weight value described in this embodiment is (1-y). Optionally, the row scaling ratio in the preset scaling ratio is y, and the first weight value can be obtained by calculating the difference between the unit length 1 and y.

[0095] Step S122: Obtain a first variable value based on the first pixel point and the first weight value.

[0096] Among them, based on the acquired first pixel point P1 and the calculated first weight value, the calculation formula of the first variable value E is substituted to obtain the first variable value E by calculation.

[0097] Step S123: Obtain a second variable value based on the second pixel point and the first weight value.

[0098] Among them, based on the acquired second pixel point P2 and the calculated first weight value, the calculation formula of the second variable value F is substituted to calculate the second variable value F.

[0099] Step S124: Store the first variable value and the second variable value.

[0100] In this embodiment, the LED sending card calculates the first variable value E through step S122 and the second variable value F through step S123, which are further stored in the storage space of the FPGA chip.

[0101] Optionally, the present application also provides another embodiment for implementing step S14 to calculate and obtain interpolated image points based on the stored intermediate variable values. Figure 6 Please continue reading Figure 3 , Figure 3 yes Figure 1 The specific flow diagram of step S14 in FIG. Specifically, the following steps are included:

[0102] Step S141: Determine a second weight value based on a preset scaling ratio.

[0103] The sum of the second weight value and the first weight value described in this embodiment is the first unit length, that is, Figure 6 The distance from the first pixel point P1 to the third pixel point P3 is shown. Specifically, the second weight value can be obtained by calculating the difference between the first unit length and the first weight value.

[0104] Optionally, in this embodiment, the second weight value may be a row scaling ratio in the preset scaling ratio, that is, y. That is, the size of the preset scaling ratio in the direction of the first unit length is equal to the size of the second weight value.

[0105] Optionally, in other embodiments, the second weight value may be calculated first, and the first weight value may be further determined based on the second weight value.

[0106] Step S142: Obtain a third variable value based on the second weight value, the third pixel point and the first variable value.

[0107] Wherein, based on the obtained first pixel point P1 and the third pixel point P3, the calculated second weight value and the first variable value E, the third variable value can be calculated by substituting them into formula (3).

[0108] Step S143: Obtain a fourth variable value based on the second weight value, the fourth pixel point and the second variable value.

[0109] Among them, based on the obtained second pixel point P2 and the fourth pixel point P4, the calculated second weight value and the second variable value F, the fourth variable value can be calculated by substituting them into formula (4).

[0110] Step S144: determining a third weight value and a fourth weight value based on a preset scaling ratio.

[0111] The third weight value in this embodiment is x, and the fourth weight value is (1-x). Optionally, the third weight value may be a column scaling ratio in a preset scaling ratio, that is, the size of the preset scaling ratio in the direction of the second unit length is equal to the size of the third weight value.

[0112] Furthermore, the sum of the third weight value and the fourth weight value described in this embodiment is the second unit length, that is, Figure 6 The distance from the first pixel point P1 to the second pixel point P2 is shown. In this embodiment, the direction of the first unit length and the direction of the second unit length are perpendicular to each other, and are the arrangement direction of the row data and the arrangement direction of the column data of the image data respectively.

[0113] In this embodiment, the fourth weight value can be obtained by calculating the difference between the second unit length and the third weight value.

[0114] Optionally, in other embodiments, the second weight value and the third weight value may be acquired simultaneously, and the first weight value and the fourth weight value may be calculated based on the second weight value and the third weight value.

[0115] Step S145: obtaining an interpolated image point based on the third weight value, the fourth weight value, the third variable and the fourth variable.

[0116] The interpolated image point P5 can be calculated by substituting the calculated third weight value, fourth weight value, third variable and fourth variable into formula (2).

[0117] Optionally, the present application also provides another embodiment for implementing step S145, so as to calculate and obtain the interpolated image point based on the third weight value, the fourth weight value, the third variable and the fourth variable. Figure 5 , Figure 5 yes Figure 4 The specific flow diagram of step S145 in FIG. Specifically, the following steps are included:

[0118] Step S1451: Obtain a first component based on the third variable and the fourth weight value.

[0119] The first component is a(1-x) shown in formula (2).

[0120] Step S1452: Obtain a second component based on the fourth variable and the third weight value.

[0121] The second component is bx shown in formula (2).

[0122] Step S1453: obtaining an interpolated image point based on the first component and the second component.

[0123] The interpolated image point P5 is equal to the sum of the first component and the second component.

[0124] Optionally, when the scaling algorithm is multi-stage, that is, when the original image data has at least three lines of image data, the present application also provides another embodiment for implementing step S141 to obtain the first weight value. Figure 4 , Figure 4 yes Figure 3 The specific flow chart of step S141 in FIG. Specifically, the following steps are included:

[0125] Step S1411: Obtain a sum of ratios based on k preset scaling ratios.

[0126] Any two adjacent lines of image data of the original image data correspond to a preset scaling ratio, and when the original image data includes k+1 lines of image data, there are k preset scaling ratios. Optionally, the preset scaling ratios of any two adjacent lines of image data may be the same or different.

[0127] Step S1412: Obtain a second weight value based on the sum of the proportions.

[0128] The second weight value of this embodiment is equal to the value obtained by subtracting the integer part from the sum of the proportions.

[0129] Specifically, when the original image needs to be reduced or enlarged by a non-integer multiple, the preset scaling ratios are all non-integer ratios. The sum of the ratios obtained by superimposing multiple preset scaling ratios similarly has an integer part and a decimal part. In this embodiment, the decimal part of the sum of the ratios is taken as the second weight value, that is, the y value.

[0130] Taking the case where the original image data includes three lines of image data and the preset scaling ratio of any two adjacent lines of image data is 0.5 as an example, how to calculate the intermediate variable value is further explained.

[0131] The preset scaling ratio between the first row of image data and the second row of data is 0.5. At this time, y=0.5. Substituting the calculation formula of the first variable value E and the second variable value F, we can get E1=0.5P1 and F1=0.5P2.

[0132] The preset scaling ratio between the second row of image data and the third row of data is 0.5, and the sum of the two preset scaling ratios is equal to 1. At this time, y=0. Substituting the first variable value E and the second variable value F into the calculation formula, we can get E2=P3, F1=P4.

[0133] Optionally, in other embodiments, formula (1) may be simplified in other simplified ways, which may be expressed as formula (5):

[0134] P5=m(1-y)+ny (5)

[0135] Wherein, m=P1(1-x)+P2x, n=P3(1-x)+P4x, then P1(1-x) can be defined as the first variable value, P3(1-x) can be defined as the second variable value, and the interpolated image point P5 can be further calculated. The specific calculation steps are similar to those in the above embodiment, and will not be repeated here.

[0136] The LED sending card of the present application only receives the original image data, calculates and stores the corresponding first variable value E and second variable value F, effectively reducing the amount of cached data in the FPGA chip. When the required computing power and storage space remain unchanged, a more economical FPGA chip can be selected, or the same FPGA chip can be used to achieve more functions.

[0137] This application also provides an image scaling device, see Figure 7 , Figure 7 The image scaling device 60 of this embodiment includes an acquisition module 61 , a calculation module 62 , a storage module 63 and an output module 64 .

[0138] Specifically, the acquisition module 61 is used to acquire the kth row of image data, the k+1th row of image data and the preset scaling ratio of at least two rows of image data. That is, the acquisition module 61 receives the original image data sent by the video source, and determines the preset scaling ratio according to the resolution of the video source and the resolution of the display device.

[0139] The calculation module 62 is connected to the acquisition module 61, and is used to obtain the intermediate variable value based on the preset scaling ratio and the kth row of image data, where k is a natural number greater than zero.

[0140] The number of intermediate variable values ​​is related to the number of pixels in each row of image data. For example, when there is one pixel in each row of image data, the calculation module 62 can calculate k intermediate variable values ​​based on a preset zoom ratio and k rows of image data; when there are two pixels in each row of image data, the calculation module 62 can calculate 2k intermediate variable values ​​based on a preset zoom ratio and k rows of image data.

[0141] The storage module 63 is connected to the calculation module 62, and is used to store intermediate variable values, wherein the intermediate variable values ​​are multiple intermediate variable values ​​calculated by the calculation module 62 based on k lines of image data.

[0142] The calculation module 62 is also used to obtain interpolated image points based on the k+1th row of image data and the intermediate variable values. Specifically, the calculation module 62 calculates the interpolated image points based on the kth row of image data, the k+1th row of image data, and the intermediate variable values ​​corresponding to the kth row of image data.

[0143] The output module 64 is connected to the calculation module 62, and the output module 64 is used to generate a new image based on the k-th row of image data, the k+1-th row of image data and the interpolated image points. When the calculation module 62 determines that the calculation of all interpolated image points is completed, the corresponding image data is output to the output module 64, and the output module 64 generates a new image based on all the image data.

[0144] This application also provides an electronic device, see Figure 8 , Figure 8 : is a schematic diagram of a framework of an embodiment of an electronic device of the present application. The electronic device 70 includes a memory 71 and a processor 72 coupled to each other, and the processor 72 is used to execute program instructions stored in the memory 71 to implement the steps in any of the above-mentioned image scaling method embodiments. In a specific implementation scenario, the electronic device 70 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 70 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0145] Specifically, the processor 72 is used to control itself and the memory 71 to implement the steps in any of the above-mentioned image scaling method embodiments. The processor 72 can also be called a CPU (Central Processing Unit). The processor 72 may be an integrated circuit chip with signal processing capabilities. The processor 72 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 72 can be implemented by an integrated circuit chip.

[0146] This application also provides a computer-readable storage medium, see Fig. 9 , Fig. 9 The computer-readable storage medium 80 stores a computer program 81 that can be executed by a processor, and the computer program 81 is used to implement the steps in any of the above-mentioned image scaling method embodiments.

[0147] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0148] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0149] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0150] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0151] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0152] The above are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. An image scaling method, characterized in that: For processing at least two lines of image data of the image, the method comprises: Acquire the kth line of image data in the at least two lines of image data; wherein k is an integer greater than 0; Obtaining an intermediate variable value based on a preset scaling ratio and the k-th row of image data, and storing the intermediate variable value; Acquire the k+1th line of image data from the at least two lines of image data; Obtaining an interpolated image point based on the k+1th row of image data and the intermediate variable value; A new image is generated based on the at least two lines of image data and the interpolated image points.

2. The image scaling method according to claim 1, characterized in that: The intermediate variable value includes a first variable value and a second variable value, and the k-th row of image data includes a first pixel point and a second pixel point input sequentially; The step of obtaining an intermediate variable value based on a preset scaling ratio and the kth row of image data, and storing the intermediate variable value comprises: Determining a first weight value based on the preset scaling ratio; Obtaining the first variable value based on the first pixel point and the first weight value; Obtaining the second variable value based on the second pixel point and the first weight value; The first variable value and the second variable value are stored.

3. The image scaling method according to claim 2, characterized in that: The k+1th row of image data includes a third pixel point and a fourth pixel point input sequentially; The step of obtaining an interpolated image point based on the k+1th row of image data and the intermediate variable value comprises: Obtaining a second weight value based on the preset scaling ratio; Obtain a third variable value based on the second weight value, the third pixel point and the first variable value; Obtain a fourth variable value based on the second weight value, the fourth pixel point and the second variable value; Determining a third weight value and a fourth weight value based on the preset scaling ratio; The interpolated image point is obtained based on the third weight value, the fourth weight value, the third variable, and the fourth variable.

4. The image scaling method according to claim 3, characterized in that: The step of obtaining the interpolated image point based on the third weight value, the fourth weight value, the third variable and the fourth variable comprises: Obtaining a first component based on the third variable and the fourth weight value; obtaining a second component based on the fourth variable and the third weight value; The interpolated image point is obtained based on the first component and the second component.

5. The image scaling method according to claim 3, characterized in that: The sum of the first weight value and the second weight value is a first unit length, the sum of the third weight value and the fourth weight value is a second unit length, and a direction of the first unit length is perpendicular to a direction of the second unit length.

6. The image scaling method according to claim 5, characterized in that: The size of the preset scaling ratio in the direction of the first unit length is equal to the size of the second weight value, and the size of the preset scaling ratio in the direction of the second unit length is equal to the size of the third weight value.

7. The image scaling method according to claim 3, characterized in that: The step of determining the second weight value based on the preset scaling ratio comprises: Obtaining a sum of ratios based on the k preset scaling ratios; The second weight value is obtained based on the ratio and the second weight value is equal to the value obtained by subtracting the integer part of the ratio and the second weight value.

8. An image scaling device, characterized in that: include: An acquisition module, used to acquire the kth row of image data, the k+1th row of image data and a preset zoom ratio among the at least two rows of image data; A calculation module, used for obtaining an intermediate variable value based on a preset scaling ratio and the k-th row of image data; A storage module, used for storing the intermediate variable value; The calculation module is also used to obtain an interpolated image point based on the k+1th row of image data and the intermediate variable value; An output module is used to generate a new image based on the k-th row of image data, the k+1-th row of image data and the interpolated image points.

9. An electronic device, characterized in that: The invention comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the image scaling method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image scaling method according to any one of claims 1 to 7 can be implemented.