Image filtering processing method and system, storage medium and electronic equipment
By calculating the difference in image pixels and adjusting the filter intensity by combining video frame rate and bidirectional prediction of coded frames, the performance loss problem caused by time domain filtering is solved, and more efficient image filtering is achieved.
Patent Information
- Application Number
- CN202510820359.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-07-22
- 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 within the nine grid, combining the video frame rate and the number of encoded frames from the two-way predicted coded frames, the filter intensity is dynamically adjusted for filtering.
It effectively avoids performance losses in the time domain filtering process, improves the filtering effect, and improves the stability and efficiency of processing.
Smart Images

Figure CN120355582A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technologies, and particularly relates to an image filtering processing method, system, storage medium, and electronic device. Background Art
[0002] During the audio and video encoding process, time-domain filtering tools are often used to save bitstreams. However, in some scenarios, there will be problems of performance loss, resulting in an increase rather than a decrease in the bitstream. Therefore, how to avoid performance loss during the time-domain filtering process is a technical problem that urgently needs to be solved by 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 during the time-domain filtering process.
[0004] To solve the above technical problems, this application provides an image filtering processing method, and the specific technical solution is as follows:
[0005] Obtain the image to be processed;
[0006] For each pixel in the image to be processed, calculate the pixel difference degree of the pixel within the nine-grid centered on it;
[0007] Determine the target parameter according to the quantity relationship between the pixel difference degree and the preset quantity threshold;
[0008] Calculate the filtering strength according to the target parameter, the video frame rate of the image to be processed, and the number of bi-predictive coded 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 degree of the pixel within the nine-grid centered on it includes:
[0010] For each target pixel in the image to be processed, calculate the first difference degree of the target pixel in the horizontal direction within the nine-grid centered on it, and the second difference degree of the target pixel in the vertical direction within the nine-grid; wherein, for the target pixel located at the edge position in the image to be processed, if there are pixels exceeding the image to be processed in the nine-grid centered on it, they are all regarded as default values;
[0011] Calculate the pixel difference degree according to the first difference degree and the second difference degree.
[0012] Optionally, determining the target parameter according to the quantity relationship between the pixel difference degree and the preset quantity threshold includes:
[0013] Determine the number of pixels in the image to be processed whose pixel difference degree is greater than a preset quantity threshold;
[0014] If the number of pixels is greater than a set value, set the target parameter to a fixed value;
[0015] If the number of pixels is not greater than the set value, calculate the target parameter according to the number of pixels.
[0016] Optionally, before determining the target parameter according to the quantitative relationship between the pixel difference degree and the preset quantity threshold, it further includes:
[0017] Calculate the preset quantity threshold 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 bi-directionally predicted coded frames includes:
[0019] Determine a range parameter according to the target parameter;
[0020] Calculate an initial filtering strength according to a limit value, the number of bi-directionally predicted coded frames, and the range parameter;
[0021] Determine an adjustment coefficient according to the video frame rate of the image to be processed;
[0022] Calculate the filtering strength according to the initial filtering strength and the adjustment coefficient.
[0023] Optionally, determining a range parameter according to the target parameter includes:
[0024] Determine the numerical interval to which the numerical value of the target parameter belongs;
[0025] Determine the corresponding range parameter according to the numerical interval.
[0026] Optionally, determining an adjustment coefficient according to the video frame rate of the image to be processed includes:
[0027] Read 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] This application also provides an image filtering processing system, including:
[0030] An image acquisition module, configured to acquire an image to be processed;
[0031] A pixel difference degree calculation module, configured to calculate, for each pixel in the to-be-processed image, the pixel difference degree of the pixel within a nine-grid centered on the pixel;
[0032] A parameter determination module, configured to determine a target parameter according to the quantitative relationship between the pixel difference degree and a preset quantity threshold;
[0033] A filtering processing module, configured to calculate a filtering intensity according to the target parameter, the video frame rate of the to-be-processed image, and the number of bi-directionally predicted coding frames, so as to perform filtering processing on the to-be-processed image based on the filtering intensity.
[0034] This application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described above are implemented.
[0035] This application also provides an electronic device, including a memory and a processor. A computer program is stored in the memory. When the processor calls the computer program in the memory, the steps of the method described above are implemented.
[0036] This application provides an image filtering processing method, including: obtaining a to-be-processed image; calculating, for each pixel in the to-be-processed image, the pixel difference degree of the pixel within a nine-grid centered on the pixel; determining a target parameter according to the quantitative relationship between the pixel difference degree and a preset quantity threshold; calculating a filtering intensity according to the target parameter, the video frame rate of the to-be-processed image, and the number of bi-directionally predicted coding frames, so as to perform filtering processing on the to-be-processed image based on the filtering intensity.
[0037] This application processes a to-be-processed image, calculates the pixel difference degree between each pixel point and the pixels within its surrounding nine-grid, and thus calculates a target parameter according to the pixel difference degree. Thereafter, comprehensively considering the target parameter, the video frame rate of the to-be-processed image, and the number of bi-directionally predicted coding frames, a filtering intensity is calculated, so as to filter the to-be-processed image. By adjusting the filtering intensity through the pixel difference degree and combining the video frame rate and the number of bi-directionally predicted coding frames, an appropriate filtering intensity can be calculated more accurately to perform a filtering operation, improving the filtering effect and avoiding performance loss.
[0038] This application also provides an image filtering processing system, a computer-readable storage medium, and an electronic device, which have the above beneficial effects and will not be elaborated here. Description of the Drawings
[0039] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained according to the provided accompanying drawings.
[0040] Figure 1 Flowchart of an image filtering processing method provided by an embodiment of the present application;
[0041] Figure 2 Schematic diagram of the pixel difference degree calculation method provided by an embodiment of the present application;
[0042] Figure 3 Schematic diagram of the structure of an image filtering processing system provided by an embodiment of the present application;
[0043] Figure 4 Structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0045] The object information involved in the present application, including but not limited to object device information, object personal information, etc., and data, including but not limited to data for analysis, stored data, displayed data, etc., are all information and data authorized by the object or fully authorized by all parties.
[0046] See Figure 1 , Figure 1 Flowchart of an image filtering processing method provided by an embodiment of the present application. The method includes:
[0047] S101: Obtain the image to be processed;
[0048] S102: For each pixel in the image to be processed, calculate the pixel difference degree of the pixel within the nine-square grid centered on it;
[0049] S103: Determine the target parameter according to the quantitative relationship between the pixel difference degree and the preset quantity threshold;
[0050] S104: Calculate the filtering intensity according to the target parameter, the video frame rate of the image to be processed, and the number of bi-directionally predicted coding frames, so as to perform filtering processing on the image to be processed based on the filtering intensity.
[0051] Here, 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 be sourced from various video sources, and is formed by dividing into several video frames, that is, the image to be processed in this application can be several image frames, or directly obtain video data as the image to be processed.
[0052] After that, calculate the pixel difference degree of each pixel in the image to be processed. For each pixel in the image to be processed, calculate the pixel difference degree of the pixel within the nine-grid centered on it.
[0053] In a feasible implementation manner, for each target pixel in the image to be processed, calculate the first difference degree in the horizontal direction of the target pixel within the nine-grid centered on it, and the second difference degree in the vertical direction of the target pixel within the nine-grid, so as to calculate the pixel difference degree according to the first difference degree and the second difference degree.
[0054] It should be noted that for the target pixels located at the edge positions in the image to be processed, if there are pixel units in the nine-grid centered on them that exceed the image to be processed, they are all regarded as default values. There is no limitation on this default value here, and it can be set to 0.
[0055] See Figure 2 , Figure 2 , which is a schematic diagram of the pixel difference degree calculation method provided by the embodiment of this application, marking the target pixel (x, y) and the nine-grid centered on it. Figure 2 The pixels shown by the rectangular dotted line in are the pixels in the x direction, and the pixels within the oval dotted line are the pixels in the y direction.
[0056] First, calculate the first difference degree 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 coordinates and parentheses, use as pixel coordinates. For example, p[x - 1][y - 1] represents the pixel at (x - 1, y - 1).
[0059] Subsequently, calculate the second difference degree noise_y in the y direction. 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, calculate the pixel difference degree noise according to the first difference degree and the second difference degree:
[0062] noise = abs(noise_x)+abs(noise_y);
[0063] where abs(x) represents taking the average value of x.
[0064] In step S103, it is necessary to determine the target parameter according to the relationship between the pixel difference degree and the preset quantity threshold. Here, there is no limitation on how to determine the preset threshold, which is related to the image parameters of the image to be processed. For example, the preset threshold can be calculated according to the bit depth of the image to be processed.
[0065] An exemplary way to calculate 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] In a feasible way to determine the target parameter, the following steps can be included:
[0069] The first step is to determine the number of pixels in the image to be processed whose pixel difference degree is greater than the preset quantity threshold;
[0070] The second step is to set the target parameter to a fixed value if the number of pixels is greater than the set value;
[0071] The third step is to calculate the target parameter according to the number of pixels if the number of pixels is not greater than the set value.
[0072] Here, there is no limitation on the preset threshold and the fixed value, which can be set by those skilled in the art. When calculating the target parameter according to the number of pixels, it can be set according to the preset target parameter calculation formula.
[0073] The complexity and characteristics of different images vary greatly. By first determining the number of pixels with a pixel difference degree greater than a preset quantity threshold, the setting method of the target parameter can be determined according to the actual content of the image. For complex images (with a large number of pixels having a high pixel difference degree), using a fixed value can ensure the stability and reliability of processing. For simple images (with a small number of pixels having a high pixel difference degree), the target parameter can be flexibly calculated according to specific circumstances to achieve more accurate processing and make the processing process more adaptable to the image content. At the same time, setting different target parameters for different pixel numbers can reduce unnecessary parameter calculations. When the pixel number is greater than the set value, the target parameter is directly set to a fixed value, which can avoid performing complex calculations to dynamically adjust the target parameter according to the pixel number. When processing complex images, a large amount of computing resources and time can be saved, and the processing efficiency can be improved. For example, in real-time video processing, performing complex dynamic calculations for each frame of the image may affect the processing speed, and this strategy can avoid excessive calculations for complex frames while ensuring the processing effect.
[0074] In addition, if the target parameter is dynamically calculated according to the pixel number in all cases, it may lead to a situation where the target parameter fluctuates too much in complex images, thus affecting the stability of the processing effect. By setting a preset quantity threshold and using a fixed value when the pixel number exceeds the preset quantity threshold, this situation can be effectively avoided, making the processing process more stable and reliable.
[0075] After that, it is necessary to calculate the filtering intensity, and the video frame rate and the number of bidirectionally predicted coding frames of the image to be processed need to be referred to. The number of bidirectionally predicted coding frames mainly refers to the B frames in a GOP.
[0076] GOP is the abbreviation of "Group of Pictures", which means "picture group". In video coding, the video is divided into groups of pictures, and each group 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). The key frame is a complete image that can be directly decoded, while the predicted frame needs to refer to the previous frames for decoding. The length of the GOP (i.e., the number of frames contained in a GOP) affects the video compression efficiency and playback quality.
[0077] A B-frame (Bidirectionally Predictive Coded Picture) is a bidirectionally predictive coded frame, which means that the content of the current frame is calculated by comparing the frames before and after it. For example, a B-frame can be imagined as a photo, which records the differences between this photo and the photos before and after it. Since a B-frame only records the changed parts, its data volume is usually small and the compression efficiency is very high. However, when decoding a B-frame, it is necessary to refer to the frames before and after at the same time, and the decoding process is relatively complex.
[0078] In a feasible implementation, the process of calculating the filtering strength can be as follows:
[0079] First step, determine the range parameter according to the target parameter;
[0080] Second step, calculate the initial filtering strength according to the limit value, the number of bidirectionally predictive coded frames, and the range parameter;
[0081] Third step, determine the adjustment coefficient according to the video frame rate of the image to be processed;
[0082] Fourth step, calculate the filtering strength according to the initial filtering strength and the adjustment coefficient.
[0083] In the first step, the numerical range to which the value of the target parameter belongs can be determined first, so as to determine the corresponding range parameter according to the numerical range, that is, the range parameters corresponding to different target parameter values are different. 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 preset by those skilled in the art.
[0084] In the third step, the video frame rate of the image to be processed can be read, so as to substitute the video frame rate into the adjustment coefficient calculation formula, and the output of the adjustment coefficient calculation formula is used as the adjustment coefficient. This adjustment coefficient calculation formula is used to represent the positive correlation between the video frame rate and the adjustment coefficient.
[0085] Determine the range parameter based on the target parameter, making the calculation of the filtering strength have clear directionality and pertinence, and ensuring that the filtering operation meets specific processing objectives. Applying the number of bi-directionally predicted coding frames to the calculation process of the initial filtering strength is because the correlation and prediction relationship between different frames in the video coding process will affect the filtering effect. A large number of bi-directionally predicted coding frames indicates strong correlation in the time series of the video content, and the filtering strength needs to be adjusted appropriately to take into account this spatio-temporal characteristic and avoid over-filtering or under-filtering. Combining the video frame rate to determine the adjustment coefficient fully considers the time characteristics of the video. Videos with different frame rates have different amounts of information per unit time. A higher frame rate means that the picture changes more delicately and frequently, and the filtering strength needs to be adjusted accordingly to adapt to this dynamic characteristic and prevent adverse phenomena such as frame freezing or over-smoothing after filtering.
[0086] Calculate the initial filtering strength by combining the limit value and the range parameter, which can limit the filtering strength within a reasonable range and perform precise calculations based on information such as the actual pixel value range, avoiding negative impacts on subsequent image processing caused by too large or too small initial filtering strength. In other words, the introduction of the limit value can prevent extreme values beyond the system's processing capacity from appearing in the calculation process of the filtering strength and ensure the stable operation of the entire processing system.
[0087] During the process of calculating the filtering strength, further precisely adjust the initial filtering strength through the adjustment coefficient, making the filtering strength more in line with the actual needs of the video. Adopting a step-by-step and gradually refined calculation method helps to achieve a higher-precision filtering operation and improve the processing quality of the image to be processed.
[0088] The embodiments of this application process the image to be processed, calculate the pixel difference degree between each pixel point and the pixels in its surrounding nine-grid, and then calculate the target parameter based on the pixel difference degree. Thereafter, comprehensively consider the target parameter, the video frame rate of the image to be processed, and the number of bi-directionally predicted coding frames to calculate the filtering strength, thereby filtering the image to be processed. Adjusting the filtering strength through the pixel difference degree, combining the video frame rate and the number of bi-directionally predicted coding frames, can calculate a more appropriate filtering strength to perform the filtering operation more accurately, improve the filtering effect, and avoid performance loss.
[0089] The following uses a specific implementation process of this application to exemplarily illustrate an image filtering processing method provided by this application:
[0090] Step 1: Input the image to be processed in YUV format into the encoder.
[0091] Step 2: For each pixel of the image to be processed in YUV format, calculate its pixel difference degree within the nine-grid. The specific steps are as follows:
[0092] Step 1: Calculate the first difference degree 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 degree 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] Step 3: Calculate the pixel difference degree noise. The formula is as follows:
[0097] noise = abs(noise_x)+abs(noise_y);
[0098] Step 3: Count the number of noise greater than the preset quantity threshold thr, denoted as num. The calculation method of the preset quantity threshold thr is as follows:
[0099] thr = 50<<(10 - bit_depth).
[0100] Step 4: If num is greater than 20, then set sigma=-1.0 and go to Step 7; otherwise go to Step 5.
[0101] Step 5: Calculate the sum of the pixel numbers of all pixel difference degrees noise greater than the preset quantity threshold thr, denoted 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] Wherein:
[0109] When the number of B-frames in the GOP is greater than or equal to 15, fs is taken as 1.9; otherwise, it is taken as 1.3;
[0110] The range 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 taken as 0.5;
[0112] When the target parameter sigma is greater than 0.25 and less than 0.5, the range parameter scale is taken as 1.05;
[0113] When the target parameter sigma is greater than 0.5, the range parameter scale is taken as 1.65.
[0114] max_strength is the limit value, taken as 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 filter_strength by the adjustment coefficient 1.3;
[0117] When the video frame rate is greater than 35 and less than 45, multiply filter_strength by the adjustment coefficient 1.5;
[0118] When the video frame rate is greater than 45, multiply filter_strength by the adjustment coefficient 1.7.
[0119] Output the calculated filtering strength and perform subsequent filtering steps.
[0120] It has been verified that by using the pixel difference degree to judge and adjust the filtering strength, and combining information such as the frame rate and GOP structure, it is possible to more accurately select an appropriate filtering strength to perform subsequent filtering steps, making the filtering effect more accurate.
[0121] See Figure 3 , Figure 3 which is a schematic structural diagram of an image filtering processing system provided by an embodiment of the present application. The system includes:
[0122] An image acquisition module for acquiring an image to be processed;
[0123] A pixel difference degree calculation module, configured to calculate, for each pixel in the image to be processed, the pixel difference degree of the pixel within a nine-grid centered on the pixel;
[0124] A parameter determination module, configured to determine a target parameter according to the quantitative relationship between the pixel difference degree and a preset quantity threshold;
[0125] A filtering processing module, configured to calculate a filtering intensity according to the target parameter, the video frame rate of the image to be processed, and the number of bi-directionally predicted coding frames, so as to perform filtering processing on the image to be processed based on the filtering intensity.
[0126] Based on the above embodiments, as a preferred embodiment, the pixel difference degree calculation module is a module for performing the following steps:
[0127] For each target pixel in the image to be processed, calculate a first difference degree of the target pixel in the horizontal direction within a nine-grid centered on the target pixel, and a second difference degree of the target pixel in the vertical direction within the nine-grid; wherein, for a target pixel located at an edge position in the image to be processed, if there are pixels exceeding the image to be processed in the nine-grid centered on the target pixel, all are regarded as default values;
[0128] Calculate the pixel difference degree according to the first difference degree and the second difference degree.
[0129] Based on the above embodiments, as a preferred embodiment, the parameter determination module includes:
[0130] A pixel quantity calculation unit, configured to determine the number of pixels in the image to be processed whose pixel difference degree is greater than a preset quantity threshold;
[0131] A parameter determination unit, configured to, if the number of pixels is greater than a set value, set the target parameter to a fixed value; if the number of pixels is not greater than the set value, calculate the target parameter according to the number of pixels.
[0132] Based on the above embodiments, as a preferred embodiment, further includes:
[0133] A threshold calculation module, configured to calculate the preset quantity threshold according to the bit depth of the image to be processed.
[0134] Based on the above embodiments, as a preferred embodiment, the filtering processing module includes:
[0135] A filtering intensity calculation unit, configured to determine a range parameter according to the target parameter; calculate an initial filtering intensity according to a limit value, the number of bi-directionally predicted coding frames, and the range parameter; determine an adjustment coefficient according to the video frame rate of the image to be processed; calculate the filtering intensity according to the initial filtering intensity and the adjustment coefficient.
[0136] Based on the above embodiments, as a preferred embodiment, the filtering intensity calculation unit includes:
[0137] A range parameter determination subunit, configured to determine the numerical range to which the numerical value of the target parameter belongs; and determine a corresponding range parameter according to the numerical range.
[0138] Based on the above embodiments, as a preferred embodiment, the filtering intensity calculation unit includes:
[0139] An adjustment coefficient determination subunit, configured to read 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 represent the positive correlation between the video frame rate and the adjustment coefficient.
[0140] This application also provides an embodiment corresponding to a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method described in the above method embodiment are implemented.
[0141] It can be understood that if the method in the above embodiments 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 such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The foregoing storage media include: 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.
[0142] The computer-readable storage medium provided in this embodiment includes the method mentioned above, and the effect is the same.
[0143] This application also provides an electronic device. Refer to Figure 4 , a structural diagram of an electronic device provided in an embodiment of this application, as shown in Figure 4 and may include a processor 1410 and a memory 1420.
[0144] Among them, 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 used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 1410 may be integrated with a GPU (Graphics Processing Unit), and the GPU 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, and the AI processor is used to process computational operations related to machine learning.
[0145] The memory 1420 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 1420 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 1420 is at least used to store the following computer program 1421. After the computer program is loaded and executed by the processor 1410, it can implement the relevant steps in the method executed by the electronic device side disclosed in any of the foregoing 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 transient 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] Of course, Figure 4 The structure of the shown electronic device does not constitute a limitation on the electronic device in the embodiments of the present application. In practical applications, the electronic device may include more or fewer components than Figure 4 shown, or combine certain components.
[0148] The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the system provided in the embodiment, since it corresponds to the method provided in the embodiment, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.
[0149] In this text, specific examples are used to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.
[0150] It should also be noted that in this specification, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the said element.
Claims
1. An image filtering processing method, characterized in that, Including: Obtain the image to be processed; For each pixel in the image to be processed, calculate the pixel difference degree of the pixel within the nine-grid centered on it; Determine the target parameter according to the quantitative relationship between the pixel difference degree and the preset quantity threshold; Calculate the filtering intensity according to the target parameter, the video frame rate of the image to be processed, and the number of bi-predictive coding frames, so as to perform filtering processing on the image to be processed based on the filtering intensity.
2. The method according to claim 1, wherein For each pixel in the image to be processed, calculating the pixel difference degree of the pixel within the nine-grid centered on it includes: For each target pixel in the image to be processed, calculate the first difference degree of the target pixel in the horizontal direction within the nine-grid centered on it, and the second difference degree of the target pixel in the vertical direction within the nine-grid; wherein, for the target pixels located at the edge positions in the image to be processed, if there are pixel units in the nine-grid centered on them that exceed the image to be processed, they are all regarded as default values; Calculate the pixel difference degree according to the first difference degree and the second difference degree.
3. The method according to claim 1, characterized in that Determining the target parameter according to the quantitative relationship between the pixel difference degree and the preset quantity threshold includes: Determine the number of pixels in the image to be processed whose pixel difference degree is greater than the preset quantity threshold; If the number of pixels is greater than the set value, set the target parameter to a fixed value; If the number of pixels is not greater than the set value, calculate the target parameter according to the number of pixels.
4. The method according to claim 3, wherein Before determining the target parameter according to the quantitative relationship between the pixel difference degree and the preset quantity threshold, it further includes: Calculate the preset quantity threshold according to the bit depth of the image to be processed.
5. The method according to claim 1, wherein Calculating the filtering intensity according to the target parameter, the video frame rate of the image to be processed, and the number of bi-predictive coding frames includes: Determine the range parameter according to the target parameter; Calculate the initial filtering intensity according to the limit value, the number of bi-predictive coding frames, and the range parameter; Determine the adjustment coefficient according to the video frame rate of the image to be processed; Calculate the filtering intensity according to the initial filtering intensity and the adjustment coefficient.
6. The method according to claim 5, wherein Determining the range parameter according to the target parameter includes: Determine the numerical interval to which the numerical value of the target parameter belongs; Determine the corresponding range parameter according to the numerical interval.
7. The method according to claim 5, wherein Determining the adjustment coefficient according to the video frame rate of the image to be processed includes: 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 represent the positive correlation between the video frame rate and the adjustment coefficient.
8. An image filtering processing system, characterized in that, Including: An image acquisition module for acquiring the image to be processed; A pixel difference degree calculation module for calculating, for each pixel in the image to be processed, the pixel difference degree of the pixel within the nine-grid centered on it; A parameter determination module for determining the target parameter according to the quantitative relationship between the pixel difference degree and the 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 bi-directionally predicted coding frames, so as to perform filtering processing on the image to be processed based on the filtering strength.
9. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to implement the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Video image processing method and display equipment
CN111445427A
Video processing method and apparatus, electronic device, and computer-readable storage medium
CN112805990A
Image noise reduction method and device, filtering data processing method and device and computer equipment
CN115131229A
Human body thermal infrared image data enhancement method and device, equipment and storage medium
CN117853356A
Time domain filtering method and device based on video inter-frame difference, equipment and medium
CN120050419A