Image adaptive sharpening overshoot control method and device

By calculating the difference value and confidence level of image pixels, the amount of sharpening overshoot is accurately adjusted, solving the problems of sharpening overshoot and insufficient detail, improving the image sharpening effect and optimizing the use of hardware resources.

CN114782258BActive Publication Date: 2024-09-06ALLWINNER TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210176339.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-24
Publication Date
2024-09-06
Estimated Expiration
2042-02-24

AI Technical Summary

Technical Problem

Existing sharpening overshoot control methods cannot effectively distinguish image edges and details, resulting in sharpening overshoot and insufficient detail sharpening, which reduces the image sharpening effect.

Method used

By calculating the difference value of the target pixel in different directions, filtering the main direction, calculating the target confidence, and adjusting the overshoot according to the confidence, the overshoot of each pixel can be accurately adjusted to avoid global parameter control.

Benefits of technology

It achieves precise control over sharpened images, alleviates the problem of insufficient sharpening of black and white edges and details, improves the image sharpening effect, reduces the need for filter windows, and saves hardware resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114782258B
    Figure CN114782258B
Patent Text Reader

Abstract

The present invention discloses an adaptive sharpening overshoot control method and device for an image, the method comprising: calculating the difference value of any pixel point in each direction in the sharpened image; screening out multiple target directions from all directions, and determining the main direction according to the difference value of the pixel point in each target direction; calculating the confidence corresponding to the pixel point according to the difference value of the pixel point in the main direction, so as to adjust the overshoot amount of the pixel point by the confidence degree. It can be seen that the implementation of the present invention can determine the directional edge strength by determining the difference value of the pixel point in multiple directions in the sharpened image, and then determine the confidence corresponding to the pixel point, so as to adaptively adjust the overshoot amount of the pixel point, so as to specifically and accurately adjust the overshoot amount of each pixel point in the sharpened image, which is conducive to solving the image sharpening overshoot phenomenon, and can alleviate the edge black and white edges and insufficient detail sharpening phenomenon, so as to improve the image sharpening effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image adaptive sharpening overshoot control method and device. Background Art

[0002] With the rapid development of image display technology, the resolution of terminal display devices (such as televisions) is becoming more and more refined, evolving from hundreds of thousands of pixels to tens of millions of pixels today, making image display more and more high-definition, bringing visual enjoyment to users.

[0003] Currently, the Internet is still flooded with a large number of low-resolution images. When users need to display low-resolution images on high-resolution terminal display devices, the low-resolution images need to be enlarged to adapt to the resolution of the terminal display device. Since low-resolution images will appear blurry after being enlarged, a sharpening algorithm is generally used to sharpen the original image to obtain a sharpened image. However, after sharpening the image using a traditional sharpening algorithm, sharpening overshoot may occur, for example, unnatural phenomena such as black and white edges appear. In order to solve the problem of sharpening overshoot, the existing sharpening overshoot control method usually controls the overshoot amount based on the maximum pixel value and the minimum pixel value of the current window where the pixel point is located. The common practice is to multiply the overshoot amount by a suppression parameter.

[0004] In practice, it is found that this method of controlling image sharpening overshoot by global parameters cannot distinguish image edges and details well, which leads to black and white edges on image edges and insufficient sharpening of image details, reducing the image sharpening effect. It can be seen that how to improve the image sharpening effect while solving the sharpening overshoot is particularly important. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method and device for adaptive sharpening overshoot control of an image, which can specifically and accurately adjust the overshoot amount of each pixel in the sharpened image, which is conducive to solving the image sharpening overshoot phenomenon, and can alleviate the edge black and white edges and insufficient detail sharpening to improve the image sharpening effect.

[0006] In order to solve the above technical problems, the first aspect of the present invention discloses an adaptive sharpening overshoot control method for an image, the method comprising:

[0007] For any target pixel point of the sharpened image, calculating the difference value of the target pixel point in each direction in the determined direction set; the sharpened image is an image obtained after performing an image sharpening operation on the original image;

[0008] Screening a plurality of target directions satisfying a preset direction condition from all the directions, and determining a main direction from all the target directions according to a difference value of the target pixel point in each of the target directions;

[0009] Calculating the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction;

[0010] The overshoot amount of the target pixel point is adjusted according to the target confidence corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point.

[0011] As an optional implementation manner, in the first aspect of the present invention, for any target pixel point of the sharpened image, calculating the difference value of the target pixel point in each direction in the determined direction set includes:

[0012] For any target pixel point of the sharpened image, determine a direction set matching the target pixel point; the direction set includes at least one direction, each of the directions represents a direction with the target pixel point as a direction reference point, and each of the directions in the direction set can determine a vertical direction perpendicular to the direction in the direction set;

[0013] According to all the directions, determining a target window with the target pixel point as the center point and matching all the directions;

[0014] For each of the directions, in the pixel matrix of the target window, at least one pixel pair matching the direction is determined; the angle value of the connecting line of the two pixel points included in each of the pixel pairs matching the direction compared to the reference direction is equal to the direction angle of the direction, and the connecting line of the two pixel points included in each of the pixel pairs matching the direction does not cross other pixel points;

[0015] For each of the directions, determining the absolute value of the pixel difference value corresponding to each of the pixel pairs matching the direction and the target weight corresponding to each of the pixel pairs; calculating the weighted average value corresponding to the absolute values ​​of the pixel difference values ​​corresponding to all of the pixel pairs according to the absolute value of the pixel difference value corresponding to each of the pixel pairs and the target weight corresponding to each of the pixel pairs, and obtaining a calculation result as the difference value of the direction; the pixel difference value corresponding to each of the pixel pairs is the pixel difference between two pixels in each of the pixel pairs;

[0016] And, after adjusting the overshoot amount of the target pixel point by the target confidence corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point, the method further includes:

[0017] The target pixel value of the target pixel is processed according to the target overshoot of the target pixel and the pixel value range corresponding to the window where the original pixel corresponding to the target pixel in the original image is located.

[0018] As an optional implementation manner, in the first aspect of the present invention, the selecting a plurality of target directions satisfying a preset direction condition from all the directions comprises:

[0019] For each of the directions, according to any of the pixel point pairs matching the direction, the line span of the pixel point pair is calculated, and it is determined whether the line span of the pixel point pair meets a preset span condition; the line span of the pixel point pair represents the length of the line between two pixel points in the pixel point pair;

[0020] When the judgment result is yes, determining that the direction is a direction that satisfies a preset direction condition;

[0021] All directions that meet the preset direction condition among all the directions are determined as all target directions.

[0022] As an optional implementation manner, in the first aspect of the present invention, calculating the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction includes:

[0023] When the main directions only include the first main direction, calculating the first confidence of the target pixel in the first main direction according to the difference value of the target pixel in the first main direction and the difference value in the first vertical direction; the first vertical direction is a direction perpendicular to the first main direction, and the first main direction is a direction with the smallest difference value among all the target directions;

[0024] Determining the first confidence level as a target confidence level corresponding to the target pixel point;

[0025] The first confidence level is calculated by the following formula:

[0026] main_edge_confidence is the first confidence, diff[main_dir] is the difference value of the target pixel in the first main direction, and diff[anti_main_dir] is the difference value of the target pixel in the first vertical direction.

[0027] As an optional implementation manner, in the first aspect of the present invention, calculating the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction includes:

[0028] When the main direction includes a second main direction and a third main direction, determining a secondary direction; the second main direction is a direction with the smallest difference value among all the target directions, the third main direction is a direction with the second smallest difference value among all the target directions, and the secondary direction is determined from all remaining directions among all the directions except all the target directions;

[0029] Calculating a second confidence level of the target pixel in the second main direction according to a difference value of the target pixel in the second main direction and a difference value in a second vertical direction; the second vertical direction is a direction perpendicular to the second main direction;

[0030] Calculating a third confidence level of the target pixel in the secondary direction according to the difference value of the target pixel in the secondary direction and the difference value in a third vertical direction; the third vertical direction is a direction perpendicular to the secondary direction;

[0031] Calculate the difference value fusion proportion corresponding to the target pixel point according to the difference value of the target pixel point in the second main direction and the difference value in the secondary direction;

[0032] Calculate a fourth confidence level according to the second confidence level, the third confidence level, and the difference value fusion ratio, and determine the fourth confidence level as a target confidence level corresponding to the target pixel point;

[0033] The second confidence level is calculated by the following formula:

[0034] main_edge_confidence is the second confidence, diff[main_dir] is the difference value of the target pixel in the second main direction, and diff[anti_main_dir] is the difference value of the target pixel in the second vertical direction;

[0035] The third confidence level is calculated by the following formula:

[0036] sub_edge_confidence is the third confidence, diff[sub_dir] is the difference value of the target pixel in the secondary direction, and diff[anti_sub_dir] is the difference value of the target pixel in the third vertical direction;

[0037] The difference value fusion ratio is calculated by the following formula:

[0038] sub_weight is the difference value fusion weight;

[0039] The fourth confidence level is calculated by the following formula:

[0040] edge_confidence=main_edge_confidence*(1-sub_weight)+sub_edge_confidence*sub_weight; edge_confidence is the fourth confidence.

[0041] As an optional implementation manner, in the first aspect of the present invention, determining the secondary direction includes:

[0042] Determining a direction parameter of the second main direction and a direction parameter of the third main direction;

[0043] A secondary direction is determined according to the direction parameter of the second main direction and the direction parameter of the third main direction.

[0044] As an optional implementation manner, in the first aspect of the present invention, adjusting the overshoot amount of the target pixel point by the target confidence corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point includes:

[0045] Determine the overshoot amount of the target pixel point according to the target pixel value of the target pixel point and the pixel value range corresponding to the window where the original pixel point corresponding to the target pixel point in the original image is located;

[0046] Calculating a target overshoot of the target pixel point according to the target confidence, the overshoot of the target pixel point, and a preset overshoot adjustment formula;

[0047] Wherein, the overshoot adjustment formula is:

[0048] ε c =ε*(1-edge_confidence);ε c is the target overshoot of the target pixel, ε is the overshoot of the target pixel, and edge_confidence is the target confidence.

[0049] The second aspect of the present invention discloses an adaptive sharpening overshoot control device for an image, the device comprising:

[0050] A first calculation module is used to calculate, for any target pixel point of a sharpened image, a difference value of the target pixel point in each direction of the determined direction set; the sharpened image is an image obtained after performing an image sharpening operation on the original image;

[0051] A determination module, used to select a plurality of target directions satisfying a preset direction condition from all the directions, and determine a main direction from all the target directions according to a difference value of the target pixel point in each of the target directions;

[0052] A second calculation module, used to calculate the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction;

[0053] The adjustment module is used to adjust the overshoot amount of the target pixel point according to the target confidence corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point.

[0054] As an optional implementation, in the second aspect of the present invention, the first calculation module calculates the difference value of any target pixel point of the sharpened image in each direction in the determined direction set in the following manner:

[0055] For any target pixel point of the sharpened image, determine a direction set matching the target pixel point; the direction set includes at least one direction, each of the directions represents a direction with the target pixel point as a direction reference point, and each of the directions in the direction set can determine a vertical direction perpendicular to the direction in the direction set;

[0056] According to all the directions, determining a target window with the target pixel point as the center point and matching all the directions;

[0057] For each of the directions, in the pixel matrix of the target window, at least one pixel pair matching the direction is determined; the angle value of the connecting line of the two pixel points included in each of the pixel pairs matching the direction compared to the reference direction is equal to the direction angle of the direction, and the connecting line of the two pixel points included in each of the pixel pairs matching the direction does not cross other pixel points;

[0058] For each of the directions, determining the absolute value of the pixel difference value corresponding to each of the pixel pairs matching the direction and the target weight corresponding to each of the pixel pairs; calculating the weighted average value corresponding to the absolute values ​​of the pixel difference values ​​corresponding to all of the pixel pairs according to the absolute value of the pixel difference value corresponding to each of the pixel pairs and the target weight corresponding to each of the pixel pairs, and obtaining a calculation result as the difference value of the direction; the pixel difference value corresponding to each of the pixel pairs is the pixel difference between two pixels in each of the pixel pairs;

[0059] And, the device further comprises:

[0060] A processing module is used to adjust the overshoot amount of the target pixel point by the target confidence corresponding to the target pixel point in the adjustment module, and after obtaining the target overshoot amount of the target pixel point, process the target pixel value of the target pixel point according to the target overshoot amount of the target pixel point and the pixel value range corresponding to the window where the original pixel point corresponding to the target pixel point in the original image is located.

[0061] As an optional implementation, in the second aspect of the present invention, the determination module selects multiple target directions that meet the preset direction condition from all the directions in a specific manner:

[0062] For each of the directions, according to any of the pixel point pairs matching the direction, the line span of the pixel point pair is calculated, and it is determined whether the line span of the pixel point pair meets a preset span condition; the line span of the pixel point pair represents the length of the line between two pixel points in the pixel point pair;

[0063] When the judgment result is yes, determining that the direction is a direction that satisfies a preset direction condition;

[0064] All directions that meet the preset direction condition among all the directions are determined as all target directions.

[0065] As an optional implementation, in the second aspect of the present invention, the second calculation module includes:

[0066] A first calculation submodule, used for calculating a first confidence of the target pixel in the first main direction according to a difference value of the target pixel in the first main direction and a difference value in a first vertical direction when the main directions only include a first main direction; the first vertical direction is a direction perpendicular to the first main direction, and the first main direction is a direction with the smallest difference value among all the target directions;

[0067] A first determination submodule, used to determine the first confidence level as a target confidence level corresponding to the target pixel point;

[0068] The first confidence level is calculated by the following formula:

[0069] main_edge_confidence is the first confidence, diff[main_dir] is the difference value of the target pixel in the first main direction, and diff[anti_main_dir] is the difference value of the target pixel in the first vertical direction.

[0070] As an optional implementation, in the second aspect of the present invention, the second calculation module includes:

[0071] A second determination submodule is used to determine a secondary direction when the main direction includes a second main direction and a third main direction; the second main direction is a direction with the smallest difference value among all the target directions, the third main direction is a direction with the second smallest difference value among all the target directions, and the secondary direction is determined from all remaining directions among all the directions except all the target directions;

[0072] A second calculation submodule is used to calculate a second confidence of the target pixel in the second main direction according to the difference value of the target pixel in the second main direction and the difference value in the second vertical direction; the second vertical direction is a direction perpendicular to the second main direction; according to the difference value of the target pixel in the secondary direction and the difference value in the third vertical direction, calculate a third confidence of the target pixel in the secondary direction; the third vertical direction is a direction perpendicular to the secondary direction; according to the difference value of the target pixel in the second main direction and the difference value in the secondary direction, calculate a difference value fusion proportion corresponding to the target pixel; according to the second confidence, the third confidence and the difference value fusion proportion, calculate a fourth confidence;

[0073] The second determination submodule is further used to determine the fourth confidence level as the target confidence level corresponding to the target pixel point;

[0074] The second confidence level is calculated by the following formula:

[0075] main_edge_confidence is the second confidence, diff[main_dir] is the difference value of the target pixel in the second main direction, and diff[anti_main_dir] is the difference value of the target pixel in the second vertical direction;

[0076] The third confidence level is calculated by the following formula:

[0077] sub_edge_confidence is the third confidence, diff[sub_dir] is the difference value of the target pixel in the secondary direction, and diff[anti_sub_dir] is the difference value of the target pixel in the third vertical direction;

[0078] The difference value fusion ratio is calculated by the following formula:

[0079] sub_weight is the difference value fusion weight;

[0080] The fourth confidence level is calculated by the following formula:

[0081] edge_confidence=main_edge_confidence*(1-sub_weight)+sub_edge_confidence*sub_weight; edge_confidence is the fourth confidence.

[0082] As an optional implementation manner, in the second aspect of the present invention, the second determination submodule determines the secondary direction in the following manner:

[0083] Determining a direction parameter of the second main direction and a direction parameter of the third main direction;

[0084] A secondary direction is determined according to the direction parameter of the second main direction and the direction parameter of the third main direction.

[0085] As an optional implementation, in the second aspect of the present invention, the adjustment module adjusts the overshoot amount of the target pixel point by the target confidence corresponding to the target pixel point, and the method of obtaining the target overshoot amount of the target pixel point is specifically:

[0086] Determine the overshoot amount of the target pixel point according to the target pixel value of the target pixel point and the pixel value range corresponding to the window where the original pixel point corresponding to the target pixel point in the original image is located;

[0087] Calculating a target overshoot of the target pixel point according to the target confidence, the overshoot of the target pixel point, and a preset overshoot adjustment formula;

[0088] Wherein, the overshoot adjustment formula is:

[0089] ε c =ε*(1-edge_confidence);ε c is the target overshoot of the target pixel, ε is the overshoot of the target pixel, and edge_confidence is the target confidence.

[0090] The third aspect of the present invention discloses another image adaptive sharpening overshoot control device, the device comprising:

[0091] A memory storing executable program code;

[0092] a processor coupled to the memory;

[0093] The processor calls the executable program code stored in the memory to execute the adaptive sharpening overshoot control method of the image disclosed in the first aspect of the present invention.

[0094] The fourth aspect of the present invention discloses a computer storable medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the adaptive sharpening overshoot control method of the image disclosed in the first aspect of the present invention.

[0095] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0096] In the embodiment of the present invention, for any target pixel of the sharpened image, the difference value of the target pixel in each direction in the determined direction set is calculated; multiple target directions that meet the preset direction conditions are screened from all directions, and the main direction is determined from all target directions according to the difference value of the target pixel in each target direction; the target confidence corresponding to the target pixel is calculated according to the difference value of the target pixel in the main direction; the overshoot of the target pixel is adjusted by the target confidence corresponding to the target pixel to obtain the target overshoot of the target pixel. It can be seen that the implementation of the present invention can adaptively adjust the overshoot of each pixel in the sharpened image without using a fixed global parameter to control the overshoot of all pixels. In this way, not only can the overshoot of each pixel in the sharpened image be adjusted in a targeted and precise manner, thereby solving the image sharpening overshoot phenomenon, alleviating the edge black and white edges and the insufficient detail sharpening phenomenon, thereby improving the image sharpening effect, but also the overshoot of each pixel can be adaptively adjusted through a smaller filtering window, reducing the storage and bandwidth occupation ratio, thereby being more conducive to hardware implementation. BRIEF DESCRIPTION OF THE DRAWINGS

[0097] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0098] Figure 1 It is a flow chart of an adaptive sharpening overshoot control method of an image disclosed in an embodiment of the present invention;

[0099] Figure 2 It is a flow chart of another method for adaptive sharpening overshoot control of an image disclosed in an embodiment of the present invention;

[0100] Figure 3It is a structural schematic diagram of an adaptive sharpening overshoot control device for an image disclosed in an embodiment of the present invention;

[0101] Figure 4 It is a structural schematic diagram of another image adaptive sharpening overshoot control device disclosed in an embodiment of the present invention;

[0102] Figure 5 It is a structural schematic diagram of another image adaptive sharpening overshoot control device disclosed in an embodiment of the present invention;

[0103] Figure 6 It is a structural schematic diagram of another image adaptive sharpening overshoot control device disclosed in an embodiment of the present invention;

[0104] Figure 7 It is a structural schematic diagram of another image adaptive sharpening overshoot control device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0105] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0106] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0107] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0108] The present invention discloses an adaptive sharpening overshoot control method and device for an image, which can specifically and accurately adjust the overshoot amount of each pixel in the sharpened image, alleviate the edge black and white edges and insufficient detail sharpening, and improve the image sharpening effect. The following are detailed descriptions.

[0109] Embodiment 1

[0110] See also Figure 1 , Figure 1 : is a flow chart of an adaptive sharpening overshoot control method for an image disclosed in an embodiment of the present invention. Figure 1 The described adaptive oversharpening control method for images can be applied when performing a sharpening operation on an image to be viewed in a smart TV, or when performing a sharpening operation on an image to be edited in a vehicle-mounted central control device, and the embodiments of the present invention do not limit this. Optionally, the method can be implemented by an oversharpening control system, which can be integrated in an oversharpening control device, or a local server or cloud server for managing the image oversharpening control process, and the embodiments of the present invention do not limit this. Figure 1 As shown, the adaptive sharpening overshoot control method of the image may include the following operations:

[0111] 101. For any target pixel point of the sharpened image, calculate the difference value of the target pixel point in each direction in the determined direction set.

[0112] In an embodiment of the present invention, the sharpened image is an image obtained after performing an image sharpening operation on the original image. Optionally, the sharpened image can be in a static image format, such as a JPEG image format or a GIF static image format; or it can be in a dynamic image format, such as a GIF dynamic image format or an AVI image format. Further optionally, for any target pixel point of the sharpened image, the corresponding original pixel point can be determined in the original image, that is, the sharpened pixel point of the sharpened image and the original pixel point of the original image form a one-to-one correspondence. For example, for any target pixel point of the sharpened image, when its coordinates are (x, y), it can be mapped to the original pixel point with coordinates (X, Y) on the original image, where "x" and "X" have a corresponding relationship, and "y" and "Y" also have a corresponding relationship. Further, for any target pixel point of the sharpened image, the required direction set can be determined according to the specific image processing requirements, and then the difference value of the target pixel point in each direction in the determined direction set is calculated. Specifically, the direction set includes at least one direction, such as 1, 8, 10, etc., and the direction angles of each direction are different, such as 30°, 60°, 135°, etc.; and when the number of directions included in the direction set is greater than 1, each direction can determine a vertical direction perpendicular to the direction in the direction set, such as 30° and 120°, 45° and 135°. Further, for any direction, the greater the difference between the difference value of the target pixel point in the direction and the difference value in the corresponding vertical direction, the stronger the edge strength of the target pixel point in the direction, that is, the more obvious the edge.

[0113] 102. Filter multiple target directions that meet preset direction conditions from all directions, and determine the main direction from all target directions according to the difference value of the target pixel point in each target direction.

[0114] In the embodiment of the present invention, optionally, the required direction condition can be set according to the image processing requirements (such as image sharpening accuracy, filter window size, image processing time, etc.). Specifically, the direction condition is related to the line span of the pixel point pairs determined in the filter window and matching the corresponding direction, such as selecting the four directions with the line span of the pixel point pairs in the corresponding direction being in the first four smallest directions, or the six directions with the first six smallest directions from the eight directions as multiple target directions that meet the preset direction condition. For example, when the direction set corresponding to the target pixel point is determined to be 0°, 30°, 45°, 60°, 90°, 120°, 135°, and 150°, by calculating the line span of the pixel point pairs matching each direction, the four directions with the line span in the first four smallest directions are selected as 0°, 45°, 90°, and 135°, and these four directions can be determined as the four target directions that meet the preset direction condition. Furthermore, after determining multiple target directions, the arrangement order corresponding to each target direction can be determined according to the difference value of the target pixel point in each target direction; according to the arrangement order corresponding to all target directions, the main direction is determined from all target directions, wherein the arrangement order matches the difference value of all directions, such as the larger the difference value, the higher (or lower) the arrangement order of the direction. Further, the direction with the smallest difference value can be selected from all target directions as the first main direction, and it can be determined as the main direction; the directions with the first two smallest difference values ​​can also be selected from all target directions as the second main direction and the third main direction, and the second main direction and the third main direction can be determined as the main directions.

[0115] 103. Calculate the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction.

[0116] In an embodiment of the present invention, optionally, when the main direction only includes the first main direction, a first confidence of the target pixel in the first main direction is calculated according to the difference value of the target pixel in the main direction; the first confidence is determined as the target confidence corresponding to the target pixel, wherein the numerical ranges of the first confidence and the target confidence are [0,1]; when the main direction includes the second main direction and the third main direction, the secondary direction is determined; according to the difference value of the target pixel in the second main direction and the difference value in the secondary direction, the second confidence of the target pixel in the second main direction and the third confidence in the secondary direction are calculated; according to the difference value of the target pixel in the second main direction and the difference value of the target pixel in the secondary direction, the target fusion proportion corresponding to the target pixel is calculated; according to the second confidence, the third confidence and the target fusion proportion, a fourth confidence is calculated; the fourth confidence is determined as the target confidence corresponding to the target pixel, wherein the numerical ranges of the second confidence, the third confidence and the fourth confidence are all [0,1], and the numerical range of the target fusion proportion is [0,1]. Specifically, the first confidence level and the fourth confidence level are both used to adjust the overshoot of the target pixel, and the adjustment accuracy of the fourth confidence level is greater than or equal to the adjustment accuracy of the first confidence level.

[0117] 104. Adjust the overshoot amount of the target pixel point according to the target confidence level corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point.

[0118] In an embodiment of the present invention, for different target pixels in the sharpened image, the corresponding target confidences are also different, that is, the target confidence is not a unified global parameter. Specifically, the overshoot of the target pixel is determined based on the target brightness value of the target pixel and the corresponding pixel value range of the window where the original pixel corresponding to the target pixel is located in the original image. For example, if the target brightness value of the target pixel is C, and the corresponding pixel value range of the window where the original pixel corresponding to the target pixel is located in the original image is [A, B], then the amplitude of C exceeding [A, B] can be regarded as the overshoot ε of the target pixel. At this time, the target confidence corresponding to the target pixel can be used to adjust the overshoot ε of the target pixel to obtain the adjusted overshoot of the target pixel, that is, the target overshoot ε of the target pixel. c , where the target overshoot of the target pixel is c Less than or equal to the overshoot ε of the target pixel.

[0119] It can be seen that the implementation of the embodiment of the present invention can determine the main direction according to the calculated difference values ​​of the sharpened pixels in different directions, and calculate the target confidence according to the edge confidence of the sharpened pixels in the main direction to adjust the overshoot of the sharpened pixels. In this way, not only the sharpening overshoot phenomenon of the sharpened image can be alleviated, but also compared with the sharpening overshoot control method of the transmission control, the use of global parameters to control the overshoot phenomenon is avoided, and the overshoot of the pixel points can be adjusted in a targeted and precise manner, thereby weakening the edge black and white edge strength of the sharpened image and enhancing the detail sharpening strength, thereby realizing dynamic adaptive adjustment of the overshoot of the pixel points and improving the image quality of the sharpened image.

[0120] In an optional embodiment, for any target pixel of the sharpened image in step 101, calculating the difference value of the target pixel in each direction in the determined direction set may include:

[0121] For any target pixel point of the sharpened image, determine a direction set that matches the target pixel point;

[0122] According to all directions, a target window with the target pixel as the center point and matching all directions is determined;

[0123] For each direction, determining at least one pixel pair matching the direction in the pixel matrix of the target window;

[0124] For each direction, determine the absolute value of the pixel difference corresponding to each pixel pair matching the direction and the target weight corresponding to each pixel pair; based on the absolute value of the pixel difference corresponding to each pixel pair and the target weight corresponding to each pixel pair, calculate the weighted average corresponding to the absolute value of the pixel difference corresponding to all pixel pairs, and obtain the operation result as the difference value of the direction.

[0125] In this optional embodiment, each direction represents the direction with the target pixel as the direction reference point. Optionally, each direction can be expressed as the direction with the target pixel as the direction reference point and the horizontal line where the target pixel is located as the reference line, or it can be the direction with the target pixel as the direction reference point and the vertical line where the target pixel is located as the reference line. Further optional, the target window size can be 3*3 (i.e., a window with a 3*3 pixel lattice), 5*5, 7*7, etc., as long as the target window can match all directions. Specifically, the target window that matches all directions represents that at least one pixel pair that matches any direction can be determined in the pixel lattice of the target window, wherein each pixel pair that matches the direction, i.e., each pixel pair includes a line of two pixels that is equal to the direction angle of the direction compared to the angle value of the reference direction, and each pixel pair includes a line of two pixels that does not span other pixels.

[0126] Further, in this optional embodiment, the target weight corresponding to each pixel pair can be determined in the following manner:

[0127] For each direction, determine the sum of weights of all pixel pairs according to image processing requirements;

[0128] For each direction, the target weight corresponding to each pixel pair is determined according to the straight-line distance between the center point of the line connecting each pixel pair and the target pixel point and the sum of the weights of all pixel pairs, wherein the target weight corresponding to each pixel pair matches the straight-line distance between the center point of the line connecting the pixel pair and the target pixel point; or,

[0129] For each direction, determine the sum of weights of all pixel pairs according to image processing requirements;

[0130] For each direction, the average value of the sum of weights is calculated based on the number of pixel pairs matching the direction and the sum of weights of all pixel pairs, which is used as the target weight corresponding to each pixel pair.

[0131] Furthermore, the sum of the weights of all pixel pairs can be 16, 32, 64, etc. For example, in a 5*5 target window, for a 45° direction, 16 pixel pairs matching the direction can be determined in the target window, and according to image processing requirements, the sum of the weights of all pixel pairs can be determined to be 16, and the target weight corresponding to each pixel pair is 1. Furthermore, the pixel difference value corresponding to each pixel pair is the pixel difference value between the two pixels in each pixel pair, where the pixel difference value can be understood as the brightness difference value.

[0132] It can be seen that this optional embodiment can determine the number of directions and directional angles corresponding to the sharpened pixels according to the specific image processing requirements, and calculate the difference values ​​of the sharpened pixels in each direction, which is conducive to the subsequent smooth determination of the edge strength of the sharpened pixels in each direction, thereby providing an adjustment basis for the adaptive adjustment of the overshoot of the sharpened pixels, which is not only conducive to improving the reliability and accuracy of the overshoot adjustment results of the sharpened pixels, but also the required filtering window is smaller, which is conducive to saving the working space occupied by it.

[0133] Embodiment 2

[0134] See also Figure 2 , Figure 2 : is a flow chart of an adaptive sharpening overshoot control method for an image disclosed in an embodiment of the present invention. Figure 2 The described adaptive sharpening and overshoot control method of an image can be applied when performing a sharpening operation on an image to be viewed in a smart TV, or when performing a sharpening operation on an image to be edited in a vehicle-mounted central control device, and the embodiments of the present invention do not limit this. Optionally, the method can be implemented by a sharpening and overshoot control system, which can be integrated in a sharpening and overshoot control device, or a local server or cloud server for managing the image sharpening process, and the embodiments of the present invention do not limit this. Figure 2 As shown, the adaptive sharpening overshoot control method of the image may include the following operations:

[0135] 201. For any target pixel point of the sharpened image, calculate the difference value of the target pixel point in each direction in the determined direction set.

[0136] 202. Filter multiple target directions that meet preset direction conditions from all directions, and determine a main direction from all target directions according to the difference value of the target pixel point in each target direction.

[0137] 203. Calculate the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction.

[0138] 204. Adjust the overshoot amount of the target pixel point according to the target confidence level corresponding to the target pixel point to obtain a target overshoot amount of the target pixel point.

[0139] In the embodiment of the present invention, for other descriptions of step 201 to step 204, please refer to the detailed description of step 101 to step 104 in the first embodiment, and the embodiment of the present invention will not be repeated here.

[0140] 205. Process the target pixel value of the target pixel according to the target overshoot amount of the target pixel and the pixel value range corresponding to the window where the original pixel corresponding to the target pixel in the original image is located.

[0141] In the embodiment of the present invention, optionally, the target pixel value C of the target pixel point is processed to obtain the processed target pixel value C t Afterwards, C t It can be within the range [A, B] or still outside the range [A, B], but C t The magnitude of the excess for [A, B] is smaller than the magnitude of the excess for [A, B] by C. Specifically, the size of the window where the original pixel corresponding to the target pixel in the original image is located matches the size of the target window, and can be of equal size, wherein the size of the window can be 3*3, 5*5, 7*7, and so on.

[0142] It can be seen that the implementation of the embodiment of the present invention can effectively adjust the overshoot of the pixel point, and then effectively process the target pixel value of the target pixel point, which is conducive to intelligently adapting to intelligent image devices with different resolutions, avoiding the appearance of black and white edge artifacts in strong edge areas and enhancing the detail texture of weak edge areas, thereby improving the overall clarity of the image, so that the small-resolution image will not be blurred after being enlarged.

[0143] In an optional embodiment, multiple target directions satisfying a preset direction condition are screened from all directions, including:

[0144] For each direction, according to any pixel pair matching the direction, the line span of the pixel pair is calculated, and it is determined whether the line span of the pixel pair meets the preset span condition;

[0145] When the judgment result is yes, the direction is determined to be a direction that satisfies a preset direction condition;

[0146] All directions that meet a preset direction condition among all directions are determined as all target directions.

[0147] In this optional embodiment, the line span of the pixel pair represents the length of the line between two pixels in the pixel pair, and for each direction, the line span of each pixel pair is consistent. Optionally, judging whether the line span of the pixel pair meets the preset span condition may include: judging whether the line span of the pixel pair is less than or equal to a preset line span threshold, and when the judgment result is yes, determining that the line span of the pixel pair meets the preset span condition; or, for each direction, selecting one of the pixel pairs from the direction, and sorting each pixel pair according to the length of the line span of each selected pixel pair; judging whether the arrangement order of the pixel pair meets the preset sorting condition, and when the judgment result is yes, determining that the line span of the pixel pair meets the preset span condition, wherein the length of the line span of the pixel pair matches the arrangement order of the pixel pair, such as the longer the line span of the pixel pair, the later the arrangement order of the pixel pair.

[0148] It can be seen that this optional embodiment can not only determine the required target direction based on basis and flexibly to meet various image processing requirements, thereby enriching the method of determining the target direction, but also can improve the reliability and accuracy of the main direction subsequently determined from the target direction, thereby improving the accuracy of adjusting the overshoot amount of the target pixel point, so that the sharpened image can obtain an effective sharpening effect.

[0149] In another optional embodiment, the step 203 of calculating the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction may include:

[0150] When the main directions only include the first main direction, calculating a first confidence level of the target pixel in the first main direction according to a difference value of the target pixel in the first main direction and a difference value in the first vertical direction;

[0151] Determine the first confidence level as the target confidence level corresponding to the target pixel point;

[0152] Among them, the first confidence is calculated by the following formula:

[0153]

[0154] In this optional embodiment, the first vertical direction is a direction perpendicular to the first main direction, and the first main direction is a direction with the smallest difference value among all target directions; main_edge_confidence is a first confidence, diff[main_dir] is a difference value of the target pixel in the first main direction, and diff[anti_main_dir] is a difference value of the target pixel in the first vertical direction. Specifically, the numerical range of the first confidence is [0,1]. For example, when the direction set corresponding to the target pixel is determined to be 0°, 30°, 45°, 60°, 90°, 120°, 135°, and 150°, by calculating the line span of the pixel pairs matching each direction, the four directions with the smallest line spans are selected as 0°, 45°, 90°, and 135°, and these four directions can be determined as four target directions that meet the preset direction conditions; according to the difference values ​​of the target pixel in these four target directions, the direction with the smallest difference value can be determined from these four target directions as the first main direction.

[0155] It can be seen that this optional embodiment can quickly determine the target confidence corresponding to the target pixel point based on the first confidence of the target pixel point in the first main direction, and then realize rapid adaptive adjustment of the overshoot amount of the target pixel point of the sharpened image, so as to quickly obtain the sharpened image after the sharpening overshoot adjustment, and avoid image processing delay.

[0156] In yet another optional embodiment, the step 203 of calculating the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction may include:

[0157] When the main direction includes the second main direction and the third main direction, determining the secondary direction;

[0158] Calculating a second confidence level of the target pixel in the second main direction according to the difference value of the target pixel in the second main direction and the difference value of the target pixel in the second vertical direction;

[0159] Calculate a third confidence level of the target pixel in the secondary direction according to the difference value of the target pixel in the secondary direction and the difference value in the third vertical direction;

[0160] Calculate the difference value fusion ratio corresponding to the target pixel point according to the difference value of the target pixel point in the second main direction and the difference value in the secondary direction;

[0161] Calculate a fourth confidence level according to the second confidence level, the third confidence level, and the difference value fusion ratio, and determine the fourth confidence level as the target confidence level corresponding to the target pixel point;

[0162] The second confidence level is calculated by the following formula:

[0163]

[0164] The third confidence level is calculated by the following formula:

[0165]

[0166] The difference value fusion ratio is calculated by the following formula:

[0167]

[0168] The fourth confidence level is calculated by the following formula:

[0169] edge_confidence=main_edge_confidence*(1-sub_weight)+sub_edge_confidence*sub_weight.

[0170] In this optional embodiment, the second main direction is the direction with the smallest difference value among all target directions, and the third main direction is the direction with the second smallest difference value among all target directions. Optionally, the secondary direction is determined from all remaining directions except all target directions. For example, when the direction set corresponding to the target pixel point is determined to be 0°, 30°, 45°, 60°, 90°, 120°, 135°, 150°, and the target direction is 0°, 45°, 90°, 135°, then the secondary direction is determined from 30°, 60°, 120°, 150°. Further, the second vertical direction is a direction perpendicular to the second main direction, and the third vertical direction is a direction perpendicular to the secondary direction, such as when the second main direction is 30°, the second vertical direction is 120°; when the secondary direction is 150°, the third vertical direction is 60°. Specifically, in the calculation formula of the second confidence, main_edge_confidence is the second confidence, diff[main_dir] is the difference value of the target pixel in the second main direction, and diff[anti_main_dir] is the difference value of the target pixel in the second vertical direction; in the calculation formula of the third confidence, sub_edge_confidence is the third confidence, diff[sub_dir] is the difference value of the target pixel in the secondary direction, and diff[anti_sub_dir] is the difference value of the target pixel in the third vertical direction; in the calculation formula of the difference value fusion ratio, sub_weight is the difference value fusion ratio; in the calculation formula of the fourth confidence, edge_confidence is the fourth confidence. Further, the degree of adjustment of the overshoot of the target pixel by the fourth confidence is greater than or equal to the degree of adjustment of the overshoot of the target pixel by the first confidence, wherein the adjustment degree can be the adjustment accuracy.

[0171] It can be seen that this optional embodiment can determine the target confidence corresponding to the target pixel point based on the second confidence of the target pixel point in the second main direction and the third confidence in the secondary direction. In this way, not only can the overshoot of the target pixel point be effectively adjusted to improve the sharpening effect of the sharpened image, thereby improving the clarity of the sharpened image, but also the overshoot control method of the target pixel point is enriched.

[0172] In yet another optional embodiment, determining the secondary direction in the above step may include:

[0173] Determining a direction parameter of the second main direction and a direction parameter of the third main direction;

[0174] The secondary direction is determined according to the direction parameter of the second main direction and the direction parameter of the third main direction.

[0175] In this optional embodiment, specifically, the direction parameter of the second main direction matches the direction angle size of the second main direction, and the direction parameter of the third main direction matches the direction angle size of the third main direction, wherein the direction parameter of the second main direction can be expressed as the direction serial number corresponding to the direction angle size of the second main direction in all directions, and the direction parameter of the third main direction can also be expressed as the direction serial number corresponding to the direction angle size of the third main direction in all directions. For example, when the direction angle size of the second main direction is the second largest in all directions, the direction serial number of the second main direction can be 2; when the direction angle size of the third main direction is the fourth largest in all directions, the direction serial number of the second main direction can be 4, and so on.

[0176] Further, determining the secondary direction according to the direction parameter of the second main direction and the direction parameter of the third main direction may include:

[0177] Determine the secondary direction according to the direction parameter of the second main direction, the direction parameter of the third main direction and a preset secondary direction determination formula;

[0178] The secondary direction determination formula can be:

[0179] if((main_dir==M&&sub_main_dir==N)||((main_dir==N&&sub_main_dir==M);

[0180] sub_dir=M+N+1;

[0181] else;

[0182] sub_dir=(main_dir+sub_main_dir)>>1; main_dir is the second main direction, sub_main_dir is the third main direction, sub_dir is the secondary direction, M represents the direction parameter of the second main direction or the direction parameter of the third main direction, and N represents the direction parameter of the third main direction or the direction parameter of the second main direction corresponding to M.

[0183] For example, when it is determined that the direction set corresponding to the target pixel point is 0°, 30°, 45°, 60°, 90°, 120°, 135°, and 150°, all directions can be arranged according to the arrangement rule from large to small direction angles and the serial numbers 0-7, where the smaller the direction angle, the higher the arrangement order of the direction; when the direction angle of the second main direction is 0°, that is, the direction serial number of the second main direction (the direction parameter of the second main direction) is 0, and when the direction angle of the third main direction is 90°, that is, the direction serial number of the third main direction (the direction parameter of the third main direction) is 4, then according to the secondary direction determination formula, the direction serial number of the secondary direction (the direction parameter of the secondary direction) can be determined to be 5, and the direction angle of the secondary direction is mapped to be 120°.

[0184] It can be seen that this optional embodiment can determine the secondary direction according to the direction parameters of each main direction in a targeted and well-founded manner, which is beneficial to improving the reliability and accuracy of the determined secondary direction, and further beneficial to improving the target confidence of the subsequently determined target pixel points, thereby improving the accuracy of the adjusted target pixel point overshoot.

[0185] In yet another optional embodiment, the step 204 of adjusting the overshoot amount of the target pixel point by the target confidence level corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point may include:

[0186] Determine the overshoot amount of the target pixel point according to the target pixel value of the target pixel point and the pixel value range corresponding to the window where the original pixel point corresponding to the target pixel point in the original image is located;

[0187] Calculate the target overshoot of the target pixel point according to the target confidence, the overshoot of the target pixel point and a preset overshoot adjustment formula;

[0188] Among them, the overshoot adjustment formula is:

[0189] ε c =ε*(1-edge_confidence).

[0190] In this optional embodiment, where ε c is the target overshoot of the target pixel, ε is the overshoot of the target pixel, and edge_confidence is the target confidence. Specifically, the larger the target confidence, the smaller the target overshoot of the target pixel; the smaller the target confidence, the larger the target overshoot of the target pixel, that is, for the strong edge area of ​​the target pixel, the overshoot of the strong edge area can be effectively weakened to alleviate the black and white edge phenomenon; for the weak edge area of ​​the target pixel, the overshoot of the weak edge area can be effectively strengthened to increase the sharpness of the details and enhance the detail texture.

[0191] It can be seen that this optional embodiment can realize dynamic adaptive control of the overshoot amount of each target pixel point in the sharpened image, which can alleviate the sharpening overshoot phenomenon of the sharpened image, thereby enhancing the detail texture and avoiding the edge black and white edge phenomenon, so that when sharpening the image, the clarity of the sharpened image can be effectively improved, and blurring of the image can be avoided after being enlarged.

[0192] Embodiment 3

[0193] See also Figure 3 , Figure 3 Schematic diagram of the structure of an adaptive sharpening overshoot control device for an image disclosed in an embodiment of the present invention. Figure 3 As shown, the adaptive sharpening overshoot control device of the image may include:

[0194] The first calculation module 301 is used to calculate the difference value of any target pixel point in the sharpened image in each direction of the determined direction set;

[0195] A determination module 302 is used to select multiple target directions that meet a preset direction condition from all directions, and determine a main direction from all target directions according to a difference value of a target pixel point in each target direction;

[0196] The second calculation module 303 is used to calculate the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction;

[0197] The adjustment module 304 is used to adjust the overshoot amount of the target pixel point according to the target confidence level corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point.

[0198] In the embodiment of the present invention, the sharpened image is an image obtained after performing an image sharpening operation on the original image.

[0199] It can be seen that implementation Figure 3 The adaptive sharpening overshoot control device of the described image can determine the main direction based on the calculated difference values ​​of the sharpened pixels in different directions, and calculate the target confidence based on the edge confidence of the sharpened pixels in the main direction to adjust the overshoot amount of the sharpened pixels. In this way, not only can the sharpening overshoot phenomenon of the sharpened image be alleviated, but also compared with the transmission and control sharpening overshoot control method, it avoids the use of global parameters to control the overshoot phenomenon, and can specifically and accurately adjust the overshoot amount of the pixel points, thereby weakening the edge black and white edge strength of the sharpened image and enhancing the detail sharpening strength, thereby realizing dynamic adaptive adjustment of the overshoot amount of the pixel points and improving the image quality of the sharpened image.

[0200] In an optional embodiment, the first calculation module 301 calculates the difference value of any target pixel of the sharpened image in each direction of the determined direction set in the following manner:

[0201] For any target pixel point of the sharpened image, determine a direction set that matches the target pixel point;

[0202] According to all directions, a target window with the target pixel as the center point and matching all directions is determined;

[0203] For each direction, determining at least one pixel pair matching the direction in the pixel matrix of the target window;

[0204] For each direction, determine the absolute value of the pixel difference corresponding to each pixel pair matching the direction and the target weight corresponding to each pixel pair; based on the absolute value of the pixel difference corresponding to each pixel pair and the target weight corresponding to each pixel pair, calculate the weighted average corresponding to the absolute value of the pixel difference corresponding to all pixel pairs, and obtain the operation result as the difference value of the direction.

[0205] In this optional embodiment, the direction set includes at least one direction, each direction represents a direction with a target pixel point as a direction reference point, and each direction in the direction set can determine a vertical direction perpendicular to the direction in the direction set; the angle value of the line connecting the two pixel points included in each pixel point pair matching the direction compared to the reference direction is equal to the direction angle of the direction, and the line connecting the two pixel points included in each pixel point pair matching the direction does not cross other pixel points; the pixel point difference value corresponding to each pixel point pair is the pixel point difference value between the two pixel points in each pixel point pair.

[0206] It can be seen that the implementation Figure 4 The adaptive sharpening overshoot control device for the described image can determine the number of directions and directional angles corresponding to the sharpened pixels according to the specific image processing requirements, and calculate the difference values ​​of the sharpened pixels in each direction, which is conducive to the subsequent smooth determination of the edge strength of the sharpened pixels in each direction, thereby providing an adjustment basis for the adaptive adjustment of the overshoot amount of the sharpened pixels, which is not only conducive to improving the reliability and accuracy of the overshoot adjustment results of the sharpened pixels, but also the required filtering window is smaller, which is conducive to saving the working space occupied by it.

[0207] In another optional embodiment, the device may further include:

[0208] The processing module 305 is used to adjust the overshoot of the target pixel point through the target confidence corresponding to the target pixel point in the adjustment module 304, and after obtaining the target overshoot of the target pixel point, process the target pixel value of the target pixel point according to the target overshoot of the target pixel point and the pixel value range corresponding to the window where the original pixel point corresponding to the target pixel point in the original image is located.

[0209] It can be seen that the implementation Figure 4 The adaptive sharpening overshoot control device of the described image can effectively adjust the overshoot amount of the pixel point, and then effectively process the target pixel value of the target pixel point, which is conducive to intelligently adapting to intelligent image devices with different resolutions, avoiding the appearance of black and white edge artifacts in strong edge areas and enhancing the detailed texture of weak edge areas, improving the overall clarity of the image, so that the small resolution image will not be blurred after being enlarged.

[0210] In yet another optional embodiment, the determination module 302 selects multiple target directions that meet the preset direction condition from all directions in the following manner:

[0211] For each direction, according to any pixel pair matching the direction, the line span of the pixel pair is calculated, and it is determined whether the line span of the pixel pair meets the preset span condition;

[0212] When the judgment result is yes, the direction is determined to be a direction that satisfies a preset direction condition;

[0213] All directions that meet a preset direction condition among all directions are determined as all target directions.

[0214] In this optional embodiment, the line span of the pixel point pair represents the length of the line between two pixel points in the pixel point pair.

[0215] It can be seen that the implementation Figure 4 The adaptive sharpening overshoot control device for the described image can not only determine the required target direction in a basis and flexibly to meet various image processing requirements, thereby enriching the method of determining the target direction, but also can improve the reliability and accuracy of the main direction subsequently determined from the target direction, thereby improving the accuracy of adjusting the overshoot amount of the target pixel point, so that the sharpened image can obtain an effective sharpening effect.

[0216] In yet another optional embodiment, the second calculation module 303 includes:

[0217] A first calculation submodule 3031 is used to calculate a first confidence level of a target pixel in the first main direction according to a difference value of the target pixel in the first main direction and a difference value in the first vertical direction when the main directions only include the first main direction;

[0218] A first determination submodule 3032 is used to determine the first confidence level as the target confidence level corresponding to the target pixel point;

[0219] Among them, the first confidence is calculated by the following formula:

[0220]

[0221] In this optional embodiment, the first vertical direction is a direction perpendicular to the first main direction, and the first main direction is the direction with the smallest difference value among all target directions; main_edge_confidence is the first confidence, diff[main_dir] is the difference value of the target pixel point in the first main direction, and diff[anti_main_dir] is the difference value of the target pixel point in the first vertical direction.

[0222] It can be seen that implementation Figure 5 The described adaptive sharpening overshoot control device for the image can quickly determine the target confidence corresponding to the target pixel point based on the first confidence of the target pixel point in the first main direction, and then realize rapid adaptive adjustment of the overshoot amount of the target pixel point of the sharpened image, so as to quickly obtain the sharpened image after the sharpening overshoot adjustment, and avoid image processing delay.

[0223] In yet another optional embodiment, the second calculation module 303 includes:

[0224] A second determination submodule 3033, configured to determine a secondary direction when the primary direction includes a second primary direction and a third primary direction;

[0225] The second calculation submodule 3034 is used to calculate the second confidence of the target pixel in the second main direction according to the difference value of the target pixel in the second main direction and the difference value in the second vertical direction; calculate the third confidence of the target pixel in the secondary direction according to the difference value of the target pixel in the secondary direction and the difference value in the third vertical direction; calculate the difference value fusion ratio corresponding to the target pixel according to the difference value of the target pixel in the second main direction and the difference value in the secondary direction; calculate the fourth confidence according to the second confidence, the third confidence and the difference value fusion ratio;

[0226] The second determining submodule 3033 is further used to determine the fourth confidence level as the target confidence level corresponding to the target pixel point;

[0227] The second confidence level is calculated by the following formula:

[0228]

[0229] The third confidence level is calculated by the following formula:

[0230]

[0231] The difference value fusion ratio is calculated by the following formula:

[0232]

[0233] The fourth confidence level is calculated by the following formula:

[0234] edge_confidence=main_edge_confidence*(1-sub_weight)+sub_edge_confidence*sub_weight.

[0235] In this optional embodiment, the second main direction is the direction with the smallest difference value among all target directions, the third main direction is the direction with the second smallest difference value among all target directions, and the secondary direction is determined from all remaining directions except all target directions; the second vertical direction is the direction perpendicular to the second main direction; the third vertical direction is the direction perpendicular to the secondary direction; main_edge_confidence is the second confidence, diff[main_dir] is the difference value of the target pixel in the second main direction, and diff[anti_main_dir] is the difference value of the target pixel in the second vertical direction; sub_edge_confidence is the third confidence, diff[sub_dir] is the difference value of the target pixel in the secondary direction, and diff[anti_sub_dir] is the difference value of the target pixel in the third vertical direction; sub_weight is the difference value fusion ratio; edge_confidence is the fourth confidence.

[0236] It can be seen that the implementation Figure 6 The adaptive sharpening overshoot control device of the described image can determine the target confidence corresponding to the target pixel point based on the second confidence of the target pixel point in the second main direction and the third confidence in the secondary direction. In this way, not only can the overshoot amount of the target pixel point be effectively adjusted to improve the sharpening effect of the sharpened image, thereby improving the clarity of the sharpened image, but also the overshoot control method of the target pixel point is enriched.

[0237] In yet another optional embodiment, the second determination submodule 3033 determines the secondary direction in the following manner:

[0238] Determining a direction parameter of the second main direction and a direction parameter of the third main direction;

[0239] The secondary direction is determined according to the direction parameter of the second main direction and the direction parameter of the third main direction.

[0240] It can be seen that the implementation Figure 6 The adaptive sharpening overshoot control device of the described image can determine the secondary direction according to the directional parameters of each main direction in a targeted and well-founded manner, which is beneficial to improving the reliability and accuracy of the determined secondary direction, and further beneficial to improving the target confidence of the subsequently determined target pixel points, thereby improving the accuracy of the overshoot amount of the adjusted target pixel points.

[0241] In another optional embodiment, the adjustment module 304 adjusts the overshoot amount of the target pixel point according to the target confidence corresponding to the target pixel point, and obtains the target overshoot amount of the target pixel point in a specific manner:

[0242] Determine the overshoot amount of the target pixel point according to the target pixel value of the target pixel point and the pixel value range corresponding to the window where the original pixel point corresponding to the target pixel point in the original image is located;

[0243] Calculate the target overshoot of the target pixel point according to the target confidence, the overshoot of the target pixel point and a preset overshoot adjustment formula;

[0244] Among them, the overshoot adjustment formula is:

[0245] ε c =ε*(1-edge_confidence).

[0246] In this alternative embodiment, ε c is the target overshoot of the target pixel, ε is the overshoot of the target pixel, and edge_confidence is the target confidence.

[0247] It can be seen that the implementation Figure 4 The described adaptive sharpening overshoot control device for an image can realize dynamic adaptive control of the overshoot amount of each target pixel point in the sharpened image, which can alleviate the sharpening overshoot phenomenon of the sharpened image, thereby enhancing the detail texture and avoiding the edge black and white edge phenomenon, so that when sharpening the image, the clarity of the sharpened image can be effectively improved, and blurring of the image after being enlarged can be avoided.

[0248] Embodiment 4

[0249] See also Figure 7 , Figure 7 FIG. 1 is a schematic diagram of the structure of another image adaptive sharpening overshoot control device disclosed in an embodiment of the present invention. Figure 7 As shown, the adaptive sharpening overshoot control device of the image may include:

[0250] A memory 401 storing executable program codes;

[0251] a processor 402 coupled to the memory 401;

[0252] The processor 402 calls the executable program code stored in the memory 401 to execute the steps in the image adaptive sharpening overshoot control method described in the first embodiment of the present invention or the second embodiment of the present invention.

[0253] Embodiment 5

[0254] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps in the adaptive sharpening overshoot control method of the image described in Embodiment 1 or Embodiment 2 of the present invention.

[0255] Embodiment 6

[0256] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the adaptive sharpening overshoot control method of an image described in Embodiment 1 or Embodiment 2.

[0257] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0258] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0259] Finally, it should be noted that the method and device for adaptive sharpening overshoot control of an image disclosed in the embodiment of the present invention disclose only the preferred embodiments of the present invention, which are only used to illustrate the technical scheme of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical schemes described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical schemes from the spirit and scope of the technical schemes of the various embodiments of the present invention.

Claims

1. An adaptive sharpening overshoot control method for an image, characterized in that: The method comprises: For any target pixel point of the sharpened image, calculating the difference value of the target pixel point in each direction in the determined direction set; the sharpened image is an image obtained after performing an image sharpening operation on the original image; Screening a plurality of target directions satisfying a preset direction condition from all the directions, and determining a main direction from all the target directions according to a difference value of the target pixel point in each of the target directions; Calculating the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction; The overshoot amount of the target pixel point is adjusted according to the target confidence corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point.

2. The method for adaptively controlling image sharpening overshoot according to claim 1, characterized in that: The step of calculating, for any target pixel of the sharpened image, a difference value of the target pixel in each direction of the determined direction set includes: For any target pixel point of the sharpened image, determine a direction set matching the target pixel point; the direction set includes at least one direction, each of the directions represents a direction with the target pixel point as a direction reference point, and each of the directions in the direction set can determine a vertical direction perpendicular to the direction in the direction set; According to all the directions, determining a target window with the target pixel point as the center point and matching all the directions; For each of the directions, in the pixel matrix of the target window, at least one pixel pair matching the direction is determined; the angle value of the connecting line of the two pixel points included in each of the pixel pairs matching the direction compared to the reference direction is equal to the direction angle of the direction, and the connecting line of the two pixel points included in each of the pixel pairs matching the direction does not cross other pixel points; For each of the directions, determining the absolute value of the pixel difference value corresponding to each of the pixel pairs matching the direction and the target weight corresponding to each of the pixel pairs; calculating the weighted average value corresponding to the absolute values ​​of the pixel difference values ​​corresponding to all of the pixel pairs according to the absolute value of the pixel difference value corresponding to each of the pixel pairs and the target weight corresponding to each of the pixel pairs, and obtaining a calculation result as the difference value of the direction; the pixel difference value corresponding to each of the pixel pairs is the pixel difference between two pixels in each of the pixel pairs; And, after adjusting the overshoot amount of the target pixel point by the target confidence corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point, the method further includes: The target pixel value of the target pixel is processed according to the target overshoot of the target pixel and the pixel value range corresponding to the window where the original pixel corresponding to the target pixel in the original image is located.

3. The method for adaptive sharpening overshoot control of an image according to claim 1 or 2, characterized in that: The step of selecting a plurality of target directions satisfying a preset direction condition from all the directions includes: For each of the directions, according to any of the pixel point pairs matching the direction, the line span of the pixel point pair is calculated, and it is determined whether the line span of the pixel point pair meets a preset span condition; the line span of the pixel point pair represents the length of the line between two pixel points in the pixel point pair; When the judgment result is yes, determining that the direction is a direction that satisfies a preset direction condition; All directions that meet the preset direction condition among all the directions are determined as all target directions.

4. The method for adaptively controlling image sharpening overshoot according to claim 3, characterized in that: The calculating the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction includes: When the main directions only include the first main direction, calculating the first confidence of the target pixel in the first main direction according to the difference value of the target pixel in the first main direction and the difference value in the first vertical direction; the first vertical direction is a direction perpendicular to the first main direction, and the first main direction is a direction with the smallest difference value among all the target directions; Determining the first confidence level as a target confidence level corresponding to the target pixel point; The first confidence level is calculated by the following formula: main_edge_confidence is the first confidence, diff[main_dir] is the difference value of the target pixel in the first main direction, and diff[anti_main_dir] is the difference value of the target pixel in the first vertical direction.

5. The method for adaptively controlling image sharpening overshoot according to claim 3, characterized in that: The calculating the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction includes: When the main direction includes a second main direction and a third main direction, determining a secondary direction; the second main direction is a direction with the smallest difference value among all the target directions, the third main direction is a direction with the second smallest difference value among all the target directions, and the secondary direction is determined from all remaining directions among all the directions except all the target directions; Calculating a second confidence level of the target pixel in the second main direction according to a difference value of the target pixel in the second main direction and a difference value in a second vertical direction; the second vertical direction is a direction perpendicular to the second main direction; Calculating a third confidence level of the target pixel in the secondary direction according to the difference value of the target pixel in the secondary direction and the difference value in a third vertical direction; the third vertical direction is a direction perpendicular to the secondary direction; Calculate the difference value fusion proportion corresponding to the target pixel point according to the difference value of the target pixel point in the second main direction and the difference value in the secondary direction; Calculate a fourth confidence level according to the second confidence level, the third confidence level, and the difference value fusion ratio, and determine the fourth confidence level as a target confidence level corresponding to the target pixel point; The second confidence level is calculated by the following formula: main_edge_confidence is the second confidence, diff[main_dir] is the difference value of the target pixel in the second main direction, and diff[anti_main_dir] is the difference value of the target pixel in the second vertical direction; The third confidence level is calculated by the following formula: sub_edge_confidence is the third confidence, diff[sub_dir] is the difference value of the target pixel in the secondary direction, and diff[anti_sub_dir] is the difference value of the target pixel in the third vertical direction; The difference value fusion ratio is calculated by the following formula: sub_weight is the difference value fusion weight; The fourth confidence level is calculated by the following formula: edge_confidence=main_edge_confidence*(1-sub_weight)+sub_edge_confidence*sub_weight; edge_confidence is the fourth confidence.

6. The method for adaptively controlling image sharpening overshoot according to claim 5, characterized in that: The determining of the secondary direction comprises: Determining a direction parameter of the second main direction and a direction parameter of the third main direction; A secondary direction is determined according to the direction parameter of the second main direction and the direction parameter of the third main direction.

7. The method for adaptively controlling image sharpening overshoot according to claim 4 or 6, characterized in that: The step of adjusting the overshoot amount of the target pixel point by the target confidence corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point includes: Determine the overshoot amount of the target pixel point according to the target pixel value of the target pixel point and the pixel value range corresponding to the window where the original pixel point corresponding to the target pixel point in the original image is located; Calculating a target overshoot of the target pixel point according to the target confidence, the overshoot of the target pixel point, and a preset overshoot adjustment formula; Wherein, the overshoot adjustment formula is: ε c =ε*(1-edge_confidence);ε c is the target overshoot of the target pixel, ε is the overshoot of the target pixel, and edge_confidence is the target confidence.

8. An adaptive sharpening overshoot control device for an image, characterized in that: The device comprises: A first calculation module is used to calculate, for any target pixel point of a sharpened image, a difference value of the target pixel point in each direction of the determined direction set; the sharpened image is an image obtained after performing an image sharpening operation on the original image; A determination module, used to select a plurality of target directions satisfying a preset direction condition from all the directions, and determine a main direction from all the target directions according to a difference value of the target pixel point in each of the target directions; A second calculation module, used to calculate the target confidence corresponding to the target pixel point according to the difference value of the target pixel point in the main direction; The adjustment module is used to adjust the overshoot amount of the target pixel point according to the target confidence corresponding to the target pixel point to obtain the target overshoot amount of the target pixel point.

9. An adaptive sharpening overshoot control device for an image, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the adaptive sharpening overshoot control method of the image as described in any one of claims 1-7.

10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the adaptive sharpening overshoot control method of the image as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Gradient value and direction based image sharpening method and device

    CN105894459A

  • Image sharpening processing method and system thereof

    CN110136073A

  • Image processing device, image processing method, and image processing program

    JP2017091231A