Image sharpening method and device, electronic equipment and storage medium

By using a sliding window algorithm and a sharpening control coefficient, the problem of white or black edges in traditional image sharpening algorithms is solved, achieving clearer image edge processing.

CN121280271APending Publication Date: 2026-01-06BEIJING LUSTER LIGHTTECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511202483.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2026-01-06

AI Technical Summary

Technical Problem

Traditional image sharpening algorithms amplify noise when processing image edges, resulting in white or black borders that affect image clarity.

Method used

The sharpening control coefficient for each pixel is obtained through a sliding window algorithm. Based on the sharpening control coefficient and the threshold, the enhancement amount of each pixel is controlled to avoid the generation of white or black edges.

Benefits of technology

It effectively controls the image sharpening process, avoids the appearance of white or black edges, and improves the clarity and quality of image edges.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121280271A_ABST
    Figure CN121280271A_ABST
Patent Text Reader

Abstract

The invention discloses an image sharpening method and device, electronic equipment and a storage medium, and belongs to the technical field of image processing. The method comprises the following steps: sharpening an original image to obtain a target image; for each pixel position of the target image, based on a sliding window algorithm, acquiring a sharpening control coefficient of the pixel position; and based on the sharpening control coefficient, obtaining a target enhanced pixel of the pixel position to obtain an enhanced sharpened image. According to the image sharpening method disclosed by the invention, the problem that white edges or black edges are generated due to the fact that excessive pixels in the image are eliminated in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and particularly relates to an image sharpening method, apparatus, electronic device and storage medium. Background Technology

[0002] Due to limitations in camera hardware or parameters such as focal length, images captured by the camera may contain excessive pixels at the edges of objects. To improve image clarity, sharpening techniques are typically used to reduce the number of excessive pixels at these edges.

[0003] However, in the process of reducing the number of excessive pixels at the edges of objects through sharpening, traditional sharpening algorithms will enhance noise along with the object edges, resulting in overly bright white or black edges at the object edges in the processed image. Summary of the Invention

[0004] This application aims to at least address one of the technical problems existing in the prior art. To this end, this application proposes an image sharpening method, apparatus, electronic device, and storage medium to solve the problem of white or black borders caused by excessive pixels in images in related technologies.

[0005] Firstly, this application provides an image sharpening method, including: The original image is sharpened to obtain the target image; For each pixel location in the target image, a sharpening control coefficient is obtained based on a sliding window algorithm. Based on the sharpening control coefficient, the target enhanced pixels at the pixel location are obtained to acquire an enhanced and sharpened image.

[0006] According to the image sharpening method of this application, a target image is obtained by sharpening the original image; for each pixel position in the target image, a sharpening control coefficient is obtained based on a sliding window algorithm; based on the sharpening control coefficient, a target enhanced pixel is obtained at that pixel position to obtain an enhanced and sharpened image. Thus, for each pixel position in the target image, the target enhanced pixel at that pixel position is obtained based on the obtained sharpening control coefficient, thereby controlling the sharpening process at that pixel position and preventing white or black edges from being generated during the sharpening process of the original image.

[0007] According to one embodiment of this application, for each pixel position of the target image, a sharpening control coefficient for the pixel position is obtained based on a sliding window algorithm, including: For each pixel position in the target image, the pixel variance and target gradient magnitude of the window corresponding to the pixel position are obtained based on the sliding window algorithm. The edge intensity value at the pixel location is obtained based on the pixel variance and the target gradient magnitude. Based on the edge intensity value, obtain the sharpening control coefficient at the pixel location.

[0008] According to one embodiment of this application, for each pixel position of the target image, based on a sliding window algorithm, the pixel variance and target gradient magnitude of the window corresponding to the pixel position are obtained, including: For a window at a pixel location, obtain the edge response values ​​in the vertical direction, horizontal direction, main diagonal direction, and secondary diagonal direction. The target gradient magnitude at the pixel location is obtained based on the edge response values ​​in the vertical direction, horizontal direction, main diagonal direction, and secondary diagonal direction.

[0009] According to one embodiment of this application, based on sharpening control coefficients, target enhanced pixels at pixel locations are obtained to acquire an enhanced and sharpened image, including: Based on the sharpening control coefficient, the basic sharpening amount at the pixel position is obtained; The target enhanced pixels are determined based on the base sharpening amount and sharpening threshold.

[0010] According to one embodiment of this application, obtaining the basic sharpening amount at a pixel location based on a sharpening control coefficient includes: The difference between the original pixel at a pixel location and the average pixel value of the window corresponding to that pixel location is determined as the brightness difference at that pixel location. The product of the brightness difference and the sharpening control coefficient is used to determine the base sharpening amount at the pixel location.

[0011] According to one embodiment of this application, determining the target enhanced pixel at a pixel location based on a base sharpening amount and a sharpening threshold includes: The target sharpening amount is determined based on the base sharpening amount and the sharpening threshold; The sum of the target sharpening amount and the original pixel at the pixel location is used to determine the target enhanced pixel at that pixel location.

[0012] According to one embodiment of this application, determining the target sharpening amount based on the base sharpening amount and the sharpening threshold includes: If the base sharpening amount is greater than the sharpening threshold, the sharpening threshold is determined as the target sharpening amount. or If the base sharpening amount is less than or equal to the sharpening threshold, the base sharpening amount is determined as the target sharpening amount.

[0013] Secondly, this application provides an image sharpening apparatus, comprising: The first acquisition module is used to sharpen the original image and acquire the target image; The second acquisition module is used to acquire the sharpening control coefficient of each pixel position in the target image based on the sliding window algorithm. The third acquisition module is used to acquire the target enhanced pixels at the pixel location based on the sharpening control coefficient, so as to obtain an enhanced and sharpened image.

[0014] According to the image sharpening apparatus of this application, a target image is obtained by sharpening an original image; for each pixel position in the target image, a sharpening control coefficient is obtained based on a sliding window algorithm; based on the sharpening control coefficient, a target enhanced pixel is obtained at that pixel position to obtain an enhanced and sharpened image. Thus, for each pixel position in the target image, the target enhanced pixel at that pixel position is obtained based on the obtained sharpening control coefficient, thereby controlling the sharpening process at that pixel position and preventing white or black edges from being generated during the sharpening process of the original image.

[0015] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the image sharpening method described in the first aspect.

[0016] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image sharpening method described in the first aspect.

[0017] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0018] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is one of the schematic flowcharts of the image sharpening method provided in the embodiments of this application; Figure 2 This is a schematic diagram of the process for obtaining the sharpening control coefficients at each pixel position according to an embodiment of this application; Figure 3 This is a second schematic flowchart of the image sharpening method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the image sharpening device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0020] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0021] The image sharpening method, apparatus, electronic device, and storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0022] Image sharpening methods can be applied to terminals, specifically executed by hardware or software within the terminal.

[0023] The terminal includes, but is not limited to, portable communication devices such as mobile phones or tablets with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).

[0024] The following embodiments describe a terminal including a display and a touch-sensitive surface. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.

[0025] The image sharpening method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the image sharpening method. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras, and wearable devices. The image sharpening method provided in this application embodiment will be described below using an electronic device as the execution subject as an example.

[0026] like Figure 1 As shown, the image sharpening method includes steps 110, 120, and 130.

[0027] Step 110: Sharpen the original image to obtain the target image.

[0028] In practice, the original image can be the image to be sharpened acquired by the camera.

[0029] In practice, the original image can be either an RGB image or a YUV image. In some embodiments, if the original image is not a YUV image, it can be converted to a YUV image.

[0030] In some embodiments, after the original image is a YUV image or the original image is converted to a YUV image, the Y channel of the YUV image can be sharpened to obtain the target image.

[0031] In some embodiments, after sharpening the Y channel of the original image to obtain the target image, edge augmentation can be performed on the target image.

[0032] In some embodiments, the target image can be expanded by X rows or X columns of pixels at each of the four edges: top, bottom, left, and right.

[0033] In some embodiments, edge expansion of the target image can be performed by mirroring, copying, or filling the pixel positions of the edge expansion with 0.

[0034] Step 120: For each pixel position in the target image, obtain the sharpening control coefficient of the pixel position based on the sliding window algorithm.

[0035] In some embodiments, sliding window information can be determined based on edge augmentation information, and a sliding window can be drawn based on the sliding window information to execute a sliding window algorithm. The sliding window information includes the sliding window width.

[0036] In some embodiments, the width of the sliding window can be determined based on the following formula: H = 2X - 1; Where H represents the width of the sliding window, and X represents the number of rows and columns of edge expansion pixels.

[0037] In some embodiments, such as Figure 2 As shown, for each pixel location (e.g., pixel location i) of the target image, the sharpening control coefficient can be obtained by using a sliding window algorithm. After obtaining the sharpening control coefficient for one pixel location, the sliding window can be moved based on a sliding step size to obtain the sharpening control coefficient for the next pixel location. The sliding step size can be 1.

[0038] In some embodiments, for each pixel location in the target image, local features of that pixel location can be obtained based on a sliding window algorithm, and then the sharpening control coefficient for that pixel location can be obtained based on the local features. Local features may include the maximum pixel value, minimum pixel value, mean pixel value, pixel variance, and edge response values ​​in each direction for all pixel locations within the sliding window.

[0039] Step 130: Based on the sharpening control coefficient, obtain the target enhanced pixels at the pixel location to obtain the enhanced and sharpened image.

[0040] In some embodiments, the target enhanced pixel at each pixel location can be obtained based on the sharpening control coefficient at that pixel location, and an enhanced sharpened image can be obtained based on the target enhanced pixels at all pixel locations.

[0041] In some embodiments, for each pixel location, the sharpening process at that pixel location can be controlled based on the sharpening control coefficient at that pixel location to obtain the sharpening amount at that pixel location, and the target enhanced pixel at that pixel location can be determined based on the sharpening amount.

[0042] The image sharpening method according to embodiments of this application involves sharpening an original image to obtain a target image; for each pixel position in the target image, a sharpening control coefficient is obtained based on a sliding window algorithm; and based on the sharpening control coefficient, a target enhanced pixel is obtained at that pixel position to obtain an enhanced and sharpened image. Thus, for each pixel position in the target image, the target enhanced pixel at that pixel position is obtained based on the obtained sharpening control coefficient, thereby controlling the sharpening process at that pixel position and preventing white or black edges from being generated during the sharpening process of the original image.

[0043] In some embodiments, for each pixel position of the target image, the pixel variance and target gradient magnitude of the window corresponding to the pixel position are obtained based on the sliding window algorithm; the edge intensity value of the pixel position is obtained based on the pixel variance and target gradient magnitude; and the sharpening control coefficient of the pixel position is obtained based on the edge intensity value.

[0044] In actual execution, the window can be a sliding window in the sliding window algorithm.

[0045] In some embodiments, the window corresponding to a pixel position can be a window centered on that pixel position.

[0046] In some embodiments, for each pixel position, the pixel variance of the window corresponding to that pixel position can be obtained by taking the pixel mean of all pixel positions within the window corresponding to that pixel position and the pixel value of each pixel position within all pixel positions within the window.

[0047] In some embodiments, for each pixel location, the target gradient magnitude of the pixel location can be obtained based on the edge response values ​​in at least one direction within the window corresponding to that pixel location. The target gradient magnitude can be a Sobel gradient magnitude or a Laplace gradient magnitude.

[0048] In some embodiments, for each pixel location, the edge intensity value can be obtained based on the following formula: ; in, This represents the edge intensity value at the i-th pixel position. This represents the target gradient magnitude at the i-th pixel position. Represents the edge blending coefficient. This represents the pixel variance of the window corresponding to the i-th pixel position, where i is an integer greater than 0.

[0049] In some embodiments, for each pixel location, the sharpening control coefficient can be obtained based on the following formula: ; in, H represents the sharpening control coefficient at the i-th pixel position, H represents the sharpening intensity factor (usually 0.5~2.0), K represents the slope of the sharpening curve (usually 1.0~5.0), and T represents the maximum pixel bit depth of the target image (for example, the maximum pixel bit depth is 255 for an 8-bit image and 1023 for a 10-bit image).

[0050] The image sharpening method according to embodiments of this application obtains a target image by sharpening the original image; for each pixel position in the target image, the pixel variance and target gradient magnitude of the window corresponding to the pixel position are obtained based on a sliding window algorithm; the edge intensity value of the pixel position is obtained based on the pixel variance and target gradient magnitude; the sharpening control coefficient of the pixel position is obtained based on the edge intensity value; and the target enhanced pixel of the pixel position is obtained based on the sharpening control coefficient to obtain an enhanced and sharpened image. Thus, for each pixel position in the target image, the target enhanced pixel of that pixel position is obtained based on the obtained sharpening control coefficient, thereby controlling the sharpening process of that pixel position and preventing white or black edges from being generated during the sharpening process of the original image.

[0051] In some embodiments, for a window at a pixel location, the vertical edge response value, the horizontal edge response value, the main diagonal edge response value, and the secondary diagonal edge response value are obtained; based on the vertical edge response value, the horizontal edge response value, the main diagonal edge response value, and the secondary diagonal edge response value, the target gradient magnitude at the pixel location is obtained.

[0052] In actual execution, the edge response value in the main diagonal direction can be the edge response value from the upper left corner to the lower right corner of the window corresponding to the pixel position, and the edge response value in the secondary diagonal direction can be the edge response value from the upper right corner to the lower left corner of the window corresponding to the pixel position.

[0053] In some implementations, for each pixel location within a window, the target gradient magnitude at that pixel location can be obtained using the following formula: ; in, This represents the target gradient magnitude at the i-th pixel position. This represents the vertical edge response value at the i-th pixel position. This represents the edge response value along the secondary diagonal direction at the i-th pixel position. This represents the edge response value along the main diagonal direction at the i-th pixel position. This represents the horizontal edge response value at the i-th pixel position.

[0054] The image sharpening method according to embodiments of this application obtains a target image by sharpening the original image; for a window at a pixel location, it obtains vertical edge response values, horizontal edge response values, main diagonal edge response values, and secondary diagonal edge response values; based on these values, it obtains a target gradient magnitude at the pixel location; based on the pixel variance and the target gradient magnitude, it obtains an edge intensity value at the pixel location; based on the edge intensity value, it obtains a sharpening control coefficient for the pixel location; and based on the sharpening control coefficient, it obtains a target enhanced pixel at the pixel location to obtain an enhanced sharpened image. Thus, for each pixel location in the target image, the target enhanced pixel at that pixel location is obtained based on the obtained sharpening control coefficient, thereby controlling the sharpening process at that pixel location and preventing white or black edges from being generated during the sharpening process of the original image.

[0055] In some embodiments, a base sharpening amount is obtained at a pixel location based on a sharpening control coefficient; and a target enhanced pixel at a pixel location is determined based on the base sharpening amount and a sharpening threshold.

[0056] In some embodiments, for each pixel location, the brightness difference between that pixel location and its neighboring pixel locations can be obtained, and the basic sharpening amount for that pixel location can be obtained based on the brightness difference and the sharpening control coefficient.

[0057] In some embodiments, for each pixel location, the actual sharpening amount at the pixel location can be determined based on the base sharpening amount and the sharpening threshold, and the original pixel at the pixel location can be adjusted based on the actual sharpening amount to determine the target enhanced pixel at the pixel location.

[0058] In some embodiments, for each pixel location, the actual sharpening amount at the pixel location can be determined based on the relationship between the base sharpening amount and the sharpening threshold.

[0059] The image sharpening method according to embodiments of this application involves sharpening an original image to obtain a target image; for each pixel location in the target image, a sharpening control coefficient is obtained based on a sliding window algorithm; based on the sharpening control coefficient, a basic sharpening amount is obtained for the pixel location; and based on the basic sharpening amount and a sharpening threshold, a target enhancement pixel is determined for that pixel location. Thus, for each pixel location in the target image, the target enhancement pixel is obtained based on the obtained sharpening control coefficient, thereby controlling the sharpening process for that pixel location and preventing white or black edges from being generated during the sharpening process of the original image.

[0060] In some embodiments, the difference between the original pixel at a pixel location and the average pixel value of the window corresponding to the pixel location is determined as the brightness difference at the pixel location; the product of the brightness difference and the sharpening control coefficient is determined as the base sharpening amount at the pixel location.

[0061] In some embodiments, for each pixel location, the sum of pixel values ​​of all pixel locations in the window corresponding to that pixel location can be obtained, thereby obtaining the average pixel value of the window corresponding to that pixel location. The difference between the original pixel value at that pixel location and the average pixel value of the window corresponding to that pixel location is determined as the brightness difference at that pixel location.

[0062] The image sharpening method according to embodiments of this application obtains a target image by sharpening an original image; for each pixel position in the target image, a sharpening control coefficient is obtained based on a sliding window algorithm; the difference between the original pixel at the pixel position and the average pixel value of the window corresponding to the pixel position is determined as the brightness difference at the pixel position; the product of the brightness difference and the sharpening control coefficient is determined as the base sharpening amount at the pixel position; and the target enhanced pixel at the pixel position is determined based on the base sharpening amount and a sharpening threshold. Thus, for each pixel position in the target image, the target enhanced pixel at that pixel position is obtained based on the obtained sharpening control coefficient, thereby controlling the sharpening process at that pixel position and preventing white or black edges from being generated during the sharpening process of the original image.

[0063] In some embodiments, a target sharpening amount is determined based on a base sharpening amount and a sharpening threshold; the sum of the target sharpening amount and the original pixel at the pixel location is determined as the target enhanced pixel at the pixel location.

[0064] In actual execution, the target sharpening amount represents the actual sharpening amount at a pixel location.

[0065] In practice, the sharpening threshold is a preset value. For example, the sharpening threshold can be based on a preset sharpening value.

[0066] In some embodiments, if the base sharpening amount is greater than the sharpening threshold, the sharpening threshold can be determined as the target sharpening amount; if the base sharpening amount is less than or equal to the sharpening threshold, the base sharpening amount can be determined as the target sharpening amount.

[0067] The image sharpening method according to embodiments of this application involves sharpening an original image to obtain a target image; for each pixel location in the target image, a sharpening control coefficient is obtained based on a sliding window algorithm; the difference between the original pixel at the pixel location and the average pixel value of the window corresponding to the pixel location is determined as the brightness difference at the pixel location; the product of the brightness difference and the sharpening control coefficient is determined as the base sharpening amount at the pixel location; based on the base sharpening amount and a sharpening threshold, a target sharpening amount is determined; and the sum of the target sharpening amount and the original pixel at the pixel location is determined as the target enhanced pixel at the pixel location. Thus, for each pixel location in the target image, the target enhanced pixel at that pixel location is obtained based on the obtained sharpening control coefficient, thereby controlling the sharpening process at that pixel location and preventing white or black edges from being generated during the sharpening process of the original image.

[0068] To better understand the image sharpening method provided in the embodiments of this application, further explanation is provided below. It should be understood that the following discussion is merely exemplary.

[0069] This application provides an image sharpening method, the specific steps of which are as follows: Figure 3 As shown: Step 310: Sharpen the original image to obtain the target image.

[0070] In practice, the original image can be the image to be sharpened acquired by the camera.

[0071] In practice, the original image can be either an RGB image or a YUV image. In some embodiments, if the original image is not a YUV image, it can be converted to a YUV image.

[0072] In some embodiments, after the original image is a YUV image or the original image is converted to a YUV image, the Y channel of the YUV image can be sharpened to obtain the target image.

[0073] In some embodiments, after sharpening the Y channel of the original image to obtain the target image, edge augmentation can be performed on the target image.

[0074] In some embodiments, the target image can be expanded by X rows or X columns of pixels at each of the four edges: top, bottom, left, and right.

[0075] In some embodiments, edge expansion of the target image can be performed by mirroring, copying, or filling the pixel positions of the edge expansion with 0.

[0076] Step 320: For each pixel position in the target image, based on the sliding window algorithm, obtain the pixel variance and target gradient magnitude of the window corresponding to the pixel position.

[0077] In actual execution, the window can be a sliding window in the sliding window algorithm.

[0078] In some embodiments, the window corresponding to a pixel position can be a window centered on that pixel position.

[0079] In some embodiments, for each pixel position, the pixel variance of the window corresponding to that pixel position can be obtained by taking the pixel mean of all pixel positions within the window corresponding to that pixel position and the pixel value of each pixel position within all pixel positions within the window.

[0080] In some embodiments, for each pixel location, the target gradient magnitude of the pixel location can be obtained based on the edge response values ​​in at least one direction within the window corresponding to that pixel location. The target gradient magnitude can be a Sobel gradient magnitude or a Laplace gradient magnitude.

[0081] In some embodiments, for a window at a pixel location, the vertical edge response value, the horizontal edge response value, the main diagonal edge response value, and the secondary diagonal edge response value are obtained; based on the vertical edge response value, the horizontal edge response value, the main diagonal edge response value, and the secondary diagonal edge response value, the target gradient magnitude at the pixel location is obtained.

[0082] In actual execution, the edge response value in the main diagonal direction can be the edge response value from the upper left corner to the lower right corner of the window corresponding to the pixel position, and the edge response value in the secondary diagonal direction can be the edge response value from the upper right corner to the lower left corner of the window corresponding to the pixel position.

[0083] In some implementations, for each pixel location within a window, the target gradient magnitude at that pixel location can be obtained using the following formula: ; in, This represents the target gradient magnitude at the i-th pixel position. This represents the vertical edge response value at the i-th pixel position. This represents the edge response value along the secondary diagonal direction at the i-th pixel position. This represents the edge response value along the main diagonal direction at the i-th pixel position. This represents the horizontal edge response value at the i-th pixel position.

[0084] Step 330: Obtain the edge intensity value of the pixel location based on the pixel variance and the target gradient magnitude.

[0085] In some embodiments, for each pixel location, the edge intensity value can be obtained based on the following formula: ; in, This represents the edge intensity value at the i-th pixel position. This represents the target gradient magnitude at the i-th pixel position. Represents the edge blending coefficient. This represents the pixel variance of the window corresponding to the i-th pixel position, where i is an integer greater than 0.

[0086] Step 340: Based on the edge intensity value, obtain the sharpening control coefficient of the pixel position.

[0087] In some embodiments, for each pixel location, the sharpening control coefficient can be obtained based on the following formula: ; in, H represents the sharpening control coefficient at the i-th pixel position, H represents the sharpening intensity factor (usually 0.5~2.0), K represents the slope of the sharpening curve (usually 1.0~5.0), and T represents the maximum pixel bit depth of the target image (for example, the maximum pixel bit depth is 255 for an 8-bit image and 1023 for a 10-bit image).

[0088] Step 350: Based on the sharpening control coefficient, obtain the basic sharpening amount for the pixel position.

[0089] In some embodiments, for each pixel location, the brightness difference between that pixel location and its neighboring pixel locations can be obtained, and the basic sharpening amount for that pixel location can be obtained based on the brightness difference and the sharpening control coefficient.

[0090] In some embodiments, the difference between the original pixel at a pixel location and the average pixel value of the window corresponding to the pixel location is determined as the brightness difference at the pixel location; the product of the brightness difference and the sharpening control coefficient is determined as the base sharpening amount at the pixel location.

[0091] In some embodiments, for each pixel location, the sum of pixel values ​​of all pixel locations in the window corresponding to that pixel location can be obtained, thereby obtaining the average pixel value of the window corresponding to that pixel location. The difference between the original pixel value at that pixel location and the average pixel value of the window corresponding to that pixel location is determined as the brightness difference at that pixel location.

[0092] Step 360: Determine the target sharpening amount based on the base sharpening amount and the sharpening threshold.

[0093] In actual execution, the target sharpening amount represents the actual sharpening amount at a pixel location.

[0094] In practice, the sharpening threshold is a preset value. For example, the sharpening threshold can be based on a preset sharpening value.

[0095] In some embodiments, if the base sharpening amount is greater than the sharpening threshold, the sharpening threshold can be determined as the target sharpening amount; if the base sharpening amount is less than or equal to the sharpening threshold, the base sharpening amount can be determined as the target sharpening amount.

[0096] Step 370: The sum of the target sharpening amount and the original pixel at the pixel location is used to determine the target enhanced pixel at the pixel location to obtain an enhanced and sharpened image.

[0097] In some embodiments, the target enhanced pixel at each pixel location can be obtained based on the sharpening control coefficient at that pixel location, and an enhanced sharpened image can be obtained based on the target enhanced pixels at all pixel locations.

[0098] This application also provides an image sharpening device.

[0099] like Figure 4 As shown, the image sharpening device 400 includes: a first acquisition module 410, a second acquisition module 420, and a third acquisition module 430.

[0100] The first acquisition module 410 is used to sharpen the original image to acquire the target image; The second acquisition module 420 is used to acquire the sharpening control coefficient of each pixel position in the target image based on the sliding window algorithm. The third acquisition module 430 is used to acquire the target enhanced pixel at the pixel position based on the sharpening control coefficient, so as to obtain an enhanced and sharpened image.

[0101] According to the image sharpening apparatus of this application, a target image is obtained by sharpening an original image; for each pixel position in the target image, a sharpening control coefficient is obtained based on a sliding window algorithm; based on the sharpening control coefficient, a target enhanced pixel is obtained at that pixel position to obtain an enhanced and sharpened image. Thus, for each pixel position in the target image, the target enhanced pixel at that pixel position is obtained based on the obtained sharpening control coefficient, thereby controlling the sharpening process at that pixel position and preventing white or black edges from being generated during the sharpening process of the original image.

[0102] In some embodiments, the first acquisition module 410 includes: The first acquisition unit is used to acquire the pixel variance and target gradient magnitude of the window corresponding to each pixel position in the target image based on the sliding window algorithm. The second acquisition unit is used to acquire the edge intensity value of the pixel position based on the pixel variance and the target gradient magnitude; The third acquisition unit is used to acquire the sharpening control coefficient of the pixel position based on the edge intensity value.

[0103] In some embodiments, the first acquisition unit is used for: For a window at a pixel location, obtain the edge response values ​​in the vertical direction, horizontal direction, main diagonal direction, and secondary diagonal direction. The target gradient magnitude at the pixel location is obtained based on the edge response values ​​in the vertical direction, horizontal direction, main diagonal direction, and secondary diagonal direction.

[0104] In some embodiments, the third acquisition module 430 includes: The fourth acquisition unit is used to acquire the basic sharpening amount of the pixel position based on the sharpening control coefficient; The first determining unit is used to determine the target enhanced pixel at the pixel location based on the base sharpening amount and the sharpening threshold.

[0105] In some embodiments, the fourth acquisition unit is used for: The difference between the original pixel at a pixel location and the average pixel value of the window corresponding to that pixel location is determined as the brightness difference at that pixel location. The product of the brightness difference and the sharpening control coefficient is used to determine the base sharpening amount at the pixel location.

[0106] In some embodiments, the first determining unit is configured to: The target sharpening amount is determined based on the base sharpening amount and the sharpening threshold; The sum of the target sharpening amount and the original pixel at the pixel location is used to determine the target enhanced pixel at that pixel location.

[0107] In some embodiments, the first determining unit is configured to: If the base sharpening amount is greater than the sharpening threshold, the sharpening threshold is determined as the target sharpening amount. or If the base sharpening amount is less than or equal to the sharpening threshold, the base sharpening amount is determined as the target sharpening amount.

[0108] The image sharpening device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.

[0109] The image sharpening device in this application embodiment can be a device with an operating system. This operating system can be a Microsoft (Windows) operating system, an Android operating system, an iOS operating system, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.

[0110] The image sharpening device 400 provided in this embodiment can achieve... Figures 1 to 3 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0111] In some embodiments, such as Figure 5 As shown, this application embodiment also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, it implements the various processes of the above-described image sharpening method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0112] It should be noted that the computer equipment in this application embodiment includes the mobile electronic equipment and non-mobile electronic equipment described above.

[0113] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described image sharpening method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0114] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0115] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described image sharpening method.

[0116] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0117] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described image sharpening method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0118] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0119] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0120] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0121] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0122] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0123] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.

Claims

1. A method of image sharpening, characterized by, The method comprises the following steps: sharpening the original image to obtain a target image; for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm; based on the sharpening control coefficient, obtaining a target enhanced pixel of the pixel position to obtain an enhanced sharpening image.

2. The image sharpening method of claim 1, wherein, The method comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps:

3. The image sharpening method of claim 2, wherein, for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps:

4. The image sharpening method of claim 1, wherein, for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps:

5. The image sharpening method of claim 4, wherein, for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps:

6. The image sharpening method of claim 4, wherein, for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps:

7. The image sharpening method of claim 6, wherein, for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps:

8. An image sharpening apparatus, characterized by comprising: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel position based on a sliding window algorithm, which comprises the following steps: for each pixel position of the target image, obtaining a sharpening control coefficient of the pixel 9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the image sharpening method as claimed in any one of claims 1-7 when executing the program.

10. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the image sharpening method as claimed in any one of claims 1-7 when executed by the processor.