Image sharpening method and device, computer device and computer readable storage medium

By obtaining the target channel components of the image and determining the pixel type to obtain the sharpening gain coefficient, the problem of low image sharpening efficiency in the existing technology is solved, and efficient image sharpening in different scenarios is achieved.

CN117115001BActive Publication Date: 2026-04-14SHENZHEN TCL NEW-TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN TCL NEW-TECH CO LTD
Filing Date
2022-06-17
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing image sharpening algorithms have low sharpening efficiency in different scenarios and require a lot of time to adjust parameters to meet image sharpening requirements.

Method used

By obtaining the target channel components of the image to be sharpened, determining the pixel type of each pixel, and obtaining the matching sharpening gain coefficient based on the pixel type, the pixels are sharpened to generate the sharpened image.

Benefits of technology

It improves the efficiency of image sharpening, can automatically adjust parameters in different scenarios, is suitable for image sharpening processing in various scenarios, and reduces the consumption of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117115001B_ABST
    Figure CN117115001B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an image sharpening method and device, computer equipment and computer readable storage medium, which can obtain an image to be sharpened, and obtain a target channel component of a pixel point in the image to be sharpened; determine a pixel type of the pixel point according to the target channel component; if the pixel type of the pixel point is a target pixel type, obtain a sharpening gain coefficient matched with the pixel point; perform sharpening processing on the pixel point according to the sharpening gain coefficient to obtain a sharpened pixel point; and generate a sharpened image according to the sharpened pixel point. Since the embodiments of the present application can determine the pixel type of the pixel point based on the target channel component, the sharpening gain coefficient matched with the pixel point can be obtained, and the pixel point of the target pixel type can be sharpened, thereby improving the sharpening efficiency of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, specifically to an image sharpening method, apparatus, computer device, and computer-readable storage medium. Background Technology

[0002] With the development of image processing technology, people have increasingly higher requirements for image clarity. Currently, image clarity can be improved by sharpening algorithms.

[0003] Existing sharpening algorithms require adjusting numerous parameters when sharpening images, and the same set of parameters is applied to all pixels in the image. This results in a significant time commitment to finding a set of parameters that meets the sharpening needs of images in different scenarios, including portrait scenes, indoor scenes, outdoor scenes, news scenes, and sports scenes.

[0004] In summary, existing methods for sharpening images are slow. Summary of the Invention

[0005] This application provides an image sharpening method, apparatus, computer device, and computer-readable storage medium, which can improve the efficiency of image sharpening.

[0006] An image sharpening method includes:

[0007] Obtain the image to be sharpened, and obtain the target channel components of the pixels in the image to be sharpened;

[0008] Determine the pixel type of each pixel based on the target channel components;

[0009] If the pixel type of a pixel is the target pixel type, then obtain the sharpening gain coefficient that matches the pixel.

[0010] The pixels are sharpened based on the sharpening gain coefficient to obtain the sharpened pixels.

[0011] Generate a sharpened image based on the sharpened pixels.

[0012] Accordingly, embodiments of this application provide an image sharpening apparatus, including:

[0013] The first acquisition unit can be used to acquire the image to be sharpened, and to acquire the target channel component of the pixel in the image to be sharpened.

[0014] The determining unit can be used to determine the pixel type of a pixel based on the target channel components;

[0015] The second acquisition unit can be used to acquire the sharpening gain coefficient matching the pixel if the pixel type of the pixel is the target pixel type.

[0016] The sharpening unit can be used to sharpen pixels according to the sharpening gain coefficient to obtain sharpened pixels.

[0017] The generation unit can be used to generate a sharpened image based on the sharpened pixels.

[0018] In some embodiments, the sharpening unit may be used to obtain a reference channel component that matches the target channel component; and to sharpen the pixel based on the reference channel component and the sharpening gain coefficient to obtain the sharpened pixel.

[0019] In some embodiments, the sharpening unit may be used to perform a fusion process on the reference channel component and the sharpening gain coefficient to obtain the fused channel component; and to perform a sharpening process on the pixel based on the fused channel component to obtain the sharpened pixel.

[0020] In some embodiments, the sharpening unit may be used to acquire a reference filter and acquire the initial channel components of a pixel; to filter the initial channel components of the pixel according to the reference filter to obtain the reference filtered channel components; and to determine the reference channel components that match the target channel components according to the reference filtered channel components.

[0021] In some embodiments, the sharpening unit may be used to acquire an initial filter and a target filter; to fuse the initial filter and the target filter to obtain a fused filter; and to determine a reference filter based on the fused filter.

[0022] In some embodiments, the second acquisition unit may be used to acquire the initial channel components of a pixel; and determine a sharpening gain coefficient matching the pixel based on the initial channel components.

[0023] In some embodiments, the first acquisition unit may be specifically used to acquire the initial channel components of the pixels of the image to be sharpened, and to acquire a first filter and a second filter; to perform filtering operations on the initial channel components using the first filter and the second filter respectively, to obtain a first filtered component corresponding to the first filter and a second filtered component corresponding to the second filter; and to determine the target channel component based on the first filtered component and the second filtered component.

[0024] In some embodiments, the first acquisition unit may be specifically used to perform component fusion on the first filter component and the second filter component to obtain the fused filter component; and determine the target channel component based on the fused filter component.

[0025] In some embodiments, the determining unit may be specifically used to determine that the pixel type of a pixel is the target pixel type if the target channel component is greater than or equal to a preset component threshold; and to determine that the pixel type of a pixel is not the target pixel type if the target channel component is less than the preset component threshold.

[0026] In some embodiments, the image sharpening apparatus further includes a filtering unit, which can be used to obtain candidate filters and obtain the initial channel components of the pixels; filter the initial channel components of the pixels according to the candidate filters to obtain a set of candidate filtered components, the set of candidate filtered components including at least two candidate filtered components; and update the sharpened pixels according to the candidate filtered components to obtain updated pixels.

[0027] Correspondingly, the generation unit can be used to generate a sharpened image based on the updated pixels.

[0028] In some embodiments, the filtering unit may be specifically used to filter out a first candidate filtered component and a second candidate filtered component from the candidate filtered components according to the numerical value of the candidate filtered components; and to update the sharpened pixels according to the first candidate filtered component and the second candidate filtered component to obtain the updated pixels.

[0029] In some embodiments, the filtering unit may be specifically used to obtain the sharpened channel components of the sharpened pixels and obtain preset parameters; determine a first parameter based on the first filtered component and the preset parameters; determine a second parameter based on the second filtered component and the preset parameters, wherein the second parameter is less than the first parameter; and update the sharpened pixels based on the first parameter and the second parameter to obtain updated pixels.

[0030] In some embodiments, the filtering unit can be specifically used to update the sharpened channel component with the first parameter if the sharpened channel component is greater than the first parameter, so as to update the sharpened pixel and obtain the updated pixel; if the sharpened channel component is less than the second parameter, the second parameter can be used to update the sharpened channel component, so as to update the sharpened pixel and obtain the updated pixel.

[0031] Furthermore, embodiments of this application also provide a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any of the image sharpening methods provided in embodiments of this application.

[0032] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program adapted for loading by a processor to execute any of the image sharpening methods provided in embodiments of this application.

[0033] Furthermore, this application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the image sharpening methods provided in this application.

[0034] Furthermore, this application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the image sharpening methods provided in this application.

[0035] This application embodiment can acquire an image to be sharpened and acquire the target channel component of the pixels in the image to be sharpened; determine the pixel type of the pixel based on the target channel component; if the pixel type of the pixel is the target pixel type, acquire the sharpening gain coefficient matching the pixel; perform sharpening processing on the pixel based on the sharpening gain coefficient to obtain the sharpened pixel; and generate a sharpened image based on the sharpened pixel. Since this application embodiment can determine the pixel type of the pixel based on the target channel component, the pixel of the target pixel type can be sharpened based on the acquired sharpening gain coefficient matching the pixel, thereby improving the image sharpening efficiency. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a schematic diagram of a scenario for the image sharpening method provided in an embodiment of this application;

[0038] Figure 2 This is a flowchart illustrating the image sharpening method provided in an embodiment of this application;

[0039] Figure 3 These are two schematic flowcharts of the image sharpening method provided in the embodiments of this application;

[0040] Figure 4 This is the image to be sharpened provided in the embodiments of this application;

[0041] Figure 5 This is the sharpened image provided in the embodiments of this application;

[0042] Figure 6 This is a schematic diagram of the image sharpening device provided in the embodiments of this application;

[0043] Figure 7 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] This application provides an image sharpening method, apparatus, computer device, and computer-readable storage medium. The image sharpening apparatus can be integrated into a computer device, which may be a server or a terminal, etc.

[0046] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0047] For example, see Figure 1 Taking an image sharpening device integrated into a computer device, specifically a smart TV, as an example, the smart TV acquires the image to be sharpened and the target channel component of the pixels in the image to be sharpened; based on the target channel component, the pixel type of the pixel is determined; if the pixel type of the pixel is the target pixel type, a sharpening gain coefficient matching the pixel is acquired; based on the sharpening gain coefficient, the pixel is sharpened to obtain the sharpened pixel; and based on the sharpened pixel, a sharpened image is generated.

[0048] The image to be sharpened can be any frame from a video, which can refer to a video being played on a computer device. The image to be sharpened can be an RGB image, a YUV image, or a YCbCr image, etc.

[0049] The target channel component can refer to the channel component obtained by processing the initial channel components of the image to be sharpened.

[0050] The sharpening gain coefficient can refer to the coefficient used to sharpen the pixels of the image to be sharpened.

[0051] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0052] This embodiment will be described from the perspective of an image sharpening device, which can be integrated into a computer device, such as a server or a terminal. The terminal can include tablet computers, laptops, personal computers (PCs), wearable devices, virtual reality devices, or other smart devices that can acquire data.

[0053] like Figure 2 As shown, the specific process of this image sharpening method is as follows: steps S101 to S105:

[0054] S101. Obtain the image to be sharpened, and obtain the target channel component of the pixels in the image to be sharpened.

[0055] The image to be sharpened can be any frame in a video, and the video can refer to a video being played on a computer device.

[0056] In this embodiment, the image to be sharpened can be an image of any scene. Scenes include scenes with people, indoor scenes, outdoor scenes, news scenes, and sports competition scenes.

[0057] S102. Determine the pixel type of the pixel based on the target channel components.

[0058] S103. If the pixel type of the pixel is the target pixel type, then obtain the sharpening gain coefficient that matches the pixel.

[0059] S104. Sharpen the pixels according to the sharpening gain coefficient to obtain the sharpened pixels.

[0060] S105. Generate a sharpened image based on the sharpened pixels.

[0061] This application embodiment can acquire an image to be sharpened and acquire the target channel component of the pixels in the image to be sharpened; determine the pixel type of the pixel based on the target channel component; if the pixel type of the pixel is the target pixel type, acquire the sharpening gain coefficient matching the pixel; perform sharpening processing on the pixel based on the sharpening gain coefficient to obtain the sharpened pixel; and generate a sharpened image based on the sharpened pixel. Since this application embodiment can determine the pixel type of the pixel based on the target channel component, the pixel of the target pixel type can be sharpened based on the acquired sharpening gain coefficient matching the pixel, thereby improving the image sharpening efficiency.

[0062] Based on the method described in the above embodiments, the following examples will provide further detailed explanations.

[0063] In this embodiment, the image sharpening device is specifically integrated into a computer device, which can be a server or a terminal.

[0064] like Figure 2 As shown, an image sharpening method is described, with specific steps S101 to S105 as follows:

[0065] S101. Obtain the image to be sharpened, and obtain the target channel component of the pixels in the image to be sharpened.

[0066] This application uses a YCbCr image as an example to illustrate the embodiments.

[0067] The method for obtaining the image to be sharpened in this embodiment of the application can be: obtaining an initial image; converting the format of the initial image to obtain the image to be sharpened.

[0068] The initial image can be an RGB image.

[0069] The method for obtaining the target channel component of a pixel in the image to be sharpened in this embodiment of the application can be as follows: obtaining the initial channel component of the pixel in the image to be sharpened, and obtaining a first filter and a second filter; performing filtering operations on the initial channel component using the first filter and the second filter respectively to obtain the first filtered component corresponding to the first filter and the second filtered component corresponding to the second filter; and determining the target channel component based on the first filtered component and the second filtered component.

[0070] The initial channel component can refer to the Y component of the pixel in the image to be sharpened.

[0071] The first filter can be a high-pass filter, and the second filter can be a band-pass filter. The high-pass filter can be represented as [-1, 2, -1], and the band-pass filter can be represented as [-1, 0, 2, 0, -1].

[0072] Specifically, for each pixel, this embodiment of the application performs matrix multiplication on the pixel and its neighborhood using a first filter to obtain a first filtered component. For each pixel, this embodiment of the application performs matrix multiplication on the pixel and its neighborhood using a second filter to obtain a second filtered component.

[0073] Based on the above, the method for determining the target channel component according to the first filter component and the second filter component in this application embodiment can be as follows: perform component fusion on the first filter component and the second filter component to obtain the fused filter component; and determine the target channel component based on the fused filter component.

[0074] Specifically, in this embodiment, the first filter component and the second filter component are added together to obtain the added filter component, which is the fused filter component. Since the added filter component can be represented in matrix form, this embodiment averages all elements in the added filter component to obtain the average value of the added filter component, which is the target channel component.

[0075] S102. Determine the pixel type of the pixel based on the target channel components.

[0076] Pixel types include edge pixel types and non-edge pixel types. Edge pixel types refer to pixels that are at the edge of the pixel, which are pixels with high-frequency signals. Non-edge pixel types refer to pixels that are not at the edge of the pixel, which are pixels with low-frequency signals and / or noise signals.

[0077] In this embodiment of the application, the pixel type of a pixel can be determined based on the target channel component as follows: if the target channel component is greater than or equal to a preset component threshold, the pixel type of the pixel is determined to be the target pixel type; if the target channel component is less than the preset component threshold, the pixel type of the pixel is determined not to be the target pixel type.

[0078] The preset component threshold can be a pre-set threshold used to determine the pixel type of a pixel. The preset component threshold can be set to 10, but is not limited to 10.

[0079] In the embodiments of this application, it was found through research that when the preset component threshold is set to 10, 90% of non-edge pixels can be filtered out.

[0080] To avoid sharpening of non-edge pixels, this embodiment of the application obtains a sharpening gain coefficient that matches the pixel when the pixel type of the pixel is the target pixel type, as detailed in step S103.

[0081] S103. If the pixel type of the pixel is the target pixel type, then obtain the sharpening gain coefficient that matches the pixel.

[0082] The target pixel type is the edge pixel type. It should be noted that, in this embodiment, each pixel of the target pixel type has a corresponding sharpening gain coefficient.

[0083] The method for obtaining the sharpening gain coefficient matching the pixel in this embodiment can be: obtaining the initial channel component of the pixel; and determining the sharpening gain coefficient matching the pixel based on the initial channel component.

[0084] In this embodiment of the application, the sharpening gain coefficient that matches the pixel is determined based on the initial channel components, as shown in formula (1):

[0085] amount=alpha*sin(y / 127)*(π / 2) formula (1)

[0086] Where, amount refers to the sharpening gain coefficient; alpha is a constant, 0.8≤alpha≤1.2, too large an alpha will result in over-sharpening of pixels, and too small an alpha will result in weak sharpening; y refers to the initial channel component of the pixel.

[0087] In this embodiment, the closer the initial channel component is to the value 127, the larger the sharpening gain coefficient of the initial channel component. Experiments have shown that the range of the initial channel components of edge pixels is approximately [70, 200]. In this embodiment, if the initial channel component of an edge pixel is closer to 127 within the range [70, 200], it indicates stronger scalability and a larger sharpening gain coefficient; conversely, if the initial channel component of an edge pixel is farther from 127 within the range [70, 200], it indicates weaker scalability and a higher risk of pixel value overflow. Therefore, edge pixels farther from 127 need to be assigned a smaller sharpening gain coefficient to prevent pixel value overflow.

[0088] By examining the first derivative of the sin function in formula (1), we find that it is a monotonically decreasing function. When the initial channel component is 127, the first derivative is 0. The first derivative of the sin function reflects its slope. The closer the initial channel component is to 127, the lower the slope of the sin function, the lower the rate of change of the initial channel component, and the lower the rate of change of the sharpening gain coefficient of the initial channel component.

[0089] The embodiments of this application can sharpen only the pixels of the target pixel type, which can improve sharpening efficiency and reduce the CPU resources of the computer device used during the sharpening process.

[0090] S104. Sharpen the pixels according to the sharpening gain coefficient to obtain the sharpened pixels.

[0091] In this embodiment of the application, the sharpening process of pixels based on the sharpening gain coefficient can be achieved by: obtaining a reference channel component that matches the target channel component; and sharpening the pixels based on the reference channel component and the sharpening gain coefficient to obtain the sharpened pixels.

[0092] The reference channel component can refer to a high-frequency signal.

[0093] The method for obtaining the reference channel component that matches the target channel component in this embodiment of the application can be as follows: obtaining a reference filter and obtaining the initial channel component of the pixel; filtering the initial channel component of the pixel according to the reference filter to obtain the reference filtered channel component; and determining the reference channel component that matches the target channel component based on the reference filtered channel component.

[0094] The reference filter can be a high-pass filter.

[0095] Based on the above, the method for obtaining the reference filter in this application embodiment can be as follows: obtaining an initial filter and obtaining a target filter; fusing the initial filter and the target filter to obtain a fused filter; and determining the reference filter based on the fused filter.

[0096] Specifically, the target filter in this embodiment can be a Gaussian filter, specifically a normalized Gaussian filter with size = 5 and sigma = 1. Experiments have shown that if the size of the Gaussian filter is too small, its filtering effect is not significant; if the size is too large, points farther from the center of the Gaussian filter have increasingly smaller weights, to the point of almost no effect. Furthermore, a large Gaussian filter consumes excessive hardware resources. Therefore, this embodiment does not recommend using filters larger than 9*9. Thus, the Gaussian filter with a size of 5*5 and sigma = 1 in this embodiment precisely meets the filtering requirements.

[0097] Specifically, in this embodiment of the application, an initial filter with the same size as the Gaussian filter described above is created, the content of the initial filter is 0, and the value of the center point of the initial filter is modified to 1.

[0098] In this embodiment, the difference between the initial filter and the target filter is calculated to obtain a reference filter for filtering high-frequency signals in the image to be sharpened.

[0099] In this embodiment, a reference filter is used to perform a convolution operation on the initial channel components of the pixel to obtain the reference filtered channel components, which are high-frequency signal quantities.

[0100] In this embodiment, the reference filtered channel component can be used as the reference channel component. In this embodiment, the reference filtered channel component can also be further filtered to obtain the reference channel component.

[0101] In this embodiment of the application, the pixel is sharpened based on the reference channel component and the sharpening gain coefficient. The sharpened pixel can be obtained by: fusing the reference channel component and the sharpening gain coefficient to obtain the fused channel component; and then sharpening the pixel based on the fused channel component to obtain the sharpened pixel.

[0102] Specifically, in this embodiment of the application, the pixel is sharpened based on the fused channel components to obtain the sharpened pixel. The method may be as follows: the fused channel components and the initial channel components of the pixel are fused to obtain the target fused channel components, which are the sharpened channel components of the pixel; the initial channel components of the pixel are updated based on the sharpened channel components to obtain the sharpened pixel.

[0103] Based on the above, the embodiments of this application perform pixel sharpening processing, and the sharpened pixels can be seen from formula (2):

[0104] y2=y+amount*y1 formula (2)

[0105] Where y2 refers to the fused channel component; y refers to the initial channel component; amount refers to the sharpening gain coefficient; and y1 refers to the reference channel component.

[0106] S105. Generate a sharpened image based on the sharpened pixels.

[0107] The embodiments of this application update the corresponding pixels based on the sharpened pixels to generate a sharpened image.

[0108] This application embodiment can convert a YCbCr image into an RGB image. The RGB image is the sharpened image.

[0109] In this embodiment of the application, after step S104, the method further includes: obtaining a candidate filter and obtaining the initial channel components of the pixel; filtering the initial channel components of the pixel according to the candidate filter to obtain a set of candidate filtered components, the set of candidate filtered components including at least two candidate filtered components; updating the sharpened pixel according to the candidate filtered components to obtain the updated pixel.

[0110] Correspondingly, in this embodiment of the application, a sharpened image is generated based on the updated pixels.

[0111] The candidate filter can be a 5x5 filter, and can be specifically represented as the following matrix:

[0112]

[0113] Specifically, in this embodiment, a candidate filter is used to perform a dot product on the initial component channels of a pixel and the neighborhood of that pixel, resulting in a new 5*5 matrix, which is the candidate filtered component set. In this embodiment, different coefficients in the candidate filter reflect the degree of influence of the corresponding initial channel component on the initial channel component of the pixel. Based on this, in order to prevent overshooting of the sharpened pixels and avoid pixel overflow, this embodiment updates the sharpened pixels according to the candidate filtered components to obtain updated pixels.

[0114] Based on the above, the method for updating the sharpened pixels according to the candidate filtered components in this application embodiment to obtain the updated pixels can be as follows: based on the numerical value of the candidate filtered components, a first candidate filtered component and a second candidate filtered component are selected from the candidate filtered components; the sharpened pixels are updated according to the first candidate filtered component and the second candidate filtered component to obtain the updated pixels.

[0115] In this embodiment, the largest candidate filtered component is extracted from the candidate filtered components as the first candidate filtered component; and the smallest candidate filtered component is extracted from the candidate filtered components as the second candidate filtered component.

[0116] In this embodiment, the sharpened pixels are updated based on the first candidate filtered component and the second candidate filtered component. The updated pixels can be obtained by: obtaining the sharpened channel component of the sharpened pixels and obtaining preset parameters; determining the first parameter based on the first filtered component and the preset parameters; determining the second parameter based on the second filtered component and the preset parameters, wherein the second parameter is less than the first parameter; and updating the sharpened pixels based on the first parameter and the second parameter to obtain the updated pixels.

[0117] The preset parameters are adjustable, with a default value of 25.

[0118] In this embodiment, the first filtered component can be added to a preset parameter to obtain a first parameter; and the second filtered component can be subtracted from the preset parameter to obtain a second parameter.

[0119] Based on the above, in this embodiment of the application, the sharpened pixels are updated according to the first parameter and the second parameter. The updated pixels can be obtained as follows: if the sharpened channel component is greater than the first parameter, the first parameter is used to update the sharpened channel component to update the sharpened pixels and obtain the updated pixels; if the sharpened channel component is less than the second parameter, the second parameter is used to update the sharpened channel component to update the sharpened pixels and obtain the updated pixels.

[0120] If the sharpened channel component is greater than or equal to the second parameter and the sharpened channel component is less than or equal to the first parameter, then there is no need to update the sharpened channel component.

[0121] Based on the above, the embodiments of this application will be further explained. For example... Figure 3 As shown, in this embodiment of the application, an image to be sharpened is obtained; initial channel components are extracted from the image to be sharpened; a first filter and a second filter are obtained; the initial channel components are filtered using the first filter and the second filter respectively to obtain a first filtered component corresponding to the first filter and a second filtered component corresponding to the second filter; and a target channel component is determined based on the first filtered component and the second filtered component.

[0122] Then, based on the target channel component, the pixel type of the pixel is determined; if the pixel type of the pixel is the target pixel type, the sharpening gain coefficient matching the pixel is obtained; next, the reference channel component matching the target channel component is obtained; based on the reference channel component and the sharpening gain coefficient, the pixel is sharpened to obtain the sharpened pixel.

[0123] Next, candidate filters and initial channel components of pixels are obtained; the initial channel components of pixels are filtered according to the candidate filters to obtain a set of candidate filtered components, which includes at least two candidate filtered components; the sharpened pixels are updated according to the candidate filtered components to obtain updated pixels; and the sharpened image is generated according to the updated pixels.

[0124] If the pixel type of a pixel is not the target pixel type, then the pixel does not need to be sharpened, and the pixel will still be part of the sharpened image.

[0125] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0126] In this application embodiment, each pixel of the target pixel type can be assigned a different sharpening gain coefficient, which can be applied to images to be sharpened in various scenarios. It can sharpen images to different degrees in different scenarios without manually adjusting the parameters of the sharpening algorithm, and will not destroy the naturalness of the image to be sharpened.

[0127] like Figure 4 As shown, Figure 4 The image to be sharpened shows a monkey as the object, and its edges are relatively blurry. Figure 5 As shown, Figure 5 This is the sharpened image. Objects in the sharpened image are clearer, especially the edges of the objects, which are significantly sharper. Figure 4 The edges of objects in the middle are clear.

[0128] This application embodiment can acquire an image to be sharpened and acquire the target channel component of the pixels in the image to be sharpened; determine the pixel type of the pixel based on the target channel component; if the pixel type of the pixel is the target pixel type, acquire the sharpening gain coefficient matching the pixel; perform sharpening processing on the pixel based on the sharpening gain coefficient to obtain the sharpened pixel; and generate a sharpened image based on the sharpened pixel. Since this application embodiment can determine the pixel type of the pixel based on the target channel component, the pixel of the target pixel type can be sharpened based on the acquired sharpening gain coefficient matching the pixel, thereby improving the image sharpening efficiency.

[0129] To better implement the above methods, this application also provides an image sharpening device that can be integrated into a computer device, such as a server or terminal. The terminal may include a tablet computer, a laptop computer, and / or a personal computer.

[0130] For example, such as Figure 6 As shown, the image sharpening device may include a first acquisition unit 301, a determination unit 302, a second acquisition unit 303, a sharpening unit 304, a generation unit 305, and a filtering unit 306, as follows:

[0131] (1) First acquisition unit 301;

[0132] The acquisition unit 301 can be used to acquire the image to be sharpened and to acquire the target channel component of the pixels in the image to be sharpened.

[0133] In some embodiments, the acquisition unit 301 can be specifically used to acquire the initial channel components of the pixels of the image to be sharpened, and to acquire the first filter and the second filter; to perform filtering operations on the initial channel components using the first filter and the second filter respectively, to obtain the first filtered component corresponding to the first filter and the second filtered component corresponding to the second filter; and to determine the target channel component based on the first filtered component and the second filtered component.

[0134] In some embodiments, the acquisition unit 301 can be specifically used to perform component fusion on the first filter component and the second filter component to obtain the fused filter component; and to determine the target channel component based on the fused filter component.

[0135] (2) Determine unit 302;

[0136] The determining unit 302 can be used to determine the pixel type of a pixel based on the target channel component.

[0137] In some embodiments, the determining unit 302 can be specifically used to determine the pixel type of a pixel as the target pixel type if the target channel component is greater than or equal to a preset component threshold; and to determine the pixel type of a pixel as not the target pixel type if the target channel component is less than the preset component threshold.

[0138] (3) Second acquisition unit 303;

[0139] The second acquisition unit 303 can be used to acquire the sharpening gain coefficient matching the pixel if the pixel type of the pixel is the target pixel type.

[0140] In some embodiments, the second acquisition unit 303 may be used to acquire the initial channel components of a pixel and determine a sharpening gain coefficient matching the pixel based on the initial channel components.

[0141] (4) Sharpening unit 304;

[0142] The sharpening unit 304 can be used to sharpen pixels according to the sharpening gain coefficient to obtain sharpened pixels.

[0143] In some embodiments, the sharpening unit 304 can be specifically used to obtain a reference channel component that matches the target channel component; and to sharpen the pixel based on the reference channel component and the sharpening gain coefficient to obtain the sharpened pixel.

[0144] In some embodiments, the sharpening unit 304 can be used to fuse the reference channel component and the sharpening gain coefficient to obtain the fused channel component; and to sharpen the pixel based on the fused channel component to obtain the sharpened pixel.

[0145] In some embodiments, the sharpening unit 304 can be specifically used to obtain a reference filter and the initial channel components of a pixel; to filter the initial channel components of the pixel according to the reference filter to obtain the reference filtered channel components; and to determine the reference channel components that match the target channel components according to the reference filtered channel components.

[0146] In some embodiments, the sharpening unit 304 can be specifically used to obtain an initial filter and a target filter; to fuse the initial filter and the target filter to obtain a fused filter; and to determine a reference filter based on the fused filter.

[0147] (5) Generation unit 305;

[0148] The generation unit 305 can be used to generate a sharpened image based on the sharpened pixels.

[0149] In some embodiments, the generation unit 305 can be specifically used to generate a sharpened image based on the updated pixels.

[0150] (6) Filtering unit 306;

[0151] The filtering unit 306 can be used to obtain candidate filters and the initial channel components of the pixels; to filter the initial channel components of the pixels according to the candidate filters to obtain a set of candidate filtered components, the set of candidate filtered components including at least two candidate filtered components; and to update the sharpened pixels according to the candidate filtered components to obtain updated pixels.

[0152] In some application embodiments, the filtering unit 306 can be specifically used to filter out the first candidate filtered component and the second candidate filtered component from the candidate filtered components according to the numerical value of the candidate filtered components; and update the sharpened pixels according to the first candidate filtered component and the second candidate filtered component to obtain the updated pixels.

[0153] In some embodiments, the filtering unit 306 can be specifically used to obtain the sharpened channel components of the sharpened pixels and obtain preset parameters; determine the first parameter based on the first filtered component and the preset parameters; determine the second parameter based on the second filtered component and the preset parameters, wherein the second parameter is less than the first parameter; and update the sharpened pixels based on the first parameter and the second parameter to obtain the updated pixels.

[0154] In some embodiments, the filtering unit 306 can be specifically used to update the sharpened channel component with the first parameter if the sharpened channel component is greater than the first parameter, so as to update the sharpened pixel and obtain the updated pixel; if the sharpened channel component is less than the second parameter, the second parameter is used to update the sharpened channel component, so as to update the sharpened pixel and obtain the updated pixel.

[0155] The first acquisition unit 301 of this application embodiment can be used to acquire an image to be sharpened and to acquire the target channel component of the pixels in the image to be sharpened; the determination unit 302 can be used to determine the pixel type of the pixels based on the target channel component; the second acquisition unit 303 can be used to acquire a sharpening gain coefficient matching the pixel if the pixel type of the pixel is the target pixel type; the sharpening unit 304 can be used to sharpen the pixels based on the sharpening gain coefficient to obtain the sharpened pixels; the generation unit 305 can be used to generate a sharpened image based on the sharpened pixels. Since the pixel type of the pixels can be determined based on the target channel component of this application embodiment, the pixels of the target pixel type can be sharpened based on the acquired sharpening gain coefficient matching the pixels, thereby improving the image sharpening efficiency.

[0156] This application also provides a computer device, such as... Figure 7 As shown, it illustrates a structural schematic diagram of the computer device involved in the embodiments of this application, specifically:

[0157] The computer device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 7 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0158] The processor 401 is the control center of the computer device, connecting various parts of the computer device through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and computer programs, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.

[0159] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0160] The computer device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0161] The computer device may also include an input unit 404, which can be used to receive input digital or character information communication, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0162] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the computer device loads the executable files corresponding to the processes of one or more computer programs into the memory 402 according to the following instructions, and the processor 401 runs the computer programs stored in the memory 402 to realize various functions, as follows:

[0163] The process involves: acquiring the image to be sharpened and the target channel component of the pixels in the image; determining the pixel type of the pixels based on the target channel component; if the pixel type of the pixels matches the target pixel type, acquiring the sharpening gain coefficient that matches the pixel; sharpening the pixels based on the sharpening gain coefficient to obtain the sharpened pixels; and generating the sharpened image based on the sharpened pixels.

[0164] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0165] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0166] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute any of the image sharpening methods provided in embodiments of this application.

[0167] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0168] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0169] Since the instructions stored in the computer-readable storage medium can execute the steps of any of the image sharpening methods provided in the embodiments of this application, the beneficial effects that any of the image sharpening methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0170] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations of the above embodiments.

[0171] The foregoing has provided a detailed description of an image sharpening method, apparatus, computer device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An image sharpening method, characterized in that, include: Obtain the image to be sharpened, and obtain the target channel components of the pixels in the image to be sharpened; The pixel type of the pixel is determined based on the target channel component; If the pixel type of the pixel is the target pixel type, then obtain the sharpening gain coefficient that matches the pixel. The pixel is sharpened according to the sharpening gain coefficient to obtain the sharpened pixel. Based on the sharpened pixels, a sharpened image is generated; The step of obtaining the target channel components of pixels in the image to be sharpened includes: The initial channel components of the pixels in the image to be sharpened are obtained, as well as a first filter and a second filter; the first filter is a high-pass filter, and the second filter is a band-pass filter. The initial channel components are filtered using the first filter and the second filter, respectively, to obtain the first filtered component corresponding to the first filter and the second filtered component corresponding to the second filter. The first and second filtered components are added together to obtain the filtered component after addition. The average value of the filtered components after addition is obtained by averaging all elements in the added components. This average value is the target channel component. After sharpening the pixel based on the sharpening gain coefficient to obtain the sharpened pixel, the method further includes: Obtain candidate filters and the initial channel components of the pixel; The initial channel components of the pixel are filtered by the candidate filter to obtain a set of candidate filtered components, which includes at least two candidate filtered components. The set of candidate filtered components is obtained by multiplying the initial channel components of the pixel and the neighborhood of the pixel by the candidate filter. Different coefficients in the candidate filter reflect the degree of influence of the initial channel components corresponding to the coefficients on the initial channel components of the pixel. Based on the magnitude of the candidate filtered components, the first candidate filtered component and the second candidate filtered component are selected from the candidate filtered components. Obtain the sharpened channel components of the sharpened pixels, and obtain preset parameters; The first candidate filtered component is added to the preset parameter to obtain the first parameter; Subtract the preset parameter from the second candidate filtered component to obtain the second parameter, which is less than the first parameter; The sharpened pixels are updated based on the first and second parameters to obtain the updated pixels. The step of updating the sharpened pixels based on the first parameter and the second parameter to obtain the updated pixels includes: If the sharpened channel component is greater than the first parameter, then the first parameter is used to update the sharpened channel component in order to update the sharpened pixel and obtain the updated pixel. If the sharpened channel component is less than the second parameter, then the second parameter is used to update the sharpened channel component in order to update the sharpened pixel and obtain the updated pixel.

2. The image sharpening method according to claim 1, characterized in that, The step of sharpening the pixel based on the sharpening gain coefficient to obtain the sharpened pixel includes: Obtain a reference channel component that matches the target channel component; The pixel is sharpened based on the reference channel component and the sharpening gain coefficient to obtain the sharpened pixel.

3. The image sharpening method according to claim 2, characterized in that, The step of sharpening the pixel based on the reference channel component and the sharpening gain coefficient to obtain the sharpened pixel includes: The reference channel component and the sharpening gain coefficient are fused to obtain the fused channel component; Based on the fused channel components, the pixel is sharpened to obtain the sharpened pixel.

4. The image sharpening method according to claim 2, characterized in that, The step of obtaining a reference channel component that matches the target channel component includes: Obtain a reference filter and obtain the initial channel components of the pixel; The initial channel components of the pixel are filtered according to the reference filter to obtain the reference filtered channel components. Based on the filtered channel components, a reference channel component that matches the target channel component is determined.

5. The image sharpening method according to claim 4, characterized in that, The acquisition of the reference filter includes: Obtain the initial filter and the target filter; The initial filter and the target filter are fused to obtain a fused filter; The reference filter is determined based on the fused filter.

6. The image sharpening method according to claim 1, characterized in that, The step of obtaining the sharpening gain coefficient matching the pixel includes: Obtain the initial channel components of the pixel; Based on the initial channel components, a sharpening gain coefficient matching the pixel is determined.

7. The image sharpening method according to claim 1, characterized in that, Determining the pixel type of the pixel based on the target channel component includes: If the target channel component is greater than or equal to a preset component threshold, then the pixel type of the pixel is determined to be the target pixel type; If the target channel component is less than a preset component threshold, then the pixel type of the pixel is determined to be not the target pixel type.

8. The image sharpening method according to any one of claims 1 to 7, characterized in that, The step of generating a sharpened image based on the sharpened pixels includes: generating a sharpened image based on the updated pixels.

9. An image sharpening device, characterized in that, include: The first acquisition unit is used to acquire the image to be sharpened and to acquire the target channel component of the pixels in the image to be sharpened. The determining unit is configured to determine the pixel type of the pixel based on the target channel component. The second acquisition unit is used to acquire a sharpening gain coefficient that matches the pixel if the pixel type of the pixel is a target pixel type. The sharpening unit is used to sharpen the pixel according to the sharpening gain coefficient to obtain the sharpened pixel. The generation unit is used to generate a sharpened image based on the sharpened pixels. The first acquisition unit is specifically used for: The initial channel components of the pixels in the image to be sharpened are obtained, as well as a first filter and a second filter; the first filter is a high-pass filter, and the second filter is a band-pass filter. The initial channel components are filtered using the first filter and the second filter, respectively, to obtain the first filtered component corresponding to the first filter and the second filtered component corresponding to the second filter. The first and second filtered components are added together to obtain the filtered component after addition. The average value of the filtered components after addition is obtained by averaging all elements in the added components. This average value is the target channel component. The image sharpening device further includes a filtering unit, which is used for: Obtain candidate filters and the initial channel components of the pixel; The initial channel components of the pixel are filtered according to the candidate filter to obtain a set of candidate filtered components, and the set of candidate filtered components includes at least two candidate filtered components. The candidate filtered component set is obtained by multiplying the initial channel component of a pixel and its neighborhood using the candidate filter. Different coefficients in the candidate filter reflect the degree of influence of the initial channel component corresponding to the coefficient on the initial channel component of the pixel. Based on the magnitude of the candidate filtered components, the first candidate filtered component and the second candidate filtered component are selected from the candidate filtered components. Obtain the sharpened channel components of the sharpened pixels, and obtain preset parameters; The first candidate filtered component is added to the preset parameter to obtain the first parameter; Subtract the preset parameter from the second candidate filtered component to obtain the second parameter, which is less than the first parameter; The sharpened pixels are updated based on the first and second parameters to obtain the updated pixels. The filtering unit is specifically used for: If the sharpened channel component is greater than the first parameter, then the first parameter is used to update the sharpened channel component in order to update the sharpened pixel and obtain the updated pixel. If the sharpened channel component is less than the second parameter, then the second parameter is used to update the sharpened channel component in order to update the sharpened pixel and obtain the updated pixel.

10. A computer device, characterized in that, It includes a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to perform the image sharpening method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the image sharpening method according to any one of claims 1 to 8.

12. A computer program product, characterized in that, The computer program product stores a computer program adapted for loading by a processor to execute the image sharpening method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Apparatus for image processing by using step gain control and related method thereof

    CN101399911A

  • Image sharpening method and related device

    CN101980521A

  • Image sharpening method and device

    CN110796626A