Image processing method and apparatus
By performing pooling processing and determining the sharpening result after image sharpening, the halo phenomenon problem in traditional sharpening algorithms is solved, thereby improving clarity and enhancing the viewer experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2026-04-07
AI Technical Summary
Traditional sharpening algorithms are prone to producing halo effects in image processing, which affects image clarity and the viewer's viewing experience.
After sharpening the image to be processed, pooling is performed on each pixel to obtain max-pooling and min-pooling images. Based on preset sharpening parameters and these images, the sharpening result of each pixel is determined, thus suppressing halo effects.
It effectively eliminates halo effects while retaining the sharpening effect that enhances image clarity, thus improving the viewing experience for the audience.
Smart Images

Figure CN115965548B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to an image processing method. The present application also relates to an image processing device, a computing device and a computer readable storage medium. BACKGROUND
[0002] Image sharpening is a technique to compensate the outline of an image, enhance the edge and gray level jump part of the image, and make the image clear. It can highlight the edge, outline or some linear target features of things on the image, and is very useful in many fields.
[0003] When a traditional sharpening algorithm is used to sharpen an image, it will enhance the details and edges while producing black and white edges in the edge area of the image, which will significantly affect the quality of the image. This phenomenon is commonly known as "halo effect" in sharpening algorithms. This negative effect will affect the clarity of the image and reduce the viewing experience of the audience. SUMMARY
[0004] Therefore, embodiments of the present application provide an image processing method. The present application also relates to an image processing device, a computing device and a computer readable storage medium to solve the problem of halo phenomenon in sharpened images and affect the clarity of the image in the prior art.
[0005] According to a first aspect of embodiments of the present application, an image processing method is provided, comprising:
[0006] obtaining a to-be-processed image, sharpening the to-be-processed image to obtain an initial sharpened image;
[0007] performing pooling processing on each pixel point in the to-be-processed image to obtain a first pooled image and a second pooled image;
[0008] determining a sharpening result corresponding to each pixel point in the initial sharpened image based on a preset sharpening parameter, the initial sharpened image, the first pooled image and the second pooled image;
[0009] determining a target sharpened image corresponding to the to-be-processed image based on the sharpening result.
[0010] According to a second aspect of embodiments of the present application, an image processing device is provided, comprising:
[0011] an initial sharpening module configured to obtain a to-be-processed image, sharpen the to-be-processed image to obtain an initial sharpened image;
[0012] an image pooling module configured to perform a pooling process on each pixel point in the image to be processed to obtain a first pooled image and a second pooled image;
[0013] a sharpening result determination module configured to determine a sharpening result corresponding to each pixel point in the initial sharpened image based on a preset sharpening parameter, the initial sharpened image, the first pooled image and the second pooled image;
[0014] an image determination module configured to determine a target sharpened image corresponding to the image to be processed based on the sharpening result.
[0015] According to a third aspect of the embodiments of the present application, a computing device is provided, which includes a memory, a processor, and computer instructions stored in the memory and executable on the processor, and the processor implements the steps of the image processing method when executing the computer instructions.
[0016] According to a fourth aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores computer instructions, and the computer instructions implement the steps of the image processing method when executed by a processor.
[0017] The image processing method provided by the present application includes the following steps: obtaining an image to be processed, performing a sharpening process on the image to be processed to obtain an initial sharpened image, performing a pooling process on each pixel point in the image to be processed to obtain a first pooled image and a second pooled image, determining a sharpening result corresponding to each pixel point in the initial sharpened image based on a preset sharpening parameter, the initial sharpened image, the first pooled image and the second pooled image, and determining a target sharpened image corresponding to the image to be processed based on the sharpening result.
[0018] In an embodiment of the present application, a sharpening process is performed on an image to be processed to obtain an initial sharpened image, a pooling process is performed on each pixel point in the image to be processed to obtain a first pooled image and a second pooled image, a preset sharpening parameter is obtained, the initial sharpened image with a halo phenomenon is reprocessed to determine a sharpening result corresponding to each pixel point, and finally, a target sharpened image corresponding to the image to be processed is determined according to the sharpening result corresponding to each pixel point. This method can suppress image sharpening halo, basically eliminate sharpening halo, greatly retain the degree of sharpening, ensure the definition of the image, and improve the viewing experience of the audience. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 is a schematic diagram of an image processing method provided by an embodiment of the present application;
[0020] Figure 2This is a flowchart of an image processing method provided in an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of an image after sharpening according to an embodiment of the image processing method provided in this application;
[0022] Figure 4 This is a schematic diagram of an image after sharpening and suppression processing according to an embodiment of the image processing method provided in this application;
[0023] Figure 5 This is a schematic diagram of the structure of an image processing apparatus provided in one embodiment of this application;
[0024] Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this application. Detailed Implementation
[0025] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.
[0026] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this application refers to and includes any or all possible combinations of one or more associated listed items.
[0027] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0028] First, the terms and concepts involved in one or more embodiments of this application will be explained.
[0029] A digital image is an image represented as a two-dimensional array, which is how an image is stored in a computer. The two dimensions of this two-dimensional array represent the rows and columns of the image, respectively. The basic building block of a digital image is called a pixel.
[0030] Pixel: A pixel is the basic unit of an image, and its essence is a numerical value. The numerical range of an image pixel is from 0 to 255. The larger the pixel value, and the closer it is to 255, the brighter and whiter the pixel is; the smaller the pixel value, and the closer it is to 0, the darker and blacker the pixel is.
[0031] Image sharpening is an image processing technique used to enhance the contrast of the edges of objects in an image, making the image appear clearer to the naked eye.
[0032] Sharpening halo: This is a negative effect introduced by some sharpening algorithms. Most sharpening algorithms introduce black or white borders at the edges of an image, which appear to the naked eye as a halo around the edges of objects.
[0033] Image sharpening technology can significantly improve image clarity in some applications and is often a necessary step in image processing enhancement. Images processed by sharpening algorithms are clearer in texture than the original, thus greatly improving the visual appeal. However, most sharpening algorithms are prone to causing a sharpening halo effect, commonly known as sharpening "white edges" (though "black and white edges" would be more accurate). While the overall image becomes much clearer, some details introduce a negative white edge effect, which is the "halo effect" commonly found in sharpening algorithms. The mechanism is that the sharpening algorithm makes the side with larger pixel values larger and the side with smaller pixel values smaller, amplifying this difference and producing a sharpening effect. However, pixels cannot increase or decrease indefinitely; pixel values range from 0 to 255, with values closer to 255 being brighter and closer to 0 being darker. When the original edge is already quite distinct, meaning the pixel value difference between the two ends of the edge is already large, continuing to amplify that edge with a sharpening algorithm will easily cause the bright and dark areas to overflow, resulting in a sharpening halo effect.
[0034] Based on this, in the embodiments of this application, the halo generated by the sharpened pixel value is reduced or even eliminated by correcting and compensating the sharpened pixel value, while retaining the sharpness improvement brought by the sharpening algorithm.
[0035] This application provides an image processing method, and also relates to an image processing apparatus, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.
[0036] Figure 1 A schematic diagram of an image processing method according to an embodiment of this application is shown.
[0037] It should be noted that the image processing method provided in this application embodiment is used to correct and compensate the pixel values corresponding to each pixel point of the sharpened image in order to eliminate the halo phenomenon caused by the sharpening algorithm.
[0038] In practical applications, when the server acquires the image to be processed, it can sharpen the image according to a preset sharpening algorithm to obtain an initial sharpened image. Further, it performs pooling on each pixel in the image to obtain two types of pooled images: max-pooled and min-pooled images. Then, based on the image to be processed, the initial sharpened image, the max-pooled image, and the min-pooled image, it determines the sharpening result corresponding to each pixel, which can be understood as the pixel value after sharpening suppression. Finally, based on the sharpening-suppressed pixel value corresponding to each pixel, the target sharpened image is generated. For example... Figure 1 As shown, the image to be processed is an "animal image" as an example. The image sharpness is A. After the initial sharpening process, image pooling process, determination of sharpening result, and generation of target sharpened image by the server, the target sharpened image of "animal image" can be obtained. The image sharpness of the target sharpened image is B (B is greater than A). This not only eliminates the halo phenomenon caused by the initial sharpening process, but also retains the sharpness improvement brought by the sharpening algorithm.
[0039] Figure 2 A flowchart of an image processing method according to an embodiment of this application is shown, which specifically includes the following steps:
[0040] It should be noted that the execution subject of the image processing method provided in this application embodiment is not limited in any way, including clients, servers, etc.
[0041] Step 202: Obtain the image to be processed, and sharpen the image to obtain an initial sharpened image.
[0042] The image to be processed can be understood as any image that needs to be sharpened to enhance its clarity, without any restrictions on the content type of the image.
[0043] In practical applications, after acquiring the object to be processed (i.e., the original image), the executing entity can sharpen the image to obtain an initial sharpened image. It should be noted that this initial sharpened image is an image with a halo effect (black and white edges) resulting from sharpening the original image. To eliminate the halo effect produced by the sharpening algorithm, the following processing mainly suppresses this over-sharpening to ensure the visual clarity of the image. For example, the image to be processed can be represented as I, and the image after sharpening (with a halo) is I0. s .
[0044] Further, the step of sharpening the image to be processed to obtain an initial sharpened image includes:
[0045] Determine the target sharpening algorithm for the image to be processed;
[0046] Based on the target sharpening algorithm, the image to be processed is sharpened to obtain an initial sharpened image.
[0047] The target sharpening algorithm may include, but is not limited to, the first-order difference Sobel operator, the second-order difference Laplacian operator, the Unsharpen Mask (USM sharpening algorithm), the differential method, the Robert gradient operator method, the Laplacian operator method, the template matching method, and the high-pass filtering method.
[0048] In practical applications, once the target sharpening algorithm corresponding to the image to be processed is determined, the executing entity can perform sharpening processing on the image to be processed according to the target sharpening algorithm to obtain an initial sharpened image. As an example, the target sharpening algorithm is the Laplacian sharpening algorithm, and the convolution vector corresponding to the pixels of the image to be processed is, for example, a 3×3 convolution.
[0049] In this model, the center value represents the weight of the current pixel, and the surrounding values represent the weights of the pixels surrounding the current pixel. In other words, the new value of the current pixel after sharpening is obtained by subtracting five times the pixel value of the current pixel from the pixel values of its four adjacent pixels. Thus, if a certain degree of image difference, or "image edge," already exists at the current position in the original image, this difference will be amplified after sharpening, resulting in a stronger edge and achieving the purpose of sharpening. It should be noted that this embodiment does not impose any limitations on the algorithm used in the initial sharpening process.
[0050] Reference Appendix Figure 3 , Figure 3 This is a schematic diagram of an image after sharpening according to an embodiment of the image processing method provided in this application.
[0051] Figure 3In the image, 'a' represents a local area of the "animal image." The image boundaries of this area are not clear. After sharpening, the desired result can be obtained. Figure 3 In the local area of the "animal image" in b, (b) is clearer than the image shown in (a). However, the edges of objects in the image still show a "black and white edge" phenomenon, which can be understood as the halo problem mentioned in this embodiment. Subsequent steps need to correct and compensate for the halo effect in the image, reduce or even eliminate the halo generated by the sharpening algorithm, and retain the clarity brought by the sharpening algorithm.
[0052] Step 204: Perform pooling processing on each pixel in the image to be processed to obtain a first pooled image and a second pooled image.
[0053] The first pooling image and the second pooling image can be understood as the images after pooling the pixel values of each pixel in the image to be processed.
[0054] In specific implementation, the step of performing pooling processing on each pixel in the image to be processed to obtain a first pooled image includes:
[0055] Based on a preset neighborhood size, the neighboring pixels of each pixel in the image to be processed are determined;
[0056] Determine the pixel value of the neighboring pixels in the image to be processed, and determine the maximum pixel value among the pixel values as the first pooling pixel value corresponding to the pixel.
[0057] A first pooling image is generated based on the first pooling pixel value corresponding to each pixel.
[0058] In practical applications, the neighboring pixels corresponding to each pixel in the image to be processed are determined according to a preset neighborhood size. For example, if the neighborhood size is 3×3, the pixel value at the center of the matrix is the pixel value of the target pixel, and the eight pixels surrounding the target pixel are the neighboring pixels. Further, it is necessary to determine the pixel values displayed by these neighboring pixels in the image to be processed, and the largest pixel value is determined as the first pooling pixel value corresponding to the target pixel. In this way, the first pooling pixel value corresponding to each pixel is determined, and thus, the first pooling image corresponding to the image to be processed is generated.
[0059] As an example, let I be the image to be processed. Perform a kxk max pooling operation on I to obtain I. max That is, to determine the maximum value I within the kxk region surrounding I(x,y). max(x,y), where I(x,y) represents the pixel with coordinates (x,y) in the image I to be processed; then, after performing max pooling operation on each pixel, the resulting image is the first pooled image.
[0060] Furthermore, the executing entity can also perform pooling processing on each pixel in the image to be processed to obtain a second pooled image; specifically, the step of performing pooling processing on each pixel in the image to be processed to obtain a second pooled image includes:
[0061] Based on a preset neighborhood size, the neighboring pixels of each pixel in the image to be processed are determined;
[0062] Determine the pixel value of the neighboring pixels in the image to be processed, and determine the minimum pixel value among the pixel values as the second pooling pixel value corresponding to the pixel.
[0063] A second pooling image is generated based on the second pooling pixel value corresponding to each pixel.
[0064] In practical applications, the neighboring pixels corresponding to each pixel in the image to be processed are determined according to a preset neighborhood size. For example, if the neighborhood size is 3×3, the pixel value at the center of the matrix is the pixel value of the target pixel, and the eight pixels surrounding the target pixel are the neighboring pixels. Further, it is necessary to determine the pixel values displayed by these neighboring pixels in the image to be processed, and the smallest pixel value is determined as the second pooling pixel value corresponding to the target pixel. In this way, the second pooling pixel value corresponding to each pixel is determined, and thus, the second pooling image corresponding to the image to be processed is generated.
[0065] Continuing with the previous example, let I be the image to be processed. Perform a kxk minpooling operation on I to obtain I. min That is, to determine the maximum value I within the kx k region surrounding I(x,y). min (x,y), where I(x,y) represents the pixel with coordinates (x,y) in the image I to be processed; then, after performing minimum pooling operation on each pixel, the resulting image is the second pooled image.
[0066] By performing pooling operations on the pixel values corresponding to each pixel in the image to be processed, we can obtain the max-pooled pixel value and the min-pooled pixel value for each pixel. This makes it easier to determine the result of pixel halo suppression based on the max-pooled pixel value and the min-pooled pixel value.
[0067] Step 206: Based on the preset sharpening parameters, the initial sharpened image, the first pooling image, and the second pooling image, determine the sharpening result corresponding to each pixel in the initial sharpened image.
[0068] The sharpening parameter can be understood as a parameter used to suppress sharpening of each pixel in the initial sharpened image, i.e., a suppression factor; this sharpening parameter is used to balance the halo effect produced by image sharpening. It should be noted that in this embodiment, the sharpening parameter can range from 0 to 1.
[0069] In practical applications, the executing entity can determine the sharpening result of each pixel value based on the preset sharpening parameters, the initial sharpened image, the first pooling image, and the second pooling image. It should be noted that the sharpening result of each pixel value in the same image can be processed with reference to the same sharpening parameters. This embodiment does not impose any limitations on this.
[0070] In specific implementation, determining the sharpening result corresponding to each pixel in the initial sharpened image based on preset sharpening parameters, the initial sharpened image, the first pooled image, and the second pooled image includes:
[0071] Based on preset sharpening parameters, the initial sharpened image, the first pooling image, and the second pooling image, the sharpening boundary value of each pixel in the initial sharpened image is determined;
[0072] Based on the sharpening boundary value, the sharpening result corresponding to each pixel in the initial sharpened image is determined.
[0073] The sharpening boundary value can be understood as the boundary value for suppressing the pixel values of the pixels in the sharpened image, including the maximum boundary value and the minimum boundary value; the sharpening result can be understood as the pixel value for sharpening suppression of each pixel in the sharpened image.
[0074] In practical applications, the executing entity determines the sharpening boundary value corresponding to each pixel in the initial sharpening image based on the preset sharpening parameters, the initial sharpened image, the first pooling image, and the second pooling image. Subsequently, based on the sharpening boundary value, it determines the sharpening result corresponding to each pixel in the initial sharpened image.
[0075] Furthermore, when determining the sharpening boundary values, the executing entity needs to determine the maximum and minimum boundary values of the pixel values in order to balance the halo effect that occurs during sharpening. Specifically, determining the sharpening boundary value of each pixel in the initial sharpened image based on preset sharpening parameters, the initial sharpened image, the first pooling image, and the second pooling image includes:
[0076] Based on preset sharpening parameters, the initial sharpened image, and the first pooled image, determine the first sharpening boundary value corresponding to each pixel in the initial sharpened image;
[0077] Based on preset sharpening parameters, the initial sharpened image, and the second pooled image, a second sharpening boundary value corresponding to each pixel in the initial sharpened image is determined.
[0078] The first sharpening boundary value can be understood as the maximum boundary value of the pixel value corresponding to the pixel point according to the sharpening parameters; the second sharpening boundary value can be understood as the minimum boundary value of the pixel value corresponding to the pixel point according to the sharpening parameters.
[0079] In practical applications, the executing entity can comprehensively determine the first sharpening boundary value corresponding to each pixel in the initial sharpened image based on preset sharpening parameters, the initial sharpened image, and the first pooling image; it can also determine the second sharpening boundary value corresponding to each pixel in the initial sharpened image based on preset sharpening parameters, the initial sharpened image, and the second pooling image. It should be noted that the determination of the first and second sharpening boundary values can be understood as the process of determining the maximum and minimum pixel values of each pixel in the image. The specific determination process can be implemented using various calculation methods, and no limitation is made in this embodiment.
[0080] Furthermore, this embodiment provides a method for calculating sharpening boundary values, wherein the calculation ideas for the first sharpening boundary value and the second sharpening boundary value are similar; specifically, determining the first sharpening boundary value corresponding to each pixel in the initial sharpened image based on preset sharpening parameters, the initial sharpened image, and the first pooled image includes:
[0081] Based on the initial sharpened image and the first pooled image, determine the first pixel difference for each pixel in the initial sharpened image;
[0082] Based on the first pixel difference and the preset sharpening parameters, the first reference pixel value of each pixel is determined;
[0083] Based on the first reference pixel value and the first pooled image, determine the first sharpening boundary value corresponding to each pixel.
[0084] The first pixel difference can be understood as the pixel difference between corresponding pixels in the initial sharpened image and the first pooled image; the first reference pixel value can be understood as the reference pixel value after balancing the first pixel difference according to preset sharpening parameters.
[0085] In practical applications, the executing entity can determine the first pixel difference for each pixel based on the initial sharpened image and the first pooling image. Continuing with the previous example, taking pixel I(x,y) and the preset sharpening parameter s as an example, the first pixel difference can be expressed as I... s -I max Furthermore, by suppressing the difference in the first pixel according to preset sharpening parameters, the first reference pixel value corresponding to that pixel can be determined. Specifically, the first reference pixel value can be determined as follows: the first reference pixel value is represented as s*max(I s -I max Finally, the first sharpening boundary value can be determined based on the first reference pixel value corresponding to each pixel and the pixel value in the first pooled image corresponding to that pixel. This can be achieved by summing the values to obtain the first sharpening boundary value I. upper , can be represented as I upper= I max +s*max(I s -I max ,0); It should be noted that the max operator means taking the larger of the two values.
[0086] Furthermore, the calculation process of the second sharpening boundary value provided in this embodiment can refer to the calculation process of the first sharpening boundary value described above; specifically, determining the second sharpening boundary value corresponding to each pixel in the initial sharpening image based on preset sharpening parameters, the initial sharpened image, and the second pooling image includes:
[0087] Based on the initial sharpened image and the second pooled image, determine the second pixel difference for each pixel in the initial sharpened image;
[0088] Based on the second pixel difference and the preset sharpening parameters, a second reference pixel value is determined for each pixel.
[0089] Based on the second reference pixel value and the second pooled image, determine the second sharpening boundary value corresponding to each pixel.
[0090] The second pixel difference can be understood as the pixel difference between corresponding pixels in the initial sharpened image and the second pooled image; the second reference pixel value can be understood as the reference pixel value after balancing the second pixel difference according to the preset sharpening parameters.
[0091] In practical applications, the executing entity can determine the second pixel difference for each pixel based on the initial sharpened image and the second pooling image. Continuing with the previous example, taking pixel I(x,y) and the preset sharpening parameter s as an example, the second pixel difference can be expressed as I... min -I sFurthermore, by suppressing the second pixel difference according to preset sharpening parameters, the second reference pixel value corresponding to that pixel can be determined. Specifically, the second reference pixel value can be determined as follows: the second reference pixel value is represented as s*max(I min -I s Finally, the second sharpening boundary value can be determined based on the second reference pixel value corresponding to each pixel and the pixel value in the second pooled image corresponding to that pixel. This can be achieved by summing the values to obtain the second sharpening boundary value I. lower , can be represented as I lower= I min +s*max(I min -I s ,0); It should be noted that the max operator means taking the larger of the two values.
[0092] Therefore, in this embodiment, during the halo processing of the initial sharpened image, it is necessary to suppress the pixel values of each pixel in the image according to the set sharpening parameters in order to eliminate the halo effect in the image and solve the problem of black and white edges in the image.
[0093] Finally, after obtaining the first and second sharpening boundary values for each pixel, the executing entity can determine the final sharpening suppression result based on the sharpening boundary value of each pixel. Specifically, determining the sharpening result for each pixel in the initial sharpened image based on the sharpening boundary value includes:
[0094] Based on the second sharpening boundary value and the initial pixel value corresponding to the initial sharpened image, a sharpening reference pixel value is determined for each pixel.
[0095] Based on the sharpening reference pixel value and the first sharpening boundary value, the sharpening result corresponding to each pixel is determined, wherein the sharpening result is the target pixel value corresponding to each pixel.
[0096] In practical applications, the sharpening reference pixel value can be understood as the maximum value between the minimum boundary pixel value corresponding to each pixel and the pixel value of the corresponding pixel in the initial sharpened image. Continuing with the previous example, the sharpening reference pixel value can be expressed as max(I lower ,I s Furthermore, the executing entity determines the final sharpening suppression result for each pixel based on the sharpening reference pixel value and the maximum sharpening boundary value, specifically, it can be represented as I. result =min(I upper ,max(I lower ,I s )).
[0097] Step 208: Based on the sharpening result, determine the target sharpened image corresponding to the image to be processed.
[0098] In practical applications, this image processing method balances the suppression results of pixel values at each pixel in the sharpened image according to preset sharpening parameters, and determines the target sharpened image corresponding to the image to be processed based on the sharpening suppression results. It should be noted that since s ranges from 0 to 1, in the above implementation process, when s is close to 1, the halo suppression degree is the lowest, and the result is at I... s When s is equal to 0, no halo suppression is achieved. As s decreases, the suppression effect begins to strengthen. When s equals 0, halo sharpening is completely suppressed. Of course, this will also reduce the sharpening effect of Is to some extent (but it is still much stronger than the original image).
[0099] Reference Appendix Figure 4 , Figure 4 This illustration shows a schematic diagram of an image after sharpening and suppression processing according to an embodiment of the image processing method provided in this application.
[0100] Figure 4 In the image 'a', the sharpened image is the result of initial sharpening of the original image. Due to over-sharpening, the edges of objects in this image exhibit a halo effect with "black and white edges." To address this, the image processing method provided in this embodiment is... Figure 4 Further sharpening and suppression processing is applied to 'a' in the image, which reduces the black and white edges of the object to some extent, keeping the pixel differences in sharpening enhancement within a reasonable range. This results in the generation of... Figure 4 In figure (b), the black and white edges of the objects have been eliminated, and the image clarity has been correspondingly improved. It should be noted that... Figure 4 (b) and Figure 3 Compared to the display effect of (a) in the middle, the visual experience is greatly improved.
[0101] In summary, the image processing method provided in this application performs sharpening suppression processing on the initial sharpened image with halo effect after sharpening algorithm processing. This process takes into account the boundary problem of the sharpening algorithm, that is, controls the pixel difference of sharpening enhancement within a reasonable range, thereby greatly reducing the risk of pixel value overflow. Furthermore, obvious edges do not need to be further enhanced, while weaker edges can be sufficiently enhanced. Therefore, the sharpening halo can be basically eliminated, and the degree of sharpening is also largely preserved.
[0102] Corresponding to the above method embodiments, this application also provides an image processing apparatus embodiment. Figure 5 A schematic diagram of the structure of an image processing apparatus according to an embodiment of this application is shown. Figure 5 As shown, the device includes:
[0103] The initial sharpening module 502 is configured to acquire an image to be processed, perform sharpening processing on the image to be processed, and obtain an initial sharpened image.
[0104] Image pooling module 504 is configured to perform pooling processing on each pixel in the image to be processed to obtain a first pooled image and a second pooled image.
[0105] The sharpening result determination module 506 is configured to determine the sharpening result corresponding to each pixel in the initial sharpening image based on preset sharpening parameters, the initial sharpened image, the first pooling image, and the second pooling image.
[0106] The image determination module 508 is configured to determine the target sharpened image corresponding to the image to be processed based on the sharpening result.
[0107] Optionally, the sharpening result determination module 506 is further configured to:
[0108] Based on preset sharpening parameters, the initial sharpened image, the first pooling image, and the second pooling image, the sharpening boundary value of each pixel in the initial sharpened image is determined;
[0109] Based on the sharpening boundary value, the sharpening result corresponding to each pixel in the initial sharpened image is determined.
[0110] Optionally, the sharpening result determination module 506 is further configured to:
[0111] Based on preset sharpening parameters, the initial sharpened image, and the first pooled image, determine the first sharpening boundary value corresponding to each pixel in the initial sharpened image;
[0112] Based on preset sharpening parameters, the initial sharpened image, and the second pooled image, a second sharpening boundary value corresponding to each pixel in the initial sharpened image is determined.
[0113] Optionally, the sharpening result determination module 506 is further configured to:
[0114] Based on the initial sharpened image and the first pooled image, determine the first pixel difference for each pixel in the initial sharpened image;
[0115] Based on the first pixel difference and the preset sharpening parameters, the first reference pixel value of each pixel is determined;
[0116] Based on the first reference pixel value and the first pooled image, determine the first sharpening boundary value corresponding to each pixel.
[0117] Optionally, the sharpening result determination module 506 is further configured to:
[0118] Based on the initial sharpened image and the second pooled image, determine the second pixel difference for each pixel in the initial sharpened image;
[0119] Based on the second pixel difference and the preset sharpening parameters, a second reference pixel value is determined for each pixel.
[0120] Based on the second reference pixel value and the second pooled image, determine the second sharpening boundary value corresponding to each pixel.
[0121] Optionally, the sharpening result determination module 506 is further configured to:
[0122] Based on the second sharpening boundary value and the initial pixel value corresponding to the initial sharpened image, a sharpening reference pixel value is determined for each pixel.
[0123] Based on the sharpening reference pixel value and the first sharpening boundary value, the sharpening result corresponding to each pixel is determined, wherein the sharpening result is the target pixel value corresponding to each pixel.
[0124] Optionally, the image pooling module 504 is further configured to:
[0125] Based on a preset neighborhood size, the neighboring pixels of each pixel in the image to be processed are determined;
[0126] Determine the pixel value of the neighboring pixels in the image to be processed, and determine the maximum pixel value among the pixel values as the first pooling pixel value corresponding to the pixel.
[0127] A first pooling image is generated based on the first pooling pixel value corresponding to each pixel.
[0128] Optionally, the image pooling module 504 is further configured to:
[0129] Based on a preset neighborhood size, the neighboring pixels of each pixel in the image to be processed are determined;
[0130] Determine the pixel value of the neighboring pixels in the image to be processed, and determine the minimum pixel value among the pixel values as the second pooling pixel value corresponding to the pixel.
[0131] A second pooling image is generated based on the second pooling pixel value corresponding to each pixel.
[0132] Optionally, the initial sharpening module 502 is further configured to:
[0133] Determine the target sharpening algorithm for the image to be processed;
[0134] Based on the target sharpening algorithm, the image to be processed is sharpened to obtain an initial sharpened image.
[0135] The image processing apparatus provided in this application embodiment obtains an initial sharpened image by sharpening the image to be processed; then, it performs pooling processing on each pixel in the image to be processed to obtain a first pooled image and a second pooled image, thereby obtaining preset sharpening parameters; the initial sharpened image with halo phenomenon is further processed to determine the sharpening result corresponding to each pixel; finally, based on the sharpening result corresponding to each pixel, the target sharpened image corresponding to the image to be processed is determined. This method can suppress image sharpening halo, basically eliminate sharpening halo, and at the same time, the degree of sharpening is largely preserved, ensuring the clarity of the image and improving the viewing experience of the audience.
[0136] The above is an illustrative scheme of an image processing apparatus according to this embodiment. It should be noted that the technical solution of this image processing apparatus and the technical solution of the image processing method described above belong to the same concept. For details not described in detail in the technical solution of the image processing apparatus, please refer to the description of the technical solution of the image processing method described above.
[0137] Figure 6 A structural block diagram of a computing device 600 according to an embodiment of this application is shown. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and a database 650 is used to store data.
[0138] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interface (e.g., a network interface controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0139] In one embodiment of this application, the aforementioned components of the computing device 600 and Figure 6 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 6 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.
[0140] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 600 can also be a mobile or stationary server.
[0141] The processor 620 executes the computer instructions to implement the steps of the image processing method.
[0142] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the image processing method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the image processing method described above.
[0143] An embodiment of this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the image processing method as described above.
[0144] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the image processing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the image processing method described above.
[0145] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0146] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0147] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0148] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0149] The preferred embodiments disclosed above are merely illustrative of this application. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this application. These embodiments are selected and specifically described in this application to better explain the principles and practical applications of this application, thereby enabling those skilled in the art to better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.
Claims
1. An image processing method, characterized in that, include: Acquire the image to be processed, and sharpen the image to obtain an initial sharpened image; Each pixel in the image to be processed is subjected to pooling to obtain a first pooled image and a second pooled image; Based on preset sharpening parameters, the initial sharpened image, the first pooling image, and the second pooling image, the sharpening result corresponding to each pixel in the initial sharpened image is determined; Based on the sharpening result, the target sharpened image corresponding to the image to be processed is determined; The step of determining the sharpening result corresponding to each pixel in the initial sharpened image based on preset sharpening parameters, the initial sharpened image, the first pooling image, and the second pooling image includes: Based on preset sharpening parameters, the initial sharpened image, and the first pooled image, determine the first sharpening boundary value corresponding to each pixel in the initial sharpened image; Based on preset sharpening parameters, the initial sharpened image, and the second pooled image, determine the second sharpening boundary value corresponding to each pixel in the initial sharpened image; Based on the sharpening boundary value, the sharpening result corresponding to each pixel in the initial sharpened image is determined.
2. The method according to claim 1, characterized in that, The step of determining the first sharpening boundary value corresponding to each pixel in the initial sharpened image based on preset sharpening parameters, the initial sharpened image, and the first pooled image includes: Based on the initial sharpened image and the first pooled image, determine the first pixel difference for each pixel in the initial sharpened image; Based on the first pixel difference and the preset sharpening parameters, the first reference pixel value of each pixel is determined; Based on the first reference pixel value and the first pooled image, determine the first sharpening boundary value corresponding to each pixel.
3. The method according to claim 1, characterized in that, The step of determining the second sharpening boundary value corresponding to each pixel in the initial sharpened image based on preset sharpening parameters, the initial sharpened image, and the second pooled image includes: Based on the initial sharpened image and the second pooled image, determine the second pixel difference for each pixel in the initial sharpened image; Based on the second pixel difference and the preset sharpening parameters, a second reference pixel value is determined for each pixel. Based on the second reference pixel value and the second pooled image, determine the second sharpening boundary value corresponding to each pixel.
4. The method according to claim 1, characterized in that, The step of determining the sharpening result corresponding to each pixel in the initial sharpened image based on the sharpening boundary value includes: Based on the second sharpening boundary value and the initial pixel value corresponding to the initial sharpened image, a sharpening reference pixel value is determined for each pixel. Based on the sharpening reference pixel value and the first sharpening boundary value, the sharpening result corresponding to each pixel is determined, wherein the sharpening result is the target pixel value corresponding to each pixel.
5. The method according to any one of claims 1-4, characterized in that, The step of performing pooling processing on each pixel in the image to be processed to obtain a first pooled image includes: Based on a preset neighborhood size, the neighboring pixels of each pixel in the image to be processed are determined; Determine the pixel value of the neighboring pixels in the image to be processed, and determine the maximum pixel value among the pixel values as the first pooling pixel value corresponding to the pixel. A first pooling image is generated based on the first pooling pixel value corresponding to each pixel.
6. The method according to any one of claims 1-4, characterized in that, The step of performing pooling processing on each pixel in the image to be processed to obtain a second pooled image includes: Based on a preset neighborhood size, the neighboring pixels of each pixel in the image to be processed are determined; Determine the pixel value of the neighboring pixels in the image to be processed, and determine the minimum pixel value among the pixel values as the second pooling pixel value corresponding to the pixel. A second pooling image is generated based on the second pooling pixel value corresponding to each pixel.
7. The method according to claim 1, characterized in that, The step of sharpening the image to be processed to obtain an initial sharpened image includes: Determine the target sharpening algorithm for the image to be processed; Based on the target sharpening algorithm, the image to be processed is sharpened to obtain an initial sharpened image.
8. An image processing apparatus, characterized in that, include: The initial sharpening module is configured to acquire the image to be processed, perform sharpening processing on the image to be processed, and obtain an initial sharpened image; The image pooling module is configured to perform pooling processing on each pixel in the image to be processed to obtain a first pooled image and a second pooled image. The sharpening result determination module is configured to determine the sharpening result corresponding to each pixel in the initial sharpening image based on preset sharpening parameters, the initial sharpened image, the first pooling image, and the second pooling image. The image determination module is configured to determine the target sharpened image corresponding to the image to be processed based on the sharpening result; The sharpening result determination module is further configured as follows: Based on preset sharpening parameters, the initial sharpened image, and the first pooled image, determine the first sharpening boundary value corresponding to each pixel in the initial sharpened image; Based on preset sharpening parameters, the initial sharpened image, and the second pooled image, determine the second sharpening boundary value corresponding to each pixel in the initial sharpened image; Based on the sharpening boundary value, the sharpening result corresponding to each pixel in the initial sharpened image is determined.
9. A computing device, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the computer instructions, it implements the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions, characterized in that, When executed by a processor, the computer instructions implement the steps of the method according to any one of claims 1-7.
11. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1-7.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and readable storage medium
CN114782279A
Image sharpening with halo suppression
US20080298712A1