Image zooming method and system, intelligent terminal and storage medium

By calculating the image scaling ratio, partitioning parameters, and jitter address value to update the starting address, selecting kernel function parameters to determine the weight coefficient matrix, and performing grayscale transformation, scaling interpolation, and spatiotemporal filtering on the image data, this approach solves the problems of high computational complexity in traditional algorithms and high resource consumption in deep learning algorithms, achieving efficient image scaling processing.

CN120976012APending Publication Date: 2025-11-18SHENZHEN AIXIESHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511073433.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing image scaling algorithms present a contradiction in terms of computational complexity and real-time performance. Traditional algorithms have high computational complexity but poor real-time performance, while deep learning algorithms consume huge computational resources and are costly, which limits their application scenarios.

Method used

The starting address is updated by calculating the image scaling ratio, partitioning parameters, and jitter address value. The weight coefficient matrix is ​​determined by selecting kernel function parameters. Gray-scale transformation, scaling interpolation calculation, and spatiotemporal filtering are performed on the image data, simplifying the calculation process and optimizing the computational cost.

Benefits of technology

It improves high-frequency signal loss and mosaic effect, enhances image visual quality and algorithm robustness, has strong adaptability, and simplifies the calculation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976012A_ABST
    Figure CN120976012A_ABST
Patent Text Reader

Abstract

The invention discloses an image scaling method and system, an intelligent terminal and a storage medium, and the method can calculate a scaling ratio, a partition parameter and a jitter address value according to a first size of an input image and a second size of an output image, and updates a head address of the current image scaling, so as to read partition image data in the input image, the method comprises the following steps of: performing gray conversion on read image data to obtain initial gray data, acquiring corresponding first gray energy and a maximum gradient value, performing scaling interpolation calculation to obtain first scaled data, acquiring second gray energy of the first scaled data, performing recovery processing on the first scaled data to obtain recovered data, and performing data processing on the recovered data to obtain the image data. And time-space domain filtering is carried out on the recovered data, so that scaling processing on the whole input image is realized, the high-frequency signal loss and the mosaic effect can be obviously improved in the scaling processing process, the calculation overhead is greatly optimized through channel combination and parameterization design, and the method has universal adaptability to various images and has good image visual effect and algorithm robustness.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to an image scaling method and system, an intelligent terminal and a storage medium. BACKGROUND

[0002] Image scaling is a basic function in computer vision and image processing, aiming to adjust the image resolution to meet different needs. In addition to adapting to different display screen resolution specifications, image scaling can also reduce the requirements for video source acquisition devices or display devices to achieve higher cost-effective benefits.

[0003] Traditional interpolation algorithms are inversely proportional to the order of magnitude and image effects. For example, the most commonly used nearest neighbor interpolation, bilinear interpolation and cubic spline interpolation algorithms are respectively calculated on the three primary color channels of the image to achieve scaling. The order of the interpolation polynomial expression of the three traditional algorithms increases in turn, and the computational complexity changes from linear to exponential. With the increase of the order, more details will be retained on the visual effect, and the sawtooth effect will be improved. Further, the real-time performance of the calculation delay will decrease with the increase of the order, and the storage overhead will also increase. In recent years, with the development of deep learning technology, super-resolution methods based on deep learning have been proposed. However, the computational complexity of the super-resolution methods is much larger than that of traditional algorithms, and the processing effect is strongly related to the pre-training method and the characteristics of the data set. The greater cost is the huge consumption of computing resources, and because of the real-time requirement, the implementation architecture must use a multi-task concurrent and hardware accelerated integrated architecture, which has high requirements for implementation cost and power consumption, thus limiting the application scenarios. SUMMARY

[0004] In view of this, the present application provides an image scaling method and system, an intelligent terminal and a storage medium to simplify the calculation process in the image scaling process.

[0005] The image scaling method provided by the present application comprises the following steps:

[0006] S1, calculating a scaling ratio between an input image and an output image according to a first size of the input image and a second size of the output image;

[0007] S2, calculating a partition parameter and a dithering address value according to the scaling ratio, respectively, and updating a first address of the current image scaling according to the scaling ratio, the partition parameter and the dithering address value;

[0008] S3, selecting a kernel function parameter according to the scaling ratio, and determining a weight coefficient matrix corresponding to the selected kernel function parameter;

[0009] S4, reading image data in the input image according to the updated first address and the partition parameter, performing gray scale transformation on the read image data to obtain initial gray scale data, and obtaining a first gray scale energy and a maximum gradient value corresponding to the initial gray scale data;

[0010] S5, performing scaling interpolation calculation on the initial gray scale data according to the weight coefficient matrix to obtain first scaling data;

[0011] S6, obtaining a second gray scale energy of the first scaling data, and performing recovery processing on the first scaling data according to the first gray scale energy and the second gray scale energy to obtain recovery data;

[0012] S7, performing space-time domain filtering on the recovery data according to the maximum gradient value to obtain second scaling data.

[0013] Optionally, the calculation process of the scaling ratio comprises:

[0014] S11, obtaining a first size [Hin, Win] of an input image, wherein Hin represents the height of the input image, and Win represents the width of the input image;

[0015] S12, obtaining a second size [Hout, Wout] of an output image, wherein Hout represents the height of the output image, and Wout represents the width of the output image;

[0016] S13, calculating a scaling ratio [Hrate, Wrate] between the input image and the output image according to the first size [Hin, Win] and the second size [Hout, Wout], wherein Hrate represents the scaling ratio in the height direction, Wrate represents the scaling ratio in the width direction, Hrate = Hout / Hin, and Wrate = Wout / Win.

[0017] Optionally, the calculation process of the scaling ratio further comprises: S14, when the difference between the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction is greater than a preset limited threshold, adjusting the size of the input image and / or the output image, and returning to perform step S11 for the adjusted input image and / or the output image, until the difference between the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction is less than or equal to the limited threshold.

[0018] Optionally, the calculation of the partition parameter and the dithering address value according to the scaling ratio comprises:

[0019] S21, determine the partitioning parameter Nblk according to the first rule based on the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction;

[0020] S22, when the scaling ratio in the height direction is characterized by the first feature, enable the calculation of the jitter address value in the height direction of the current image scaling, and calculate the jitter address value HidxShift in the height direction according to the second rule; when the scaling ratio in the width direction is characterized by the first feature, enable the calculation of the jitter address value in the width direction of the current image scaling, and calculate the jitter address value WidxShift in the width direction according to the second rule; when the scaling ratio in the height direction is characterized by the second feature, disable the calculation of the jitter address value in the height direction of the current image scaling, and set the jitter address value HidxShift in the height direction to zero; when the scaling ratio in the width direction is characterized by the second feature, disable the calculation of the jitter address value in the width direction of the current image scaling, and set all jitter address values ​​WidxShift in the width direction to zero.

[0021] Optionally, the starting address includes the height starting address HidxStart and the width starting address WidxStart; updating the starting address of this image scaling based on [Hrate, Wrate], the partition parameter Nblk, and the jitter address value includes:

[0022] HidxStart=HidxStart+(Hcnt*Hrate-Nblk / 2)-HidxShift;

[0023] WidxStart=WidxStart+(Wcnt*Wrate-Nblk / 2)-WidxShift;

[0024] Where HidxStart represents the starting address of the height, WidxStart represents the starting address of the width, Hcnt represents the data retrieval count in the height direction, Wcnt represents the data retrieval count in the width direction, Nblk represents the partitioning parameter, HidxShift represents the jitter address value in the height direction, and WidxShift represents the jitter address value in the width direction.

[0025] Optionally, the process of determining the weight coefficient matrix includes:

[0026] S31, Select kernel function parameters according to the scaling ratio;

[0027] S32, determining a high weight coefficient HW and a wide weight coefficient WW according to the selected kernel function parameter and the serial number in the partition where the image is scaled this time; wherein the weight coefficient HW(Hidxblk) at the height direction serial number count Hidxblk and the weight coefficient WW(Widxblk) at the width direction serial number count Widxblk are respectively:

[0028] HW(Hidxblk) = Kernel(L-1) * abs(Hidxblk-Nblk / 2)^L-1 + Kernel(L-2) * abs(Hidxblk-Nblk / 2)^L-2 + … + Kernel(1) * abs(Hidxblk-Nblk / 2) + Kernel(0);

[0029] WW(Widxblk) = Kernel(L-1) * abs(Widxblk-Nblk / 2)^L-1 + Kernel(L-2) * abs(Widxblk-Nblk / 2)^L-2 + … + Kernel(1) * abs(Widxblk-Nblk / 2) + Kernel(0);

[0030] In the formula, Kernel(i) represents an i-order kernel function parameter, i is an integer greater than or equal to 1 and less than or equal to L-1, L represents the order of the kernel function parameter, and abs() represents an absolute value;

[0031] S33, determining a weight coefficient matrix according to the high weight coefficient HW and the wide weight coefficient WW, wherein the weight coefficient matrix is HW’*WW, and the superscript’ represents transposition.

[0032] Optionally, the obtaining of the first gray energy and the maximum gradient value corresponding to the initial gray data comprises:

[0033] S41, performing gradient calculation on the initial gray data and saving the maximum gradient value;

[0034] S42, independently accumulating the energy of the three pixel channels of RGB in the initial gray data respectively to obtain the first gray energy of each pixel channel.

[0035] Optionally, the scaling interpolation calculation on the initial gray data according to the weight coefficient matrix to obtain the first scaling data comprises: performing multiplication and accumulation operation on the kernel function weight coefficient matrix and the initial gray data to obtain the first scaling data.

[0036] Optionally, the recovering the first scaling data according to the first gray energy and the second gray energy to obtain recovered data comprises: obtaining a ratio parameter between the first gray energy of each pixel channel and the second gray energy of the corresponding pixel channel, multiplying the ratio parameter corresponding to each pixel channel with the first gray energy of each pixel channel in the initial gray data to obtain the RGB pixel value corresponding to each pixel channel in the first scaling data, and determining the recovered data according to the RGB pixel value corresponding to each pixel channel.

[0037] Optionally, the spatio-temporal filtering the recovered data according to the maximum gradient value to obtain second scaling data comprises:

[0038] S71, if the maximum gradient is greater than or equal to a preset gradient threshold, a first filter parameter is selected, if the maximum gradient is less than the preset gradient threshold, a second filter parameter is selected, and otherwise a third filter parameter is selected;

[0039] S72, the first filter parameter or the second filter parameter or the third filter parameter is used to perform spatio-temporal filtering on the recovered data to obtain second scaling data.

[0040] Optionally, the image scaling method further comprises: S8, cyclically performing steps S4 to S7 until the scaling processing is performed on the entire input image.

[0041] The application further provides an image scaling system, comprising:

[0042] a first calculation module configured to calculate a scaling ratio between an input image and an output image according to a first size of the input image and a second size of the output image;

[0043] an updating module configured to calculate a partition parameter and a dithering address value according to the scaling ratio respectively, and update a first address of the current image scaling according to the scaling ratio, the partition parameter and the dithering address value;

[0044] a determination module configured to select a kernel function parameter according to the scaling ratio, and determine a weight coefficient matrix corresponding to the selected kernel function parameter;

[0045] a reading module configured to read image data from the input image according to the updated first address and the partition parameter, perform gray transformation on the read image data to obtain initial gray data, and obtain a first gray energy and a maximum gradient value corresponding to the initial gray data;

[0046] a second calculation module configured to perform scaling interpolation calculation on the initial gray data according to the weight coefficient matrix to obtain first scaling data;

[0047] a recovery module configured to obtain a second gray energy of the first scaling data, perform recovery processing on the first scaling data according to the first gray energy and the second gray energy, and obtain recovery data;

[0048] a filtering module configured to perform time-space domain filtering on the recovery data according to the maximum gradient value, and obtain second scaling data.

[0049] The application further provides an intelligent terminal, comprising a memory and a processor, wherein the memory stores an image scaling program, and the image scaling program, when executed by the processor, implements the steps of any one of the above image scaling methods.

[0050] The application further provides a computer readable storage medium, wherein the storage medium stores a computer program, and the computer program, when executed by a processor, implements the steps of any one of the above image scaling methods.

[0051] The above image scaling method and system, intelligent terminal, and storage medium can calculate a scaling ratio between an input image and an output image according to a first size of the input image and a second size of the output image, calculate a partition parameter and a dithering address value according to the scaling ratio respectively, update a first address of the current image scaling according to the scaling ratio, the partition parameter, and the dithering address value, read image data in the input image according to the updated first address and the partition parameter, perform gray transformation on the read image data to obtain initial gray data, obtain a first gray energy and a maximum gradient value corresponding to the initial gray data, perform scaling interpolation calculation on the initial gray data according to the weight coefficient matrix to obtain first scaling data, obtain a second gray energy of the first scaling data, perform recovery processing on the first scaling data according to the first gray energy and the second gray energy to obtain recovery data, and perform time-space domain filtering on the recovery data according to the maximum gradient value to obtain second scaling data, so as to implement scaling processing on the entire input image. The scaling processing process can obviously improve high-frequency signal loss and mosaic effect, channel merging and parameterized design greatly optimize the calculation overhead, and the method has universal adaptability to various images and good image visual effect and algorithm robustness. BRIEF DESCRIPTION OF DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.

[0053] Figure 1 is a flowchart of an image scaling method according to an embodiment of the present application;

[0054] Figure 2 This is a schematic diagram showing the image reduction and comparison according to an embodiment of this application;

[0055] Figure 3 This is a magnified comparison diagram of an embodiment of this application.

[0056] Figure 4 This is a schematic diagram of the structure of an image scaling system according to an embodiment of this application;

[0057] Figure 5 This is a schematic diagram of a smart terminal structure according to an embodiment of this application. Detailed Implementation

[0058] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. In the absence of conflict, the following embodiments and their technical features can be combined with each other.

[0059] The first aspect of this application provides an image scaling method, which can be executed by a smart terminal for performing related image processing. (Reference) Figure 1 As shown, the above image scaling method includes the following steps S1 to S7.

[0060] S1, calculate the scaling ratio between the input image and the output image based on the first size of the input image and the second size of the output image.

[0061] The first size of the input image and the second size of the output image can include dimensions in the height and width directions. For example, the first size can be [Hin, Win], where Hin represents the height of the input image and Win represents the width of the input image. The second size can be [Hout, Wout], where Hout represents the height of the output image and Wout represents the width of the output image. The input and output images can be regular shapes such as squares or rectangles, and the height and width directions are intersecting directions; that is, one of the intersecting directions is the height direction, and the other is the width direction.

[0062] S2, calculate the partition parameters and jitter address value according to the scaling ratio, and update the starting address of the current image scaling (also known as the current image scaling cycle) according to the scaling ratio, the partition parameters and the jitter address value.

[0063] Optionally, the partition parameter can be used to determine the range of the current image scaling, and the corresponding image data can be extracted from the input image according to the first address of the current image scaling and the partition parameter for subsequent processing. The first address is the corresponding first address of each partition in the original image in the scaling process.

[0064] S3, according to the scaling ratio, the kernel function parameters are selected, and the weight coefficient matrix corresponding to the selected kernel function parameters is determined.

[0065] Optionally, the above-mentioned steps can select the corresponding kernel function parameters according to the value characteristics of the scaling ratio, and then determine the corresponding weight coefficient matrix according to the selected kernel function parameters; for example, when at least one value of the scaling ratio is an integer, the most sharpened kernel function parameter can be selected; when at least one value of the scaling ratio is a periodic decimal, a moderately sharpened kernel function parameter is selected; when at least one value of the scaling ratio is a non-periodic decimal, the most smooth kernel function parameter is selected, and so on. The kernel function parameter is the calculation coefficient in the weight coefficient polynomial, and the kernel function parameter can be represented as a row vector, and the vector length of the row vector is equal to the polynomial order.

[0066] S4, in the input image, the image data is read according to the updated first address and the partition parameter, that is, the updated first address is taken as the starting address, the data range to be read is determined by the partition parameter, the image data is read, the initial gray data is obtained by performing gray scale transformation on the read image data, and the first gray energy and the maximum gradient value corresponding to the initial gray data are obtained.

[0067] The above-mentioned first gray energy includes energy parameters corresponding to each pixel channel in the initial gray data, for example, the first gray energy includes R energy parameters corresponding to R channel, G energy parameters corresponding to G channel and B energy parameters corresponding to B channel. The above-mentioned maximum gradient value can be used to measure the degree of change of the pixels in the image partition corresponding to the current image scaling, which can be calculated by a related gradient value calculation formula.

[0068] S5, according to the weight coefficient matrix, the initial gray data is scaled and interpolated to obtain the first scaling data.

[0069] Optionally, each element value in the weight coefficient matrix has a corresponding relationship with each pixel point in the initial gray data, and step S5 can multiply and accumulate the element value in the weight coefficient matrix with the corresponding gray value of each pixel point in the initial gray data to obtain the first scaling data.

[0070] S6, the second gray energy of the first scaling data is obtained, the first scaling data is recovered according to the first gray energy and the second gray energy, and the recovery data is obtained.

[0071] The second gray energy includes energy parameters corresponding to respective pixel channels in the first scaling data, for example, the second gray energy includes an R energy parameter corresponding to an R channel, a G energy parameter corresponding to a G channel, and a B energy parameter corresponding to a B channel. Optionally, the process of recovering the first scaling data according to the first gray energy and the second gray energy can include: comparing the first gray energy and the second gray energy to obtain a feature between the initial gray data and the first scaling data, and recovering the first scaling data according to the feature obtained by comparison to obtain the recovered data.

[0072] S7, performing space-time domain filtering on the recovered data according to the maximum gradient value to obtain second scaling data, and improving the visual quality of the second scaling data.

[0073] The step S7 only uses the maximum gradient in the image partition corresponding to the current image scaling to perform space-time domain filtering, which can avoid high complexity of global calculation, and can simplify the corresponding calculation process on the basis of ensuring the scaling quality and visual effect of the obtained image data.

[0074] The image scaling method can calculate a scaling ratio between an input image and an output image according to a first size of the input image and a second size of the output image, calculate a partition parameter and a dithering address value according to the scaling ratio, update a first address of the current image scaling according to the scaling ratio, the partition parameter, and the dithering address value, read image data in the input image according to the updated first address and the partition parameter, perform gray transformation on the read image data to obtain initial gray data, obtain a first gray energy and a maximum gradient value corresponding to the initial gray data, perform scaling interpolation calculation on the initial gray data according to the weight coefficient matrix to obtain first scaling data, obtain a second gray energy of the first scaling data, perform recovery processing on the first scaling data according to the first gray energy and the second gray energy to obtain recovered data, and perform space-time domain filtering on the recovered data according to the maximum gradient value to obtain second scaling data, so as to realize scaling processing of the entire input image. The scaling processing process can significantly improve the loss of high-frequency signals and the mosaic effect, channel merging and parameterized design greatly optimize the calculation overhead, and has universal adaptability to various images, good image visual effect, and algorithm robustness.

[0075] In some embodiments, the calculation process of the scaling ratio includes steps S11 to S13.

[0076] S11, obtaining a first size [Hin, Win] of an input image, where Hin represents the height of the input image, and Win represents the width of the input image.

[0077] S12, obtaining a second size [Hout, Wout] of the output image, wherein Hout represents a height of the output image, and Wout represents a width of the output image.

[0078] S13, calculating a scaling ratio [Hrate, Wrate] between the input image and the output image according to the first size [Hin, Win] and the second size [Hout, Wout], wherein Hrate represents a scaling ratio in the height direction, Wrate represents a scaling ratio in the width direction, Hrate = Hout / Hin, and Wrate = Wout / Win.

[0079] The scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction can be the same value or a value close to the same value.

[0080] The inventor has found that if the difference between the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction is large, the visual experience of a user is easily affected when the corresponding image is played. Based on this problem, in some examples, the calculation process of the scaling ratio further includes step S14.

[0081] S14, when the difference between the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction is greater than a preset limited threshold, adjusting the size of the input image and / or the output image with reference to the visual aspect ratio of the output image, and returning to execute step S11 for the adjusted input image and / or the output image until the difference between the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction is less than or equal to the limited threshold, and the corresponding calculation and processing according to the value in the scaling ratio will not affect the visual experience of the finally obtained image.

[0082] Optionally, the threshold value can be set to 18%, 20%, or 22%, etc. Optionally, the size of the input image is adjusted, including: performing a first proportion of cropping on the aspect ratio of the input image, wherein the first proportion can be set according to the first size [Hin, Win], the scaling ratio [Hrate, Wrate], and / or the expected visual effect, etc. Optionally, the size of the output image is adjusted, including: performing a second proportion of black border padding on the output image. The second proportion can be set according to the second size [Hout, Wout] of the input image, the scaling ratio [Hrate, Wrate], and / or the expected visual effect, etc.; the black border padding includes but is not limited to black edge padding, original image filter padding. In some examples, the adjusted output image size can be smaller than the original second size of the output image (i.e., the first obtained output image size) compared with the actual configured second size of the output image.

[0083] In some embodiments, the calculating the partition parameter and the dithering address value according to the scaling ratio respectively includes steps S21 and S22.

[0084] S21, determining the partition parameter Nblk according to the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction according to a first rule. The first rule includes a rule of performing corresponding operations on the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction to obtain the partition parameter Nblk, which is used to describe the height and width of the image data reading this time; for example, the first rule can include: multiplying the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction by 2 plus 1 to obtain the maximum value of the results (i.e., the result corresponding to the scaling ratio Hrate and the result corresponding to the scaling ratio Wrate) as the partition parameter Nblk.

[0085] S22, when the scaling ratio in the height direction represents the first feature, enabling the calculation of the dithering address value in the height direction of the image scaling this time, calculating the dithering address value HidxShift in the height direction according to a second rule, when the scaling ratio in the width direction represents the first feature, enabling the calculation of the dithering address value in the width direction of the image scaling this time, calculating the dithering address value WidxShift in the width direction according to the second rule; when the scaling ratio in the height direction represents the second feature, disabling the calculation of the dithering address value in the height direction of the image scaling this time, setting the dithering address value HidxShift in the height direction to zero, when the scaling ratio in the width direction represents the second feature, disabling the calculation of the dithering address value in the width direction of the image scaling this time, setting the dithering address value WidxShift in the width direction to zero.

[0086] Optionally, the first feature includes that the corresponding scaling ratio is an integer or a periodic circulating decimal, and the second feature includes that the corresponding scaling ratio is a non-periodic circulating decimal. Here, the dithering address values in the height direction and the width direction are determined independently, and have higher flexibility. For example, when the scaling ratio in the height direction is an integer or a periodic circulating decimal, the dithering address value calculation in the height direction of this image scaling is enabled, and the dithering address value HidxShift in the height direction is calculated according to the second rule; when the scaling ratio in the width direction is an integer or a periodic circulating decimal, the dithering address value calculation in the width direction of this image scaling is enabled, and the dithering address value WidxShift in the width direction is calculated according to the second rule; when the scaling ratio in the height direction is a non-periodic circulating decimal, the dithering address value calculation in the height direction of this image scaling is disabled, and the dithering address value HidxShift in the height direction is set to zero; and when the scaling ratio in the width direction is a non-periodic circulating decimal, the dithering address value calculation in the width direction of this image scaling is disabled, and the dithering address value WidxShift in the width direction is set to zero.

[0087] Optionally, the second rule includes a rule of updating each dithering address value (including the dithering address value HidxShift in the height direction and the dithering address value WidxShift in the width direction) in a corresponding image scaling period; for example, the second rule includes: when the corresponding scaling ratio is an integer, taking the integer as a period for dithering calculation, and in the period, each dithering address value is increased by 1 on the basis of its original value each time; when the corresponding scaling ratio is a periodic circulating decimal, taking the integer part of the reciprocal of the decimal as a period for dithering calculation, and in the period, each dithering address value is increased by 1 on the basis of its original value each time; at the end of the calculation period, each dithering address value is set to zero, and the dithering address calculation in the next period (the next-period image scaling) is prepared.

[0088] Specifically, the first address includes a height first address HidxStart and a width first address WidxStart; and the updating the first address of this image scaling according to the scaling ratio [Hrate, Wrate], the partition parameter Nblk and the dithering address value (including the dithering address value HidxShift in the height direction and the dithering address value WidxShift in the width direction) includes:

[0089] HidxStart = HidxStart + (Hcnt*Hrate-Nblk / 2)-HidxShift;

[0090] WidxStart = WidxStart + (Wcnt*Wrate-Nblk / 2)-WidxShift;

[0091] Wherein, HidxStart represents the height first address, HidxStart on the left side of the equal sign represents the updated height first address, WidxStart represents the width first address, HidxStart on the right side of the equal sign represents the height first address before the update, Hcnt represents the height direction data taking count, Wcnt represents the width direction data taking count, Nblk represents the partition parameter, HidxShift represents the height direction dithering address value, and WidxShift represents the width direction dithering address value. After updating the first address of the current image scaling, Nblk data can be continuously taken from the height direction and the width direction respectively with the first address as the starting address, so that the partition data of the current image scaling can be formed, and the current data taking (which can also be referred to as image data reading) can be realized by reading the partition data.

[0092] In some embodiments, the process of determining the weight coefficient matrix comprises steps S31 to S33.

[0093] S31, selecting a kernel function parameter according to the scaling ratio. Specifically, step S31 can select a corresponding kernel function parameter according to the value characteristics of at least one scale parameter in the scaling ratio; the kernel function parameter is the calculation coefficient of the weight coefficient polynomial, which can be represented as a row vector, and the vector length of the row vector is equal to the polynomial order. If the kernel function parameter includes a first kernel function parameter, a second kernel function parameter and a third kernel function parameter, the sharpening degree of the first kernel function parameter, the second kernel function parameter and the third kernel function parameter decreases in turn, and the smoothness increases in turn; at this time, the kernel function parameter is selected according to the scaling ratio, which includes: when at least one scale parameter in the scaling ratio is an integer, the first kernel function parameter (i.e. the most sharpened kernel function parameter) is selected; when at least one scale parameter in the scaling ratio is a periodic repeating decimal, the second kernel function parameter (i.e. the moderately sharpened kernel function parameter) is selected; when at least one scale parameter in the scaling ratio is a non-periodic decimal, the third kernel function parameter (i.e. the most smooth kernel function parameter) is selected.

[0094] S32, determining high weight coefficients HW and wide weight coefficients WW according to the selected kernel function parameter and the sequence number in the partition of the current image scaling; wherein the high weight coefficients HW include weight coefficients HW(Hidxblk) at each height direction sequence number count Hidxblk, and the wide weight coefficients WW include weight coefficients WW(Widxblk) at each width direction sequence number count Widxblk; the weight coefficients HW(Hidxblk) at the height direction sequence number count Hidxblk and the weight coefficients WW(Widxblk) at the width direction sequence number count Widxblk are respectively:

[0095] HW(Hidxblk) = Kernel(L-1) * abs(Hidxblk - Nblk / 2) ^ L-1 + Kernel(L-2) * abs(Hidxblk - Nblk / 2) ^ L-2 +... + Kernel(1) * abs(Hidxblk - Nblk / 2) + Kernel(0);

[0096] WW(Widxblk) = Kernel(L-1) * abs(Widxblk - Nblk / 2) ^ L-1 + Kernel(L-2) * abs(Widxblk - Nblk / 2) ^ L-2 +... + Kernel(1) * abs(Widxblk - Nblk / 2) + Kernel(0);

[0097] In the formula, Kernel(i) represents an i-order kernel function parameter, i is an integer greater than or equal to 1 and less than or equal to L-1, L represents an order of the kernel function parameter, and abs() represents an absolute value.

[0098] S33, determining a weight coefficient matrix according to the high weight coefficient HW and the wide weight coefficient WW, wherein the weight coefficient matrix is HW' * WW, and the superscript'represents transposition.

[0099] The weight coefficient matrix has a large proportion of repetition or approximation in different partitions, and therefore, in this embodiment, the abs(Hidxblk - Nblk / 2) coefficient value corresponding to Hidxblk, Widxblk and Nblk is approximated and fitted to reduce the calculation process of initialization and greatly reduce the required storage of the HW and WW values. In subsequent calculation, the optimized weight coefficient table is converted, and Hidxblk and Widxblk are used to look up the table.

[0100] In some embodiments, the step of obtaining the first gray energy and the maximum gradient value corresponding to the initial gray data includes steps S41 and S42.

[0101] S41, performing gradient calculation on the initial gray data and saving the maximum gradient value. This step can be performed by calculating the initial gray data according to a related gradient value calculation formula, obtaining and saving the maximum gradient value calculated.

[0102] S42, independently accumulating the energy of the RGB three pixel channels in the initial gray data respectively to obtain the first gray energy of each pixel channel. Specifically, this step can calculate the energy of the RGB three pixel channels respectively, and accumulate the energy of each pixel channel respectively to obtain the energy sum of the corresponding pixel channel, which is the first gray energy of the corresponding pixel channel.

[0103] In some embodiments, the scaling and interpolation of the initial gray data according to the weight coefficient matrix to obtain first scaling data comprises: multiplying and accumulating the kernel function weight coefficient matrix and the initial gray data to obtain the first scaling data. Specifically, the values of Hidxblk and Widxblk in abs(Hidxblk-Nblk / 2), abs(Widxblk-Nblk / 2) can be taken as the lookup table input to obtain the weight coefficient matrix of the kernel function (i.e. HW’*WW), and the weight coefficient matrix is multiplied and accumulated with the partition gray data matrix corresponding to the current image scaling, that is, the element values in the weight coefficient matrix are multiplied and accumulated with the gray values corresponding to each pixel point in the initial gray data to obtain the first scaling data corresponding to the current image scaling.

[0104] In some embodiments, the recovery processing of the first scaling data according to the first gray energy and the second gray energy to obtain recovery data comprises: obtaining the ratio parameters between the first gray energy of each pixel channel and the second gray energy of the corresponding pixel channel, multiplying the ratio parameters corresponding to each pixel channel with the first gray energy of each pixel channel in the initial gray data to obtain the RGB pixel values corresponding to each pixel channel in the first scaling data, and determining the recovery data according to the RGB pixel values corresponding to each pixel channel. The recovery data is the pixel output after the RGB scaling recovery.

[0105] In some embodiments, the recovery data is filtered in the time-space domain according to the maximum gradient value to obtain second scaling data, comprising steps S71 and S72.

[0106] S71, if the maximum gradient is greater than or equal to a preset gradient threshold, a first filter parameter is selected, if the maximum gradient is less than the preset gradient threshold, a second filter parameter is selected, otherwise a third filter parameter is selected.

[0107] Optionally, the first filter parameter comprises a filter parameter with a steeper amplitude characteristic for achieving a relatively sharpening filter effect, and the second filter parameter comprises a relatively balanced filter coefficient. The gradient threshold can be set according to the effect of the time-space domain filtering and / or the target. Specifically, when the maximum gradient is greater than or equal to the gradient threshold, part of the filter parameters can be reduced in proportion to the gradient to obtain the first filter parameter, so that the first filter parameter has a steeper amplitude characteristic to obtain a more sharpening filter effect; when the maximum gradient is less than the gradient threshold, a relatively balanced filter coefficient is selected to suppress the energy leakage or aliasing that may exist after scaling.

[0108] S72, performing time-space domain filtering on the recovered data using the first filter parameter or the second filter parameter or the third filter parameter to obtain second scaled data, that is, when the maximum gradient is greater than or equal to the gradient threshold, performing time-space domain filtering on the recovered data using the first filter parameter, and when the maximum gradient is less than the gradient threshold, selecting the second filter parameter and performing time-space domain filtering on the recovered data using the second filter parameter.

[0109] In some embodiments, the image scaling method further comprises: S8, cyclically performing steps S4 to S7 until the entire input image is scaled to simplify the calculation complexity in the entire scaling process and improve the image scaling effect and the visual effect of the final obtained image.

[0110] In some examples, the inventors further analyze the above-mentioned image scaling method, and the analysis process can include:

[0111] The scaling ratio between the input image and the output image is calculated by step S1, and related algorithm derivation configuration parameter calculation and selection are performed to complete parameter initialization. The input image is partitioned by step S2 to obtain a data selection strategy. The kernel function weight coefficient table is initialized based on the kernel function parameter and the data selection address by step S3.

[0112] Specifically, during the parameter initialization and strategy decision parameter calculation processes of steps S1 to S3, the specific examples of the scaling configuration parameters and decision calculation parameters can refer to Table 1.

[0113] Table 1

[0114]

[0115]

[0116] The steps S4 perform parallel gray scale conversion, energy accumulation of each RGB channel (pixel channel), and maximum gradient search. Specifically, the input pixel partition can be defined as 5*5 RGB pixel values, and 5*5 gray scale values are obtained by gray scale calculation,

[0117] Optionally, the gray scale conversion process can use a related gray scale conversion formula for conversion operation. In some examples, the conversion formula can include: Y=0.257R+0.504G+0.098B, C b =0.439R+0.368G+0.071B, C r =0.148R+0.291G+0.439B, wherein Y represents the luminance component, C b represents the chrominance component of the B channel, and C rchrominance component of R channel; R represents color component of R channel, G represents color component of G channel, and B represents color component of B channel. The calculation of the maximum gradient search is represented as follows: Gmax = max(max(abs(absolute value of difference between two adjacent rows in height dimension)), max(abs(absolute value of difference between two adjacent columns in width dimension))), max represents taking maximum value, that is, the maximum gradient value Gmax includes maximum gradient in height direction and maximum gradient in width direction. The maximum gradient in height direction includes maximum value in absolute value of difference between two adjacent rows in height dimension, and the maximum gradient in width direction includes maximum value in absolute value of difference between two adjacent rows in width dimension.

[0118] The calculation of the RGB pixel channel energy accumulation is represented as follows: Er = sum(R); Eg = sum(G); Eb = sum(B); Er represents first gray energy of R channel, Eg represents first gray energy of G channel, and Eb represents first gray energy of B channel, sum() represents, for example, sum(R) table sums up gray of each pixel in R channel, and the like.

[0119] The gray pixel information (that is, initial gray data) after the gray transformation is scaled and interpolated by the kernel function weight coefficient based on the partition address lookup table through step S5. The partition pixel matrix here can be 5*5 pixel values, and Hidxblk and Widxblk are symmetrical in the calculation of the address because of taking absolute value; and because the high and wide scaling rates are equal, they can be reused, so each partition only needs to look up the kernel function weight coefficient table twice, that is, a 5*5 weight coefficient table matrix is obtained, which is multiplied and accumulated with the partition gray pixel information to obtain a scaled and interpolated calculation output.

[0120] The ratio of the front and rear channel energy is calculated through step S6 to restore the scaled pixel partition value. The first scaled data obtained based on S5 is compared with the gray energy before scaling to obtain a ratio parameter, and the ratio parameter is multiplied with the energy of each channel of RGB before scaling to obtain the pixel value of the scaled RGB, which is taken as the output of the restored pixel (that is, the restored data) after scaling.

[0121] The restored data is subjected to spatial and temporal domain filtering through step S7. Here, the filtering parameter selection can be based on the maximum gradient value Gmax, when the maximum gradient value Gmax is greater than or equal to the gradient threshold value, part of the filtering parameter is reduced in proportion to the gradient, so that the filtering parameter has a more steep amplitude characteristic to obtain a more sharpening filtering effect; when the maximum gradient value Gmax is less than the gradient threshold value, a relatively balanced filtering coefficient is selected to suppress the possible energy leakage or aliasing after scaling. The RGB pixel data of the current partition restored is subjected to the spatial and temporal domain filtering to obtain the pixel data as the final output after scaling.

[0122] The scaling calculation of all partitions is repeated to complete the scaling processing of the entire input image.

[0123] Figure 2 is a visual effect contrast chart for image zooming in the present example; wherein the left picture is the original image, the middle picture is the output of the traditional library function scaling, and the right picture is the output after the image scaling processing by the above steps S1 to S8 in the present example. Figure 2 is a typical example of image zooming in, the input image is a column stripe at the pixel level, and when zoomed in by two times, the traditional algorithm output will have aliasing of two columns of pixels; the image scaling method provided by the present application can effectively protect the high-frequency signal characteristics, and the output is approximately lossless in quality. Figure 3 is a visual effect contrast chart for image zooming in the present example; wherein the left picture is the original image, the middle picture is the output of the traditional library function scaling, and the right picture is the output after the image scaling processing by the above steps S1 to S8 in the present example. Figure 3 is a typical example of image zooming in, the input image is a column stripe at the pixel level, and when zoomed in by two times, the traditional algorithm output will have aliasing of two columns of pixels; the image scaling method provided by the present application can effectively protect the high-frequency signal characteristics, and the output is approximately lossless in quality.

[0124] The above analysis shows that the image scaling scheme provided by the present example can better balance the overall effect of the calculation overhead and the image quality under different scaling ratios, and solve the problems of high-frequency loss and mosaic in the image scaling process, to obtain better visual effect of the scaled image, with low complexity and high robustness.

[0125] The above image scaling method can calculate a scaling ratio between an input image and an output image according to a first size of the input image and a second size of the output image, calculate partition parameters and dither address values according to the scaling ratio, update a first address of the current image scaling according to the scaling ratio, the partition parameters and the dither address values, read image data from the input image according to the updated first address and the partition parameters, perform a gray scale transformation on the read image data to obtain initial gray scale data, obtain a first gray scale energy and a maximum gradient value corresponding to the initial gray scale data, perform scaling interpolation calculation on the initial gray scale data according to the weight coefficient matrix to obtain first scaling data, obtain a second gray scale energy of the first scaling data, perform recovery processing on the first scaling data according to the first gray scale energy and the second gray scale energy to obtain recovery data, and perform time-space domain filtering on the recovery data according to the maximum gradient value to obtain second scaling data, thereby achieving scaling processing of the entire input image. The scaling processing process can significantly improve the loss of high-frequency signals and the mosaic effect, and the channel merging and parameterization design greatly optimize the calculation overhead, and the method has universal adaptability to various images and good image visual effect and algorithm robustness.

[0126] The second aspect of the present application provides an image scaling system which can be arranged in a smart terminal for performing related image processing. Referring to Figure 4 The image scaling system comprises:

[0127] A first calculation module 10 is configured to calculate a scaling ratio between an input image and an output image according to a first size of the input image and a second size of the output image.

[0128] An updating module 20 is configured to calculate a partition parameter and a dithering address value according to the scaling ratio, and update a first address of the current image scaling according to the scaling ratio, the partition parameter and the dithering address value.

[0129] A determination module 30 is configured to select a kernel function parameter according to the scaling ratio, and determine a weight coefficient matrix corresponding to the selected kernel function parameter.

[0130] A reading module 40 is configured to read image data in the input image according to the updated first address and the partition parameter, perform a gray scale transformation on the read image data to obtain initial gray scale data, and obtain a first gray scale energy and a maximum gradient value corresponding to the initial gray scale data.

[0131] A second calculation module 50 is configured to perform scaling interpolation calculation on the initial gray scale data according to the weight coefficient matrix to obtain first scaling data.

[0132] A recovery module 60 is configured to obtain a second gray scale energy of the first scaling data, perform recovery processing on the first scaling data according to the first gray scale energy and the second gray scale energy to obtain recovery data.

[0133] A filtering module 70 is configured to perform space-time filtering on the recovery data according to the maximum gradient value to obtain second scaling data.

[0134] The specific limitations of the image scaling system can refer to the limitations of the image scaling method described above, which will not be repeated here. Each module in the image scaling system can be realized by software, hardware and their combination. Each module described above can be embedded in or independent of the operation module in the related computer device in hardware form, or stored in the memory of the computer device in software form, so as to call and execute the operation corresponding to each unit by the operation module.

[0135] The present application also provides a smart terminal, referring to Figure 5 The smart terminal can comprise a memory and a processor, wherein the memory stores an image scaling program, and the processor implements the steps of the image scaling method according to any one of the above embodiments when the image scaling program is executed.

[0136] The application also provides a computer readable storage medium, wherein a computer program is stored on the storage medium, and the computer program, when executed by a processor, implements the steps of the image zooming method according to any one of the above embodiments.

[0137] Although the present application has been shown and described with respect to one or more implementations, equivalent alterations and modifications will occur to others skilled in the art based on the foregoing description and accompanying drawings. The present application includes all such modifications and alterations and is limited only by the scope of the following claims. In particular, with respect to the various functions performed by the above described components (assemblies), the terms (including a reference to a "means") used to describe certain components (assemblies) are intended to correspond, unless otherwise indicated, to any component (assembly) which performs the specified function of that component (which

[0138] That is, the above descriptions are only embodiments of the present application, and do not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the specification and drawings of the present application, such as the mutual combination of technical features between embodiments, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.

[0139] In addition, in the description of the present application, it should be understood that the orientations or positional relationships indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, for structural elements with the same or similar properties, the present application can use the same or different reference numerals to identify them. Furthermore, the terms "first", "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features referred to. Therefore, the features with "first", "second" can explicitly or implicitly include one or more features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise specifically limited.

[0140] In this application, the use of the singular includes the plural unless specifically stated otherwise. In this application, the use of "or" means "and / or" unless stated otherwise. In this application, the use of "an" includes "one or more". In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at least a third" unless context clearly indicates otherwise. In this application, the use of "another" means "at least a second" or "at

Claims

1. An image scaling method, characterized in that, The image scaling method includes: S1, calculate the scaling ratio between the input image and the output image based on the first size of the input image and the second size of the output image; S2, calculate the partition parameters and jitter address value according to the scaling ratio, and update the starting address of the current image scaling according to the scaling ratio, the partition parameters and the jitter address value; S3, Select kernel function parameters according to the scaling ratio, and determine the weight coefficient matrix corresponding to the selected kernel function parameters; S4, in the input image, read image data according to the updated starting address and partition parameters, perform grayscale transformation on the read image data to obtain initial grayscale data, and obtain the first grayscale energy and maximum gradient value corresponding to the initial grayscale data; S5, perform scaling interpolation calculation on the initial grayscale data according to the weight coefficient matrix to obtain the first scaled data; S6, obtain the second grayscale energy of the first scaled data, and perform recovery processing on the first scaled data based on the first grayscale energy and the second grayscale energy to obtain the recovered data; S7. Perform spatiotemporal filtering on the recovered data based on the maximum gradient value to obtain the second scaled data.

2. The image scaling method according to claim 1, characterized in that, The calculation process for the scaling ratio includes: S11, obtain the first size of the input image [Hin, Win], where Hin represents the height of the input image and Win represents the width of the input image; S12, obtain the second size of the output image [Hout, Wout], where Hout represents the height of the output image and Wout represents the width of the output image; S13, calculate the scaling ratio [Hrate, Wrate] between the input image and the output image based on the first size [Hin, Win] and the second size [Hout, Wout], where Hrate represents the scaling ratio in the height direction and Wrate represents the scaling ratio in the width direction, Hrate = Hout / Hin, Wrate = Wout / Win.

3. The image scaling method according to claim 2, characterized in that, The scaling ratio calculation process also includes: S14, when the difference between the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction is greater than a preset threshold, adjust the size of the input image and / or the output image, and return to step S11 for the adjusted input image and / or the output image until the difference between the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction is less than or equal to the threshold.

4. The image scaling method according to claim 3, characterized in that, The step of calculating the partition parameters and jitter address values ​​according to the scaling ratio includes: S21, determine the partitioning parameter Nblk according to the first rule based on the scaling ratio Hrate in the height direction and the scaling ratio Wrate in the width direction; S22, when the scaling ratio in the height direction is characterized by the first feature, enable the calculation of the jitter address value in the height direction of the current image scaling, and calculate the jitter address value HidxShift in the height direction according to the second rule; when the scaling ratio in the width direction is characterized by the first feature, enable the calculation of the jitter address value in the width direction of the current image scaling, and calculate the jitter address value WidxShift in the width direction according to the second rule; when the scaling ratio in the height direction is characterized by the second feature, disable the calculation of the jitter address value in the height direction of the current image scaling, and set the jitter address value HidxShift in the height direction to zero; when the scaling ratio in the width direction is characterized by the second feature, disable the calculation of the jitter address value in the width direction of the current image scaling, and set all jitter address values ​​WidxShift in the width direction to zero.

5. The image scaling method according to claim 4, characterized in that, The starting address includes the height starting address HidxStart and the width starting address WidxStart; updating the starting address of this image scaling based on [Hrate, Wrate], the partition parameter Nblk, and the jitter address value includes: HidxStart=HidxStart+(Hcnt*Hrate-Nblk / 2)-HidxShift; WidxStart=WidxStart+(Wcnt*Wrate-Nblk / 2)-WidxShift; Where HidxStart represents the starting address of the height, WidxStart represents the starting address of the width, Hcnt represents the data retrieval count in the height direction, Wcnt represents the data retrieval count in the width direction, Nblk represents the partitioning parameter, HidxShift represents the jitter address value in the height direction, and WidxShift represents the jitter address value in the width direction.

6. The image scaling method according to claim 5, characterized in that, The process of determining the weight coefficient matrix includes: S31, Select kernel function parameters according to the scaling ratio; S32, determine the height weight coefficient HW and width weight coefficient WW based on the selected kernel function parameters and the index within the partition where the image is scaled; where the weight coefficient HW(Hidxblk) at the height index Hidxblk and the weight coefficient WW(Widxblk) at the width index Widxblk are respectively: HW(Hidxblk)=Kernel(L-1)*abs(Hidxblk-Nblk / 2)^L-1+Kernel(L-2)*abs(Hidxblk-Nblk / 2)^L-2+…+Kernel(1)*abs(Hidxblk-Nblk / 2)+Kernel(0); WW(Widxblk)=Kernel(L-1)*abs(Widxblk-Nblk / 2)^L-1+Kernel(L-2)*abs(Widxblk-Nblk / 2)^L-2+…+Kernel(1)*abs(Widxblk-Nblk / 2)+Kernel(0); In the formula, Kernel(i) represents the i-th order kernel function parameter, i is an integer greater than or equal to 1 and less than or equal to L-1, L represents the order of the kernel function parameter, and abs() represents the absolute value; S33, determine the weight coefficient matrix based on the high weight coefficient HW and the wide weight coefficient WW, where the weight coefficient matrix is ​​HW'*WW, and the superscript ' indicates transpose.

7. The image scaling method according to claim 1, characterized in that, The step of obtaining the first grayscale energy and the maximum gradient value corresponding to the initial grayscale data includes: S41, perform gradient calculation on the initial grayscale data and save the maximum gradient value; S42, the energy of the three pixel channels of RGB in the initial grayscale data is independently accumulated to obtain the first grayscale energy of each pixel channel.

8. The image scaling method according to claim 1, characterized in that, The step of scaling and interpolating the initial grayscale data according to the weight coefficient matrix to obtain the first scaled data includes: performing a multiplication and accumulation operation between the kernel function weight coefficient matrix and the initial grayscale data to obtain the first scaled data; And / or, the step of restoring the first scaled data based on the first grayscale energy and the second grayscale energy to obtain restored data includes: obtaining the ratio parameter between the first grayscale energy of each pixel channel and the second grayscale energy of the corresponding pixel channel, multiplying the ratio parameter corresponding to each pixel channel by the first grayscale energy of each pixel channel in the initial grayscale data to obtain the RGB pixel value corresponding to each pixel channel in the first scaled data, and determining the restored data based on the RGB pixel value corresponding to each pixel channel; And / or, the image scaling method further includes: S8, cyclically executing steps S4 to S7 until the entire input image is scaled.

9. The image scaling method according to claim 1, characterized in that, The step of performing spatiotemporal domain filtering on the recovered data based on the maximum gradient value to obtain the second scaled data includes: S71, if the maximum gradient is greater than or equal to a preset gradient threshold, select the first filtering parameter; if the maximum gradient is less than the preset gradient threshold, select the second filtering parameter; otherwise, select the third filtering parameter. S72, the recovered data is subjected to spatiotemporal domain filtering using the first filtering parameter, the second filtering parameter, or the third filtering parameter to obtain the second scaled data.

10. An image scaling system, characterized in that, include: The first calculation module is used to calculate the scaling ratio between the input image and the output image based on the first size of the input image and the second size of the output image; The update module is used to calculate the partition parameters and jitter address value according to the scaling ratio, and update the starting address of the current image scaling according to the scaling ratio, the partition parameters and the jitter address value; The determination module is used to select kernel function parameters according to the scaling ratio and determine the weight coefficient matrix corresponding to the selected kernel function parameters. The reading module is used to read image data from the input image according to the updated starting address and partition parameters, perform grayscale transformation on the read image data to obtain initial grayscale data, and obtain the first grayscale energy and maximum gradient value corresponding to the initial grayscale data; The second calculation module is used to perform scaling interpolation calculations on the initial grayscale data based on the weight coefficient matrix to obtain the first scaled data. The recovery module is used to obtain the second grayscale energy of the first scaled data, and perform recovery processing on the first scaled data based on the first grayscale energy and the second grayscale energy to obtain the recovered data; The filtering module is used to perform spatiotemporal domain filtering on the recovered data based on the maximum gradient value to obtain the second scaled data.

11. A smart terminal, characterized in that, The smart terminal may include: a memory and a processor, wherein the memory stores an image scaling program, and when the image scaling program is executed by the processor, it implements the steps of the image scaling method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the steps of the image scaling method as described in any one of claims 1 to 9.