Image filtering processing method, system, device and storage medium
By performing filtering block processing on the image, and adjusting the filter weight according to the motion vector modulus length, the performance loss problem caused by time domain filtering is solved, and the encoding efficiency and compression effect of audio and video encoding are improved.
Patent Information
- Application Number
- CN202510812499.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-18
AI Technical Summary
During the audio and video encoding process, time domain filtering processing leads to performance loss problems such that the code stream does not fall but increases.
By dividing the image to be processed into several filter blocks, the motion vector modulus length of each filter block is calculated, and the filter weight value is adjusted according to the motion vector modulus length and the setting threshold value, and the filter intensity is adaptively adjusted to avoid performance losses.
It effectively avoids the performance losses caused by time-domain filtering and improves coding efficiency and compression effect.
Smart Images

Figure CN120355581B_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, device and storage medium. Background Art
[0002] Currently, audio and video encoding involves temporal filtering. This involves temporal filtering of images that are more likely to be referenced in inter-frame coding (note: whether a frame is likely to be referenced is manually determined and known before encoding begins). This reduces the residual error in subsequent frames encoded using that image as a reference, thereby saving bitrate. For example, suppose a two-frame sequence needs to be encoded, with frame A as the first and frame B as the second. During encoding, frame B will be encoded using frame A as a reference. Before encoding, TF filters frame A with a specific filtering strength using frame B, essentially integrating some of the information from frame B into frame A. In the subsequent encoding, frame B is predictively coded using frame A as a reference. Because frame A already contains some information from frame B, the residual error remaining after predictive coding is reduced, resulting in higher compression efficiency in the subsequent transform, quantization, and entropy coding, thus saving bitrate.
[0003] However, during the time-domain filtering process, performance loss often occurs, that is, the bit rate increases instead of decreases, which is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0004] 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.
[0005] To solve the above technical problems, this application provides an image filtering processing method, the specific technical solutions are as follows:
[0006] Get the image to be processed;
[0007] Dividing the image to be processed into a plurality of filter blocks;
[0008] Calculating the motion vector modulus of each filter block;
[0009] If the motion vector modulus is greater than a set threshold, limiting the weight value according to the motion vector modulus and the set threshold;
[0010] If the motion vector modulus is not greater than the set threshold, setting the weight value according to a preset value;
[0011] A filtering operation is performed on the image to be processed based on the weight value.
[0012] Optionally, dividing the image to be processed into a plurality of filter blocks includes:
[0013] Adjusting the set image block size according to the resolution and image coding standard of the image to be processed to obtain filter block parameters;
[0014] The image to be processed is divided into a plurality of filter blocks using the filter block parameters.
[0015] Optionally, after dividing the image to be processed into a plurality of filter blocks, the method further includes:
[0016] Performing motion estimation on the filter block to determine an optimal motion vector;
[0017] Motion compensation is performed on the filter block based on the optimal motion vector to obtain a residual block; the residual block is used to replace the filter block to perform the step of calculating the motion vector modulus of each filter block.
[0018] Optionally, performing motion estimation on the filter block to determine the optimal motion vector includes:
[0019] Setting a reference block in the filter block;
[0020] Setting a search range centered on the reference block; wherein the search range is positively correlated with the intensity of motion of the image to be processed;
[0021] Within the search range, a set block matching algorithm is used to search for candidate blocks whose matching error is less than a set value;
[0022] Calculating a matching error based on the candidate blocks;
[0023] The displacement vector corresponding to the candidate block with the smallest matching error is taken as the optimal motion vector.
[0024] Optionally, performing motion compensation on the filter block based on the optimal motion vector to obtain a residual block includes:
[0025] Determine a corresponding matching block according to the optimal motion vector, and use the matching block as a prediction block for the current coding block;
[0026] Subtract the pixel value of the corresponding filter block from the pixel value of the prediction block to obtain a residual block.
[0027] Optionally, calculating the motion vector modulus of each filter block includes:
[0028] Determine the horizontal component according to the number of pixels that the filter block moves in the horizontal direction within a unit frame in a time series, and determine the vertical component according to the number of pixels that the filter block moves in the vertical direction;
[0029] The motion vector modulus of the filter block is calculated according to the horizontal direction component and the vertical direction component; the motion vector modulus is used to represent the intensity of the motion of the filter block between adjacent frames.
[0030] Optionally, if the motion vector modulus is greater than a set threshold, before limiting the weight value according to the motion vector modulus and the set threshold, the method further includes:
[0031] The set threshold is calculated according to the width and height of the image to be processed and a set coefficient.
[0032] The present application also provides an image filtering processing system, comprising:
[0033] An image acquisition module, used for acquiring an image to be processed;
[0034] An image division module, configured to divide the image to be processed into a plurality of filter blocks;
[0035] A module for calculating the module length, configured to calculate the module length of the motion vector of each filter block;
[0036] a weight value calculation module configured to, if the motion vector modulus is greater than a set threshold, limit the weight value according to the motion vector modulus and the set threshold; and, if the motion vector modulus is not greater than the set threshold, set the weight value according to a preset value;
[0037] An image filtering processing module is used to perform a filtering operation on the image to be processed based on the weight value.
[0038] 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.
[0039] 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.
[0040] The present application provides an image filtering processing method, comprising: acquiring an image to be processed; dividing the image to be processed into a plurality of filter blocks; calculating the motion vector modulus of each filter block; if the motion vector modulus is greater than a set threshold, limiting a weight value according to the motion vector modulus and the set threshold; if the motion vector modulus is not greater than the set threshold, setting the weight value according to a preset value; and performing a filtering operation on the image to be processed based on the weight value.
[0041] This application divides the processed image into several filter blocks, which facilitates the rapid calculation of the motion vector modulus of the filter block, thereby setting the filter weight based on the motion vector modulus. When the motion vector modulus is large, the filter weight can be adaptively reduced. When the motion vector modulus is small, the weight value is kept stable through the preset value, avoiding the performance loss caused by time domain filtering.
[0042] 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
[0043] 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.
[0044] Figure 1 A flowchart of an image filtering processing method provided in an embodiment of the present application;
[0045] Figure 2 A flowchart of another image filtering processing method provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of the structure of an image filtering processing system provided in an embodiment of the present application;
[0047] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] 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.
[0049] The object information involved in this application, namely the image to be processed, including but not limited to the object device information, the object personal information, etc., and the 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.
[0050] See also Figure 1 , Figure 1This is a flowchart of an image filtering processing method provided in an embodiment of the present application, the method comprising:
[0051] S101: Acquire an image to be processed;
[0052] S102: Divide the image to be processed into a number of filter blocks;
[0053] S103: Calculating the motion vector modulus of each filter block;
[0054] S104: If the motion vector modulus is greater than a set threshold, limiting the weight value according to the motion vector modulus and the set threshold;
[0055] S105: If the motion vector modulus is not greater than the set threshold, setting the weight value according to a preset value;
[0056] S106: Perform a filtering operation on the image to be processed based on the weight value.
[0057] 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.
[0058] The image to be processed is then divided into a plurality of filter blocks. Before the division, the parameters of the filter blocks can be determined, and the division is performed according to the parameters. It should be noted that, in order to improve processing efficiency, the sizes of the filter blocks are usually kept consistent. In other embodiments of the present application, it is not ruled out that the filter blocks obtained by the division have different sizes, which does not affect the technical effects produced by the present application.
[0059] In one feasible implementation, the set image block size can be adjusted based on the resolution and image coding standard of the image to be processed to obtain filter block parameters, and the image to be processed can then be divided into a plurality of filter blocks using the filter block parameters. The set image block size can be pre-set by those skilled in the art and is not specifically limited herein.
[0060] When adjusting the image block size, consider the resolution of the image being processed. For high-resolution images, a relatively large block size is generally recommended. For example, for 4K ultra-high-definition images (3840×2160 pixels), consider using filter blocks of 64×64 pixels or larger. Because high-resolution images contain a wealth of detailed information, larger filter blocks can capture more relevant content, helping to process overall texture and structure.
[0061] The image block size can also be adjusted based on the complexity of the image being processed. If the image content is complex, such as containing many fine textures (such as fine patterns or leaf details), the block size may need to be reduced appropriately. For example, for a painting image containing a large number of intricate brushstrokes, using a 16×16 pixel filter block can better accommodate these fine details. For relatively simple images, such as large areas of monochrome backgrounds or images with simple geometric shapes, a larger filter block size, such as 32×32 pixels, can be used.
[0062] If used for specific image or video coding standards (such as MPEG-4, H.264 / AVC, H.265 / HEVC, AVS, etc.), the filter block size requirements must be followed. For example, in the H.264 / AVC standard, the basic macroblock size is 16×16 pixels, which can also be divided into smaller filter blocks (such as 8×8 or 4×4 pixels) for different processing.
[0063] The motion vector modulus of the filter block can then be calculated. This involves determining the horizontal component based on the number of pixels the filter block moves horizontally within a unit frame, and determining the vertical component based on the number of pixels the filter block moves vertically. The motion vector modulus is used to characterize the intensity of the filter block's motion between adjacent frames.
[0064] In other embodiments of the present application, the horizontal direction component and the vertical direction component may also be the number of pixels moved from the current frame to a reference frame.
[0065] After determining the motion vector modulus, the weight value in the filtering process can be determined. Specifically, the motion vector needs to be compared with a set threshold. There is no limitation on how to determine the set threshold. In a feasible implementation, the set threshold can be calculated based on the width and height of the image to be processed and a set coefficient. For example:
[0066] thr = 0.1*sqrt(width*width+height*height);
[0067] Where thr is the set threshold, width and height are the width and height of the image to be processed respectively, and 0.1 is the set coefficient.
[0068] At this time, if the motion vector modulus is greater than a set threshold, the weight value is limited according to the motion vector modulus and the set threshold. If the motion vector modulus is not greater than the set threshold, the weight value is set according to a preset value.
[0069] There is no limitation on how to limit the weight value. For example, when the threshold is set to be greater than 1, the weight value can be calculated based on the quotient of the motion vector modulus and the set threshold, thereby limiting the weight value.
[0070] Meanwhile, there is no limitation on the preset value, which can be set by those skilled in the art.
[0071] After the weight values are determined, subsequent filtering operations may be performed based on the weight values.
[0072] The embodiment of the present application divides the processed image into several filter blocks, which facilitates the rapid calculation of the motion vector modulus of the filter block, thereby setting the filter weight based on the motion vector modulus. When the motion vector modulus is large, the filter weight can be adaptively reduced. When the motion vector modulus is small, the weight value is kept stable through the preset value, thereby avoiding the performance loss caused by time domain filtering.
[0073] In a feasible implementation, after the image to be processed is divided into a number of filter blocks, motion estimation and motion compensation may be performed in sequence. The specific process is as follows:
[0074] The first step is to perform motion estimation on the filter block to determine the optimal motion vector;
[0075] The second step is to perform motion compensation on the filter block based on the optimal motion vector to obtain a residual block; the residual block is used to replace the filter block to perform the step of calculating the motion vector module length of each filter block.
[0076] The complete implementation process can be found in Figure 2 , Figure 2 This is a flowchart of another image filtering processing method provided in an embodiment of the present application. The specific process is as follows:
[0077] S201: Acquire an image to be processed;
[0078] S202: Divide the image to be processed into a number of filter blocks;
[0079] S203: Perform motion estimation on the filter block to determine an optimal motion vector;
[0080] S204: performing motion compensation on the filter block based on the optimal motion vector to obtain a residual block;
[0081] S205: Calculating the motion vector modulus of each residual block;
[0082] S206: If the motion vector modulus is greater than a set threshold, limit the weight value according to the motion vector modulus and the set threshold;
[0083] S207: If the motion vector modulus is not greater than the set threshold, setting the weight value according to a preset value;
[0084] S208: Perform a filtering operation on the image to be processed based on the weight value.
[0085] The following steps may be included in the motion estimation process:
[0086] The first step is to set a reference block in the filter block;
[0087] Step 2: setting a search range centered on the reference block; wherein the search range is positively correlated with the intensity of motion of the image to be processed;
[0088] Step 3: within the search range, a set block matching algorithm is used to search for candidate blocks whose matching error is less than a set value;
[0089] Step 4: Calculate the matching error based on the candidate blocks;
[0090] Step 5: The displacement vector corresponding to the candidate block with the smallest matching error is used as the optimal motion vector.
[0091] First, a reference block is set, and then a search area is set centered around the reference block. The size of the search area can be determined based on factors such as the intensity of the video's motion. For relatively slow-motion video sequences, the search area can be smaller; for fast-motion scenes, the search area needs to be expanded.
[0092] There are no restrictions on the block matching algorithm used. Common block matching algorithms include full search (FS), three-step search (TSS), and diamond search (DS). While full search is computationally complex, it guarantees the optimal matching block. The three-step and diamond search algorithms reduce computational complexity while maintaining a certain level of encoding quality. For example, the three-step search method begins with a coarser step size, gradually narrowing the search range until the block with the smallest matching error is found.
[0093] For each candidate block within the search range whose matching error is less than a set value, the matching error between it and the current encoding block is calculated. Common matching error criteria include the sum of absolute differences (SAD) and mean squared error (MSE).
[0094] Finally, the matching errors of the candidate blocks are compared to find the candidate block that minimizes the matching error. The corresponding displacement vector is the optimal motion vector.
[0095] Thereafter, a corresponding matching block is determined according to the optimal motion vector, and the matching block is used as a prediction block of the current coding block, thereby subtracting pixel values of the corresponding filtering block from pixel values of the prediction block to obtain a residual block.
[0096] Based on the optimal motion vector obtained by motion estimation, the corresponding matching block is determined and used as the prediction block for the current coding block. For example, if the motion vector points to a specific location in the reference frame, a block of the same size as the current coding block is intercepted from that location and used as the prediction block.
[0097] Subtract the pixel values of the original current block from the pixel values of the predicted block to obtain a residual block. This residual block contains the difference information between the current block and the predicted block. Subsequent operations such as transformation, quantization, and entropy coding are performed on the residual block to reduce the amount of encoded data.
[0098] As can be seen, the result of motion estimation (i.e., the optimal motion vector) is a prerequisite for motion compensation. Motion compensation requires the use of the motion vector obtained by motion estimation to obtain a prediction block from the reference frame. Without an accurate motion vector, effective motion compensation is impossible. This embodiment, by applying motion estimation and motion compensation, can leverage the temporal correlation between the processed images to reduce redundant information during the filtering process, thereby improving coding efficiency.
[0099] In a feasible implementation, in order to improve prediction accuracy and encoding quality, the prediction block or the residual block may be filtered, for example, by using bilateral filtering, adaptive loop filtering, etc., to further smooth the boundary between the prediction block and the residual block or reduce noise.
[0100] The following is an exemplary implementation process of this application:
[0101] Step 1: Pass the YUV image into the AVS3 encoder and divide it into 8x8 filter blocks.
[0102] Step 2: Perform motion estimation and motion compensation on the input filter block.
[0103] Step 3: According to the result obtained in step 2, the motion vector modulus MV is calculated.
[0104] Step 4: Determine whether the motion vector modulus MV is greater than the set threshold THR; if so, proceed to step 5; otherwise, set the weight value weight to 1.0 and proceed to step 6.
[0105] The formula for calculating THR is as follows:
[0106] thr = 0.1*sqrt(width*width+height*height);
[0107] Where width and height are the width and height of the YUV image respectively.
[0108] Step 5: Let weight = MV / THR and go to step 6;
[0109] Step 6: Use the calculated weight values to continue executing the remaining filtering steps.
[0110] 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:
[0111] An image acquisition module, used for acquiring an image to be processed;
[0112] An image division module, configured to divide the image to be processed into a plurality of filter blocks;
[0113] A module for calculating the module length, configured to calculate the module length of the motion vector of each filter block;
[0114] a weight value calculation module configured to, if the motion vector modulus is greater than a set threshold, limit the weight value according to the motion vector modulus and the set threshold; and, if the motion vector modulus is not greater than the set threshold, set the weight value according to a preset value;
[0115] An image filtering processing module is used to perform a filtering operation on the image to be processed based on the weight value.
[0116] Based on the above embodiment, as a preferred embodiment, the image segmentation module includes:
[0117] A parameter setting unit, configured to adjust the set image block size according to the resolution of the image to be processed and the image coding standard to obtain filter block parameters;
[0118] An image division unit is configured to divide the image to be processed into a plurality of filter blocks by applying the filter block parameters.
[0119] Based on the above embodiment, as a preferred embodiment, it also includes:
[0120] A motion estimation module, configured to perform motion estimation on the filter block and determine an optimal motion vector;
[0121] A motion compensation module is configured to perform motion compensation on the filter block based on the optimal motion vector to obtain a residual block.
[0122] Based on the above embodiment, as a preferred embodiment, the motion estimation module is a module for performing the following steps:
[0123] Setting a reference block in the filter block;
[0124] Setting a search range centered on the reference block; wherein the search range is positively correlated with the intensity of motion of the image to be processed;
[0125] Within the search range, a set block matching algorithm is used to search for candidate blocks whose matching error is less than a set value;
[0126] Calculating a matching error based on the candidate blocks;
[0127] The displacement vector corresponding to the candidate block with the smallest matching error is taken as the optimal motion vector.
[0128] Based on the above embodiment, as a preferred embodiment, the motion compensation module is a module for performing the following steps:
[0129] Determine a corresponding matching block according to the optimal motion vector, and use the matching block as a prediction block for the current coding block;
[0130] Subtract the pixel value of the corresponding filter block from the pixel value of the prediction block to obtain a residual block.
[0131] Based on the above embodiment, as a preferred embodiment, the motion estimation module is a module for performing the following steps and includes:
[0132] a direction component calculation unit, configured to determine a horizontal direction component according to the number of pixels moved in the horizontal direction of the filter block within a unit frame in a time series, and determine a vertical direction component according to the number of pixels moved in the vertical direction;
[0133] The modulus calculation unit is used to calculate the motion vector modulus of the filter block according to the horizontal component and the vertical component; the motion vector modulus is used to represent the intensity of the motion of the filter block between adjacent frames.
[0134] Based on the above embodiment, as a preferred embodiment, it also includes:
[0135] The threshold calculation module is used to calculate the set threshold according to the width and height of the image to be processed and a set coefficient.
[0136] 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.
[0137] 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.
[0138] The computer-readable storage medium provided in this embodiment includes the above-mentioned method, and the effect is the same as above.
[0139] 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.
[0140] 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.
[0141] 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.
[0142] 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 .
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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; Dividing the image to be processed into a plurality of filter blocks; Performing motion estimation on the filter block to determine an optimal motion vector; Performing motion compensation on the filter block based on the optimal motion vector to obtain a residual block; Calculating the motion vector modulus of each residual block; If the motion vector modulus is greater than a set threshold, limiting the weight value according to the motion vector modulus and the set threshold; If the motion vector modulus is not greater than the set threshold, setting the weight value according to a preset value; performing a filtering operation on the image to be processed based on the weight value; The step of performing motion estimation on the filter block and determining an optimal motion vector includes: Setting a reference block in the filter block; Setting a search range centered on the reference block; wherein the search range is positively correlated with the intensity of motion of the image to be processed; Within the search range, a set block matching algorithm is used to search for candidate blocks whose matching error is less than a set value; Calculating a matching error based on the candidate blocks; The displacement vector corresponding to the candidate block with the smallest matching error is taken as the optimal motion vector.
2. The image filtering processing method according to claim 1, wherein: Dividing the image to be processed into a number of filter blocks comprises: Adjusting the set image block size according to the resolution and image coding standard of the image to be processed to obtain filter block parameters; The image to be processed is divided into a plurality of filter blocks using the filter block parameters.
3. The image filtering processing method according to claim 1, wherein: Performing motion compensation on the filter block based on the optimal motion vector to obtain a residual block includes: Determine a corresponding matching block according to the optimal motion vector, and use the matching block as a prediction block for the current coding block; Subtract the pixel value of the corresponding filter block from the pixel value of the prediction block to obtain a residual block.
4. The image filtering processing method according to claim 1, wherein: Calculating the motion vector modulus of each filter block includes: Determine the horizontal component according to the number of pixels that the filter block moves in the horizontal direction within a unit frame in a time series, and determine the vertical component according to the number of pixels that the filter block moves in the vertical direction; The motion vector modulus of the filter block is calculated according to the horizontal direction component and the vertical direction component; the motion vector modulus is used to represent the intensity of the motion of the filter block between adjacent frames.
5. The image filtering processing method according to claim 1, wherein: If the motion vector modulus is greater than a set threshold, before limiting the weight value according to the motion vector modulus and the set threshold, the method further includes: The set threshold is calculated according to the width and height of the image to be processed and a set coefficient.
6. An image filtering processing system, characterized in that: include: An image acquisition module, used for acquiring an image to be processed; An image division module, configured to divide the image to be processed into a plurality of filter blocks; A motion estimation module, configured to perform motion estimation on the filter block and determine an optimal motion vector; a motion compensation module, configured to perform motion compensation on the filter block based on the optimal motion vector to obtain a residual block; A modulus calculation module, configured to calculate the motion vector modulus of each residual block; a weight value calculation module, configured to, if the motion vector modulus is greater than a set threshold, limit the weight value according to the motion vector modulus and the set threshold; If the motion vector modulus is not greater than the set threshold, setting the weight value according to a preset value; An image filtering processing module, configured to perform a filtering operation on the image to be processed based on the weight value; The motion estimation module is a module for performing the following steps: Setting a reference block in the filter block; Setting a search range centered on the reference block; wherein the search range is positively correlated with the intensity of motion of the image to be processed; Within the search range, a set block matching algorithm is used to search for candidate blocks whose matching error is less than a set value; Calculating a matching error based on the candidate blocks; The displacement vector corresponding to the candidate block with the smallest matching error is taken as the optimal motion vector.
7. 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 5 when executing the computer program.
8. 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 5 when executed.
Citation Information
Patent Citations
Time domain filtering method and system
CN119676433A
Method, device, and medium for video processing
US20240214565A1