Image processing method, computer equipment and readable medium
By filtering and edge detection of film particle noise at the image encoding end, and identifying and adding film particle noise in edge areas, the poor visual effect caused by film particle noise processing in the prior art is solved, and a more realistic particle feeling is achieved and better visual quality.
Patent Information
- Application Number
- CN202310732722.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-19
- Publication Date
- 2024-12-27
AI Technical Summary
When processing film particle noise, the image after removing the noise lacks graininess, resulting in poor visual effects and it is difficult to restore the realism of film particles while maintaining high-definition resolution.
The image encoding end is filtered and edge detection to identify and determine the film particle noise in the flat area and edge area of the image, and synthesize it in combination with the decoded image, and add film particle noise in the edge area to improve the graininess of the image.
By adding film particle noise in edge areas, the generated image has a more realistic graininess, improving the visual quality and display effect of the image.
Smart Images

Figure CN119205540A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of image processing, and in particular to an image processing method, a computer device, and a readable medium. Background Art
[0002] Film grain is a common type of noise in film photography. When the film or negative is developed, the tiny crystals of silver halide salts are converted into extremely small metallic silver filaments. These filaments gather together in a random pattern and form particles, which appear in the image as film grain. Due to the high-definition resolution of digital movies, the image will appear distorted. Now many videos or movies pursue the realism of film grain, but the randomness of film grain noise and its high-frequency components bring great inconvenience to video encoding.
[0003] In the related art, the method for processing film grain noise is to remove the film grain noise during pre-processing at the encoding end, obtain relevant parameters based on the characteristics of the film grain, perform post-processing at the decoding end, and perform image synthesis based on the parameters transmitted by the bit stream. However, the image with film grain noise removed lacks graininess and has poor visual effects. Summary of the invention
[0004] The present disclosure provides an image processing method, a computer device and a readable medium.
[0005] In a first aspect, an embodiment of the present disclosure provides an image processing method, which is applied to an image encoding end, and the method includes:
[0006] Performing filtering processing on the first image to obtain a second image, and performing edge detection on the second image to obtain a flat area of the second image and an edge area of the second image; wherein the first image is an image in a preset color space format;
[0007] determining a second film grain noise of a flat area of the second image;
[0008] A first film grain noise of an edge region of the second image is determined according to the second film grain noise, and the first film grain noise is used to synthesize a third image with the decoded image.
[0009] On the other hand, an embodiment of the present disclosure further provides a computer device, comprising: one or more processors; a storage device on which one or more programs are stored; when the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described above.
[0010] On the other hand, an embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, wherein the program implements the image processing method as described above when executed.
[0011] The image processing method provided by the embodiment of the present disclosure is applied to an image encoding end, and includes: filtering a first image in a preset color space format to obtain a second image, and performing edge detection on the second image to obtain a flat area of the second image and an edge area of the second image; determining a second film grain noise of the flat area of the second image, and determining a first film grain noise of the edge area of the second image based on the second film grain noise, and the first film grain noise is used to synthesize a third image with the decoded image; before image encoding, the embodiment of the present disclosure identifies the edge area by performing edge detection on the denoised second image, and detects the film grain noise of the edge area; after encoding and decoding the second image, synthesizes the third image based on the film grain noise of the edge area and the decoded image at the image decoding end; since the film grain noise of the edge area is added, the synthesized third image has a more realistic sense of grain, a better video effect, and improved image visual quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 A schematic diagram of the image processing method provided by the embodiment of the present disclosure;
[0013] Figure 2 A schematic diagram of a process of determining a first film grain noise in an edge region of a second image provided by an embodiment of the present disclosure;
[0014] Figure 3 A schematic diagram of a process for determining the noise in the edge area of a second image provided by an embodiment of the present disclosure;
[0015] Figure 4 A schematic diagram of a flow chart for generating a fitting curve provided in an embodiment of the present disclosure;
[0016] Figure 5 A schematic diagram of a process of determining a first film grain noise in an edge region of a second image provided by an embodiment of the present disclosure;
[0017] Figure 6 Schematic diagram of the image processing method flow of a specific example of the present invention. DETAILED DESCRIPTION
[0018] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete and to enable those skilled in the art to fully understand the scope of the present disclosure.
[0019] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0020] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.
[0021] The embodiments described herein may be described with reference to plan views and / or cross-sectional views by means of idealized schematic diagrams of the present disclosure. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances. Therefore, the embodiments are not limited to the embodiments shown in the accompanying drawings, but include modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the accompanying drawings have schematic properties, and the shapes of the regions shown in the figures illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.
[0022] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0023] The present disclosure provides an image processing method, which is applied to an image encoding end and is used to process an original image before image encoding. Figure 1 As shown, the image processing method comprises the following steps:
[0024] Step S1, filtering a first image to obtain a second image, and performing edge detection on the second image to obtain a flat area of the second image and an edge area of the second image; wherein the first image is an image in a preset color space format.
[0025] The color space format mentioned in the embodiment of the present disclosure refers to the encoding format of the image color, and the preset color space format includes but is not limited to the YUV color format, the RGB color format, the HSV color format, etc. In the embodiment of the present disclosure, the YUV color format is used as the preset color space format for example.
[0026] The first image is the original image to be processed, and the original image is a noisy image. Filtering the first image can eliminate the noise in the first image, and the obtained second image is a denoised image. The denoised image is edge detected to divide it into a flat area and an edge area. Edge detection algorithms include but are not limited to: Canny algorithm, Roberts algorithm, Prewitt algorithm, Sobel algorithm, Marr-Hidreth algorithm, etc.
[0027] Step S2, determining a second film grain noise of a flat area of a second image.
[0028] By comparing the flat area of the second image with the flat area of the first image, a second film grain noise N2 of the flat area of the second image is obtained.
[0029] Step S3, determining a first film grain noise in an edge region of the second image according to the second film grain noise, and the first film grain noise is used to synthesize a third image with the decoded image.
[0030] In the disclosed embodiment, the second film grain noise N2 of the flat area of the second image is first determined, and then the first film grain noise N1' of the edge area of the second image is determined according to the second film grain noise N2, so as to realize the identification of the film grain noise of the edge area. After identifying the first film grain noise N1' of the edge area, the image encoding end can model the first film grain noise N1', obtain the relevant parameters of the first film grain noise N1', and after encoding the second image, send the relevant parameters of the first film grain noise N1' and the encoded image to the image decoding end, the image decoding end decodes the received image to obtain a decoded image, synthesizes the decoded image and the relevant parameters of the first film grain noise N1', and generates a third image, the third image has a real grainy feeling, and the user visual experience is better.
[0031] The image processing method provided by the embodiment of the present disclosure is applied to an image encoding end, and includes: filtering a first image in a preset color space format to obtain a second image, and performing edge detection on the second image to obtain a flat area of the second image and an edge area of the second image; determining a second film grain noise in the flat area of the second image, and determining a first film grain noise in the edge area of the second image based on the second film grain noise, and the first film grain noise is used to synthesize a third image with a decoded image; before image encoding, the embodiment of the present disclosure identifies the edge area by performing edge detection on the denoised second image, and detects the film grain noise in the edge area; after encoding and decoding the second image, synthesizes the third image based on the film grain noise in the edge area and the decoded image at the image decoding end; since the film grain noise in the edge area is added, the synthesized third image has a more realistic graininess in the edge area, a better display effect, and improved image visual quality.
[0032] In some embodiments, the first film grain noise is used to synthesize a third image with the decoded image, including the following steps: determining a third film grain noise N of the second image according to the first film grain noise N1' and the second film grain noise N2, and the third film grain noise N is used to synthesize the third image with the decoded image. That is, after determining the first film grain noise N1' of the edge area of the second image, the third film grain noise N of the second image is determined according to the first film grain noise N1' and the second film grain noise N2, wherein N=N1'+N2, and the third film grain noise N is the film grain noise of the second image. Correspondingly, in this case, the third image is synthesized by the image decoding end using the third film grain noise N and the decoded image, so that the third image has a real graininess not only in the edge area but also in the flat area, which can further improve the visual quality of the image.
[0033] In some embodiments, Figure 2 As shown, the step of determining the first film grain noise of the edge area of the second image according to the second film grain noise (i.e., step S3) includes the following steps:
[0034] Step S31, determining the noise in the edge area of the second image.
[0035] The noise N1 in the edge area of the second image is a suspected film grain noise set in the edge area, which includes not only film grain noise (ie, the first film grain noise N1') but also other types of noise and interference. Therefore, the noise N1 in the edge area of the second image needs to be processed secondary later.
[0036] Step S32: generating a fitting curve according to the pixel value of each pixel in the flat area of the second image and the second film grain noise.
[0037] The fitting curve is a piecewise linear function curve, which reflects the characteristics of film grain noise. The fitting curve is a curve of the standard deviation of pixels with respect to the second film grain noise, the x-axis of the fitting curve is the second film grain noise N2, and the y-axis is the standard deviation of pixels.
[0038] Step S33: Screen the noise in the edge area of the second image using the fitting curve to obtain the first film grain noise in the edge area of the second image.
[0039] In the disclosed embodiment, according to the characteristics of the normal distribution of the film grain noise, the first film grain noise N1' of the edge area of the second image is screened. The noise N1 of the edge area of the second image is substituted into the fitting curve. If the sample value of the noise N1 deviates from the fitting curve, the sample of the noise N1 is not film grain noise; if the sample value of the noise N1 can match the fitting curve, the sample of the noise N1 is considered to be film grain noise. In this way, by matching the noise N1 with the fitting curve, the noise N1 can be screened, and other types of noise except the film grain noise can be eliminated to obtain the first film grain noise N1' of the edge area of the second image.
[0040] In some embodiments, Figure 3 As shown, the step of determining the noise in the edge area of the second image (i.e., step S31) includes the following steps:
[0041] Step S311, calculating a first gradient of an edge region of the second image.
[0042] The first gradient S1 of the edge region of the second image may be calculated using one of the Laplace algorithm, the Sobel algorithm, and the Scharr algorithm.
[0043] Step S312: determining the edge region of the first image according to the edge region of the second image, and calculating a second gradient of the edge region of the first image.
[0044] In step S1, the edge area of the second image has been identified, and the edge area of the first image is at the same position as the edge area of the second image, so the edge area of the first image can be determined and the second gradient S2 of the edge area of the first image can be calculated. In the embodiment of the present disclosure, the Laplace algorithm can be used to calculate the second gradient S2 of the edge area of the first image.
[0045] Step S313: determining the noise in the edge area of the second image according to the first gradient and the second gradient.
[0046] The first gradient S1 and the second gradient S2 are compared, and samples that cannot be compared are recorded as noise N1 in the edge area of the second image, where the noise N1 is a set of suspected film grain noise in the edge area.
[0047] The gradient can be characterized by a gradient magnitude and a direction angle, and therefore, the first gradient includes a first gradient magnitude G1 and a first direction angle θ1. In some embodiments, the calculation of the first gradient S1 of the edge region of the second image includes the following steps: according to the pixel value of each pixel in the edge region of the second image and a preset first operator parameter, the first gradient magnitude G1 and the first direction angle θ1 of each pixel in the edge region of the second image are calculated.
[0048] The first gradient amplitude G1 and the first direction angle θ1 may be calculated using one of the Laplace algorithm, the Sobel algorithm, and the Scharr algorithm. In the embodiment of the present disclosure, the Laplace algorithm is used to calculate the first gradient amplitude G1 and the first direction angle θ1. Accordingly, the first operator parameter is the Laplace operator.
[0049] The partial derivative Gx of each pixel in the edge region of the second image in the horizontal direction (x-axis direction) is calculated according to the following formula (1), and the partial derivative Gy of each pixel in the edge region of the second image in the vertical direction (y-axis direction) is calculated according to the following formula (2):
[0050]
[0051]
[0052] in, is a preset first operator parameter, namely, the Laplace operator; src is a set of pixel values of each pixel in the edge area of the second image.
[0053] The first gradient magnitude G1 of each pixel in the edge region of the second image is calculated according to the following formula (3), and the first direction angle θ1 of each pixel in the edge region of the second image is calculated according to the following formula (4):
[0054]
[0055] θ 1= atan2(G y ,G x ) (4)
[0056] Among them, G1 is the first gradient amplitude of each pixel in the edge area of the second image, θ1 is the first direction angle of each pixel in the edge area of the second image, Gx is the partial derivative of each pixel in the edge area of the second image in the horizontal direction, and Gy is the partial derivative of each pixel in the edge area of the second image in the vertical direction; atan2() is a function that returns the azimuth angle.
[0057] In some embodiments, the second gradient includes a second gradient amplitude G2 and a second direction angle θ2, and the calculation of the second gradient S2 of the edge area of the first image includes the following steps: according to the pixel value of each pixel in the edge area of the first image and the preset second operator parameters, the second gradient amplitude G2 and the second direction angle θ2 of each pixel in the edge area of the first image are calculated.
[0058] The partial derivative Gx' of each pixel in the edge region of the first image in the horizontal direction (x-axis direction) is calculated according to the following formula (5), and the partial derivative Gy' of each pixel in the edge region of the first image in the vertical direction (y-axis direction) is calculated according to the following formula (2):
[0059]
[0060]
[0061] in, is a preset first operator parameter, namely, the Laplace operator; src' is a set of pixel values of each pixel in the edge area of the first image.
[0062] The second gradient magnitude G2 of each pixel in the edge region of the first image is calculated according to the following formula (7), and the second direction angle θ2 of each pixel in the edge region of the first image is calculated according to the following formula (8):
[0063]
[0064] θ2 = atan2(G y ′,G x ′) (8)
[0065] Among them, G2 is the second gradient amplitude of each pixel in the edge area of the first image, θ2 is the second direction angle of each pixel in the edge area of the first image, Gx' is the partial derivative of each pixel in the edge area of the first image in the horizontal direction, Gy' is the partial derivative of each pixel in the edge area of the first image in the vertical direction; atan2() is a function that returns the azimuth angle.
[0066] In some embodiments, Figure 4 As shown, the step of generating a fitting curve according to the pixel value of each pixel in the flat area of the second image and the second film grain noise (i.e., step S32) includes the following steps:
[0067] Step S321, for each pixel in the flat area of the second image, calculate the standard deviation between the pixel value of the pixel and the neighborhood of the pixel.
[0068] The neighborhood size can be customized, and is generally 3x3 or 5x5. Through this step, the standard deviation of each pixel in the flat area of the second image can be calculated.
[0069] Step S322: generating a fitting curve according to the standard deviation of each pixel and the second film grain noise.
[0070] In this step, illustratively, the standard deviation of each pixel and the corresponding second film grain noise N2 may be fitted using a least squares algorithm, thereby generating a fitting curve of a piecewise linear function.
[0071] In some embodiments, Figure 5 As shown, the method of using the fitting curve to filter the noise in the edge area of the second image to obtain the first film grain noise in the edge area of the second image (i.e., step S33) includes the following steps:
[0072] Step S331, calculating a first standard deviation corresponding to the noise in the edge area of the second image.
[0073] For each noise N1 in the edge region of the second image, the standard deviation P1 of the noise is calculated.
[0074] Step S332, calculating the difference between the first standard deviation and the second standard deviation corresponding to the fitting curve.
[0075] According to the fitting curve, the second standard deviation P2 corresponding to each second film grain noise N2 is determined, and the difference P between the two is calculated, where P=|P2-P1|.
[0076] Step S333 , when the difference is greater than the preset threshold, remove the noise corresponding to the difference greater than the preset threshold from the noise in the edge area of the second image to obtain the first film grain noise in the edge area of the second image.
[0077] The difference is compared with a preset threshold. If the difference is greater than the preset threshold, it means that the noise corresponding to the difference is non-film grain noise. Therefore, the noise corresponding to the difference is removed from the noise N1 in the edge area of the second image to obtain the first film grain noise N1' in the edge area of the second image.
[0078] In some embodiments, the preset threshold is 3 times the average standard deviation. Since the fitting curve is a segmented curve, the average standard deviation is the average value of the standard deviations of each segment of the fitting curve.
[0079] It should be noted that if the color space format of the image to be processed is not the preset color space format, before image processing, the color space format of the image to be processed must be converted to the preset color space format. Therefore, before filtering the first image to obtain the second image (i.e., step S1), the image processing method may further include the following steps: converting the fourth image in the non-preset color space format into the first image in the preset color space format.
[0080] In the embodiment of the present disclosure, the preset color space format is the YUV format, and the fourth image is in the RGB format. Taking the conversion of the RGB format to the YUV format under the BT601 and NTSC color gamut as an example, the fourth image in the RGB format is converted into the first image in the YUV format by the following set of formulas (9):
[0081] Y=0.299*R+0.587*G+0.114*B
[0082] U=-0.169*R-0.331*G+0.5*B
[0083] V=0.5*R -0.419*G -0.081*B (9)
[0084] Among them, R, G, B represent the values of the R, G, B channels of the pixel, and Y, U, V represent the values of the Y, U, V channels of the pixel.
[0085] In order to clearly illustrate the technical solution of the embodiment of the present disclosure, the following Figure 6 , the YUV image film grain noise recognition process using the Canny algorithm for edge detection and the Laplace algorithm for gradient calculation is described in detail. Figure 6 As shown, the YUV image film grain noise recognition process includes the following steps:
[0086] Step 11, edge detection is performed on the noisy first image to obtain an edge region and a flat region of a denoised second image, and a gradient S1 of the edge region.
[0087] Among them, the process of edge detection using the Canny algorithm is as follows:
[0088] (1) Applying Gaussian filtering to smooth the first image to remove noise obtains a denoised second image.
[0089] (2) Calculate the gradient of the second image through Laplace transform to obtain possible edge areas.
[0090] (3) Apply non-maximum suppression technology to eliminate false edge detection. Specifically, traverse all pixels in the possible edge area, determine whether the current pixel is the maximum value of the surrounding pixels with the same gradient direction in the 3x3 neighborhood, and mark the pixel with the maximum value as a possible edge point.
[0091] (4) Apply the double threshold method to filter edge information. Specifically, set a high threshold and a low threshold, remove possible edge points below the low threshold, mark possible edge points above the high threshold as strong edges, and mark possible edge points between the high threshold and the low threshold as weak edges, thereby obtaining edge areas and flat areas.
[0092] (5) Use hysteresis technology to track boundaries. To determine whether a weak edge is a real edge, it is usually stipulated that the weak edge caused by the real edge and the strong edge are connected, so check whether there is a strong edge in the 3×3 neighborhood pixels of a weak edge pixel. If there is a strong edge, the weak edge is considered to be a real edge.
[0093] The edge region and the flat region of the second image can be obtained through the above steps, and the first gradient S1 of the edge region can be calculated during the edge detection process.
[0094] Step 12: Calculate a second gradient S2 of an edge region of the first image.
[0095] Formulas (5)-(8) can be used to calculate the second gradient amplitude G2 of each pixel in the edge area of the first image and the second direction angle θ2 of each pixel in the edge area of the first image, thereby obtaining the second gradient S2 of the edge area of the first image.
[0096] Step 13: Obtain the noise N1 of the edge area of the second image by comparing the first gradient S1 and the second gradient S2.
[0097] After executing step 11, also execute step 14:
[0098] Step 14: obtaining a second film grain noise N2 of the flat area of the second image by comparing the flat area of the second image with the flat area of the first image.
[0099] Step 15: Use a least squares algorithm to fit the standard deviation of each pixel in the flat area of the second image and the corresponding second film grain noise N2 to generate a fitting curve.
[0100] Step 16, matching the noise N1 in the edge area of the second image with the fitting curve, if the difference between the two is large, it is not film grain noise, and it is removed to achieve screening of the noise N1, thereby obtaining the first film grain noise N1' in the edge area of the second image.
[0101] Step 17: Determine a third film grain noise N of the second image according to the first film grain noise N1 ′ and the second film grain noise N2 , wherein N=N1 ′+N2 .
[0102] The image processing method of the embodiment of the present disclosure is applied to a video codec that needs to perform film grain removal and synthesis.
[0103] The disclosed embodiment uses an edge detection algorithm to perform edge detection on an image, obtains an edge area and a flat area of a denoised image, performs gradient calculation on the edge area of the denoised image, obtains a first gradient S1, and performs gradient calculation on the edge area of the noisy image to obtain a second gradient S2. By comparing S1 and S2, the noise N1 of the edge area is obtained. By directly comparing the difference between the noisy image and the denoised image, the film grain noise N2 of the flat area of the denoised image can be obtained. The standard deviation of the film grain noise in N2 is obtained, and the relationship between the intensity of the film grain noise and its standard deviation is fitted using the least squares method to obtain a fitting curve. After obtaining the fitting curve, the noise N1 of the edge area is screened using the fitting curve, and the noise that does not conform to the fitting curve is eliminated. The noise that conforms to the fitting curve is recorded as the first film grain noise N1'. At the image decoding end, the first film grain noise N1' is synthesized with the decoded image to generate a final film grain noise image (i.e., the third image). Since the film grain noise of the edge area is added, the synthesized image has a more realistic graininess, a better video effect, and improved image visual quality.
[0104] The embodiments of the present disclosure also provide a computer device, which includes: one or more processors and a storage device; wherein one or more programs are stored on the storage device, and when the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method provided in the aforementioned embodiments.
[0105] The embodiments of the present disclosure further provide a computer-readable medium on which a computer program is stored, wherein the computer program, when executed, implements the image processing method provided in the aforementioned embodiments.
[0106] It will be appreciated by those skilled in the art that all or some of the steps in the method disclosed above, the functional modules / units in the device may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0107] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.
Claims
1. An image processing method, characterized in that: The method is applied to an image encoding end, and the method comprises: Performing filtering processing on the first image to obtain a second image, and performing edge detection on the second image to obtain a flat area of the second image and an edge area of the second image; wherein the first image is an image in a preset color space format; determining a second film grain noise of a flat area of the second image; A first film grain noise of an edge region of the second image is determined according to the second film grain noise, and the first film grain noise is used to synthesize a third image with the decoded image.
2. The method according to claim 1, characterized in that The first film grain noise is used to synthesize a third image with the decoded image, comprising: A third film grain noise of the second image is determined according to the first film grain noise and the second film grain noise, and the third film grain noise is used to synthesize a third image with the decoded image.
3. The method according to claim 1, characterized in that The determining the first film grain noise of the edge area of the second image according to the second film grain noise comprises: determining noise in an edge region of the second image; generating a fitting curve according to the pixel value of each pixel in the flat area of the second image and the second film grain noise; The fitting curve is used to screen the noise in the edge area of the second image to obtain the first film grain noise in the edge area of the second image.
4. The method according to claim 3, characterized in that The determining the noise of the edge area of the second image comprises: Calculating a first gradient of an edge region of the second image; determining an edge region of the first image according to an edge region of the second image, and calculating a second gradient of the edge region of the first image; The noise of the edge area of the second image is determined according to the first gradient and the second gradient.
5. The method according to claim 4, characterized in that The first gradient includes a first gradient magnitude and a first direction angle, and the calculating the first gradient of the edge region of the second image includes: calculating the first gradient magnitude and the first direction angle of each pixel in the edge region of the second image according to the pixel value of each pixel in the edge region of the second image and a preset first operator parameter; and / or, The second gradient includes a second gradient amplitude and a second direction angle, and calculating the second gradient of the edge area of the first image includes: calculating the second gradient amplitude and second direction angle of each pixel in the edge area of the first image according to the pixel value of each pixel in the edge area of the first image and a preset second operator parameter.
6. The method according to claim 3, characterized in that The generating a fitting curve according to the pixel value of each pixel in the flat area of the second image and the second film grain noise comprises: For each pixel in the flat area of the second image, calculating a standard deviation between a pixel value of the pixel and a neighborhood of the pixel; A fitting curve is generated according to the standard deviation of each of the pixels and the second film grain noise.
7. The method according to claim 3, characterized in that The step of screening the noise in the edge area of the second image by using the fitting curve to obtain the first film grain noise in the edge area of the second image includes: Calculating a first standard deviation corresponding to noise in an edge area of the second image; Calculating a difference between the first standard deviation and a second standard deviation corresponding to the fitting curve; When the difference is greater than a preset threshold, the noise corresponding to the difference greater than the preset threshold is removed from the noise in the edge area of the second image to obtain the first film grain noise in the edge area of the second image.
8. The method according to any one of claims 1 to 7, characterized in that: Before filtering the first image to obtain the second image, the method further includes: The fourth image which is not in the preset color space format is converted into the first image in the preset color space format.
9. A computer device, wherein: include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method according to any one of claims 1 to 8.
10. A computer readable medium having a computer program stored thereon, wherein: When the program is executed, the image processing method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Signaling film grain resolution
US12574565B1
