Image sharpening method, system, device, and storage medium

By adaptively setting the edge detection threshold and mapping relationship, reasonable sharpening intensity values ​​are assigned to different types of pixels, solving the problem that existing technologies cannot effectively distinguish between edge and noise regions, and improving the image sharpening effect.

CN116757961BActive Publication Date: 2026-04-24SUZHOU KEDA TECH +1
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU KEDA TECH
Filing Date
2023-06-29
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing image sharpening algorithms cannot effectively distinguish between edge regions and noisy regions, resulting in poor sharpening effects that cannot meet the needs of video conferencing and monitoring scenarios.

Method used

By acquiring the edge detection response value of each pixel in the image to be sharpened, the edge detection threshold is adaptively set, and the cumulative number of pixels is calculated based on the edge detection response value of the pixel and the preset adjustment node value. Different regions are divided, and reasonable sharpening intensity values ​​are assigned to different types of pixels based on the mapping relationship.

Benefits of technology

It implements a sharpening scheme that is more adapted to individual images, effectively distinguishing between background noise areas and detail edge areas, improving image sharpening effects, and avoiding excessive noise introduction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116757961B_ABST
    Figure CN116757961B_ABST
Patent Text Reader

Abstract

The application provides an image sharpening method, system, device and storage medium. The method comprises: obtaining edge detection response values of each pixel point in an image to be sharpened; counting the number of pixel points corresponding to each edge detection response value and calculating the accumulated value of the number of pixel points corresponding to each edge detection response value; obtaining a plurality of preset adjustment node values, selecting the accumulated value of the number of pixel points corresponding to the adjustment node values, and taking the edge detection response value corresponding to the selected accumulated value of the number of pixel points as an edge detection threshold; comparing the edge detection response value of each pixel point with the edge detection threshold respectively to obtain a comparison result, and determining the sharpening intensity value of each pixel point according to the mapping relationship between the comparison result and a plurality of sharpening intensity values; and performing sharpening processing on the image to be sharpened according to the sharpening intensity value of each pixel point. The application can improve the image sharpening effect.
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, and in particular to an image sharpening method, system, device and storage medium. Background Technology

[0002] Image sharpening algorithms are fundamental image enhancement algorithms used to highlight image edges or textured areas, thereby improving image sharpness and overall visual appeal. Therefore, they are applied in various scenarios. For example, in video conferencing, due to limitations in cost, size, and other factors, the original images from video conferencing devices often suffer from insufficient sharpness and a slightly weaker overall visual quality. Therefore, image sharpening processing can improve image quality in video conferencing, enhancing the user experience of the video conferencing system. Specifically for video conferencing systems, sharpening algorithms need to enhance details near the face, highlighting facial features, while minimizing the introduction of noise.

[0003] Existing sharpening algorithms typically employ first-order gradient operators, Laplace operators, and unsharpened masking algorithms. However, these algorithms often fail to effectively distinguish between edge and noisy regions. While they can highlight edges, they frequently suffer from significant noise and coarse edges, failing to meet the practical needs of video conferencing systems. Similarly, when existing image sharpening algorithms are applied to other scenarios, such as image processing in surveillance environments, they also exhibit the problem of not being able to effectively differentiate between edge and noisy regions, resulting in sharpening effects that do not meet usage requirements. Summary of the Invention

[0004] In view of the problems in the prior art, the purpose of this application is to provide an image sharpening method, system, device and storage medium to improve the image sharpening effect.

[0005] This application provides an image sharpening method, including the following steps:

[0006] Obtain the edge detection response value of each pixel in the image to be sharpened;

[0007] The number of pixels corresponding to each edge detection response value is counted, and the cumulative value of the number of pixels corresponding to each edge detection response value is calculated.

[0008] Based on the image information of the image to be sharpened, obtain a plurality of preset adjustment node values, select the pixel count accumulation value corresponding to the adjustment node value, and use the edge detection response value corresponding to the selected pixel count accumulation value as the edge detection threshold.

[0009] The edge detection response value of each pixel is compared with the edge detection threshold to obtain the comparison result. Based on the mapping relationship between the comparison result and multiple sharpening intensity values, the sharpening intensity value of each pixel is determined.

[0010] The image to be sharpened is sharpened based on the sharpening intensity value of each pixel to obtain the sharpened image.

[0011] In the method of this application, after obtaining the edge detection response value of each pixel in the image to be sharpened, an edge detection threshold is adaptively set. This edge detection threshold is selected and set based on the cumulative value of the number of pixels calculated from the edge detection response value of the image to be sharpened and a preset adjustment node value. Therefore, this threshold fully considers the distribution of the edge detection response value in the current image to be sharpened. Furthermore, the adjustment node value is determined based on the image information of the image to be sharpened itself, which better meets the edge detection requirements of the current sharpened image. Then, the pixels are grouped based on the comparison between the edge detection response value of each pixel and the threshold. Pixels in different groups correspond to different types of regions. For example, pixels with larger edge detection response values ​​correspond to edge regions, pixels with smaller edge detection response values ​​correspond to background noise regions, and pixels with edge detection response values ​​in between correspond to texture regions, etc. Different sharpening intensity values ​​are assigned to different pixels based on the mapping relationship between the comparison results and the sharpening intensity values, thereby making the set sharpening intensity values ​​more reasonable. The image is then sharpened based on the more reasonable sharpening intensity values. Therefore, this application can provide a sharpening scheme that is more suitable for a single image, setting more appropriate sharpening intensity values ​​for different pixels, and effectively improving the image sharpening effect.

[0012] In some embodiments, the image information of the image to be sharpened includes the width, height, and bit depth of the image to be sharpened. Obtaining a plurality of preset adjustment node values ​​based on the image information of the image to be sharpened includes: calculating the plurality of adjustment node values ​​using a preset node calculation function based on the width, height, and bit depth of the image to be sharpened.

[0013] In some embodiments, the edge detection response value of each pixel is compared with the edge detection threshold to obtain a comparison result, and the sharpening intensity value of each pixel is determined according to the mapping relationship between the comparison result and multiple sharpening intensity values, including the following steps:

[0014] Obtain a preset mapping relationship between comparison results and multiple sharpening intensity values, wherein the mapping relationship includes the mapping relationship between multiple edge detection response value ranges corresponding to the comparison results and sharpening intensity values;

[0015] For each pixel, the edge detection response value is compared with the edge detection threshold to determine the range of edge detection response values ​​that the edge detection response value of each pixel falls into, which is used as the comparison result.

[0016] According to the mapping relationship, the sharpening intensity value corresponding to the range of edge detection response values ​​that the edge falls into is taken as the sharpening intensity value of the corresponding pixel.

[0017] In some embodiments, the image to be sharpened is sharpened based on the sharpening intensity value of each pixel, including the following steps:

[0018] Based on the initial grayscale channel image of the image to be sharpened, the initial high-frequency components of each pixel in the image to be sharpened are obtained.

[0019] Calculate the sharpened high-frequency components of each pixel based on the initial high-frequency components and the sharpening intensity value of each pixel;

[0020] The sharpened high-frequency components are superimposed onto the initial grayscale channel image to obtain the sharpened grayscale channel image.

[0021] The sharpened image is obtained based on the sharpened grayscale channel image.

[0022] This application also provides an image sharpening system applied to the image sharpening method, the system comprising:

[0023] The edge detection response value acquisition module is used to acquire the edge detection response value of each pixel in the image to be sharpened;

[0024] The threshold setting module is used to count the number of pixels corresponding to each edge detection response value and calculate the cumulative value of the number of pixels corresponding to each edge detection response value; and to obtain a plurality of preset adjustment node values ​​according to the image information of the image to be sharpened, select the cumulative value of the number of pixels corresponding to the adjustment node value, and use the edge detection response value corresponding to the selected cumulative value of the number of pixels as the edge detection threshold.

[0025] The sharpening intensity acquisition module is used to compare the edge detection response value of each pixel with the edge detection threshold respectively to obtain the comparison result, and determine the sharpening intensity value of each pixel according to the mapping relationship between the comparison result and multiple sharpening intensity values;

[0026] The sharpening module is used to sharpen the image to be sharpened based on the sharpening intensity value of each pixel.

[0027] In the system of this application, after the edge detection response value acquisition module obtains the edge detection response value of each pixel in the image to be sharpened, the threshold setting module adaptively sets the edge detection threshold. This edge detection threshold is selected and set based on the cumulative value of the number of pixels calculated from the edge detection response value of the image to be sharpened and a preset adjustment node value. Therefore, this threshold fully considers the distribution of the edge detection response value in the current image to be sharpened, and the adjustment node value is determined based on the image information of the image to be sharpened itself, which is more in line with the edge detection requirements of the current sharpened image. The sharpening intensity acquisition module groups the pixels based on the comparison between the edge detection response value of each pixel and the threshold. Different groups of pixels correspond to different types of regions. For example, pixels with larger edge detection response values ​​correspond to edge regions, pixels with smaller edge detection response values ​​correspond to background noise regions, and pixels with edge detection response values ​​in between correspond to texture regions, etc. Based on the mapping relationship between the comparison results and the sharpening intensity value, different sharpening intensity values ​​are assigned to different pixels, thereby making the set sharpening intensity value more reasonable. The sharpening processing module then sharpens the image based on the more reasonable sharpening intensity value. Therefore, this application can provide a sharpening scheme that is more suitable for a single image, setting more appropriate sharpening intensity values ​​for different pixels, and effectively improving the image sharpening effect.

[0028] This application embodiment also provides an image sharpening device, including:

[0029] processor;

[0030] A memory in which executable instructions of the processor are stored;

[0031] The processor is configured to perform the steps of the image sharpening method by executing the executable instructions.

[0032] By employing the image sharpening device provided in this application, the processor executes the image sharpening method when executing the executable instructions, thereby obtaining the beneficial effects of the image sharpening method described above.

[0033] This application also provides a computer-readable storage medium for storing a program that, when executed by a processor, implements the steps of the image sharpening method.

[0034] By employing the computer-readable storage medium provided in this application, wherein the program stored therein implements the steps of the image sharpening method when executed, the beneficial effects of the image sharpening method described above can be obtained. Attached Figure Description

[0035] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.

[0036] Figure 1 This is a flowchart of an image sharpening method according to an embodiment of this application;

[0037] Figure 2 This is a schematic diagram of a horizontal Sobel filter according to an embodiment of this application;

[0038] Figure 3 This is a schematic diagram of a vertical Sobel filter according to an embodiment of this application;

[0039] Figure 4 This is a schematic diagram of a histogram according to an embodiment of this application;

[0040] Figure 5 This is a schematic diagram of a high-pass filter according to an embodiment of this application;

[0041] Figure 6 This is a schematic diagram of an image sharpening system according to an embodiment of this application;

[0042] Figure 7 This is a schematic diagram of the structure of an image sharpening device according to an embodiment of this application;

[0043] Figure 8 This is a schematic diagram of the structure of a computer storage medium according to an embodiment of this application. Detailed Implementation

[0044] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and therefore repeated descriptions of them will be omitted. Although the terms "first" or "second," etc., are used in this specification to denote certain features, these are merely indicative of function and not as a limitation on the number or importance of specific features.

[0045] like Figure 1 As shown, in one embodiment, this application provides an image sharpening method, including the following steps:

[0046] S100: Obtain the edge detection response value of each pixel in the image to be sharpened;

[0047] The edge detection response value can be obtained by using an edge detection filter. For example, to obtain the image to be sharpened, obtain its grayscale channel image, and process it with an edge detection filter to obtain the edge detection response value of each pixel.

[0048] S200: Count the number of pixels corresponding to each edge detection response value, and calculate the cumulative value of the number of pixels corresponding to each edge detection response value;

[0049] S300: Obtain multiple preset adjustment node values ​​based on the image information of the image to be sharpened, select the pixel count accumulation value corresponding to the adjustment node value, and use the edge detection response value corresponding to the selected pixel count accumulation value as the edge detection threshold.

[0050] Therefore, in this application, the number of edge detection thresholds obtained can be the same as the number of adjustment node values. The number of edge detection response value ranges for subsequent pixel classification can be adjusted by adjusting the number of preset adjustment node values. For example, when setting 8 adjustment node values, the 8 edge detection response values ​​corresponding to the cumulative value of the 8 pixel counts are selected as edge detection thresholds. Then, the 8 edge detection thresholds can divide 9 edge detection response value ranges (less than threshold 1; greater than or equal to threshold 1 and less than threshold 2; greater than or equal to threshold 3 and less than threshold 3... greater than threshold 8).

[0051] S400: Compare the edge detection response value of each pixel with the edge detection threshold to obtain a comparison result, and determine the sharpening intensity value of each pixel according to the mapping relationship between the comparison result and multiple sharpening intensity values;

[0052] The mapping relationship between the comparison results and the sharpening intensity values ​​here includes, for example, the mapping relationship between multiple edge detection response value ranges corresponding to the comparison results and the sharpening intensity values. Specifically, each edge detection response value range is divided according to the edge detection threshold, and each edge detection response value range corresponds to a sharpening intensity value. When the edge detection response value range of a pixel is determined according to the comparison results, the comparison results correspond to that edge detection response value range, and are further mapped to a sharpening intensity value according to the mapping relationship. For example, when 9 edge detection response value ranges can be divided based on 8 edge detection thresholds, the comparison result may be that the edge detection response value of a pixel falls into one of these 9 edge detection response value ranges. The mapping relationship includes the mapping relationship between each edge detection response value range corresponding to the comparison result and the sharpening intensity value. Different edge detection response value ranges correspond to different types of pixel regions. For example, when the edge detection response value of a pixel falls into a lower edge detection response value range, the pixel corresponds to a background noise region; when the edge detection response value of a pixel falls into a medium edge detection response value range, the pixel corresponds to a texture region; and when the edge detection response value of a pixel falls into a higher edge detection response value range, the pixel corresponds to an edge region. By classifying pixels through edge detection thresholds, different sharpening intensity values ​​can be set for different types of regions.

[0053] S500: The image to be sharpened is sharpened according to the sharpening intensity value of each pixel to obtain the sharpened image.

[0054] This application, after obtaining the edge detection response values ​​of each pixel in the image to be sharpened in step S100, adaptively sets the edge detection threshold in steps S200-S300. This edge detection threshold is selected and set based on the cumulative value of the number of pixels calculated from the edge detection response values ​​of the image to be sharpened and a preset adjustment node value. Therefore, this threshold fully considers the distribution of edge detection response values ​​in the current image to be sharpened, and the adjustment node value is determined based on the image information of the image to be sharpened itself, which better meets the edge detection requirements of the current sharpened image. Step S400, based on... The pixels are grouped by comparing their edge detection response values ​​with a threshold. Pixels in different groups correspond to different types of regions. For example, pixels with larger edge detection response values ​​correspond to edge regions, pixels with smaller edge detection response values ​​correspond to background noise regions, and pixels with edge detection response values ​​in between correspond to texture regions. Based on the mapping relationship between the comparison results and sharpening intensity values, different sharpening intensity values ​​are assigned to different pixels, making the set sharpening intensity values ​​more reasonable. The image is then sharpened in step S500 based on the more reasonable sharpening intensity values. Therefore, this application can provide a sharpening scheme more suitable for individual images, setting more appropriate sharpening intensity values ​​for different pixels, and effectively distinguishing between background noise regions and detail edge regions. While highlighting edges, it does not excessively introduce noise, effectively improving the image sharpening effect.

[0055] In this embodiment, step S100, obtaining the edge detection response value of each pixel in the image to be sharpened, includes: obtaining the image to be sharpened in YUV format, obtaining its grayscale channel image, i.e., the Y channel image, and processing it with an edge detection filter to obtain the edge detection response value of each pixel. Here, the grayscale channel image is the grayscale image of the image to be sharpened, also known as a grayscale image or a brightness image. The edge detection filter can be, for example,... Figure 2 The horizontal Sobel filter shown and Figure 3 The vertical Sobel filter is shown. Two filters are applied to the Y-channel image respectively. The absolute values ​​of the filtered pixel results are taken, and the absolute values ​​of the results corresponding to the horizontal and vertical filters for each pixel are added together to obtain the edge detection response value (Gradient) for that pixel. Figure 2 and Figure 3 The values ​​in the filter can be adjusted as needed, and are not limited to those shown in the figure, for example... Figure 2 and Figure 3 The numbers 1, -1, 2, and -2 in the text are changed to 2, -2, 5, and -5, respectively. The edge detection filter can also be other types of filters, not limited to the Sobel filter.

[0056] Step S200: Counting the number of pixels corresponding to each edge detection response value and calculating the cumulative number of pixels corresponding to each edge detection response value, including the following steps:

[0057] Determine m edge detection response values ​​of the image to be sharpened, where m is the number of edge detection response values ​​appearing in all pixels of the image to be sharpened. There are m different edge detection response values ​​in the image to be sharpened, and these m edge detection response values ​​can be sorted in ascending order.

[0058] Calculate the response value x of the i-th edge detection respectively. i The corresponding number of pixels y i , i∈(1,m);

[0059] For the i-th edge detection response value, calculate the cumulative value Acc, which represents the number of pixels from the 1-th edge detection response value to the i-th edge detection response value. i For example, for the first edge detection response value x1, its accumulated pixel count Acc1 is equal to the pixel count y1 corresponding to the first edge detection response value; for the second edge detection response value x2, its accumulated pixel count Acc2 is equal to y1 + y2; for the third edge detection response value x3, its accumulated pixel count Acc2 is equal to y1 + y2 + y3, and so on, for the m-th edge detection response value x... m The cumulative number of pixels, Acc m This is the sum of the number of pixels corresponding to all edge detection response values.

[0060] Furthermore, the cumulative number of pixels corresponding to each edge detection response value can be calculated by constructing a histogram. Specifically, for the i-th edge detection response value, the cumulative number of pixels Acc corresponding to the first edge detection response value to the i-th edge detection response value is calculated. i It includes the following steps:

[0061] A histogram is constructed based on the number of pixels corresponding to each edge detection response value obtained from statistics; Figure 4 An example histogram is shown, where the horizontal axis x represents the edge detection response value, and the vertical axis y represents the number of pixels corresponding to each edge detection response value, i.e., the number of pixels corresponding to the horizontal axis x. i When, the vertical coordinate y i The edge detection response value in the image to be sharpened is equal to x. i The number of pixels, after obtaining the histogram, the m edge detection response values ​​are sorted in ascending order of edge detection response values, i.e., x1 <x2<x3<……<xm ;

[0062] Traverse the histogram, starting from the first edge detection response value, and cumulatively calculate the number of pixels corresponding to each edge detection response value, such that the cumulative pixel count Acc for the i-th edge detection response value is calculated. i The cumulative pixel count Acc is equal to the sum of the number of pixels corresponding to the first edge detection response value to the i-th edge detection response value. i They are also sorted from smallest to largest.

[0063] In this embodiment, by constructing a histogram and calculating the cumulative number of pixels based on traversing the histogram, the cumulative number of m pixels can be obtained more quickly and accurately. This histogram-based calculation method is more intuitive, and the calculation of the cumulative value is faster and more convenient.

[0064] In this embodiment, step S300, which involves obtaining multiple preset adjustment node values ​​and selecting the pixel count accumulation value corresponding to the adjustment node value, includes the following steps:

[0065] Obtain the preset n adjustment node values ​​(p1, p2, p3, p 4…… p n );

[0066] The cumulative value of the number of pixels (Acc1, Acc2, Acc3, Acc4...Acc) m The values ​​are compared with the n adjustment node values ​​respectively, and the value p that is less than the j-th adjustment node value is selected. j And with the j-th adjustment node value p j The cumulative count of the closest pixels is used as the value p of the j-th adjustment node. j The cumulative number of corresponding pixels, j∈(1,n). For example, if Acc1 and Acc2 are both less than the first adjustment node value p1, while Acc3 is greater than the first adjustment node value p1, then the cumulative number of pixels corresponding to the first adjustment node value p1 is Acc2. The edge detection response value x2 corresponding to this cumulative number of pixels Acc2 is set as the edge detection threshold EdgeTresh1. In this way, the corresponding edge detection threshold can be selected according to each adjustment node value, thereby selecting n edge detection thresholds EdgeTresh1, EdgeTresh2, EdgeTresh3, ... EdgeTresh from m edge detection response values. n .

[0067] In this embodiment, the image information of the image to be sharpened includes the width, height, and bit depth of the image. Multiple preset adjustment node values ​​are obtained based on the image information, including: calculating the multiple adjustment node values ​​using a preset node calculation function based on the width, height, and bit depth of the image. For an image to be sharpened, there is a strong correlation between its edge detection response value and its bit depth. Furthermore, the sum of the number of pixels corresponding to each edge detection response value (in histogram calculations, this corresponds to the vertical coordinate value corresponding to each edge detection response value) equals the image resolution. Therefore, setting adjustment node values ​​by combining the image's bit depth and resolution (width and height) allows for setting reasonable adjustment values ​​suitable for adjusting the edge detection response value threshold, better meeting the edge detection requirements of the current sharpened image.

[0068] Specifically, in this embodiment, a total of n adjustment nodes are set, and the adjustment node values ​​of the n adjustment nodes are sorted from smallest to largest. For the j-th adjustment node (j∈[1,n]), the preset node calculation function is p. j = k(j) * width * height / 2 a , where p j Let k(j) be the adjustment node value of the j-th adjustment node, width be the width of the image to be sharpened (i.e., the number of pixels in the width direction), height be the height of the image to be sharpened (i.e., the number of pixels in the height direction), and k(j) = j * 2. a / n, where a is the number of bits used to sharpen the image. Therefore, in this embodiment, the preset node calculation function is implemented using a linear function formula, which allows for faster and more convenient acquisition of the adjustment node values ​​corresponding to each image to be sharpened, thus facilitating real-time image sharpening.

[0069] For example, when the image to be sharpened is 8-bit precision, 2 a The value is 256. When n is chosen to be 8, then k(j) = j * 256 / 8 = j * 32, p j =j*32*width*height / 256 =j*width*height / 8, where the first adjustment node value equals width*height / 8, the second adjustment node value equals 2*width*height / 8, and the eighth adjustment node value equals width*height. When n is chosen as 16, then k(j) = j*256 / 16 = j*16, p j =j*16*width*height / 256=j*width*height / 16.

[0070] In this embodiment, step S400, which compares the edge detection response value of each pixel with the edge detection threshold to obtain a comparison result, and determines the sharpening intensity value of each pixel based on the mapping relationship between the comparison result and multiple sharpening intensity values, includes the following steps:

[0071] Obtain a preset mapping relationship between comparison results and multiple sharpening intensity values, wherein the mapping relationship includes the mapping relationship between multiple edge detection response value ranges corresponding to the comparison results and sharpening intensity values;

[0072] For each pixel, the edge detection response value is compared with the edge detection threshold to determine the range of edge detection response values ​​that the edge detection response value of each pixel falls into, which is used as the comparison result.

[0073] Based on the mapping relationship, the sharpening intensity value corresponding to the range of edge detection response values ​​that the edge falls into is taken as the sharpening intensity value of the corresponding pixel, thereby obtaining the sharpening intensity value of each pixel.

[0074] For example, for a pixel whose edge detection response value is less than the edge detection threshold EdgeTresh1, the sharpening intensity value of that pixel is sharpen_level1. For another pixel whose edge detection response value is greater than or equal to EdgeTresh1 and less than EdgeTresh2, the sharpening intensity value of that pixel is sharpen_level2, and so on. For pixels with an edge detection response value greater than EdgeTresh1, the sharpening intensity value is sharpen_level2. n The pixel whose sharpening intensity value is sharpen_level n+1 .

[0075] In this embodiment, obtaining the mapping relationship between the comparison result and multiple sharpening intensity values ​​may include, after obtaining the edge detection threshold in step S300, manually adjusting the sharpening intensity values ​​corresponding to each edge detection response value range corresponding to the comparison result based on experience. For example, manually distinguishing the edge detection response value ranges corresponding to noise regions, texture regions, and edge regions based on the edge detection threshold, and setting the corresponding sharpening intensity values ​​for noise regions, texture regions, and edge regions respectively. Alternatively, it can be implemented based on a pre-trained machine learning model for sharpening intensity value prediction. For example, an intensity value prediction model is constructed, and multiple sample images are collected. Sample threshold vectors are set for the sample images, and sharpening intensity value vectors are labeled for the sample images. The sample images and sample threshold vectors are used as input data for the intensity value prediction model. The loss function value is calculated based on the sharpening intensity value vector output by the model and the labeled sharpening intensity value vector. The intensity value prediction model is then iteratively optimized and trained based on the loss function value. After obtaining the edge detection threshold through step S300, the vector composed of the image to be sharpened and the edge detection threshold can be input into the trained intensity value prediction model to obtain the sharpening intensity value vector output by the intensity value prediction model. The above mapping relationship is determined based on the correspondence between the sharpening intensity value vector and the edge detection threshold vector.

[0076] In this embodiment, step S500, which involves sharpening the image to be sharpened based on the sharpening intensity value of each pixel, includes the following steps:

[0077] Based on the initial grayscale channel image of the image to be sharpened, the initial high-frequency components of each pixel in the image to be sharpened are obtained; specifically, based on the initial Y-channel image of the image to be sharpened, a high-pass filter is used for filtering to obtain the initial high-frequency components, which are equal to the initial high-frequency components H1 of each pixel obtained through filtering; the high-pass filter is, for example, a... Figure 5 The Laplace filter is shown, but the values ​​are for illustrative purposes only and not intended to represent a complete picture. Figure 5 The information shown is limited to what is presented in the text;

[0078] The sharpened high-frequency components of each pixel are calculated based on the initial high-frequency components and the sharpening intensity value of each pixel. Specifically, for a pixel, the initial high-frequency component H1 of the pixel is multiplied by the sharpening intensity value sharpen_level of the pixel to obtain the sharpened high-frequency component H2 of the pixel.

[0079] The sharpened high-frequency component is superimposed on the initial grayscale channel image to obtain the sharpened grayscale channel image. Specifically, for a pixel, the sharpened high-frequency component H2 of the pixel is added to the pixel value of the pixel in the initial Y channel image to obtain the pixel value of the pixel in the sharpened grayscale channel image, thereby obtaining the sharpened Y channel image.

[0080] The sharpened image is obtained based on the sharpened grayscale channel image. Specifically, the sharpened Y channel image is written to the storage space where the initial Y channel image is located, and the complete sharpened YUV image can be obtained.

[0081] This embodiment exemplarily employs a relatively small filter (e.g., a 3x3 filter), resulting in finer edges after sharpening and requiring less cache resources, making it easy to implement in hardware, particularly with low-cost FPGA hardware. However, this application is not limited to this; in other embodiments, the filter can also be implemented using other types of filter structures, all of which fall within the scope of protection of this application.

[0082] like Figure 6 As shown, this application embodiment also provides an image sharpening system applied to the image sharpening method described above, the system comprising:

[0083] The edge detection response value acquisition module M100 is used to acquire the edge detection response value of each pixel in the image to be sharpened.

[0084] The threshold setting module M200 is used to count the number of pixels corresponding to each edge detection response value and calculate the cumulative value of the number of pixels corresponding to each edge detection response value; and to obtain a plurality of preset adjustment node values ​​according to the image information of the image to be sharpened, select the cumulative value of the number of pixels corresponding to the adjustment node value, and use the edge detection response value corresponding to the selected cumulative value of the number of pixels as the edge detection threshold.

[0085] The sharpening intensity acquisition module M300 is used to compare the edge detection response value of each pixel with the edge detection threshold to obtain the comparison result, and determine the sharpening intensity value of each pixel according to the mapping relationship between the comparison result and multiple sharpening intensity values.

[0086] The sharpening module M400 is used to sharpen the image to be sharpened according to the sharpening intensity value of each pixel.

[0087] This application, through the edge detection response value acquisition module M100, acquires the edge detection response values ​​of each pixel in the image to be sharpened, and then through the threshold setting module M200, adaptively sets the edge detection threshold. This edge detection threshold is selected and set based on the cumulative value of the number of pixels calculated from the edge detection response values ​​of the image to be sharpened and a preset adjustment node value. Therefore, this threshold fully considers the distribution of edge detection response values ​​in the current image to be sharpened, and the adjustment node value is determined based on the image information of the image to be sharpened itself, which better meets the edge detection requirements of the current sharpening image. The sharpening intensity acquisition module M200 further refines this threshold. The 300 method groups pixels based on a comparison of their edge detection response values ​​with a threshold. Different groups correspond to different types of regions; for example, pixels with larger edge detection response values ​​correspond to edge regions, pixels with smaller values ​​correspond to background noise regions, and pixels with values ​​in between correspond to texture regions. Based on the mapping relationship between the comparison results and sharpening intensity values, different sharpening intensity values ​​are assigned to different pixels, making the set sharpening intensity values ​​more reasonable. The sharpening processing module M400 then sharpens the image based on these more reasonable sharpening intensity values. Therefore, this application can provide a sharpening scheme more suitable for individual images, setting more appropriate sharpening intensity values ​​for different pixels, and effectively improving image sharpening effects.

[0088] In this image sharpening system, the functions of each module are implemented using the specific implementation methods of each step in the above-described image sharpening method embodiment, which will not be elaborated here.

[0089] This application also provides an image sharpening device, including a processor; a memory storing executable instructions of the processor; wherein the processor is configured to perform the steps of the image sharpening method by executing the executable instructions.

[0090] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."

[0091] The following reference Figure 7 To describe an electronic device 600 according to this embodiment of the present application. Figure 7 The electronic device 600 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0092] like Figure 7As shown, the electronic device 600 is presented in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including storage unit 620 and processing unit 610), a display unit 640, etc.

[0093] The storage unit stores program code that can be executed by the processing unit 610, causing the processing unit 610 to perform the steps described in the above-described vehicle image enhancement method section of this specification according to various exemplary embodiments of this application. For example, the processing unit 610 can perform actions such as... Figure 1 The steps are shown in the figure.

[0094] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache storage unit 6202, and may further include a read-only memory unit (ROM) 6203.

[0095] The storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0096] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0097] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0098] By employing the image sharpening device provided in this application, the processor executes the image sharpening method when executing the executable instructions, thereby obtaining the beneficial effects of the image sharpening method described above.

[0099] This application also provides a computer-readable storage medium for storing a program that, when executed by a processor, implements the steps of the image sharpening method. In some possible implementations, various aspects of this application can also be implemented as a program product comprising program code that, when run on a terminal device, causes the terminal device to perform the steps described in the above-described vehicle image enhancement method section of this specification according to various exemplary embodiments of this application.

[0100] refer to Figure 8 As shown, a program product 800 for implementing the above-described method according to an embodiment of this application is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a terminal device, such as a personal computer. However, the program product of this application is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0101] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0102] The computer-readable storage medium may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0103] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or cluster. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to external computing devices (e.g., via the Internet using an Internet service provider).

[0104] By employing the computer-readable storage medium provided in this application, wherein the program stored therein implements the steps of the image sharpening method when executed, the beneficial effects of the image sharpening method described above can be obtained.

[0105] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of this application and should not be construed as limiting the specific implementation of this application to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of this application, and all such modifications or substitutions should be considered within the scope of protection of this application.

Claims

1. An image sharpening method, characterized in that, Includes the following steps: Obtain the edge detection response value of each pixel in the image to be sharpened; The number of pixels corresponding to each edge detection response value is counted, and the cumulative value of the number of pixels corresponding to each edge detection response value is calculated. Based on the image information of the image to be sharpened, a plurality of preset adjustment node values ​​are obtained. A cumulative pixel count value corresponding to each adjustment node value is selected, and the edge detection response value corresponding to the selected cumulative pixel count value is used as an edge detection threshold. This yields a plurality of edge detection thresholds corresponding to the plurality of adjustment node values, whereby the plurality of edge detection thresholds define a range of edge detection response values. The image information of the image to be sharpened includes the width, height, and bit depth of the image to be sharpened. Obtaining the plurality of preset adjustment node values ​​based on the image information of the image to be sharpened includes: calculating the plurality of adjustment node values ​​using a preset node calculation function based on the width, height, and bit depth of the image to be sharpened. The vector composed of the image to be sharpened and the edge detection threshold is input into the trained intensity value prediction model to obtain the sharpening intensity value vector output by the intensity value prediction model, so as to determine the mapping relationship between the preset comparison result and multiple sharpening intensity values. The mapping relationship includes the mapping relationship between the multiple edge detection response value ranges corresponding to the comparison result and the sharpening intensity value. For each pixel, the edge detection response value is compared with the edge detection threshold to determine the range of edge detection response values ​​that the edge detection response value of each pixel falls into. This range is used as the comparison result. Based on the mapping relationship, the sharpening intensity value corresponding to the range of edge detection response values ​​that the pixel falls into is used as the sharpening intensity value of the corresponding pixel. The image to be sharpened is sharpened based on the sharpening intensity value of each pixel to obtain the sharpened image.

2. The image sharpening method according to claim 1, characterized in that, The step of obtaining the edge detection response value of each pixel in the image to be sharpened includes obtaining the edge detection response value of each pixel in the image to be sharpened based on the initial grayscale channel image of the image to be sharpened. The process of counting the number of pixels corresponding to each edge detection response value and calculating the cumulative number of pixels corresponding to each edge detection response value includes the following steps: Determine the m edge detection response values ​​of the image to be sharpened; Calculate the response value x of the i-th edge detection respectively. i The corresponding number of pixels y i , i∈(1,m); For the i-th edge detection response value, calculate the cumulative value Acc, which represents the number of pixels from the 1-th edge detection response value to the i-th edge detection response value. i .

3. The image sharpening method according to claim 2, characterized in that, For the i-th edge detection response value, calculate the cumulative value Acc of the number of pixels corresponding to the 1st edge detection response value to the i-th edge detection response value. i It includes the following steps: A histogram is constructed, wherein the horizontal axis of the histogram represents the edge detection response value, and the vertical axis represents the number of pixels corresponding to each edge detection response value. Traverse the histogram, starting from the first edge detection response value, and cumulatively calculate the number of pixels corresponding to each edge detection response value, such that the cumulative pixel count Acc for the i-th edge detection response value is calculated. i It equals the sum of the number of pixels corresponding to the first edge detection response value to the i-th edge detection response value.

4. The image sharpening method according to claim 1, characterized in that, The step of obtaining multiple preset adjustment node values ​​and selecting the pixel count accumulation value corresponding to the adjustment node value includes the following steps: Obtain the preset values ​​of n adjustment nodes; The accumulated pixel count is compared with each of the n adjustment node values, and the value p that is less than the j-th adjustment node value is selected. j And with the j-th adjustment node value p j The cumulative count of the closest pixels is used as the value p of the j-th adjustment node. j The cumulative number of corresponding pixels, j∈(1,n).

5. The image sharpening method according to claim 1, characterized in that, The image to be sharpened is sharpened based on the sharpening intensity value of each pixel, including the following steps: Based on the initial grayscale channel image of the image to be sharpened, the initial high-frequency components of each pixel in the image to be sharpened are obtained. Calculate the sharpened high-frequency components of each pixel based on the initial high-frequency components and the sharpening intensity value of each pixel; The sharpened high-frequency components are superimposed onto the initial grayscale channel image to obtain the sharpened grayscale channel image. The sharpened image is obtained based on the sharpened grayscale channel image.

6. An image sharpening system, characterized in that, The system, applied to the image sharpening method according to any one of claims 1 to 5, comprises: The edge detection response value acquisition module is used to acquire the edge detection response value of each pixel in the image to be sharpened; The threshold setting module is used to count the number of pixels corresponding to each edge detection response value and calculate the cumulative value of the number of pixels corresponding to each edge detection response value; and to obtain a plurality of preset adjustment node values ​​according to the image information of the image to be sharpened, select the cumulative value of the number of pixels corresponding to the adjustment node value, and use the edge detection response value corresponding to the selected cumulative value of the number of pixels as the edge detection threshold. The sharpening intensity acquisition module is used to compare the edge detection response value of each pixel with the edge detection threshold respectively to obtain the comparison result, and determine the sharpening intensity value of each pixel according to the mapping relationship between the comparison result and multiple sharpening intensity values; The sharpening module is used to sharpen the image to be sharpened based on the sharpening intensity value of each pixel.

7. An image sharpening device, characterized in that, include: processor; A memory in which executable instructions of the processor are stored; The processor is configured to perform the steps of the image sharpening method according to any one of claims 1 to 5 by executing the executable instructions.

8. A computer-readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps of the image sharpening method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image sharpening method and device, electronic equipment and computer readable storage medium

    CN111028182A

  • Method and device for processing infrared image

    CN114359067A

  • Image processing method and device, electronic equipment and readable storage medium

    CN114782279A

  • Image sharpening method and device

    CN115439370A

  • Electronic equipment and video processing method

    JP2013045410A