CN112862673A - Adaptive image scaling method, adaptive image scaling device and storage device - Google Patents

Adaptive image scaling method, adaptive image scaling device and storage device Download PDF

Info

Publication number
CN112862673A
CN112862673A CN201911101193.9A CN201911101193A CN112862673A CN 112862673 A CN112862673 A CN 112862673A CN 201911101193 A CN201911101193 A CN 201911101193A CN 112862673 A CN112862673 A CN 112862673A
Authority
CN
China
Prior art keywords
scaling
image
image data
along
level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911101193.9A
Other languages
Chinese (zh)
Other versions
CN112862673B (en
Inventor
王昆
陈鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Tuqing Microelectronics Co ltd
Original Assignee
Shanghai Tuqing Microelectronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Tuqing Microelectronics Co ltd filed Critical Shanghai Tuqing Microelectronics Co ltd
Priority to CN201911101193.9A priority Critical patent/CN112862673B/en
Publication of CN112862673A publication Critical patent/CN112862673A/en
Application granted granted Critical
Publication of CN112862673B publication Critical patent/CN112862673B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The application provides a self-adaptive image zooming method, a self-adaptive image zooming device and a device with a storage function. The adaptive image scaling method includes: acquiring an image, and carrying out first-level zooming on the image along a first direction to acquire first image data; determining whether to perform a second level of scaling on the first image data in the first direction according to a first scaling ratio of the first direction; performing first-level scaling on the image data scaled along the first direction along a second direction to obtain second image data, wherein the first direction is vertical to the second direction; whether to perform second-level scaling on the second image data in the second direction is determined according to a second scaling ratio of the second direction. By the method, the image processing time delay can be reduced, and the image scaling efficiency can be improved.

Description

Adaptive image scaling method, adaptive image scaling device and storage device
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an adaptive image scaling method, an adaptive image scaling apparatus, and an apparatus having a storage function.
Background
With the increasing resolution of display screens and the existence of input film sources with different resolutions, the requirements for image scaling technology are higher and higher for better displaying video contents.
The principle of image scaling is to sum up the weighted sum of the pixel points of the output image according to the neighborhood around the pixel point corresponding to the input image, the image scaling process is a low-pass filtering process in the frequency domain, and the selection of the neighborhood and the weight coefficient directly influences the image effect of scaling. Common image scaling algorithms are the proximity method, bilinear, bicubic, and lanczos algorithms, among others.
The inventors of the present application have found, in a long-term research and development, that the image scaling algorithm can improve image quality, but has a long time delay in hardware processing and a low scaling efficiency.
Disclosure of Invention
The present application mainly solves the technical problem of providing an image scaling method, an image scaling device, and a device with a storage function, so as to reduce image processing time delay and improve image scaling efficiency.
In order to solve the above technical problem, the present application provides an image scaling method. The image scaling method includes: acquiring an image, and carrying out first-level zooming on the image along a first direction to acquire first image data; determining whether to perform a second level of scaling on the first image data in the first direction according to a first scaling ratio of the first direction; performing first-level scaling on the image data scaled along the first direction along a second direction to obtain second image data, wherein the first direction is vertical to the second direction; whether to perform second-level scaling on the second image data in the second direction is determined according to a second scaling ratio of the second direction.
To solve the above technical problem, the present application provides an adaptive image scaling apparatus. The adaptive image scaling apparatus includes: the image processing device comprises a first image zooming module, a second image zooming module and a processing module, wherein the processing module is connected with the first image zooming module and the second image zooming module; the first image zooming module is used for zooming the image at a first level along a first direction to acquire first image data; the processing module determines whether to carry out second-stage scaling on the first image data along the first direction according to a first scaling ratio of the first direction; the second image zooming module performs first-level zooming on the image data zoomed along the first direction along a second direction to acquire second image data, wherein the first direction is vertical to the second direction; the processing module further determines whether to perform a second level of scaling on the second image data along a second direction according to a second scaling ratio of the second direction, wherein the first direction is perpendicular to the second direction.
In order to solve the above technical problem, the present application provides a device with a storage function. The apparatus having the storage function stores program data that can be executed to implement the above-described adaptive image scaling method.
Compared with the prior art, the beneficial effects of this application are: the self-adaptive image scaling method comprises the following steps: acquiring an image, and carrying out first-level zooming on the image along a first direction to acquire first image data; determining whether to perform a second level of scaling on the first image data in the first direction according to a first scaling ratio of the first direction; performing first-level scaling on the image data scaled along the first direction along a second direction to obtain second image data, wherein the first direction is vertical to the second direction; whether to perform second-level scaling on the second image data in the second direction is determined according to a second scaling ratio of the second direction. In this way, the embodiment of the present application first performs one-level scaling on an image in a first direction, determines whether to perform second-level scaling on the image in the first direction according to a first scaling ratio of the image in the first direction, then performs the first-level scaling on image data subjected to scaling in the first direction in a second direction, and determines whether to perform the second-level scaling on the image in the first direction according to a second scaling ratio of the image in the second direction. Therefore, whether to carry out the second-stage scaling on the image along a certain direction can be determined according to the scaling ratio of the image along the direction, the second-stage scaling on the whole image is not needed, and therefore the image processing time delay can be reduced, and the image scaling efficiency can be improved.
Drawings
FIG. 1 is a schematic flowchart illustrating an embodiment of an adaptive image scaling method according to the present application;
FIG. 2 is a detailed flowchart of step S101 in the adaptive image scaling method of the embodiment of FIG. 1;
FIG. 3 is a flowchart illustrating a specific process of step S1302 in the adaptive image scaling method of the embodiment of FIG. 1;
FIG. 4 is a detailed flowchart of step S301 in the embodiment of FIG. 3;
FIG. 5 is a detailed flowchart of step S302 in the embodiment of FIG. 3;
FIG. 6 is a schematic diagram of a polyphase filter in the adaptive image scaling apparatus according to the present application;
FIG. 7 is a flowchart illustrating an embodiment of an adaptive image scaling method according to the present application;
FIG. 8 is a schematic structural diagram of a color space conversion module in an adaptive image scaling apparatus according to an embodiment of the present application;
FIG. 9 is a schematic structural diagram of an embodiment of an adaptive image scaling apparatus;
FIG. 10 is a schematic structural diagram illustrating a partial structure of an embodiment of an adaptive image scaling apparatus;
FIG. 11 is a schematic structural diagram of an embodiment of an apparatus with storage function according to the present application;
FIG. 12 is a detailed flowchart of step S501 in the embodiment of FIG. 5;
FIG. 13 is a flowchart illustrating the operation of step S102 in the embodiment of FIG. 1;
fig. 14 is a specific flowchart of step S104 in the embodiment of fig. 1.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
First, an image scaling method is provided, as shown in fig. 1, where fig. 1 is a schematic flow diagram of an embodiment of an adaptive image scaling method according to the present application. The self-adaptive image scaling method of the embodiment comprises the following steps:
step S101: an image is acquired and first-level scaled in a first direction to acquire first image data.
The image is composed of a plurality of pixels arranged in a matrix, and the first direction may be a vertical direction of the image, that is, a column direction of the matrix.
Alternatively, the present embodiment may implement step S101 by the method shown in fig. 2. The method of the present embodiment includes steps S201 to S203.
Step S201: and acquiring a zooming instruction of the image.
The zooming instruction of the image comprises a zooming-in instruction and a zooming-out instruction, and the zooming instruction can be determined according to the original resolution of the image before zooming and the target resolution of the image after zooming. Specifically, the scaling ratio of the image may be determined according to the original resolution and the target resolution of the image, the scaling ratio is compared with a ratio threshold, and if the scaling ratio is greater than the ratio threshold, the zoom-in instruction is generated; if the scaling ratio is smaller than the ratio threshold, generating a scaling-down instruction; wherein the ratio threshold may be 1.
Step S202: if the zooming instruction is an amplifying instruction, the pixels of the image are interpolated along the first direction by adopting a bilinear method so as to obtain the pixels after interpolation processing as first image data.
Step S203: if the zooming instruction is a zooming-out instruction, acquiring neighborhood pixels of pixels in the image along the first direction, acquiring weighted values of the pixels and the neighborhood pixels by adopting an averaging method, and acquiring new pixels according to the weighted values to serve as first image data.
In the embodiment, the image is enlarged and reduced based on the bilinear principle, and the processing procedures of the image and the image are opposite. Specifically, the image magnification may calculate a relevant weight coefficient according to a bilinear method, and interpolate pixels of the image according to the weight coefficient; the image reduction can obtain the weighted value of the pixel and the neighborhood pixel according to the bilinear principle, and the weighted value is used as the pixel value of the reduced pixel, wherein the neighborhood pixel can select two adjacent pixels, and related hardware resources can be saved. The image reduction method can achieve a good low-pass filtering effect, eliminate aliasing effect possibly existing and improve image quality.
Of course, in other embodiments, the image may be enlarged or reduced using, for example, a double cube difference value or a multiphase difference value.
The first-level zooming can be used as coarse adjustment, and in an application scene with low requirements on image zooming, the first-level zooming can be only performed on the image.
The present embodiment may employ a similar method to implement the first-level scaling of the image along the second direction, which is not described herein.
Step S102: whether to perform the second-level scaling on the first image data along the first direction is determined according to a first scaling ratio of the first direction.
Specifically, the present embodiment may implement step S102 by the method shown in fig. 13. The method of the present embodiment includes steps S1301 to S1303.
Step S1301: the first scaling ratio is matched with a preset ratio.
Acquiring a first scaling ratio of the image along a first direction, and matching the first scaling ratio with a preset ratio.
A first scaling ratio of the image in the first direction may be determined based on the original resolution and the target resolution of the image in the first direction. The method for obtaining the first scaling ratio may refer to the specific method of step S201.
Step S1302: and if the first scaling ratio is successfully matched with the preset ratio, performing second-level scaling on the first image data along the first direction to acquire third image data.
And if the first scaling ratio is successfully matched with the preset ratio, performing second-level scaling on the first image data, namely performing second-level scaling on the image data subjected to the first-level scaling along the first direction.
Step S1303: if the first scaling ratio is not matched with the preset ratio successfully, the scaling of the image along the first direction is finished.
The preset ratio of the embodiment may be a ratio range, the lower limit thereof may be 0.8, and the upper limit thereof may be 1.2, for example, the mapping relationship f between the preset ratio a and the zoom level1(A) As follows:
Figure BDA0002269913870000051
for example, if the first scaling ratio is greater than or equal to 0.8 and less than or equal to 1.2, only the image is subjected to the first level scaling in the first direction, and so on.
Step S103: and carrying out first-level scaling on the image data scaled along the first direction along a second direction to obtain second image data, wherein the first direction is vertical to the second direction.
Wherein the second direction may be a horizontal direction of the image, i.e. a row direction of the matrix.
Specifically, the first image data may be subjected to the first-level scaling in the second direction or the third image data may be subjected to the first-level scaling in the second direction to acquire the second image data.
Step S104: whether to perform second-level scaling on the second image data in the second direction is determined according to a second scaling ratio of the second direction.
Specifically, the present embodiment may implement step S104 by the method shown in fig. 14. The method of the present embodiment includes steps S1401 to S1403.
Step S1401: and matching the second scaling ratio with a preset ratio.
And acquiring a second scaling ratio of the image along a second direction, and matching the second scaling ratio with the preset ratio.
A second scaling ratio of the image in the second direction may be determined based on the original resolution and the target resolution of the image in the second direction. The second scaling ratio obtaining method may refer to the specific method of step S201.
Step S1402: and if the second scaling ratio is successfully matched with the preset ratio, performing second-level scaling on the second image data along the second direction to acquire fourth image data.
And if the second scaling ratio is successfully matched with the preset ratio, performing second-stage scaling on the second image data, namely performing second-stage scaling on the image data subjected to the first-stage scaling along a second direction.
Step S1403: and if the second scaling ratio is not matched with the preset ratio successfully, finishing the scaling of the image along the second direction.
And finishing the self-adaptive scaling of the image by taking the second image data as a final result after the image scaling.
The second scaling ratio is the same as the first scaling ratio, and is not described herein.
Different from the prior art, the embodiment first performs one-level scaling on an image in a first direction, determines whether to perform second-level scaling on the image in the first direction according to a first scaling ratio of the image in the first direction, then performs the first-level scaling on image data subjected to scaling in the first direction in a second direction, and determines whether to perform the second-level scaling on the image in the first direction according to a second scaling ratio of the image in the second direction. Therefore, whether to carry out the second-stage scaling on the image along a certain direction can be determined according to the scaling ratio of the image along the direction, the second-stage scaling on the whole image is not needed, and therefore the image processing time delay can be reduced, and the image scaling efficiency can be improved.
Although the image quality can be improved by the conventional image scaling algorithm, for some images with obvious edges, the algorithm with a good scaling effect is closer to an ideal low-pass filter in a frequency domain, so that the loss of high-frequency components is easy to generate a ringing effect.
To this end, the present embodiment may implement step S1302 by the method shown in fig. 3. The method of the present embodiment includes steps S301 to S302.
Step S301: and acquiring edge information of the first image data, and determining a scaling weight coefficient of the first image data according to the edge information.
Alternatively, the present embodiment may implement step S301 by the method shown in fig. 4. The method of the present embodiment includes steps S401 to S402.
Step S401: pixels of the first image data are acquired.
From the above analysis, it can be known that the first image data is pixels of the image subjected to the first-level scaling along the first direction, and therefore the pixels for acquiring the first image can be obtained by acquiring the pixels of the image subjected to the first scaling and arranged along the first direction.
Step S402: the second derivative of the pixel is obtained and matched to a threshold.
The second derivative of the pixel of the image can embody the abrupt change points (namely the zero crossing points) in the image, and the abrupt change points are often the edge points of the image, so the second derivative of the pixel of the image can embody the edge information of the image.
Therefore, the edge information of the first image data can be obtained using the following second derivative formula. Where x is the position information of the pixel, f2(x +1) and f2(x-1) is the pixel value of a pixel in the neighborhood of the pixel, f2(x) Is the pixel value of the pixel.
Figure BDA0002269913870000071
Of course, in other embodiments, there may be other algorithms for obtaining edge information for the first image data using the first derivative of the image pixels or other algorithms.
Step S403: and if the matching is successful, obtaining a scaling weight coefficient corresponding to the threshold value of the successful matching.
The threshold and the scaling weight coefficient of this embodiment are multiple.
In an application scene, the edge information C and the threshold value H of the first image data0-H4And a scaling weight coefficient f0-f4Is in the mapping relation f3(C) This can be shown as follows:
Figure BDA0002269913870000072
for example, the edge information C of the first image data is less than the threshold H0When the scaling weight coefficient of the first image data is f0
The lanczos kernel is chosen by default as the kernel for scaling the weighting coefficients. Because the image enhancement effect is better in the zooming of the lanczos nuclear image, the image enhancement effect is taken as the default weight coefficient of the zooming, and the adaptive zooming weight coefficient can be generated according to different edge information
The scaling weight coefficient is a low-pass filter in a frequency domain, and different groups of scaling weight coefficients can be generated by designing the low-pass filter according to the finite impulse filter; in addition, the lanczos kernel may be selected as the kernel for the default scaling weight coefficients, since the default scaling weight coefficients are closer to the ideal low pass filter in the frequency domain; in addition, the lanczos kernel is a good compromise to reduce aliasing, sharpness, and ringing effects; the lanczos kernel function has a good effect on image enhancement while performing low-pass filtering, is used as a default weight coefficient for scaling, and can generate a suitable scaling weight coefficient according to different edge information. The lanczos kernel function l (x) is shown below:
Figure BDA0002269913870000081
the lanczos kernel function can be divided into a horizontal direction (second direction) and a vertical direction (first direction) by SVD (singular value decomposition), which can reduce the amount of computation and the system delay; different scaling methods correspond to different scaling weight coefficients and the widths and heights of the scaling weight coefficients.
Step S302: and carrying out second-stage scaling on the first image data along the first direction according to the scaling weight coefficient to obtain third image data.
The third image data is image data after the image is subjected to the second-level scaling in the first direction.
Optionally, the present embodiment may perform the second-stage scaling on the first image by using a polyphase filter according to the scaling weight coefficient. Specifically, the present embodiment may optionally implement step S302 by the method shown in fig. 5. The method of the present embodiment includes steps S501 to S503.
Step S501: the plurality of scaling weight coefficients are divided into a plurality of groups.
The scaling weight coefficients are divided into n groups of different phases (as shown in fig. 6) according to the phase uniformity to form a plurality of different filtering branches p (1) -p (n).
Alternatively, the present embodiment may implement the step S501 by a method as shown in fig. 12. The method of the present embodiment includes step S1201 and step S1202.
Step S1201: the design requirements of the low-pass filter and the number of scaling weight coefficients are obtained.
Step S1202: and according to the design requirements and the number, acquiring a plurality of groups of scaling weight coefficients through a software function, and performing fixed-point processing and storage on the scaling weight coefficients.
The software function can be a software function in matlab or fdatool, or a window function and the like; the fixed-point processing of the scaling weight coefficients can simplify the computational overhead.
The scaling weight coefficient of the present embodiment can be designed according to the low-pass filter and combined with the fixed-point design to determine the correlation value; several groups of scaling weight coefficients can be pre-stored in an internal SRAM, and different groups of scaling weight coefficients are selected according to different index values; the value of the weight coefficient can be scaled by software programming, and the threshold value can also be set by software.
Step S502: and respectively filtering the first image data by using a polyphase filter, wherein the number of phases of the polyphase filter is the same as the number of the groups, and the filter coefficients of the polyphase filter are arranged corresponding to the scaling weight coefficients.
Each filtering branch performs low-pass filtering on the first image data x.
The filter coefficient of the polyphase filter and the scaling weight coefficient are correspondingly set, that is, each filter branch selects a corresponding filter coefficient according to the scaling weight coefficient of the first image, and the filter coefficient is used for performing low-pass filtering on the first image data x.
Step S503: and obtaining the filtered first image data as third image data from a plurality of output ends of the polyphase filter.
Multiplying and adding the first image data x and the filter coefficient of each filter branch; at the output of the polyphase filter, data is selected as third image data y from the n sets of filtered data at n outputs with r × n (r is input size/output size) as a step size. Where r is a ratio of the size of the first image x to the size of the third image data y.
By the mode, the previous filtering with higher order can be divided into a plurality of filtering with lower order through the polyphase filter, so that the time delay of a system can be reduced, and the calculation amount can be reduced.
Different from the prior art, the second-stage scaling is performed on the image according to the edge information of the image, so that the problem that the image with a more prominent edge is easy to cause a ringing effect for some scaling coefficients close to an ideal low-pass filter can be solved.
The above step S1402 can also be implemented by the above method to implement the first-level scaling and the second-level scaling of the image along the second direction, which is not described herein again.
Therefore, the method of the embodiment can selectively perform the second-level scaling on the image in two directions or in any one direction or not perform the second-level scaling on the image according to the scaling ratio of the image in the first direction and the scaling ratio of the image in the second direction.
The present application further provides an image scaling method according to another embodiment, as shown in fig. 7, the present embodiment specifically includes the following steps:
step S701: acquiring an image, and determining whether the format of the image is the first format, if not, executing step S702, and if so, directly executing step S703.
The first format of this embodiment is YUV format.
Step S702: the image is color space converted.
Since the data source of the image may be in YUV format, it is necessary to add converting YUV format to RGB format and then scaling the image in RGB format.
The color space conversion formula is as follows:
Figure BDA0002269913870000101
the color space conversion can be realized by a color space conversion module as shown in fig. 8, and the color space conversion module is configured to process three components of one pixel in the RGB color space at the same time; the processing module has a clipping function and can prevent the bit width exceeding the set bit width in data processing; the coefficient a can be configured by software00-a22、offset0-offset2(ii) a The correlation coefficient can be preset according to the standards such as BT601 or BT709 and the like, and data bit width localization processing is carried out.
The present embodiment adapts to image content of different input formats by color space conversion.
Step S703: the image is first scaled in a first direction to obtain first image data.
Step S704: and respectively acquiring first scaling ratios of the images along the first direction, and matching the first scaling ratios with a preset ratio.
Step S705: and if the first scaling ratio is successfully matched with the preset ratio, performing second-level scaling on the first image to acquire second image data.
Step S706: and scaling the first image data or the second image data along a second direction, wherein the first direction is perpendicular to the second direction.
Steps S703 to S706 in this embodiment are similar to steps S101 to S104 described above, and are not described herein again.
The present application further provides an image scaling apparatus, as shown in fig. 9, the image scaling apparatus 90 of the present embodiment includes: the image processing device comprises a first image zooming module 91, a second image zooming module 92 and a processing module 93, wherein the processing module 93 is connected with the first image zooming module 91 and the second image zooming module 92; the first image scaling module 91 is configured to perform a first-level scaling on an image along a first direction to obtain first image data; the processing module 93 determines whether to perform a second level of scaling on the first image data along the first direction according to a first scaling ratio of the first direction; the second image scaling module 92 performs first-level scaling on the image data scaled along the first direction along a second direction to obtain second image data, wherein the first direction is perpendicular to the second direction; the processing module 93 further determines whether to perform a second level of scaling on the second image data along a second direction according to a second scaling ratio of the second direction, wherein the first direction is perpendicular to the second direction.
Unlike the prior art, the image scaling apparatus 90 of the present embodiment can determine whether to perform the second-level scaling on the image in a certain direction according to the scaling ratio of the image in the direction, without performing the second-level scaling on the entire image, and therefore, the image processing time delay can be reduced, and the image scaling efficiency can be improved.
In another embodiment, as shown in fig. 10, the first image scaling module (not shown) of the present embodiment includes a first image scaling unit 911 and a second image scaling unit 912, and the second image scaling module (not shown) includes a third image scaling unit 921 and a fourth image scaling unit 922; the first image scaling unit 911 is configured to perform first-level scaling on an image in a first direction, the second image scaling unit 912 is configured to perform second-level scaling on the image data scaled by the first image scaling unit 911 in the first direction, the third image scaling unit 921 is configured to perform second-level scaling on the image data scaled by the first image scaling unit 911 or the image data scaled by the second image scaling unit 912 in a second direction, and the fourth image scaling unit 922 is configured to perform second-level scaling on the image data scaled by the third image scaling unit 922 in the second direction.
Optionally, the image scaling device 90 of this embodiment further includes an edge information statistics module (not shown), which is connected to the processing module (not shown) and the first image scaling module, wherein the edge statistics module includes a first edge statistics unit 941 and a second edge statistics unit 942, the first edge statistics unit 941 is configured to obtain edge information of the image data scaled by the first image scaling unit 911, and the second edge statistics unit 942 is configured to obtain edge information of the image data scaled by the second image scaling unit 921; the processing module is further configured to determine a scaling weight coefficient of the image according to the edge information of the first edge statistical unit 941, and perform second-level scaling on the image data scaled by the first image scaling unit 911 according to the scaling weight coefficient; the processing module is further configured to determine a scaling weight coefficient of the image according to the edge information of the second edge statistics unit 942, and perform second-level scaling on the image data scaled by the third image scaling unit 921 according to the scaling weight coefficient to obtain a fourth image.
Optionally, the image scaling apparatus 90 of this embodiment further includes a color space conversion module 96, the color space conversion module 96 is connected to the first image scaling unit 911, and the color space conversion module 96 is configured to convert the image in the YUV format into the image in the RGB format.
Optionally, the image scaling apparatus 90 of this embodiment further includes a memory (not shown), where the memory includes a first storage unit 951 and a second storage unit 952, the first storage unit 951 is configured to store the edge information counted by the first edge information counting unit 941, and the second storage unit 952 is configured to store the edge information counted by the second edge information counting unit 942.
The adaptive image scaling apparatus 10 of this embodiment is also used to implement the above adaptive image scaling method, which is not described herein again.
In other embodiments, the image may be scaled first in the second direction and then in the first direction.
The present application further proposes a device with storage function, as shown in fig. 11, the device with storage function 110 of the present embodiment is used for storing the related data 111 and the program data 112 of the above embodiment, wherein the related data 111 at least includes the above image data, the zoom ratio, and the like, and the program data 112 can be executed with the method of the above method embodiment. The related data 111 and the program data 112 have been described in detail in the above method embodiments, and are not described herein again.
The device 110 with storage function of the present embodiment can be, but is not limited to, a usb disk, an SD card, a PD optical drive, a removable hard disk, a high-capacity floppy drive, a flash memory, a multimedia memory card, a server, etc.
Different from the prior art, the method comprises the steps of obtaining an image, and carrying out first-level scaling on the image along a first direction to obtain first image data; determining whether to perform a second level of scaling on the first image data in the first direction according to a first scaling ratio of the first direction; performing first-level scaling on the image data scaled along the first direction along a second direction to obtain second image data, wherein the first direction is vertical to the second direction; whether to perform second-level scaling on the second image data in the second direction is determined according to a second scaling ratio of the second direction. In this way, the embodiment of the present application first performs one-level scaling on an image in a first direction, determines whether to perform second-level scaling on the image in the first direction according to a first scaling ratio of the image in the first direction, then performs the first-level scaling on image data subjected to scaling in the first direction in a second direction, and determines whether to perform the second-level scaling on the image in the first direction according to a second scaling ratio of the image in the second direction. Therefore, whether to carry out the second-stage scaling on the image along a certain direction can be determined according to the scaling ratio of the image along the direction, the second-stage scaling on the whole image is not needed, and therefore the image processing time delay can be reduced, and the image scaling efficiency can be improved.
According to the method and the device, the image with low requirements can be subjected to one-level scaling, the image with high requirements can be subjected to two-level scaling, and the scaling coefficient of the second-level scaling can be judged and dynamically selected according to the edge information of the image subjected to the first-level scaling and the programmable threshold. In this way, the problems that some images with more prominent edges are easy to cause ringing effect for some scaling coefficients close to an ideal low-pass filter or image blurring is caused by selecting improper scaling coefficients can be improved.
According to the embodiment of the application, whether two-stage scaling is adopted can be dynamically switched according to the scaling ratio, and the scaling ratio of each stage of scaling can be adjusted. By the method, for a plurality of scenes with larger scaling coefficients, the scaling effect can be better improved by two-stage scaling.
And selecting a lanczos kernel scaling coefficient for the ordinary image to enhance the contrast of the image, and selecting the ordinary kernel scaling coefficient for the image which is easy to generate ringing effect.
In the prior art, a proper image algorithm has a relatively obvious influence on the image output quality, a relatively simple algorithm easily causes the sawtooth effect of an image, but a relatively ideal algorithm easily causes the ringing effect, and meanwhile, although some algorithms have relatively good effects, the hardware implementation is difficult due to the fact that the complexity and related parameters of the algorithms are relatively high, and the frame rate of the whole system does not meet the relatively ideal requirement
After the scaling of the first direction is completed, the data processed in the first direction directly pass through the second direction, new pixel points are obtained through field weighted summation in the first-stage scaling, if the second-stage scaling is needed, the new pixel points are weighted summation through the scaling weight factors, and finally scaled images are obtained.
According to the embodiment of the application, a proper scaling weight factor can be dynamically selected according to the content of the image, and the time delay of a system is reduced while the image scaling quality is improved by combining the design mode of a hardware pipeline.
In addition, if the above functions are implemented in the form of software functions and sold or used as a standalone product, the functions may be stored in a storage medium readable by a mobile terminal, that is, the present application also provides a storage device storing program data, which can be executed to implement the method of the above embodiments, the storage device may be, for example, a usb disk, an optical disk, a server, etc. That is, the present application may be embodied as a software product, which includes several instructions for causing an intelligent terminal to perform all or part of the steps of the methods described in the embodiments.
In the description of the present application, reference to the description of the terms "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be viewed as implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device (e.g., a personal computer, server, network device, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions). For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory. The above description is only for the purpose of illustrating embodiments of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application or are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (12)

1. An adaptive image scaling method, characterized in that the adaptive image scaling method comprises:
acquiring an image, and carrying out first-level scaling on the image along a first direction to acquire first image data;
determining whether to perform a second level of scaling on the first image data along the first direction according to a first scaling ratio of the first direction;
performing first-level scaling on the image data scaled along the first direction along a second direction to obtain second image data, wherein the first direction is perpendicular to the second direction;
determining whether to perform a second level of scaling on the second image data along the second direction according to a second scaling ratio of the second direction.
2. The adaptive image scaling method of claim 1, wherein said step of determining whether to second scale the first image data along the first direction according to the first scaling ratio of the first direction comprises:
matching the first scaling ratio with a preset ratio;
if the first scaling ratio is successfully matched with the preset ratio, performing second-level scaling on the first image data along the first direction to obtain third image data;
if the first scaling ratio is unsuccessfully matched with the preset ratio, finishing the scaling of the image along the first direction.
3. The adaptive image scaling method according to claim 2, wherein said step of performing a first-level scaling on the image data scaled in the first direction along the second direction to obtain second image data comprises:
and carrying out first-level scaling on the first image data along the second direction or carrying out first-level scaling on the third image data along the second direction to obtain second image data.
4. The adaptive image scaling method of claim 3, wherein said step of determining whether to second scale the second image data in the second direction according to a second scaling ratio in the second direction comprises:
matching the second scaling ratio with a preset ratio;
if the second scaling ratio is successfully matched with the preset ratio, performing second-level scaling on the second image data along the second direction to obtain fourth image data;
and if the second scaling ratio is not matched with the preset ratio successfully, finishing the scaling of the image along the second direction.
5. The adaptive image scaling method of claim 1, wherein said first scaling the image in the first direction to obtain first image data comprises:
acquiring a zooming instruction of the image;
if the zooming instruction is an amplifying instruction, interpolating pixels of the image along the first direction by adopting a bilinear method to obtain pixels after interpolation processing as first image data;
if the zooming instruction is a zooming-out instruction, acquiring neighborhood pixels of pixels in the image along the first direction, acquiring weighted values of the pixels and the neighborhood pixels by adopting an averaging method, and acquiring new pixels according to the weighted values to serve as first image data.
6. The adaptive image scaling method of claim 2, wherein if the first scaling ratio is successfully matched with the preset ratio, the step of scaling the first image data in the first direction in the second stage comprises:
acquiring edge information of the first image data, and determining a scaling weight coefficient of the first image data according to the edge information;
and carrying out second-stage scaling on the first image data along the first direction according to the scaling weight coefficient so as to obtain third image data.
7. The adaptive image scaling method according to claim 6, wherein the step of obtaining edge information of the first image data and determining a scaling weight coefficient of the first image data according to the edge information comprises:
acquiring pixels of the first image data;
acquiring a second derivative of the pixel, and matching the second derivative with a threshold;
and if the matching is successful, obtaining a scaling weight coefficient corresponding to the threshold value of the successful matching.
8. The adaptive image scaling method of claim 7, wherein the step of performing a second level of scaling of the first image data along the first direction according to the scaling weight coefficients comprises:
dividing a plurality of the scaling weight coefficients into a plurality of groups;
respectively filtering the first image data by using a polyphase filter, wherein the number of phases of the polyphase filter is the same as the number of the groups, and a filter coefficient of the polyphase filter is set corresponding to the scaling weight coefficient;
obtaining filtered image data from a plurality of outputs of the polyphase filter as the third image data.
9. The adaptive image scaling method of claim 1, wherein prior to said step of first scaling said image in a first direction, said adaptive image scaling method further comprises:
judging whether the format of the image is a first format or not;
if yes, executing the step of carrying out first-stage scaling on the image along the first direction;
if not, performing color space conversion on the image so as to perform first-level scaling on the image subjected to the color space conversion along a first direction.
10. The adaptive image scaling apparatus according to claim 8, wherein said step of dividing the plurality of scaling weight coefficients into a plurality of groups comprises:
acquiring the design requirement of the low-pass filter and the number of scaling weight coefficients;
and according to the design requirements and the number, acquiring a plurality of groups of scaling weight coefficients through software functions, and performing fixed-point processing and storage on the scaling weight coefficients.
11. An adaptive image scaling apparatus, characterized in that the adaptive image scaling apparatus comprises: the image processing device comprises a first image zooming module, a second image zooming module and a processing module, wherein the processing module is connected with the first image zooming module and the second image zooming module;
the first image zooming module is used for zooming an image at a first level along a first direction to acquire first image data; the processing module determines whether to perform a second level of scaling on the first image data along the first direction according to a first scaling ratio of the first direction; the second image zooming module performs first-level zooming on the image data zoomed along the first direction along a second direction to acquire second image data, wherein the first direction is vertical to the second direction; the processing module further determines whether to perform a second level of scaling on the second image data along the second direction according to a second scaling ratio of the second direction, wherein the first direction is perpendicular to the second direction.
12. An apparatus having a storage function, wherein the apparatus stores program data executable to implement the adaptive image scaling method of any one of claims 1-10.
CN201911101193.9A 2019-11-12 2019-11-12 Adaptive image scaling method, adaptive image scaling device, and storage device Active CN112862673B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911101193.9A CN112862673B (en) 2019-11-12 2019-11-12 Adaptive image scaling method, adaptive image scaling device, and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911101193.9A CN112862673B (en) 2019-11-12 2019-11-12 Adaptive image scaling method, adaptive image scaling device, and storage device

Publications (2)

Publication Number Publication Date
CN112862673A true CN112862673A (en) 2021-05-28
CN112862673B CN112862673B (en) 2024-06-14

Family

ID=75984403

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911101193.9A Active CN112862673B (en) 2019-11-12 2019-11-12 Adaptive image scaling method, adaptive image scaling device, and storage device

Country Status (1)

Country Link
CN (1) CN112862673B (en)

Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5790714A (en) * 1994-11-01 1998-08-04 International Business Machines Corporation System and method for scaling video
US20020085121A1 (en) * 2000-12-28 2002-07-04 Kye-Won Ryou Image processing apparatus capable of changing active size and method for changing the active size thereof
US20060204138A1 (en) * 2005-03-14 2006-09-14 Samsung Electronics Co., Ltd. Image scaling device using a single line memory and a scaling method thereof
CN101789235A (en) * 2009-01-22 2010-07-28 华为终端有限公司 Method and device for processing image
CN101849246A (en) * 2007-09-19 2010-09-29 汤姆森特许公司 System and method for scaling images
CN101923704A (en) * 2009-06-12 2010-12-22 深圳市融创天下科技发展有限公司 Adaptive image scaling method
CN102201126A (en) * 2010-03-24 2011-09-28 联想(北京)有限公司 Image processing method, system and terminal
CN102222317A (en) * 2011-06-22 2011-10-19 王洪剑 Image scaling method and system
CN103699390A (en) * 2013-12-30 2014-04-02 华为技术有限公司 Image scaling method and terminal equipment
CN104700360A (en) * 2015-04-01 2015-06-10 中国科学院自动化研究所 Image zooming method and system based on edge self-adaptation
US20150170330A1 (en) * 2013-12-13 2015-06-18 Samsung Electronics Co., Ltd. Image processor, computing system comprising same, and related method of operation
US20150278991A1 (en) * 2014-03-27 2015-10-01 Wipro Limited Method and system for image scaling
US20160093016A1 (en) * 2014-09-25 2016-03-31 Sony Corporation Bayer-consistent raw scaling
US20160171652A1 (en) * 2014-12-10 2016-06-16 Samsung Electronics Co., Ltd. Image scaler having adaptive filter
CN108616701A (en) * 2016-12-12 2018-10-02 中国航空工业集团公司西安航空计算技术研究所 A kind of image-scaling method based on Sinc filters
CN109584204A (en) * 2018-10-15 2019-04-05 上海途擎微电子有限公司 A kind of image noise intensity estimation method, storage medium, processing and identification device
CN109903224A (en) * 2019-01-25 2019-06-18 珠海市杰理科技股份有限公司 Image-scaling method, device, computer equipment and storage medium
CN109978768A (en) * 2019-03-28 2019-07-05 南京邮电大学 A kind of image non-linear Zoom method of view-based access control model conspicuousness detection
CN110349090A (en) * 2019-07-16 2019-10-18 合肥工业大学 A kind of image-scaling method based on newton second order interpolation

Patent Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5790714A (en) * 1994-11-01 1998-08-04 International Business Machines Corporation System and method for scaling video
US20020085121A1 (en) * 2000-12-28 2002-07-04 Kye-Won Ryou Image processing apparatus capable of changing active size and method for changing the active size thereof
US20060204138A1 (en) * 2005-03-14 2006-09-14 Samsung Electronics Co., Ltd. Image scaling device using a single line memory and a scaling method thereof
CN101849246A (en) * 2007-09-19 2010-09-29 汤姆森特许公司 System and method for scaling images
CN101789235A (en) * 2009-01-22 2010-07-28 华为终端有限公司 Method and device for processing image
CN101923704A (en) * 2009-06-12 2010-12-22 深圳市融创天下科技发展有限公司 Adaptive image scaling method
CN102201126A (en) * 2010-03-24 2011-09-28 联想(北京)有限公司 Image processing method, system and terminal
CN102222317A (en) * 2011-06-22 2011-10-19 王洪剑 Image scaling method and system
US20150170330A1 (en) * 2013-12-13 2015-06-18 Samsung Electronics Co., Ltd. Image processor, computing system comprising same, and related method of operation
CN103699390A (en) * 2013-12-30 2014-04-02 华为技术有限公司 Image scaling method and terminal equipment
US20150278991A1 (en) * 2014-03-27 2015-10-01 Wipro Limited Method and system for image scaling
US20160093016A1 (en) * 2014-09-25 2016-03-31 Sony Corporation Bayer-consistent raw scaling
US20160171652A1 (en) * 2014-12-10 2016-06-16 Samsung Electronics Co., Ltd. Image scaler having adaptive filter
CN104700360A (en) * 2015-04-01 2015-06-10 中国科学院自动化研究所 Image zooming method and system based on edge self-adaptation
CN108616701A (en) * 2016-12-12 2018-10-02 中国航空工业集团公司西安航空计算技术研究所 A kind of image-scaling method based on Sinc filters
CN109584204A (en) * 2018-10-15 2019-04-05 上海途擎微电子有限公司 A kind of image noise intensity estimation method, storage medium, processing and identification device
CN109903224A (en) * 2019-01-25 2019-06-18 珠海市杰理科技股份有限公司 Image-scaling method, device, computer equipment and storage medium
CN109978768A (en) * 2019-03-28 2019-07-05 南京邮电大学 A kind of image non-linear Zoom method of view-based access control model conspicuousness detection
CN110349090A (en) * 2019-07-16 2019-10-18 合肥工业大学 A kind of image-scaling method based on newton second order interpolation

Also Published As

Publication number Publication date
CN112862673B (en) 2024-06-14

Similar Documents

Publication Publication Date Title
CN110675404B (en) Image processing method, image processing apparatus, storage medium, and terminal device
US7483040B2 (en) Information processing apparatus, information processing method, recording medium, and program
EP3017594B1 (en) Method and processor for efficient video processing in a streaming environment
Dengwen An edge-directed bicubic interpolation algorithm
JP2011523275A (en) Improving image resolution
WO2018196470A1 (en) Image processing method and apparatus
US6166773A (en) Method and apparatus for de-interlacing video fields to progressive scan video frames
JP6190386B2 (en) Video ringer ringing reduction
CN102129666B (en) Image scaling method and device
JP2001008037A (en) Pixel interpolation method and circuit
CN101588462A (en) Image processing method and device thereof
US8755639B2 (en) Image scaling method and apparatus with enhancement of image quality
CN112862673B (en) Adaptive image scaling method, adaptive image scaling device, and storage device
Gour et al. Hardware accelerator for real-time image resizing
AU2007219336B8 (en) Method and apparatus for abitrary ratio image reduction
KR100463552B1 (en) Cubic convolution interpolation apparatus and method
KR20130059546A (en) Methods of interpolation based on edge and apparatuses for using the same
Goswami Comparison of image interpolation methods for image zooming
US8588553B2 (en) Scaling method and device for image signals
Savagave et al. Study of image interpolation
KR101028449B1 (en) Method and apparatus for resizing image
KR20080079392A (en) Device and method of adaptive image interpolation
CN103916649A (en) Image processing method, apparatus and system
Parkkinen et al. A fast method for scaling color images
WO2017185348A1 (en) Method, device, and apparatus for processing display content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant