Image filtering processing method, system, storage medium and electronic device
By calculating the difference in image pixels and calculating the filter intensity in combination with video frame rate and bidirectional prediction of coded frames, the performance loss caused by time domain filtering is solved, and more accurate filtering effect and processing efficiency are achieved.
Patent Information
- Application Number
- CN202510820359.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-19
AI Technical Summary
During the audio and video encoding process, the time domain filtering tool causes the code stream to rise instead of falling, resulting in performance loss.
By calculating the pixel difference degree of each pixel in the image to be processed in a nine-cable grid centered on it, the target parameters are determined based on the pixel difference degree and the preset number threshold, and the filter intensity is calculated in combination with the video frame rate and the number of bidirectional predicted coded frames, and the filtering process is performed.
It effectively avoids performance losses in the time domain filtering process, improves the filtering effect, and ensures the stability and efficiency of processing.
Smart Images

Figure CN120355582B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image filtering processing method, system, storage medium and electronic device. Background Art
[0002] Temporal filtering is a common tool used to save bitrate during audio and video encoding. However, in some scenarios, this can lead to performance loss, causing the bitrate to increase rather than decrease. Therefore, avoiding this performance loss during temporal filtering is a pressing technical challenge for those skilled in the art. Summary of the Invention
[0003] The purpose of this application is to provide an image filtering processing method, system, computer-readable storage medium and electronic device, which can avoid performance loss in the time domain filtering process.
[0004] To solve the above technical problems, this application provides an image filtering processing method, the specific technical solutions are as follows:
[0005] Get the image to be processed;
[0006] For each pixel in the image to be processed, calculating the pixel difference within the nine-square grid centered on the pixel;
[0007] Determining a target parameter based on a quantitative relationship between the pixel difference and a preset quantity threshold;
[0008] The filtering strength is calculated according to the target parameter, the video frame rate of the image to be processed, and the number of bidirectional predictive coding frames, so as to perform filtering processing on the image to be processed based on the filtering strength.
[0009] Optionally, for each pixel in the image to be processed, calculating the pixel difference within a nine-square grid centered on the pixel includes:
[0010] For each target pixel in the image to be processed, calculating a first difference of the target pixel in the horizontal direction within a nine-square grid centered on the target pixel, and a second difference of the target pixel in the vertical direction of the nine-square grid; wherein, for a target pixel located at an edge of the image to be processed, if the nine-square grid centered on the target pixel exceeds the pixel unit of the image to be processed, it is regarded as a default value;
[0011] The pixel difference is calculated according to the first difference and the second difference.
[0012] Optionally, determining the target parameter according to the quantitative relationship between the pixel difference and a preset quantity threshold includes:
[0013] Determining the number of pixels in the image to be processed whose pixel difference is greater than a preset number threshold;
[0014] If the number of pixels is greater than a set value, setting the target parameter to a fixed value;
[0015] If the number of pixels is not greater than the set value, the target parameter is calculated according to the number of pixels.
[0016] Optionally, before determining the target parameter according to the quantitative relationship between the pixel difference and a preset quantity threshold, the method further includes:
[0017] The preset quantity threshold is calculated according to the bit depth of the image to be processed.
[0018] Optionally, calculating the filtering strength according to the target parameter, the video frame rate of the image to be processed, and the number of bidirectional predictive coding frames includes:
[0019] determining a range parameter based on the target parameter;
[0020] Calculating an initial filtering strength according to a limit value, the number of bidirectional predictive coding frames and the range parameter;
[0021] determining an adjustment coefficient according to a video frame rate of the image to be processed;
[0022] The filtering strength is calculated according to the initial filtering strength and the adjustment coefficient.
[0023] Optionally, determining the range parameter according to the target parameter includes:
[0024] Determining the numerical range to which the numerical value of the target parameter belongs;
[0025] A corresponding range parameter is determined according to the numerical interval.
[0026] Optionally, determining the adjustment coefficient according to the video frame rate of the image to be processed includes:
[0027] Reading the video frame rate of the image to be processed;
[0028] Substitute the video frame rate into an adjustment coefficient calculation formula, and use the output of the adjustment coefficient calculation formula as the adjustment coefficient; wherein the adjustment coefficient calculation formula is used to characterize the positive correlation between the video frame rate and the adjustment coefficient.
[0029] The present application also provides an image filtering processing system, comprising:
[0030] An image acquisition module, used for acquiring an image to be processed;
[0031] a pixel difference calculation module, configured to calculate, for each pixel in the image to be processed, a pixel difference within a nine-square grid centered on the pixel;
[0032] a parameter determination module, configured to determine a target parameter based on a quantitative relationship between the pixel difference and a preset quantity threshold;
[0033] The filtering processing module is used to calculate the filtering strength according to the target parameter, the video frame rate of the image to be processed and the number of bidirectional predictive coding frames, so as to perform filtering processing on the image to be processed based on the filtering strength.
[0034] The present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-described method when executed by a processor.
[0035] The present application also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned method when calling the computer program in the memory.
[0036] The present application provides an image filtering processing method, comprising: obtaining an image to be processed; for each pixel in the image to be processed, calculating the pixel difference of the pixel within a nine-square grid centered on the pixel; determining a target parameter based on a quantitative relationship between the pixel difference and a preset number threshold; and calculating a filtering strength based on the target parameter, the video frame rate of the image to be processed, and the number of bidirectional predictive coding frames, so as to perform filtering processing on the image to be processed based on the filtering strength.
[0037] This application processes the image to be processed, calculates the pixel difference between each pixel and the pixels in the surrounding nine-square grid, and then calculates the target parameter based on the pixel difference. Then, the filter strength is calculated by comprehensively considering the target parameter, the video frame rate of the image to be processed, and the number of bidirectional predictive coding frames, so as to filter the image to be processed. The filter strength is adjusted by the pixel difference. Combined with the video frame rate and the number of bidirectional predictive coding frames, it can more accurately calculate the appropriate filter strength to perform the filtering operation, improve the filtering effect, and avoid performance loss.
[0038] The present application also provides an image filtering processing system, a computer-readable storage medium, and an electronic device, which have the above-mentioned beneficial effects and are not described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0040] Figure 1 A flowchart of an image filtering processing method provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of a method for calculating pixel difference provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of the structure of an image filtering processing system provided in an embodiment of the present application;
[0043] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0045] The object information involved in this application, including but not limited to object device information, object personal information, etc., and data, including but not limited to data used for analysis, stored data, displayed data, etc., are all information and data authorized by the object or fully authorized by all parties.
[0046] See also Figure 1 , Figure 1 This is a flowchart of an image filtering processing method provided in an embodiment of the present application, the method comprising:
[0047] S101: Acquire an image to be processed;
[0048] S102: For each pixel in the image to be processed, calculating the pixel difference within a nine-square grid centered on the pixel;
[0049] S103: determining a target parameter according to a quantitative relationship between the pixel difference and a preset quantity threshold;
[0050] S104: Calculating a filtering strength according to the target parameter, the video frame rate of the image to be processed, and the number of bidirectional predictive coding frames, so as to perform filtering processing on the image to be processed based on the filtering strength.
[0051] There is no limitation on how to obtain the image to be processed. It should be emphasized that the image to be processed described in this application can come from various video sources and be formed by dividing it into several video frames. That is, the image to be processed in this application can be several image frames, or video data can be directly obtained as the image to be processed.
[0052] Thereafter, the pixel difference of each pixel in the image to be processed is calculated. For each pixel in the image to be processed, the pixel difference within the nine-square grid centered on the pixel is calculated.
[0053] In a feasible implementation manner, for each target pixel in the image to be processed, a first difference of the target pixel in the horizontal direction within the nine-square grid centered on it and a second difference of the target pixel in the vertical direction of the nine-square grid are calculated, thereby calculating the pixel difference based on the first difference and the second difference.
[0054] It should be noted that for a target pixel located at an edge of the image to be processed, if the nine-square grid with the target pixel as the center exceeds the pixel unit of the image to be processed, it is considered as a default value. The default value is not limited here and can be set to 0.
[0055] See also Figure 2 , Figure 2 This is a schematic diagram of a pixel difference calculation method provided in an embodiment of the present application, which marks the target pixel (x, y) and the nine-square grid centered on it. Figure 2 The dotted lines in the middle rectangle indicate pixels in the x-direction, and the pixels within the dotted lines in the ellipse indicate pixels in the y-direction.
[0056] First calculate the first difference noise_x in the x direction. The calculation formula is as follows:
[0057] noise_x[x][y]=(p[x-1][y-1]-p[x+1][y-1])+(p[x-1][y+1]-p[x+1][y+1])+2×(p[x-1][y]-p[x+1][y]);
[0058] In the above formula, in order to distinguish the coordinates and parentheses, As pixel coordinates, for example, p[x-1][y-1] represents the pixel at (x-1, y-1).
[0059] Then, the second difference noise_y in the y direction is calculated. The calculation formula is as follows:
[0060] noise_y[x][y]=(p[x-1][y-1]-p[x-1][y+1])+(p[x+1][y-1]-p[x+1][y+1])+2×(p[x][y-1]-p[x][y+1]);
[0061] Finally, the pixel difference noise is calculated according to the first difference and the second difference:
[0062] noise = abs(noise_x)+abs(noise_y);
[0063] Where abs(x) means taking the average value of x.
[0064] In step S103, a target parameter is determined based on the quantitative relationship between the pixel difference and a preset threshold value. The method for determining the preset threshold value is not limited herein and is related to the image parameters of the image to be processed. For example, the preset threshold value can be calculated based on the bit depth of the image to be processed.
[0065] An exemplary method for calculating the preset threshold thr can be calculated according to the following formula:
[0066] thr = 50<<(10-bit_depth);
[0067] Where bit_depth represents the bit depth of the image to be processed, and “<<” represents the shift symbol.
[0068] One possible approach to determining target parameters may include the following steps:
[0069] The first step is to determine the number of pixels in the image to be processed whose pixel difference is greater than a preset number threshold;
[0070] Step 2: If the number of pixels is greater than the set value, the target parameter is set to a fixed value;
[0071] Step 3: If the number of pixels is not greater than the set value, calculate the target parameter according to the number of pixels.
[0072] The preset threshold and fixed value are not limited here and can be set by those skilled in the art. When calculating the target parameter based on the number of pixels, it can be set according to a pre-set target parameter calculation formula.
[0073] The complexity and features of different images vary significantly. By first determining the number of pixels with a pixel difference greater than a preset threshold, the target parameter setting method can be determined based on the actual image content. For complex images (those with a large number of pixels with high pixel difference), using fixed values can ensure stable and reliable processing. For simple images (those with a small number of pixels with high pixel difference), the target parameters can be flexibly calculated based on the specific situation, achieving more precise processing and making the processing more adaptive to the image content. Furthermore, setting different target parameters for different pixel counts can reduce unnecessary parameter calculations. When the number of pixels is greater than the set value, the target parameter is directly set to a fixed value, avoiding the complex calculations required to dynamically adjust the target parameter based on the number of pixels. When processing complex images, this can save significant computing resources and time, improving processing efficiency. For example, in real-time video processing, performing complex dynamic calculations for each frame can slow down processing. This strategy can ensure processing quality while avoiding excessive calculations for complex frames.
[0074] Furthermore, if the target parameters are dynamically calculated based on the number of pixels in all cases, this can lead to large fluctuations in the target parameters in complex images, affecting the stability of the processing results. However, by setting a preset number threshold and then using a fixed value when the number of pixels exceeds the preset number threshold, this can be effectively avoided, making the processing process more stable and reliable.
[0075] The filter strength needs to be calculated based on the video frame rate and the number of bidirectionally predicted coded frames of the image to be processed. The number of bidirectionally predicted coded frames mainly refers to the B frames in a GOP.
[0076] GOP stands for "Group of Pictures." In video encoding, videos are divided into groups of pictures, each of which is a GOP. Simply put, a GOP is like a "small package" that contains a series of consecutive pictures in the video. These pictures include a complete "key frame" (I frame) and some "predicted frames" (P frames and B frames). Key frames are complete images and can be decoded directly, while predicted frames require reference to previous frames for decoding. The length of the GOP (that is, the number of frames contained in a GOP) affects the video's compression efficiency and playback quality.
[0077] B-frames (Bidirectionally Predictive Coded Pictures) are frames whose content is calculated by comparing the previous and next frames. For example, a B-frame can be thought of as a photo, recording the differences between it and the previous and next frames. Because B-frames only record the changes, their data size is typically small, resulting in high compression efficiency. However, decoding B-frames requires reference to both the previous and next frames, making the decoding process relatively complex.
[0078] In a feasible implementation, the process of calculating the filter strength may be as follows:
[0079] The first step is to determine the range parameter according to the target parameter;
[0080] Step 2: calculating the initial filtering strength according to the limit value, the number of bidirectional prediction coding frames and the range parameter;
[0081] Step 3: determining an adjustment coefficient according to the video frame rate of the image to be processed;
[0082] Step 4: Calculate the filtering strength according to the initial filtering strength and the adjustment coefficient.
[0083] In the first step, the numerical interval to which the numerical value of the target parameter belongs can be determined first, and then the corresponding range parameter can be determined according to the numerical interval, that is, there are differences in the range parameters corresponding to different target parameter values. Usually, the target parameter and the range parameter are positively correlated, but the mathematical relationship between the two is not specifically limited and can be pre-set by those skilled in the art.
[0084] In the third step, the video frame rate of the image to be processed can be read, and the video frame rate can be substituted into the adjustment coefficient calculation formula, and the output of the adjustment coefficient calculation formula is used as the adjustment coefficient. The adjustment coefficient calculation formula is used to represent the positive correlation between the video frame rate and the adjustment coefficient.
[0085] Determining the range parameters based on the target parameters ensures that the filter strength calculation is clearly directional and targeted, ensuring that the filtering operation meets the specific processing objectives. The number of bidirectionally predicted coded frames is used in the calculation of the initial filter strength because the correlation and predictive relationship between different frames during the video encoding process can affect the filtering effect. A large number of bidirectionally predicted coded frames indicates that the video content has strong temporal correlations. The filter strength needs to be appropriately adjusted to account for these temporal and spatial characteristics to avoid over- or under-filtering. The adjustment coefficient is determined based on the video frame rate, fully considering the temporal characteristics of the video. Videos with different frame rates contain different amounts of information per unit time. A higher frame rate means more subtle and frequent image changes. The filter strength needs to be adjusted accordingly to accommodate this dynamic characteristic to prevent undesirable effects such as image freezes or over-smoothing after filtering.
[0086] Combining limit values and range parameters to calculate the initial filter strength keeps the filter strength within a reasonable range and accurately calculates it based on information such as the actual pixel value range, preventing excessive or insufficient initial filter strength from negatively impacting subsequent image processing. In other words, the introduction of limit values prevents extreme values exceeding the system's processing capabilities from occurring during the filter strength calculation process, ensuring stable operation of the entire processing system.
[0087] In the process of calculating the filter strength, the initial filter strength is further accurately adjusted by adjusting the coefficient to make the filter strength more in line with the actual needs of the video. The use of a step-by-step and gradually refined calculation method helps to achieve higher-precision filtering operations and improve the processing quality of the image to be processed.
[0088] In an embodiment of the present application, a target parameter is calculated based on the pixel difference between each pixel and the surrounding pixels in a nine-square grid. A filter strength is then calculated by comprehensively considering the target parameter, the video frame rate of the image to be processed, and the number of bidirectionally predicted coded frames. The filter strength is then adjusted based on the pixel difference, and combined with the video frame rate and the number of bidirectionally predicted coded frames, a more accurate calculation of the appropriate filter strength is performed to improve the filtering effect and avoid performance loss.
[0089] The following is an exemplary description of an image filtering processing method provided by the present application using a specific implementation process of the present application:
[0090] Step 1: Pass the YUV format image to be processed into the encoder.
[0091] Step 2: For each pixel of the YUV format image to be processed, calculate its pixel difference within the nine-square grid. The specific steps are as follows:
[0092] The first step is to calculate the first difference noise_x in the x direction. The calculation formula is as follows:
[0093] noise_x[x][y]=(p[x-1][y-1]-p[x+1][y-1])+(p[x-1][y+1]-p[x+1][y+1])+2×(p[x-1][y]-p[x+1][y]);
[0094] Step 2: Calculate the second difference noise_y in the y direction. The calculation formula is as follows:
[0095] noise_y[x][y]=(p[x-1][y-1]-p[x-1][y+1])+(p[x+1][y-1]-p[x+1][y+1])+2×(p[x][y-1]-p[x][y+1]);
[0096] The third step is to calculate the pixel difference noise. The formula is as follows:
[0097] noise = abs(noise_x)+abs(noise_y);
[0098] Step 3: Count the number of noises that are greater than the preset threshold thr, denoted as num. The preset threshold thr is calculated as follows:
[0099] thr = 50<<(10-bit_depth).
[0100] Step 4. If num is greater than 20, set sigma = -1.0 and go to step 7; otherwise, go to step 5.
[0101] Step 5: Calculate the total number of pixels of all pixel difference noises greater than a preset number threshold thr, and record it as sum.
[0102] Step 6: Calculate the target parameter sigma. The calculation formula of the target parameter is as follows:
[0103] sigma = sum / (6×num)×sqrt_pi;
[0104] Where sqer_pi is the square root of pi, which is 1.25331413732.
[0105] Step 7: Calculate the final filter_strength. The specific steps are as follows:
[0106] Calculate the initial filter_strength. The calculation formula is as follows:
[0107] filter_strength = 0.4×min(fs×scale, max_strength)
[0108] in:
[0109] fs is 1.9 when there are 15 or more B frames in a GOP; otherwise, it is 1.3.
[0110] The scale parameter scale is determined by the value of sigma.
[0111] When the target parameter sigma is less than 0.25, the range parameter scale is 0.5;
[0112] When the target parameter sigma is greater than 0.25 and less than 0.5, the range parameter scale is 1.05;
[0113] When the target parameter sigma is greater than 0.5, the range parameter scale is 1.65.
[0114] max_strength is the limit value, which is 4.0.
[0115] Adjust filter_strength according to the video frame rate.
[0116] When the video frame rate is greater than 25 and less than 35, multiply the filter_strength by an adjustment factor of 1.3;
[0117] When the video frame rate is greater than 35 and less than 45, multiply the filter_strength by an adjustment factor of 1.5;
[0118] When the video frame rate is greater than 45, multiply filter_strength by an adjustment factor of 1.7.
[0119] Output the calculated filter strength and perform subsequent filtering steps.
[0120] It has been verified that using pixel difference to judge and adjust the filter strength, combined with information such as frame rate and GOP structure, can more accurately select the appropriate filter strength to perform subsequent filtering steps, making the filtering effect more accurate.
[0121] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of an image filtering processing system provided in an embodiment of the present application, the system comprising:
[0122] An image acquisition module, used for acquiring an image to be processed;
[0123] a pixel difference calculation module, configured to calculate, for each pixel in the image to be processed, a pixel difference within a nine-square grid centered on the pixel;
[0124] a parameter determination module, configured to determine a target parameter based on a quantitative relationship between the pixel difference and a preset quantity threshold;
[0125] The filtering processing module is used to calculate the filtering strength according to the target parameter, the video frame rate of the image to be processed and the number of bidirectional predictive coding frames, so as to perform filtering processing on the image to be processed based on the filtering strength.
[0126] Based on the above embodiment, as a preferred embodiment, the pixel difference calculation module is a module configured to perform the following steps:
[0127] For each target pixel in the image to be processed, calculating a first difference of the target pixel in the horizontal direction within a nine-square grid centered on the target pixel, and a second difference of the target pixel in the vertical direction of the nine-square grid; wherein, for a target pixel located at an edge of the image to be processed, if the nine-square grid centered on the target pixel exceeds the pixel unit of the image to be processed, it is regarded as a default value;
[0128] The pixel difference is calculated according to the first difference and the second difference.
[0129] Based on the above embodiment, as a preferred embodiment, the parameter determination module includes:
[0130] a pixel number calculation unit, configured to determine the number of pixels in the image to be processed whose pixel difference is greater than a preset number threshold;
[0131] A parameter determination unit is configured to set the target parameter to a fixed value if the number of pixels is greater than a set value; and to calculate the target parameter based on the number of pixels if the number of pixels is not greater than the set value.
[0132] Based on the above embodiment, as a preferred embodiment, it also includes:
[0133] The threshold calculation module is used to calculate the preset number threshold according to the bit depth of the image to be processed.
[0134] Based on the above embodiment, as a preferred embodiment, the filtering processing module includes:
[0135] A filter strength calculation unit is used to determine a range parameter based on the target parameter; calculate an initial filter strength based on a limit value, the number of bidirectional predictive coding frames and the range parameter; determine an adjustment coefficient based on the video frame rate of the image to be processed; and calculate the filter strength based on the initial filter strength and the adjustment coefficient.
[0136] Based on the above embodiment, as a preferred embodiment, the filter strength calculation unit includes:
[0137] The range parameter determination subunit is used to determine the numerical interval to which the numerical value of the target parameter belongs; and determine the corresponding range parameter according to the numerical interval.
[0138] Based on the above embodiment, as a preferred embodiment, the filter strength calculation unit includes:
[0139] The adjustment coefficient determination subunit is used to read the video frame rate of the image to be processed; substitute the video frame rate into the adjustment coefficient calculation formula, and use the output of the adjustment coefficient calculation formula as the adjustment coefficient; wherein, the adjustment coefficient calculation formula is used to characterize the positive correlation between the video frame rate and the adjustment coefficient.
[0140] The present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in the above method embodiment.
[0141] It is understandable that if the method in the above embodiment 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, 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 executes all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.
[0142] The computer-readable storage medium provided in this embodiment includes the above-mentioned method, and the effect is the same as above.
[0143] This application also provides an electronic device, see Figure 4 , a structural diagram of an electronic device provided in an embodiment of the present application, such as Figure 4 As shown, a processor 1410 and a memory 1420 may be included.
[0144] The processor 1410 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1410 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1410 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1410 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1410 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0145] The memory 1420 may include one or more computer-readable storage media, which may be non-transitory. The memory 1420 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 1420 is at least used to store the following computer program 1421, wherein, after the computer program is loaded and executed by the processor 1410, it can implement the relevant steps in the method performed by the electronic device side disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 1420 may also include an operating system 1422 and data 1423, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 1422 may include Windows, Linux, Android, etc.
[0146] In some embodiments, the electronic device may further include a display screen 1430 , an input / output interface 1440 , a communication interface 1450 , a sensor 1460 , a power supply 1470 , and a communication bus 1480 .
[0147] certainly, Figure 4 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiment of the present application. In actual applications, the electronic device may include Figure 4 More or fewer components than shown, or combinations of certain components.
[0148] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems provided in the embodiments, since they correspond to the methods provided in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0149] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core ideas of this application. It should be noted that for those skilled in the art, without departing from the principles of this application, various improvements and modifications can be made to this application, and such improvements and modifications also fall within the scope of protection of this application.
[0150] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
Claims
1. An image filtering processing method, characterized in that: include: Get the image to be processed; For each pixel in the image to be processed, calculating the pixel difference within the nine-square grid centered on the pixel; Determining a target parameter based on a quantitative relationship between the pixel difference and a preset quantity threshold; Calculating a filtering strength according to the target parameter, the video frame rate of the image to be processed, and the number of bidirectional predictive coding frames, so as to perform filtering processing on the image to be processed based on the filtering strength; The step of calculating the filtering strength according to the target parameter, the video frame rate of the image to be processed, and the number of bidirectional predictive coding frames includes: determining a range parameter based on the target parameter; Calculating an initial filtering strength according to a limit value, the number of bidirectional predictive coding frames and the range parameter; determining an adjustment coefficient according to a video frame rate of the image to be processed; The filtering strength is calculated according to the initial filtering strength and the adjustment coefficient.
2. The method according to claim 1, characterized in that For each pixel in the image to be processed, calculating the pixel difference of the pixel in the nine-square grid centered on the pixel includes: For each target pixel in the image to be processed, calculating a first difference of the target pixel in the horizontal direction within a nine-square grid centered on the target pixel, and a second difference of the target pixel in the vertical direction of the nine-square grid; wherein, for a target pixel located at an edge of the image to be processed, if the nine-square grid centered on the target pixel exceeds the pixel unit of the image to be processed, it is regarded as a default value; The pixel difference is calculated according to the first difference and the second difference.
3. The method according to claim 1, characterized in that Determining the target parameter according to the quantitative relationship between the pixel difference and the preset quantity threshold includes: Determining the number of pixels in the image to be processed whose pixel difference is greater than a preset number threshold; If the number of pixels is greater than a set value, setting the target parameter to a fixed value; If the number of pixels is not greater than the set value, the target parameter is calculated according to the number of pixels.
4. The method according to claim 3, characterized in that Before determining the target parameter according to the quantitative relationship between the pixel difference and the preset quantity threshold, the method further includes: The preset quantity threshold is calculated according to the bit depth of the image to be processed.
5. The method according to claim 1, wherein Determining the range parameter according to the target parameter includes: Determining the numerical range to which the numerical value of the target parameter belongs; A corresponding range parameter is determined according to the numerical interval.
6. The method according to claim 1, wherein Determining the adjustment coefficient according to the video frame rate of the image to be processed includes: Reading the video frame rate of the image to be processed; Substitute the video frame rate into an adjustment coefficient calculation formula, and use the output of the adjustment coefficient calculation formula as the adjustment coefficient; wherein the adjustment coefficient calculation formula is used to characterize the positive correlation between the video frame rate and the adjustment coefficient.
7. An image filtering processing system, characterized in that: include: An image acquisition module, used for acquiring an image to be processed; a pixel difference calculation module, configured to calculate, for each pixel in the image to be processed, a pixel difference within a nine-square grid centered on the pixel; a parameter determination module, configured to determine a target parameter based on a quantitative relationship between the pixel difference and a preset quantity threshold; a filtering processing module, configured to calculate a filtering strength according to the target parameter, the video frame rate of the image to be processed, and the number of bidirectionally predictive coding frames, so as to perform filtering processing on the image to be processed based on the filtering strength; Among them, the filtering processing module includes: A filter strength calculation unit is used to determine a range parameter based on the target parameter; calculate an initial filter strength based on a limit value, the number of bidirectional predictive coding frames and the range parameter; determine an adjustment coefficient based on the video frame rate of the image to be processed; and calculate the filter strength based on the initial filter strength and the adjustment coefficient.
8. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which implements the steps of the method according to any one of claims 1 to 6 when executed.
Citation Information
Patent Citations
Video image processing method and display equipment
CN111445427A
Time domain filtering method and device based on video inter-frame difference, equipment and medium
CN120050419A
Method of pre-processing of video information for optimized video encoding
US20190246138A1