Dynamic image processing method, device and equipment and readable storage medium
By dynamically determining the iterative update of the order k and intermediate cache value of the image scaling algorithm, the problems of information loss and cache resource consumption in the prior art are solved, and efficient image scaling processing is realized.
Patent Information
- Application Number
- CN202311559325.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-21
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, when the resolution of the video source and the LED display screen are inconsistent, a large number of cache resources are required for image scaling processing, and a fixed order reduction algorithm leads to loss of image information.
By dynamically determining the order k of the image scaling algorithm, k is calculated based on the ratio of input and output resolutions, and iterative update of the intermediate cache value, reducing the amount of cached data and retaining image information.
It effectively reduces the amount of cached data of the FPGA chip, solves the problem of information loss during image scaling, and improves computing efficiency and applicability.
Smart Images

Figure CN120075529A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image processing, and particularly to a dynamic image processing method, apparatus, device, and readable storage medium. Background Art
[0002] Currently, video playback has become an important part of life, including using video playback for entertainment or training, etc. The video source is usually sent from an electronic device to a corresponding display device for playback. Among them, there are various electronic devices for sending the video source, including computers, tablets, and set-top boxes, etc., and the output resolution of each of them can be a standard resolution, such as 2k (1920×1080), 4k (3840×2160), etc. conventionally. The display device for receiving the video source and playing it can be an LED display screen of various specifications, and its output resolution can be a non-standard resolution, which is specifically related to its individual specifications, such as 2660×1128, 4000×4000, etc.
[0003] Therefore, when the resolution of the video source is inconsistent with the resolution of the LED display screen, video processing is required to perform magnification or reduction processing on the image data of the input source to make it consistent with the resolution of the LED display screen. In the prior art, an FPGA (Field-Programmable Gate Array) chip is usually used to perform scaling processing on the original image data of the video source. Specifically, a scaling algorithm can be designed by programming the FPGA chip to complete the scaling of the original image data.
[0004] Among them, the existing scaling algorithms need to cache all the original image data of the video source, resulting in extremely large consumption of cache resources. However, the number of caches in the FPGA chip is very limited, so multiple FPGA chips need to be set up to handle the scaling processing of video sources with a large amount of cached data.
[0005] At the same time, the existing video scaling device includes an image reduction unit for reducing the image. However, the existing image reduction unit usually uses a reduction algorithm with a fixed order. When using this image reduction unit to perform reduction processing on images with different resolutions, the problem of image information loss will occur. Summary of the Invention
[0006] The present application provides a dynamic image processing method, apparatus, device, and readable storage medium, which can reduce the amount of cached data in the FPGA chip and at the same time solve the problem of image information loss existing in scaled images.
[0007] The first aspect of the present application provides a dynamic image processing method, which is used to process at least two rows of image data of an image. The dynamic image processing method includes:
[0008] Obtain the order k of the image scaling algorithm based on at least two rows of image data;
[0009] Obtain the m-th row of image data, and obtain the m-th row coefficient based on the m-th row of image data;
[0010] Calculate the sum of coefficient products based on the m-th row of image data and the m-th row coefficient;
[0011] Iteratively update the intermediate cache value based on the sum of coefficient products corresponding to the m-th row of image data;
[0012] In response to the number of iterations of the intermediate cache value being less than k, return to execute the steps of obtaining the m-th row of image data and obtaining the m-th row coefficient based on the m-th row of image data and its subsequent steps;
[0013] Obtain the interpolated image points based on the iterated intermediate cache value, and output the interpolated image points.
[0014] Optionally, the m-th row of image data includes at least first image data and second image data, and the m-th row coefficient includes a first coefficient corresponding to the first image data and a second coefficient corresponding to the second image data; the step of calculating the sum of coefficient products based on the m-th row of image data and the m-th row coefficient includes:
[0015] Obtain the first coefficient product based on the first image data and the first coefficient;
[0016] Obtain the second coefficient product based on the second image data and the second coefficient;
[0017] Obtain the sum of coefficient products based on the first coefficient product and the second coefficient product.
[0018] Optionally, the step of iteratively updating the intermediate cache value based on the sum of coefficient products corresponding to the m-th row of image data includes:
[0019] Obtain the current intermediate cache value;
[0020] Calculate the sum of parameters based on the sum of coefficient products corresponding to the m-th row of image data and the current intermediate cache value;
[0021] Define the sum of parameters as the new intermediate cache value, and store and overwrite the current intermediate cache value.
[0022] Optionally, the step of obtaining the order k of the image scaling algorithm based on at least two rows of image data includes:
[0023] Obtain the input resolution based on at least two rows of image data;
[0024] Obtain the ratio based on the input resolution and the preset output resolution;
[0025] Obtain the order k of the image scaling algorithm based on the ratio.
[0026] Optionally, the step of obtaining the order k of the image scaling algorithm based on the ratio includes:
[0027] In response to the ratio being less than k + 1 and greater than or equal to k, determine the order k of the image scaling algorithm.
[0028] Optionally, the input resolution includes the input horizontal resolution and the input vertical resolution, and the preset output resolution includes the output horizontal resolution and the output vertical resolution; the step of obtaining the ratio based on the input resolution and the preset output resolution includes:
[0029] Obtain a first ratio based on the input horizontal resolution and the output horizontal resolution;
[0030] Obtain a second ratio based on the input vertical resolution and the output vertical resolution;
[0031] Compare the first ratio and the second ratio, and use the maximum value of the first ratio and the second ratio as the ratio.
[0032] Optionally, the dynamic image processing method further includes:
[0033] In response to the output of the interpolated image points, obtain the image data of the (m + 1)-th row;
[0034] Define the image data of the (m + 1)-th row as the new image data of the m-th row, and return to execute the step of obtaining the image data of the m-th row and subsequent steps of obtaining the coefficients of the m-th row based on the image data of the m-th row;
[0035] Generate a new image based on multiple interpolated image points.
[0036] A second aspect of the present application provides a dynamic image processing apparatus, which includes:
[0037] A first image processing unit, configured to obtain at least two rows of image data of an image; obtain the order k of the image scaling algorithm based on at least two rows of image data; obtain the coefficients of the m-th row based on the image data of the m-th row; calculate the sum of coefficient products based on the image data of the m-th row and the coefficients of the m-th row; iteratively update the intermediate cache value based on the sum of coefficient products corresponding to the image data of the m-th row; in response to the number of iterations of the intermediate cache value being less than k, return to execute the step of obtaining the image data of the m-th row and subsequent steps of obtaining the coefficients of the m-th row based on the image data of the m-th row; obtain the interpolated image points based on the iterated intermediate cache value, and output the interpolated image points;
[0038] A cache unit, configured to cache the interpolated image points;
[0039] A second image processing unit for generating a new image based on a plurality of interpolated image points.
[0040] A third aspect of the present application provides an electronic device including a memory and a processor coupled to each other. The processor is configured to execute program instructions stored in the memory to implement the dynamic image processing method as described above.
[0041] A fourth aspect of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, can implement the dynamic image processing method as described above.
[0042] Different from the prior art, the present application determines the order k of the image scaling algorithm by using at least two rows of image data of the input image, specifically by calculating the ratio of the input resolution to the output resolution to determine the order k of the image scaling algorithm. When the input image does not need to be reduced, the video stream is directly output to the next-level processing unit, effectively saving the data calculation amount; when the input image needs to be reduced, the order k of the image scaling algorithm is flexibly determined to adapt to the requirements of display devices with different resolutions, improving the applicability. The present application can dynamically adjust the image scaling algorithm to solve the problem of image information loss in the scaled image caused by too low an order of the scaling algorithm, and at the same time avoid excessive resource consumption caused by using a scaling algorithm with too high an order for scaling processing.
[0043] Moreover, the present application further determines the number of iterations of the intermediate cache value based on the order of the image scaling algorithm, enabling each pixel to participate in the scaling calculation and retaining the original image information to a certain extent, further solving the problem of image information loss in the scaled image. At the same time, the present application calculates the product sum of the coefficients corresponding to each row of image data and iteratively updates the intermediate cache value, and only needs to cache the intermediate cache value without caching the input original image data value, which can reduce the amount of image data to be cached.
[0044] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0046] Figure 1 It is a schematic flowchart of an embodiment of the dynamic image processing method of the present application;
[0047] Figure 2 is Figure 1 The specific process schematic diagram of step S11 in
[0048] Figure 3 is Figure 2 The specific process schematic diagram of step S112 in
[0049] Figure 4 is Figure 1 The specific process schematic diagram of step S13 in
[0050] Figure 5 is Figure 1 The specific process schematic diagram of step S14 in
[0051] Figure 6 It is the process schematic diagram of another embodiment of the dynamic image processing method of the present application;
[0052] Figure 7 It is the distribution schematic diagram of the image data of the present application;
[0053] Figure 8 It is the framework schematic diagram of an embodiment of the dynamic image processing device of the present application;
[0054] Figure 9 It is the framework schematic diagram of an embodiment of the electronic device of the present application;
[0055] Figure 10 It is the framework schematic diagram of an embodiment of the computer-readable storage medium of the present application. Detailed implementation manners
[0056] To enable those skilled in the art to better understand the technical solutions of the present application, the dynamic image processing method, device, equipment and readable storage medium provided by the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners. It can be understood that the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0057] The terms "first", "second", etc. in the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.
[0058] The entire process of video transmission can be regarded as sending the video source to the LED sending card of the display device. The controller in the LED sending card processes the video source, that is, performs scaling processing through the FPGA chip. The LED sending card further sends the scaled video to the LED receiving card, and the LED receiving card further displays the corresponding video image through the LED display screen.
[0059] Specifically, the LED sending card may include an image scaling module A (scaler A), a cache module, and an image scaling module B (scaler B) connected in sequence. The image scaling module A is used to perform downscaling processing on the input video stream, the cache module is used to cache the video stream after being downscaled by the image scaling module A, and the image scaling module B is used to perform upscaling processing on the input video stream.
[0060] However, the existing image scaling module A usually uses a fixed-order downscaling algorithm. When using this image downscaling unit to perform downscaling processing on images with different resolutions, due to the fixed algorithm order, the problem of losing image information will occur.
[0061] Therefore, the present application provides a dynamic image processing method, especially for image downscaling processing. By using multiple rows of image data of the input image, the order of the image scaling algorithm can be dynamically determined to reduce the amount of image data cached in the FPGA chip, and at the same time solve the problem of losing image information caused by the fixed algorithm order. Please refer to Figure 1 , Figure 1 which is a schematic flowchart of an embodiment of the dynamic image processing method of the present application.
[0062] Among them, the execution subject of the dynamic image processing method of the present application can be the image scaling module A in the LED sending card. In some possible implementation manners, this dynamic image processing method can also be implemented by a processor calling computer-readable instructions stored in a memory.
[0063] Specifically, the dynamic image processing method of the embodiments of the present disclosure may include the following steps:
[0064] Step S11: Obtain the order k of the image scaling algorithm based on at least two rows of image data.
[0065] Among them, the image processed by the dynamic image processing method of this embodiment includes at least two rows of image data, and the resolution of the input image can be obtained according to at least two rows of image data, and the order k of the image scaling algorithm for dynamic processing can be further determined based on the resolution of the input image.
[0066] Optionally, the order k of the image scaling algorithm can be an image algorithm greater than or equal to the second order, such as a second-order algorithm, a fourth-order algorithm, an eighth-order algorithm, a twelfth-order algorithm, and so on.
[0067] Step S12: Obtain the image data of the m-th row, and obtain the coefficients of the m-th row based on the image data of the m-th row.
[0068] Among them, the input image of this embodiment includes at least two rows of image data, specifically n rows of image data. Then, at least the image data of the first row, the second row to the n-th row of image data can be obtained. m is an integer greater than 1 and less than or equal to n.
[0069] Optionally, interpolation coefficients corresponding to each row of image data can be calculated based on image algorithms of different orders. Therefore, based on the order k of the image scaling algorithm determined in step S11, the image scaling algorithm of this embodiment is determined, and further the coefficients of the m-th row corresponding to the obtained image data of the m-th row are calculated.
[0070] Step S13: Calculate the sum of coefficient products based on the image data of the m-th row and the coefficients of the m-th row.
[0071] Among them, each row of image data may include multiple image point data. Therefore, each row of coefficients includes pixel point coefficients corresponding to the multiple image point data. By calculating the product of each image point data and the corresponding pixel point coefficient and accumulating the multiple products, the sum of coefficient products can be calculated.
[0072] Step S14: Iteratively update the intermediate cache value based on the sum of coefficient products corresponding to the image data of the m-th row.
[0073] Among them, the intermediate cache value is an iterative cache value. When the image data of the first row is input, the sum of coefficient products calculated based on the image data of the first row is the intermediate cache value initially cached.
[0074] When the image data of the second row is input, the corresponding sum of coefficient products can be calculated based on the image data of the second row and superimposed with the intermediate cache value to calculate a new intermediate cache value. That is, the intermediate cache value is the accumulated sum of m sums of coefficient products.
[0075] Step S15: In response to the number of iterations of the intermediate cache value being less than k, return to execute the step of obtaining the image data of the m-th row and obtaining the coefficients of the m-th row based on the image data of the m-th row and its subsequent steps.
[0076] Among them, when each row of image data is input, the intermediate cache value is iteratively updated. When the number of iterations is less than k, that is, the number of iterations of the intermediate cache value is less than the order k of the image scaling algorithm, then step S12 is continued to be executed to iterate the intermediate cache value until the number of iterations is equal to k, and step S16 is executed.
[0077] This embodiment only needs to cache the calculated intermediate cache value, rather than the input original image data, which can effectively reduce the amount of image data cached in the FPGA chip, thereby improving the calculation efficiency.
[0078] Step S16: Obtain the interpolated image points based on the iterated intermediate cache value and output the interpolated image points.
[0079] Among them, when the iteration count of the intermediate cache value is equal to k, it proves that the number of rows of the input image data is equal to the image scaling algorithm order k. Then, this intermediate cache value is the calculated interpolated image point, which is output to the next-level processing unit.
[0080] This embodiment uses at least two rows of image data of the input image to determine the image scaling algorithm order k, and can dynamically adjust the image scaling algorithm to solve the problem of image information loss in the scaled image caused by too low a scaling algorithm order, while avoiding excessive resource consumption caused by using a scaling algorithm with too high an order for scaling processing. Moreover, this embodiment further determines the iteration count of the intermediate cache value based on the image scaling algorithm order, so that each pixel participates in the scaling calculation, and the original image information is retained to a certain extent, further solving the problem of image information loss in the scaled image.
[0081] Optionally, the present application also provides another embodiment for implementing step S11 to determine the image scaling algorithm order k. Please continue to refer to Figure 2 , Figure 2 Yes Figure 1 is the specific flowchart of step S11 in
[0082] Step S111: Obtain the input resolution based on at least two rows of image data.
[0083] Among them, the resolution of the video source is a fixed value, which can be determined specifically through the input image. For example, when the resolution of the video source is 1920×1080, the number of rows and columns of its input image are both fixed values. Among them, the input horizontal resolution can be determined based on the number of rows of the input image, and the input vertical resolution can be determined based on the number of columns of the input image.
[0084] Step S112: Obtain a ratio based on the input resolution and the preset output resolution.
[0085] Among them, the preset output resolution can be the resolution of the LED display screen. By determining the preset scaling ratio of the image based on the resolution of the LED display screen and the resolution of the video source, that is, the ratio described in this embodiment.
[0086] For example, when the resolution of the video source is 1920×1080 and the resolution of the LED display screen is 4000×4000, the preset scaling ratio can be (1920 / 4000)×(1080 / 4000), that is, the preset scaling ratio includes a row scaling ratio and a column scaling ratio. Optionally, in different embodiments, the row scaling ratio and the column scaling ratio may be the same or different.
[0087] Optionally, the present application further provides another embodiment for implementing step S112 to obtain the calculated ratio. Please continue to refer to Figure 3 , Figure 3 is Figure 2 the specific flowchart of step S112 in
[0088] Specifically, it includes the following steps:
[0089] Step S1121: Obtain a first ratio based on the input horizontal resolution and the output horizontal resolution.
[0090] Among them, the input resolution of this embodiment includes the input horizontal resolution and the input vertical resolution, and the preset output resolution includes the output horizontal resolution and the output vertical resolution.
[0091] Specifically, in this embodiment, by calculating the ratio of the input horizontal resolution to the output horizontal resolution, the first ratio can be obtained, that is, the row scaling ratio is obtained.
[0092] Step S1122: Obtain a second ratio based on the input vertical resolution and the output vertical resolution.
[0093] Among them, in this embodiment, by calculating the ratio of the input vertical resolution to the output vertical resolution, the second ratio can be obtained, that is, the column scaling ratio is obtained.
[0094] Step S1123: Compare the first ratio and the second ratio, and use the maximum value of the first ratio and the second ratio as the ratio.
[0095] Among them, since the row scaling ratio and the column scaling ratio may be the same or different, this embodiment compares the first ratio and the second ratio, and uses the maximum value of the first ratio and the second ratio as the ratio; when the first ratio and the second ratio are the same, either the first ratio or the second ratio can be used as the ratio.
[0096] Step S113: Obtain the image scaling algorithm order k based on the ratio.
[0097] Among them, by judging the size of the ratio, the image scaling algorithm order k can be determined.
[0098] Specifically, in response to the ratio being less than 1, it is necessary to perform image magnification processing, so there is no need to perform image reduction processing. Therefore, the image scaling module A outputs the input video stream, that is, the original image data, to the next-level processing unit.
[0099] In response to the ratio being equal to 1, it is proved that the input and output of the LED sending card are consistent, and there is no need to perform image magnification processing or reduction processing. Therefore, the image scaling module A outputs the input video stream, that is, the original image data, to the next-level processing unit, and further outputs the value to the LED receiving card, so that it displays the corresponding video image based on the original image data.
[0100] In response to the ratio being less than k + 1 and greater than or equal to k, it is necessary to perform image reduction processing. Therefore, it is determined that the order of the image scaling algorithm used by the image scaling module A is k, where k is a natural number greater than or equal to 2.
[0101] In this embodiment, by calculating the resolution ratio to determine the order k of the image scaling algorithm, the input image is flexibly processed. When the input image does not need to be reduced, the video stream is directly output to the next-level processing unit, effectively saving the data calculation amount; when the input image needs to be reduced, the order k of the image scaling algorithm is flexibly determined to adapt to the requirements of display devices with different resolutions, improving the applicability. At the same time, based on determining the order k of the image scaling algorithm, each pixel participates in the scaling calculation, and the original image information is retained to a certain extent, solving the problem of image information loss in the scaled image.
[0102] Optionally, the present application also provides another embodiment for implementing step S13 to calculate the product sum of the coefficients corresponding to the image data in the m-th row. Please continue to refer to Figure 4 , Figure 4 is Figure 1 the specific flowchart of step S13 in. Specifically, it includes the following steps:
[0103] Step S131: Obtain the first coefficient product based on the first image data and the first coefficient.
[0104] Among them, the image data in the m-th row includes at least the first image data and the second image data, and the coefficients in the m-th row include the first coefficient corresponding to the first image data and the second coefficient corresponding to the second image data. Specifically, in this embodiment, by calculating the product of the first image data and the first coefficient, the first coefficient product can be obtained.
[0105] Step S132: Obtain the second coefficient product based on the second image data and the second coefficient.
[0106] Among them, in this embodiment, by calculating the product of the second image data and the second coefficient, the second coefficient product can be obtained.
[0107] Step S133: Obtain the product sum of coefficients based on the first product of coefficients and the second product of coefficients.
[0108] Among them, in this embodiment, by calculating the sum of the first product of coefficients and the second product of coefficients, the product sum of coefficients can be obtained.
[0109] Optionally, the present application also provides another embodiment for implementing step S14 to achieve iterative update of the intermediate cache value. Optionally, this embodiment is described with a fourth-order image scaling algorithm. Please refer to Figure 7 , Figure 7 is a schematic diagram of the distribution of the image data of the present application. As Figure 7 shown, the input image may include eight rows of image data, and each row of image data includes eight image point data.
[0110] Combined with Figure 7 , please continue to refer to Figure 5 , Figure 5 is Figure 1 a specific flowchart of step S14 in
[0111] Step S141: Obtain the current intermediate cache value.
[0112] Among them, when the m-th row of image data is input, the current intermediate cache value at this time is the intermediate cache value after iterative update based on the product sum of coefficients calculated from the (m - 1)-th row of image data.
[0113] Step S142: Calculate the parameter sum based on the product sum of coefficients corresponding to the m-th row of image data and the current intermediate cache value.
[0114] Among them, in this embodiment, by calculating the sum of the product sum of coefficients corresponding to the m-th row of image data and the current intermediate cache value, the parameter sum can be calculated, that is, the parameter sum is the accumulated value of the product sum of coefficients of multiple rows of image data.
[0115] Step S143: Define the parameter sum as the new intermediate cache value and store it to overwrite the current intermediate cache value.
[0116] Among them, in this embodiment, the image scaling module A stores the parameter sum in the storage space and overwrites the previously stored current intermediate cache value at the same position, defines the parameter sum as the new intermediate cache value, and sequentially realizes the iterative update of the intermediate cache value.
[0117] As Figure 7As shown, the first row of image data includes image points A1, A2, A3, A4, A5, A6, A7, and A8. Each image point can calculate the corresponding coefficient based on the fourth-order image scaling algorithm. For example, the coefficient of image point A1 is a1, the coefficient of image point A2 is a2, and so on.
[0118] When the first row of image data is input, in this embodiment, by calculating the products of image points A1, A2, A3, and A4 with their corresponding coefficients respectively, and accumulating the four products, the first coefficient product sum corresponding to the first row of image data can be obtained. And by calculating the products of image points A5, A6, A7, and A8 with their corresponding coefficients respectively, and accumulating the four products, the second coefficient product sum corresponding to the first row of image data can be obtained.
[0119] At this time, the first coefficient product sum and the second coefficient product sum are used as intermediate cache values and stored. Among them, the first coefficient product sum contains the image information of image points A1, A2, A3, and A4, and the second coefficient product sum contains the image information of image points A5, A6, A7, and A8.
[0120] Similarly, calculate the first coefficient product sum and the second coefficient product sum corresponding to the second row of image data, and calculate the sum of the first coefficient product sum corresponding to the first row of image data and the first coefficient product sum corresponding to the second row of image data. Then this parameter value is the new intermediate cache value.
[0121] Until the fourth row of image data is input, calculate the accumulated value S1 of the first coefficient product sums from the first row of image data to the fourth row of image data and the accumulated value S2 of the second coefficient product sums.
[0122] Since the number of rows of the input image data is equal to the order k of the image scaling algorithm, the iteration of the intermediate cache value ends, and the accumulated value S1 of the first coefficient product sum and the accumulated value S2 of the second coefficient product sum are output as the first interpolated image point and the second interpolated image point.
[0123] This application also provides another dynamic image processing method, in combination with Figures 1 - 5 and Figure 7 , please refer to Figure 6 , Figure 6 is the flow schematic diagram of another embodiment of the dynamic image processing method of this application.
[0124] Step S17: In response to the output of the interpolated image point, obtain the (m + 1)-th row of image data.
[0125] Wherein, in response to the number of iterations of the intermediate cache value being equal to the order k of the image scaling algorithm, the image scaling module A outputs interpolated image points, and at this time, the image data of the (m + 1)-th row is input.
[0126] Step S18: Define the image data of the (m + 1)-th row as the new image data of the m-th row, and return to execute the steps of obtaining the image data of the m-th row and obtaining the coefficients of the m-th row based on the image data of the m-th row and its subsequent steps.
[0127] Wherein, since the number of iterations of the intermediate cache value reaches the threshold after the image data of the m-th row is input, that is, it is equal to the order k of the image scaling algorithm, and the numerical iteration of one cycle is completed, then when the image data of a new row is input, it is used as the image data of the first row of a new iteration cycle to execute steps S12 and its subsequent steps as Figure 1 shown.
[0128] As Figure 7 shown, when the image data of the fifth row is input, the product sum of the coefficients calculated based on the image data of the fifth row is the new intermediate cache value, and iteration update is performed again until the image data of the eighth row is input. At this time, the intermediate cache value is the accumulated values S3 and S4 of the product sum of the coefficients of the image data from the fifth row to the eighth row, and is output as the third interpolated image point and the fourth interpolated image point.
[0129] Step S19: Generate a new image based on multiple interpolated image points.
[0130] Wherein, based on steps S11 - S18, multiple interpolated image points are obtained, and then a new image can be generated and output.
[0131] Please refer to Figure 8 , Figure 8 which is a schematic framework diagram of an embodiment of the dynamic image processing device of the present application. The dynamic image processing device 60 of this embodiment includes a first image processing unit 61, a cache unit 62, and a second image processing unit 63.
[0132] Specifically, the first image processing unit 61 receives the input video stream, that is, obtains the image input, and performs image reduction processing on it. Among them, the image reduction processing performed by the first image processing unit 61 can be the steps in any of the above-mentioned embodiments of the dynamic image processing method.
[0133] The cache unit 62 is used to store multiple interpolated image points output by the first image processing unit 61. Optionally, the cache unit 62 in this embodiment may be a DDR3 (double-data-rate 3 synchronous dynamic RAM), a DDR2 (Double Data Rate 2 SDRAM), a DRAM (Dynamic Random Access Memory), and so on.
[0134] The second image processing unit 63 is used to generate a new image based on multiple interpolated image points and implement image output. Optionally, the second image processing unit 63 can also be used to perform magnification processing on the new image formed by the interpolated image points.
[0135] This application also provides an electronic device. Please refer to Figure 9 , Figure 9 which is a schematic diagram of the framework of an embodiment of the electronic device of this application. The electronic device 70 includes a memory 71 and a processor 72 that are coupled to each other. The processor 72 is used to execute program instructions stored in the memory 71 to implement the steps in any of the above embodiments of the dynamic image processing method. In a specific implementation scenario, the electronic device 70 may include, but is not limited to, a microcomputer and a server. In addition, the electronic device 70 may also include mobile devices such as a laptop computer and a tablet computer, which are not limited here.
[0136] Specifically, the processor 72 is used to control itself and the memory 71 to implement the steps in any of the above embodiments of the dynamic image processing method. The processor 72 may also be referred to as a CPU (Central Processing Unit). The processor 72 may be an integrated circuit chip with signal processing capabilities. The processor 72 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Additionally, the processor 72 may be implemented jointly by integrated circuit chips.
[0137] This application also provides a computer-readable storage medium. Please refer to Figure 10 , Figure 10It is a schematic framework diagram of an embodiment of the computer-readable storage medium of the present application. The computer-readable storage medium 80 stores a computer program 81 that can be run by a processor. The computer program 81 is used to implement the steps in any of the above-described embodiments of the dynamic image processing method.
[0138] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0139] The above descriptions of the various embodiments tend to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to each other. For the sake of brevity, they will not be repeated in this article.
[0140] In several embodiments provided by the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0141] In addition, each functional unit in the various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0143] The above are only the embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present application.
Claims
1. A dynamic image processing method, characterized in that, it is used to process at least two rows of image data of an image, including: obtaining the order k of an image scaling algorithm based on the at least two rows of image data; obtaining the m-th row of image data, and obtaining the m-th row of coefficients based on the m-th row of image data; calculating the sum of coefficient products based on the m-th row of image data and the m-th row of coefficients; iteratively updating an intermediate cache value based on the sum of coefficient products corresponding to the m-th row of image data; in response to the number of iterations of the intermediate cache value being less than k, returning to execute the step of obtaining the m-th row of image data and obtaining the m-th row of coefficients based on the m-th row of image data and its subsequent steps; obtaining an interpolated image point based on the iterated intermediate cache value, and outputting the interpolated image point.
2. The dynamic image processing method according to claim 1, characterized in that, the m-th row of image data at least includes first image data and second image data, and the m-th row of coefficients includes a first coefficient corresponding to the first image data and a second coefficient corresponding to the second image data; the step of calculating the sum of coefficient products based on the m-th row of image data and the m-th row of coefficients includes: obtaining a first coefficient product based on the first image data and the first coefficient; obtaining a second coefficient product based on the second image data and the second coefficient; obtaining the sum of coefficient products based on the first coefficient product and the second coefficient product.
3. The dynamic image processing method according to claim 2, characterized in that, the step of iteratively updating the intermediate cache value based on the sum of coefficient products corresponding to the m-th row of image data includes: obtaining the current intermediate cache value; calculating a sum of parameters based on the sum of coefficient products corresponding to the m-th row of image data and the current intermediate cache value; defining the sum of parameters as a new intermediate cache value, and storing and overwriting the current intermediate cache value.
4. The dynamic image processing method according to claim 1, characterized in that, the step of obtaining the order k of an image scaling algorithm based on the at least two rows of image data includes: obtaining an input resolution based on the at least two rows of image data; obtaining a ratio based on the input resolution and a preset output resolution; obtaining the order k of the image scaling algorithm based on the ratio.
5. The dynamic image processing method according to claim 4, characterized in that, the step of obtaining the order k of the image scaling algorithm based on the ratio includes: in response to the ratio being less than k + 1 and greater than or equal to k, determining the order k of the image scaling algorithm.
6. The dynamic image processing method according to claim 4, characterized in that, the input resolution includes an input horizontal resolution and an input vertical resolution, and the preset output resolution includes an output horizontal resolution and an output vertical resolution; the step of obtaining a ratio based on the input resolution and the preset output resolution includes: obtaining a first ratio based on the input horizontal resolution and the output horizontal resolution; obtaining a second ratio based on the input vertical resolution and the output vertical resolution; Compare the first ratio and the second ratio, and use the maximum value of the first ratio and the second ratio as the ratio.
7. The dynamic image processing method according to claim 1, wherein, the dynamic image processing method further includes: in response to outputting the interpolated image point, obtaining the image data of the (m + 1)-th row; defining the image data of the (m + 1)-th row as the new image data of the m-th row, returning to execute the step of obtaining the image data of the m-th row and subsequent steps based on the image data of the m-th row to obtain the coefficients of the m-th row; generating a new image based on a plurality of the interpolated image points.
8. A dynamic image processing apparatus, wherein, it includes: a first image processing unit, configured to obtain at least two rows of image data of an image; obtaining the order k of the image scaling algorithm based on the at least two rows of image data; obtaining the coefficients of the m-th row based on the image data of the m-th row; calculating a coefficient product sum based on the image data of the m-th row and the coefficients of the m-th row; iteratively updating an intermediate cache value based on the coefficient product sum corresponding to the image data of the m-th row; in response to the number of iterations of the intermediate cache value being less than k, returning to execute the step of obtaining the image data of the m-th row and subsequent steps based on the image data of the m-th row to obtain the coefficients of the m-th row; obtaining an interpolated image point based on the iterated intermediate cache value, and outputting the interpolated image point; a cache unit, configured to cache the interpolated image points; a second image processing unit, configured to generate a new image based on a plurality of the interpolated image points.
9. An electronic device, wherein, it includes a memory and a processor coupled to each other, and the processor is configured to execute program instructions stored in the memory to implement the dynamic image processing method according to any one of claims 1-7.
10. A computer-readable storage medium, wherein, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it can implement the dynamic image processing method according to any one of claims 1-7.