Method and electronic device for removing image ringing noise

By calculating the image grayscale information matrix and the mask matrix to record the ringing noise intensity and performing weighted filtering processing, the problem of ringing noise in image compression coding is solved and the image quality and perception are improved.

CN115034971BActive Publication Date: 2025-09-09HISENSE VISUAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110239396.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-04
Publication Date
2025-09-09
Estimated Expiration
2041-03-04

AI Technical Summary

Technical Problem

In the existing technology, ringing noise generated during the image compression encoding process causes image quality degradation and mosquito noise during video playback, affecting the viewing experience.

Method used

The target area of ​​ringing noise is determined by calculating the grayscale information matrix of the image, and the intensity information of the ringing noise is recorded using a mask matrix. Weighted filtering is then performed to remove the ringing noise.

Benefits of technology

Accurately locate and remove ringing noise in the image, protect the stability of the noise-free part of the image, and improve the restoration quality and appearance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115034971B_ABST
    Figure CN115034971B_ABST
Patent Text Reader

Abstract

The present application provides a method and electronic device for removing image ringing noise. The method can utilize the characteristics of the one-dimensional grayscale value of the ringing noise in the first image, which fluctuates periodically with decreasing amplitude and appears attached to strong edges, to more accurately locate the target area including the ringing noise in the first image. The method can also record the target area according to a mask matrix, and then filter only the target area in the first image according to the instructions of the mask matrix, while retaining other parts that do not include the ringing noise, avoiding damage to the structure and texture information of the first image, thereby more accurately removing the ringing noise in the image and improving the restoration quality and appearance of the processed image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method and electronic device for removing image ringing noise. Background Art

[0002] With the gradual advancement of informatization and digitalization in countries around the world, more and more images and videos need to be stored and transmitted, and since each frame of a high-definition image or video corresponds to a large amount of data, in order to improve the processing efficiency of images and videos, some technologies such as JPEG, MPEG, and H.26X can compress and encode images, and then perform subsequent processing on the compressed image data.

[0003] Due to the Gibbs effect, the existing technology causes truncation of the high-frequency components of the image during image compression encoding. This causes ringing noise to appear at the strong edges between different elements in the processed image, reducing the quality of the restored image and making the restored image appear blurry. The ringing noise also exists in continuous video images, causing mosquito noise during video playback.

[0004] Therefore, how to remove ringing noise in images is a technical problem that needs to be solved urgently in this field. Summary of the Invention

[0005] The present application provides a method and electronic device for removing ringing noise from an image, so as to achieve more accurate positioning detection and effective removal of ringing noise in an image, and also to protect the parts of the image where no ringing noise exists as much as possible to remain stable and unchanged, thereby more accurately removing the ringing noise in the image, and further improving the restoration quality and appearance of the processed image.

[0006] In a first aspect, the present application provides a method for removing ringing noise in an image, comprising: acquiring a first image, wherein the first image includes ringing noise; determining a target area within the first image that includes the ringing noise; and filtering the ringing noise within the target area of ​​the first image to obtain a second image; wherein the filtering is used to remove the ringing noise.

[0007] In an embodiment of the first aspect of the present application, determining the target area including ringing noise in the first image includes: calculating the grayscale information matrix of the first image; determining the target pixel group including ringing noise in the grayscale information matrix, wherein the target pixel group includes a plurality of continuous pixel points in rows or columns, and the change pattern between the target pixel group and other pixel points in the row or column meets preset conditions; and determining the area corresponding to the target pixel group in the first image as the target area.

[0008] In an embodiment of the first aspect of the present application, determining the target pixel group including ringing noise in the grayscale information matrix includes: traversing all pixel points in the grayscale information matrix; for target pixel points greater than a preset threshold among all pixel points, taking multiple continuous pixel points in one direction of the row or column where the target pixel point is located as the pixel group to be judged; when multiple change parameters of the grayscale information of the continuous pixel points in the pixel group to be judged meet the preset conditions, determining the pixel group to be judged as the target pixel group; wherein the change parameters include: the degree of convergence in one direction, the number of cycles, the fluctuation amplitude and the peak span; or, the change parameters include: the edge variance value, the degree of convergence from both sides to the middle direction, the number of cycles, the fluctuation amplitude and the peak span.

[0009] In an embodiment of the first aspect of the present application, after determining the target area including the ringing noise in the first image, the method further includes: calculating the intensity information of the ringing noise in the target area; filtering the ringing noise in the target area of ​​the first image to obtain the second image, including: filtering the ringing noise in the target area of ​​the first image according to the intensity information to obtain the second image.

[0010] In an embodiment of the first aspect of the present application, the calculating the intensity information of the ringing noise in the target area includes: performing weighted processing on multiple change parameters of the pixel group to obtain the intensity information of the ringing noise in the target area.

[0011] In an embodiment of the first aspect of the present application, after obtaining the intensity information of the ringing noise in the target area, it also includes: recording the intensity information of the ringing noise in the target area through a first mask matrix; wherein the elements in the first ringing mask matrix correspond one-to-one to the pixel points of the first image.

[0012] In an embodiment of the first aspect of the present application, after recording the intensity information of the ringing noise in the target area through the ringing mask matrix, it also includes: performing morphological operations on the first mask matrix to obtain a second mask matrix.

[0013] In an embodiment of the first aspect of the present application, the ringing noise in the target area of ​​the first image is filtered according to the intensity information to obtain the second image, including: using the intensity information of each element in the second mask matrix as a weight, performing weighted filtering on the pixel points corresponding to the element in the first image to obtain the second image.

[0014] In an embodiment of the first aspect of the present application, the intensity information of each element in the second mask matrix is ​​used as a weight to perform weighted filtering on the pixel points corresponding to the element in the first image to obtain the second image, including: filtering the first image to obtain a third image; and calculating the second image r by the formula r=p*α+q*(1-α), wherein p is the third image, q is the first image, and α is the second mask matrix.

[0015] In an embodiment of the first aspect of the present application, filtering the first image to obtain a third image includes: filtering the first image through a guided filter to obtain the third image; wherein, when the guided filter filters the target area, the filtering intensity is related to the grayscale information in the target area.

[0016] A second aspect of the present application provides a device for removing image ringing noise, which can be used to perform the method for removing image ringing noise provided in the first aspect of the present application. The device includes: a ringing noise detection module, used to determine a target area including ringing noise in a first image, and calculate the intensity information of the ringing noise in the target area; a ringing noise removal module, used to filter the ringing noise in the target area of ​​the first image based on the intensity information to obtain a second image.

[0017] In an embodiment of the second aspect of the present application, the ringing noise detection module is specifically used to calculate the grayscale information matrix of the first image; determine the target pixel group including ringing noise in the grayscale information matrix, wherein the target pixel group includes multiple continuous pixel points in rows or columns, and the change pattern between the target pixel group and other pixel points in the row or column where it is located meets preset conditions; determine that the area corresponding to the target pixel group in the first image is the target area.

[0018] In an embodiment of the second aspect of the present application, the ringing noise detection module is specifically used to traverse all pixel points in the grayscale information matrix; for the target pixel points among all pixel points that are greater than a preset threshold, multiple continuous pixel points in one direction of the row or column where the target pixel point is located are respectively used as the pixel group to be judged; when multiple change parameters of the grayscale information of the continuous pixel points in the pixel group to be judged meet the preset conditions, the pixel group to be judged is determined to be the target pixel group; wherein the change parameters include: the degree of convergence in one direction, the number of cycles, the fluctuation amplitude and the peak span; or, the change parameters include: the edge variance value, the degree of convergence from both sides to the middle direction, the number of cycles, the fluctuation amplitude and the peak span.

[0019] In an embodiment of the second aspect of the present application, the ringing noise detection module is further configured to calculate intensity information of the ringing noise in the target area; filtering the ringing noise in the target area of ​​the first image to obtain the second image includes: filtering the ringing noise in the target area of ​​the first image according to the intensity information to obtain the second image

[0020] In an embodiment of the second aspect of the present application, the ringing noise detection module is specifically configured to perform weighted processing on multiple change parameters of the pixel group to obtain intensity information of the ringing noise in the target area.

[0021] In an embodiment of the second aspect of the present application, the ringing noise detection module is also used to, after obtaining the intensity information of the ringing noise in the target area, also include: recording the intensity information of the ringing noise in the target area through a first mask matrix; wherein the elements in the first ringing mask matrix correspond one-to-one to the pixel points of the first image.

[0022] In an embodiment of the second aspect of the present application, the ringing noise detection module is further used to perform morphological operations on the first mask matrix to obtain a second mask matrix.

[0023] In an embodiment of the second aspect of the present application, the ringing noise removal module is specifically used to perform weighted filtering on the pixel points corresponding to the element in the first image based on the intensity information of each element in the second mask matrix as a weight to obtain the second image.

[0024] In an embodiment of the second aspect of the present application, the ringing noise removal module is specifically used to filter the first image to obtain a third image; the second image r is calculated by the formula r=p*α+q*(1-α), where p is the third image, q is the first image, and α is the second mask matrix.

[0025] In an embodiment of the second aspect of the present application, the ringing noise removal module is specifically used to filter the first image through a guided filter to obtain the third image; wherein, when the guided filter filters the target area, the filtering intensity is related to the grayscale information in the target area.

[0026] A third aspect of the present application provides an electronic device comprising a processor and a memory; the memory stores instructions, and when the processor runs the instructions, the processor executes the method as described in any one of the first aspects of the present application.

[0027] A fourth aspect of the present application provides a storage medium storing a computer program. When the computer program is run on a computer, the computer is caused to execute the method as described in any one of the first aspects of the present application.

[0028] In summary, the method for removing image ringing noise provided in the embodiment of the present application can utilize the characteristics of the one-dimensional grayscale value of the ringing noise in the first image that the amplitude fluctuates periodically and decreases and appears dependent on strong edges, so as to more accurately locate the target area including the ringing noise in the first image, and can also record the target area according to the mask matrix, and then only filter the target area in the first image according to the instruction of the mask matrix, while retaining other parts that do not include the ringing noise, avoiding damage to the first image structure and texture information, thereby protecting the part of the first image where no ringing noise exists as much as possible to remain stable and unchanged, and thus more accurately removing the ringing noise in the image while maximally protecting the texture and edge information of the original image, thereby improving the restoration quality and appearance of the processed image. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] 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 only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0030] Figure 1 This is a flow chart of an embodiment of a method for removing image ringing noise provided by the present application;

[0031] Figure 2 A schematic diagram of an embodiment of the first image provided in this application;

[0032] Figure 3 A grayscale information change curve diagram of the ringing noise provided in this application;

[0033] Figure 4 Another grayscale information change curve diagram of the ringing noise provided by this application;

[0034] Figure 5 This is a flow chart of an embodiment of a method for removing image ringing noise provided by the present application;

[0035] Figure 6 A schematic diagram of the first mask matrix diagram provided in this application;

[0036] Figure 7 A schematic diagram of a second mask matrix diagram provided in this application;

[0037] Figure 8A schematic diagram of the second image provided in this application;

[0038] Figure 9 A schematic diagram of the structure of a device for removing image ringing noise provided in this application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only 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.

[0040] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the numbers used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0041] The technical solution of the present application is described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. For example, Figure 1 This is a flow chart of an embodiment of a method for removing image ringing noise provided by the present application. Figure 1 The execution subject of the method shown can be a computer, workstation, server or other electronic device used by the user to process the image, and can remove the ringing noise from the image. Specifically, the method for removing the ringing noise from the image provided by this embodiment includes:

[0042] S100: Acquire a first image from which ringing noise is to be removed. The electronic device serving as the execution subject first acquires a first image, which may be an image including ringing noise.

[0043] In one embodiment, the electronic device may obtain an image input by a user as the first image, or the electronic device may obtain an image from a storage device, the Internet, or other storage devices as the first image according to preset conditions; or, when processing a video image including mosquito noise, the electronic device may use each frame of the video image as the first image in sequence, remove the ringing noise in each frame of the video image, and thereby remove the mosquito noise in the video image.

[0044] As an example, Figure 2 A schematic diagram of the first embodiment of the present application is provided. Figure 2 As can be seen in the first image shown, due to the existence of boundaries between different contents around the two Chinese characters "News" and around the letters "i" and "e", the first image after compression and reconstruction includes relatively obvious ringing noise at the above boundaries, making the image blurred and seriously affecting the viewing experience.

[0045] S101: Determine a target area in a first image that includes ringing noise. The area in the first image that includes ringing noise is recorded as the target area. After the electronic device acquires the first image in S100, it then determines a specific location of the ringing noise in the first image in S101.

[0046] In one specific implementation, due to the truncation of high-frequency components and the Gibbs effect during image compression, the grayscale waveform corresponding to ringing noise in the image exhibits periodic fluctuations of decreasing amplitude, appearing along strong edges between different image contents. Therefore, the present application can identify the target region where the ringing noise is located based on the grayscale value changes between consecutive pixels in the first image.

[0047] As an example, Figure 3 A grayscale information change curve diagram of the ringing noise provided by the present application, which shows the grayscale information corresponding to each pixel value on a row or column of continuous pixels in the first image. Figure 3 The figure shows the grayscale values ​​of consecutive pixels numbered 60-130 in a row or column. It can be seen that near the pixel numbered 110, the grayscale values ​​of the pixels on its left and right have undergone a relatively obvious change. The grayscale values ​​of the consecutive pixels on the left of the pixel numbered 110 are around 100, while the grayscale values ​​of the consecutive pixels on the right of the pixel have reached around 200. In addition, the fluctuation trend towards the right is more gentle, and the grayscale values ​​can converge to a relatively stable value in the direction of gentle fluctuation. Figure 3 The variation pattern of the ringing noise on consecutive pixels shown in FIG. 1 can be used for the ringing noise between a strong edge and a flat area in the first image, for example, Figure 2In the first image shown, between the Chinese character "新" and the background area on its left, there is this type of ringing noise. In the embodiments of this application, this ringing noise is denoted as a first type of ringing noise. The manifestation of this first type of ringing noise can be summarized as: periodic amplitude decreasing fluctuations and having strong convergence. Strong convergence means that the gray values of consecutive pixels at the ringing noise can converge to a stable value after several fluctuations in the decreasing direction.

[0048] Figure 4 This is another gray information change curve graph of the ringing noise provided by this application. Among them, it also shows the gray information corresponding to each pixel value on a certain row or a certain column of consecutive pixels on a row of pixels. It can be seen that there are ringing noises near label 20 and label 30 respectively, and the two ringing noises fluctuate towards each other. Then, between the two pixel value peaks at label 20 and 30, the gray value fluctuates more smoothly from both sides to the middle. However, because the distance between the pixel points corresponding to the two ringing noises is relatively close, the gray values of the pixels between them do not converge to a stable value. As Figure 4 shown by the change rule of the ringing noise on consecutive pixels, for the ringing noise between strong edges in the first image, for example, as Figure 2 shown in the first image, between the Chinese character "新" and the Chinese character "闻", there are strong edges between each of the two Chinese characters and the background. Then, between the strong edges of the two Chinese characters, there is this type of noise. In the embodiments of this application, this ringing noise is denoted as a second type of ringing noise. The manifestation of this second type of ringing noise can be summarized as: two first type of ringings fluctuate towards each other, that is, the peaks start to periodically decrease in amplitude from both sides to the middle at the same time, and the peak in the middle of the two strong edges does not have a long enough flat area to converge to a stable value.

[0049] In one embodiment, in order to determine the target area within the first image, including the above-mentioned type I ringing noise and type II ringing noise, the electronic device serving as the executing body first converts the first image into a grayscale space (or called brightness space, grayscale channel, brightness channel, etc.) after acquiring the first image. For example, assuming that the acquired first image is an image of a three-dimensional color domain, the first image with a resolution of a*b includes three a*b matrices, and the value of the same element position on these three matrices is used to represent the value of the three color domains corresponding to the element position on the first image. Subsequently, a color domain transformation calculation is performed based on the three matrices of the above-mentioned three-dimensional color domain to obtain the a*b grayscale information matrix of the first image. In the grayscale information matrix, the value of each element corresponds to the grayscale value of the pixel point at the same position in the first image. Subsequently, with each row and each column of the grayscale information matrix as a unit, a target pixel group on each row or each column is determined, wherein the target pixel group includes multiple pixel points, and the changes of multiple consecutive pixel points in the target pixel group meet the preset conditions, and the preset conditions may be satisfied as follows: Figure 3 or Figure 4 The changing pattern of multiple consecutive pixels in the circular frame is obtained. Finally, the target pixel group in the grayscale information matrix is ​​matched with the pixels of the first image. Within the first image, the pixels with the same position within the grayscale information matrix as the target pixel group are determined as the target region of the first image. It is understood that there may be one or more target regions within the first image, and different target regions may be adjacent or overlap.

[0050] Furthermore, in one embodiment, Figure 5 A flow chart of an embodiment of a method for removing image ringing noise provided in the present application shows an implementation method for determining the target area including the above-mentioned type I ringing noise and type II ringing noise in the first image according to the grayscale information matrix after calculating the grayscale information matrix.

[0051] Specifically, if Figure 5 As shown, when the electronic device receives the first image including ringing noise input by the user, it calculates the grayscale information matrix of the first image, then traverses all the pixel points in the grayscale information matrix, finds the target pixel point that is greater than the preset threshold, and respectively uses multiple consecutive pixel points in one direction of the row or column where the target pixel point is located as the pixel group to be judged. The preset threshold can be specified, input by the user of the electronic device, or adjusted by the electronic device according to the properties of the currently processed image. For example, Figure 3 In the figure, the grayscale value of any row of pixels in the first image in the grayscale information matrix is ​​shown. The preset threshold value can be set to 200. Figure 3The pixel numbered 110 can be determined as the target pixel, and multiple (for example, 10) pixel points in front of the target pixel in the row can be taken as the pixel group to be judged, or multiple (for example, 10) pixel points behind the target pixel in the row can be taken as the pixel group to be judged.

[0052] Subsequently, after determining the pixel groups to be judged on both sides of the above-mentioned target pixel point, whether the pixel group to be judged includes ringing noise is judged based on whether multiple changing parameters of the grayscale information of consecutive pixel points in the pixel group to be judged meet preset conditions. If so, the pixel group to be judged is recorded as the target pixel group.

[0053] In one embodiment, in order to determine whether the pixel group to be judged belongs to Figure 3 The target pixel group corresponding to the type of ringing noise shown can be used to determine whether the following multiple change parameters of the pixel group to be determined meet preset conditions:

[0054] (1) The degree of convergence in one direction. Among them, the preset condition (1) specifically includes condition A, which can be measured by whether the number of pixels that tend to converge in the pixel group to be judged is greater than a certain number a to measure the number of convergent pixels in the pixel group to be judged in the direction of one side; condition B, which can be measured by whether the difference between the sum of the absolute values ​​of half of the pixels in the pixel group close to the edge and the sum of the absolute values ​​of the remaining pixels in the pixel group is greater than b to measure the degree of amplitude attenuation in the pixel group to be judged in the direction of one side; condition C, which can be measured by whether the difference between the sum of the variances of half of the pixels in the pixel group close to the edge and the sum of the variances of the remaining pixels is greater than c to measure the degree of variance attenuation in the pixel group to be judged in the direction of one side. Then, when the pixel points in the pixel group to be judged meet the above conditions ab, it is determined that the degree of convergence of the pixel group to be judged in the direction of one side meets the preset conditions. As an example, with Figure 3 The pixel points 110-120 framed by the middle circle are the pixel group to be judged. The number of pixel points 10 that tend to converge in the pixel group is greater than a, which meets condition A; the difference between the sum of the absolute values ​​of the half of the 5 pixel points close to the right and the sum of the absolute values ​​of the other 5 pixel points on the left of the pixel is greater than b, which meets condition B; the difference between the sum of the absolute variances of the half of the 5 pixel points close to the right and the sum of the absolute variances of the other 5 pixel points on the left of the pixel is greater than c, which meets condition C. Therefore, the pixel group to be judged meets condition (1). The same judgment method is used for the pixel points 100-110 on the left of this pixel point, which do not meet the above condition (2).

[0055] (2) The number of cycles. The preset condition (2) specifically includes: the grayscale values ​​of the consecutive pixels in the pixel group to be determined fluctuate periodically, for example, the number of cycles is greater than d. Figure 3The pixel points 110-120 framed by the middle circle are taken as an example of the pixel group to be judged. In this pixel group to be judged, a change in the grayscale value is recorded as a cycle. It can be seen that there are continuous cycles from left to right in this pixel group, and the number of cycles is greater than d. Therefore, this pixel group to be judged meets condition (2). In the same judgment method, for the pixel points 100-110 on the left side of this pixel point, since there is no periodic fluctuation, it does not meet the above condition (2).

[0056] (3) Fluctuation amplitude. The preset condition (3) specifically includes: when the grayscale values ​​of all pixels in the pixel group to be determined fluctuate, the amplitude of the fluctuation is limited, for example, the difference in grayscale value between the maximum value and the minimum value of the fluctuation is less than e. Similarly, Figure 3 The pixel points 110-120 framed by the middle circle are taken as an example of the pixel group to be judged. In this pixel group to be judged, the difference in grayscale value between the maximum value 220 and the minimum value 200 of the fluctuation is less than e, so this pixel group to be judged meets condition (3). In the same judgment method, for the pixel points 100-110 on the left side of this pixel point, the difference between the maximum value and the minimum value of the fluctuation is large, and therefore does not meet the above condition (3).

[0057] (4) Peak span. The preset condition (4) specifically includes: the horizontal distance between adjacent peaks of the grayscale values ​​of all pixels in the pixel group to be judged should be less than f when the grayscale values ​​fluctuate. Figure 3 The pixel points 110-120 framed by the middle circle are taken as an example of the pixel group to be judged. In this pixel group to be judged, due to the existence of continuous cycles, when the horizontal distance between the peaks is 1 pixel less than f, the pixel group to be judged meets condition (4). The same judgment method is used for the pixel points 100-110 on the left side of the pixel point. Since there is no continuous cycle, the distance between the peaks is large, and the peak span is greater than f, which does not meet the above condition (4).

[0058] Finally, when the above four variation parameters of the pixel group to be judged all meet conditions (1)-(4), the pixel group to be judged is determined to be the target pixel group, and the ringing noise in the target pixel group belongs to Figure 3 A type of ringing noise is shown.

[0059] It can be understood that, in the embodiment of the present application, for the first image, for each target pixel point that is greater than the preset threshold, four pixel groups to be judged can be determined in the row direction or column direction, and the change parameters of the pixel groups to be judged corresponding to all target pixels meet the above preset conditions (1)-(4), thereby determining that the pixel groups to be judged include the following: Figure 3 The target pixel group for a type of ringing noise is shown.

[0060] In one embodiment, in order to determine whether the pixel group to be judged belongs to Figure 4 The target pixel group corresponding to the second type of ringing noise shown can be used to determine whether the following multiple change parameters of the pixel group to be determined meet preset conditions:

[0061] (5) The edge variance value of the ringing noise. The preset condition (5) specifically includes: the average variance of the edge to which the ringing noise in the pixel group to be judged is less than g, then Figure 4 The pixel points 20-30 framed by the middle circle are the pixel group to be judged. As an example, the average variance of the left and right edges is less than g, which meets condition (5). However, the average variance of the 10-20 side edges to the left of the pixel point is greater than g, so it does not meet the above condition (5).

[0062] (6) Peak attenuation. The preset condition (6) specifically includes: in the pixel group to be judged, the attenuation degree from the peaks on both sides of the pixel group to the middle peak is less than h. Figure 4 The pixel points 20-30 framed by the middle circle are the pixel group to be judged. As an example, the difference between the maximum peak value on the left and right edges and the maximum peak value in the middle is less than h, which meets condition (6). However, due to the large fluctuation on the left side of the pixel point 10-20, the difference between the peak value on the two edges and the peak value in the middle is greater than h, so it does not meet the above condition (6).

[0063] (7) Fluctuation amplitude. The judgment method is the same as (3) and will not be repeated here.

[0064] (8) Peak span. The judgment method is the same as (4) and will not be repeated here.

[0065] (9) The number of cycles. The judgment method is the same as (2) and will not be repeated here.

[0066] Finally, when the above five variation parameters of the pixel group to be judged all meet conditions (5)-(9), the pixel group to be judged is determined to be the target pixel group, and the ringing noise in the target pixel group belongs to Figure 4 The second type of ringing noise is shown.

[0067] It can be understood that, in the embodiment of the present application, for the first image, for each target pixel point that is greater than the preset threshold, four pixel groups to be judged can be determined in the row direction or column direction, and the change parameters of the pixel groups to be judged corresponding to all target pixels meet the above preset conditions (5)-(9), thereby determining that the pixel groups to be judged include the following: Figure 4 The target pixel group of the second type of ringing noise is shown.

[0068] When a pixel group to be judged does not meet the above preset conditions (1)-(4) and the above preset conditions (5)-(9) at the same time, it can be determined that the pixel group to be judged does not include the following: Figure 3 The type of ringing noise shown does not include Figure 4 The second type of ringing noise is shown.

[0069] In addition, it should be noted that the present application does not limit the specific value of ah provided when determining the change parameter in the above example. It can be preset or input by the user of the electronic device.

[0070] In addition, the embodiments of the present application provide a method for detecting two types of ringing noise, namely, type I ringing noise and type II ringing noise, in the grayscale information matrix of the first image. Other methods of determining ringing noise based on changes in grayscale values ​​in the grayscale information matrix can also realize the detection of ringing noise. It is only necessary to increase or decrease the change parameters. They should be understood as equivalent solutions to the embodiments of the present application and will not be repeated in this application.

[0071] S102: After the above processing in S101, the electronic device as the executing entity determines the target area including the ringing noise in the first image, that is, determines the location of the ringing noise in the first image. At this time, the electronic device can record the target area in the first image in S102 and calculate the specific intensity of the ringing noise in the target area.

[0072] In a specific implementation of S102, the electronic device may calculate the intensity information of the ringing noise in the target area by performing weighted processing on the multiple change parameters of the target pixel group in the target area obtained in S101. The weighted processing of the multiple change parameters may be performed using the following formula 1:

[0073] P 振铃 =ω1*Fea1+ω2*Fea2+ω3*Fea3… Formula 1

[0074] Among them, P 振铃 is the confidence rate of the ringing noise corresponding to the target pixel group, which can be used to represent the intensity information of the ringing noise. Fea is the variation parameter of the ringing noise, such as the variation parameters corresponding to the above conditions (1)-(4) and (5)-(9). ω is the weight value corresponding to different variation parameters, and the sum of the weight values ​​of all variation parameters is 1.

[0075] For example, for Figure 2In the first image shown, for the ringing noise existing on the left side of the Chinese character "新", after identifying the target pixel group including a type of ringing noise in a column on the left side of the character "新" through S101, the conditions (1)-(4) corresponding to the type of ringing noise can be quantified and weighted through Formula 1 to obtain the intensity information P. Subsequently, the intensity information P of the ringing noise of the target pixel group can be recorded through the first mask matrix, where the size of the first mask matrix is the same as the pixel size of the first image, and each element of the first mask matrix corresponds to a pixel point within the first image. For example, Figure 6 is a schematic diagram of the first mask matrix provided by this application. Among them, the size of the first mask matrix is the same as that of the first image as shown in Figure 2 , and the first mask matrix is visually represented in the form of a mask matrix diagram. Therefore, for the ringing noise that appears at the left position of the Chinese character "新" in Figure 2 , it is recorded at the white position in the upper left corner of Figure 6 . The greater the intensity information of the ringing noise, the lighter the color represented in Figure 6 , and the black part in Figure 6 indicates that there is no type of ringing noise and type II ringing noise in this part.

[0076] Then, the electronic device records the intensity information of all target pixel groups within the entire first image in the first mask matrix shown in Figure 6 in the same manner as in the above example, to obtain the first mask matrix corresponding to the entire first image. In a specific implementation manner, the mask matrix corresponding to the target pixel groups identified in all rows of the first image can be recorded first, then the mask matrix corresponding to the target pixel groups identified in all columns of the first image can be recorded, and finally, after merging the above two mask matrices, the first mask matrix shown in Figure 6 is finally obtained. When merging, the overlapping values can be processed by means such as OR operation, averaging, weighting, etc., which is not limited in this application.

[0077] In some embodiments, since the ringing noise is distributed around the edge and there is no ringing noise in the flat area, care needs to be taken not to damage the image structure such as edges and textures when removing the ringing. The ringing detection algorithm may misjudge a few textures similar to the ringing waveform as ringing, but these misdetections exist isolatedly in the ringing mask diagram. For example, Figure 6 the vertical lines, horizontal lines, etc. in the lower left corner of Figure 6 . Therefore, after the electronic device obtains the first mask matrix shown in Figure 6 , morphological processing operations such as filtering can be further performed on the first mask matrix to remove isolated points, burrs, line segments, etc. in the first mask matrix and sharpen the edges, so as to compensate for possible misdetections and missed detections of ringing noise in the first mask matrix.

[0078] Specifically, when the electronic device performs the above morphological processing, it can first Figure 6 The first mask matrix shown is split into a vertical ringing mask map and a horizontal ringing mask map. Then, the horizontal mask map is closed using elements of size 5*1 to fill the isolated small gaps in the horizontal mask map. The vertical mask map is closed using elements of size 1*5 to fill the isolated small gaps in the vertical mask map. The horizontal mask map and the vertical mask map are ORed to form a ringing mask map. Finally, the ringing mask map is opened using elements of size 3*3 to remove isolated points, glitches, and line segments in the mask map. The resulting mask map is recorded as the second mask matrix map, as shown in FIG. Figure 7 This is a schematic diagram of the second mask matrix diagram provided in the present application. The second mask matrix diagram corresponds to the second mask matrix. The size of the second mask matrix is ​​also the same as the pixel points of the first image, and each element corresponds one-to-one to the pixel points of the first image.

[0079] S103: Filtering the ringing noise in the target area of ​​the first image based on the intensity information to obtain a second image. The second image is obtained by performing weighted filtering on the pixels corresponding to each element in the first image using the intensity information of each element as a weight based on the second mask matrix obtained in S102.

[0080] In one embodiment, the guided filtering method can be used in S103 provided by the present application to filter the first image, wherein, in order to implement the guided filtering, the first image is used as the guided graph G, and the first image is guided filtered to maximize the protection of the edge of the first image from loss. At the same time, in the filter intensity control of the guided filtering, two parameters, the neighborhood width and the filter intensity, can also be set. Among them, the neighborhood width k can be set to 5, which is used to determine the width of the guided filter when processing pixels; the filter intensity ∈ is used to control the different filter intensities of different variance areas, and the filter intensity of the edge with a variance greater than ∈ is lower, so that the edge information will be better protected, and the filter intensity of the area with a variance less than ∈ will be higher. In addition, bidirectional filtering or other filtering methods can also be used in S103, which is not limited by the present application.

[0081] In a specific implementation, the electronic device may filter the entire first image to obtain a filtered third image, and then fuse the third image with the first image through the formula r=p*α+q*(1-α) to obtain a second image r, wherein p is the third image, q is the first image, and α is the second mask matrix. Alternatively, in another specific implementation, the electronic device may also filter only the target area with ringing noise indicated by the second mask matrix in the first image according to the above formula, while not filtering the area in the first image that does not include ringing noise, thereby retaining more of the content in the original first image, and finally obtaining the second image after removing the ringing noise. The obtained second image is as follows: Figure 8 As shown, Figure 8 A schematic diagram of the second image provided by this application, wherein Figure 2 By comparing the first image shown in FIG. 1 , it can be seen that after being processed by the embodiment of the present application, Figure 8 The second image shown has the ringing noise removed, so the second image becomes clearer than the first image, thereby improving the viewing experience of the image.

[0082] In summary, the method for removing image ringing noise provided in the embodiment of the present application can utilize the characteristics of the one-dimensional grayscale value of the ringing noise in the first image that the amplitude fluctuates periodically and decreases and appears dependent on strong edges, so as to more accurately locate the target area including the ringing noise in the first image, and can also record the target area according to the mask matrix, and then only filter the target area in the first image according to the instruction of the mask matrix, while retaining other parts that do not include the ringing noise, avoiding damage to the first image structure and texture information, thereby protecting the part of the first image where no ringing noise exists as much as possible to remain stable and unchanged, and thus more accurately removing the ringing noise in the image while maximally protecting the texture and edge information of the original image, thereby improving the restoration quality and appearance of the processed image.

[0083] In the aforementioned embodiments, the method for removing image ringing noise provided by the embodiments of the present application has been described. To implement the various functions of the method provided by the embodiments of the present application, the electronic device serving as the execution subject may include hardware structures and / or software modules, and implement the aforementioned functions in the form of hardware structures, software modules, or hardware structures and software modules. Whether a particular function is implemented in the form of hardware structures, software modules, or hardware structures and software modules depends on the specific application and design constraints of the technical solution.

[0084] For example, Figure 9 This is a schematic diagram of the structure of a device for removing image ringing noise provided by this application, such as Figure 9The illustrated apparatus 100 includes a ringing noise detection module 1001 and a ringing noise removal module 1002. The ringing noise detection module 1001 is configured to determine a target region containing ringing noise within a first image and calculate intensity information of the ringing noise within the target region. The ringing noise removal module 1002 is configured to filter the ringing noise within the target region of the first image based on the intensity information to obtain a second image.

[0085] Optionally, the ringing noise detection module 1001 is specifically used to calculate the grayscale information matrix of the first image; determine the target pixel group that includes ringing noise in the grayscale information matrix, wherein the target pixel group includes multiple continuous pixel points in rows or columns, and the change pattern between the target pixel group and other pixel points in the row or column where it is located meets preset conditions; and determine that the area corresponding to the target pixel group in the first image is the target area.

[0086] Optionally, the ringing noise detection module 1001 is specifically used to traverse all pixel points in the grayscale information matrix; for the target pixel points that are greater than a preset threshold among all pixel points, multiple continuous pixel points in one direction of the row or column where the target pixel point is located are respectively used as the pixel group to be judged; when multiple change parameters of the grayscale information of the continuous pixel points in the pixel group to be judged meet preset conditions, the pixel group to be judged is determined to be the target pixel group; wherein the change parameters include: the degree of convergence in one direction, the number of cycles, the fluctuation amplitude and the peak span; or, the change parameters include: the edge variance value, the degree of convergence from both sides to the middle direction, the number of cycles, the fluctuation amplitude and the peak span.

[0087] Optionally, the ringing noise detection module 1001 is further configured to calculate the intensity information of the ringing noise in the target area; filter the ringing noise in the target area of ​​the first image to obtain a second image, including: filtering the ringing noise in the target area of ​​the first image according to the intensity information to obtain the second image.

[0088] Optionally, the ringing noise detection module 1001 is specifically configured to perform weighted processing on multiple variation parameters of the pixel group to obtain intensity information of the ringing noise in the target area.

[0089] Optionally, the ringing noise detection module 1001 is also used to, after obtaining the intensity information of the ringing noise in the target area, also include: recording the intensity information of the ringing noise in the target area through a first mask matrix; wherein the elements in the first ringing mask matrix correspond one-to-one to the pixel points of the first image.

[0090] Optionally, the ringing noise detection module 1001 is further configured to perform a morphological operation on the first mask matrix to obtain a second mask matrix.

[0091] Optionally, the ringing noise removal module 1002 is specifically configured to perform weighted filtering on pixel points corresponding to each element in the first image based on the intensity information of each element in the second mask matrix as a weight, so as to obtain the second image.

[0092] Optionally, the ringing noise removal module 1002 is specifically used to filter the first image to obtain a third image; and calculate the second image r by the formula r=p*α+q*(1-α), where p is the third image, q is the first image, and α is the second mask matrix.

[0093] Optionally, the ringing noise removal module 1002 is specifically configured to filter the first image using a guided filter to obtain a third image; wherein, when the guided filter filters the target area, the filtering intensity is related to the grayscale information in the target area.

[0094] It should be understood that the division of the various modules of the above device is merely a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. Moreover, these modules can all be implemented in the form of software called by a processing element; they can also all be implemented in the form of hardware; some modules can also be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. In addition, they can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device to perform the functions of the above-mentioned determined modules. The implementation of other modules is similar. In addition, these modules can all or partly be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the hardware integrated logic circuit in the processor element or by instructions in the form of software.

[0095] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented by scheduling program code on a processing element, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0096] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)).

[0097] An embodiment of the present application also provides an electronic device, comprising: a processor and a memory; instructions are stored in the memory; when the processor runs the instructions stored in the memory, the processor executes the method executed by the electronic device in any of the aforementioned embodiments of the present application.

[0098] An embodiment of the present application further provides a readable storage medium, wherein the storage medium stores instructions, which, when executed on a computer, enables the computer to execute the method executed by the electronic device in any of the aforementioned embodiments of the present application.

[0099] An embodiment of the present application further provides a chip for executing instructions, wherein the chip is used to execute a method executed by an electronic device in any of the aforementioned embodiments of the present application.

[0100] An embodiment of the present application also provides a program product, which includes a computer program stored in a storage medium. At least one processor can read the computer program from the storage medium, and when the at least one processor executes the computer program, it can implement the method performed by the electronic device in any of the aforementioned embodiments of the present application.

[0101] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for removing ringing noise from an image, characterized in that: include: Acquire a first image, where the first image includes ringing noise; determining a target area including ringing noise within the first image; Performing filtering processing on the ringing noise in the target area of ​​the first image to obtain a second image; wherein the filtering processing is used to remove the ringing noise; The determining a target area including ringing noise in the first image includes: Calculating a grayscale information matrix of the first image; Determining a target pixel group including ringing noise in the grayscale information matrix, wherein the target pixel group includes a plurality of consecutive pixels in a row or column, and a variation pattern between the target pixel group and other pixels in the row or column satisfies a preset condition; An area corresponding to the target pixel group in the first image is determined as the target area.

2. The method according to claim 1, characterized in that The determining of the target pixel group including ringing noise in the grayscale information matrix comprises: Traversing all pixels in the grayscale information matrix; For a target pixel whose value is greater than a preset threshold among all pixels, a plurality of consecutive pixels in one direction of the row or column where the target pixel is located are respectively used as a pixel group to be determined; When multiple variation parameters of the grayscale information of consecutive pixels in the pixel group to be determined meet the preset conditions, determining the pixel group to be determined as the target pixel group; Among them, the change parameters include: the degree of convergence in one direction, the number of cycles, the fluctuation amplitude and the peak span; or, the change parameters include: the edge variance value, the degree of convergence in the middle direction from both sides, the number of cycles, the fluctuation amplitude and the peak span, wherein the period refers to a single change in the grayscale value in the pixel group to be judged.

3. The method according to claim 1 or 2, characterized in that After determining the target area including the ringing noise in the first image, the method further includes: Calculating intensity information of the ringing noise in the target area; The filtering the ringing noise in the target area of ​​the first image to obtain the second image includes: The ringing noise in the target area of ​​the first image is filtered according to the intensity information to obtain the second image.

4. The method according to claim 3, characterized in that The calculating the intensity information of the ringing noise in the target area includes: Weighted processing is performed on multiple change parameters of the pixel group to obtain intensity information of the ringing noise in the target area.

5. The method according to claim 4, characterized in that After obtaining the intensity information of the ringing noise in the target area, the method further includes: The intensity information of the ringing noise in the target area is recorded through a first mask matrix; wherein the elements in the first mask matrix correspond one-to-one to the pixels of the first image.

6. The method according to claim 5, characterized in that After recording the intensity information of the ringing noise in the target area by using the first mask matrix, the method further includes: Performing morphological operations on the first mask matrix to obtain a second mask matrix.

7. The method according to claim 6, characterized in that The filtering process of the ringing noise in the target area of ​​the first image according to the intensity information to obtain the second image includes: The second image is obtained by performing weighted filtering on the pixel points corresponding to the element in the first image based on the intensity information of each element in the second mask matrix as a weight.

8. The method according to claim 7, characterized in that The step of performing weighted filtering on the pixel points corresponding to each element in the first image based on the intensity information of each element in the second mask matrix as a weight to obtain the second image includes: performing filtering processing on the first image to obtain a third image; By formula The second image r is obtained by calculation, wherein p is the third image, q is the first image, and α is the second mask matrix.

9. The method according to claim 8, characterized in that The filtering the first image to obtain a third image includes: performing filtering processing on the first image by using a guided filter to obtain the third image; When the guided filter filters the target area, the filtering intensity is related to the grayscale information in the target area.

10. An electronic device, characterized in that: include: processor and memory; Instructions are stored in the memory; When the processor executes the instructions, the processor is configured to calculate a grayscale information matrix of the first image; determine a target pixel group including ringing noise in the grayscale information matrix, wherein the target pixel group includes a plurality of consecutive pixel points in a row or column, and a variation pattern between the target pixel group and other pixel points in the row or column in which the target pixel group resides meets a preset condition; determine an area corresponding to the target pixel group in the first image as a target area, and calculate intensity information of the ringing noise in the target area; The ringing noise in the target area of ​​the first image is filtered according to the intensity information to obtain a second image.

Citation Information

Patent Citations

  • Methods and apparatus for reducing image ringing noise

    CN102289798A

  • Self-adaptation compensation system and method for video compression distortion

    CN103888764A