An image enhancement method, related device, storage medium and computer product

By acquiring the sharpness of the target image and the reference image, the image fusion coefficient is determined for image enhancement, which solves the problem of unnatural image display effect in traditional methods and achieves both sharpness improvement and naturalness preservation.

CN117173062BActive Publication Date: 2025-12-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210590645.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-27
Publication Date
2025-12-19
Estimated Expiration
2042-05-27

AI Technical Summary

Technical Problem

While traditional image enhancement algorithms improve image clarity, the enhanced image display effect is not natural enough.

Method used

By acquiring the sharpness of the target image and the reference image, the image fusion coefficient is determined, and the target image is enhanced using this coefficient to generate an enhanced image with higher sharpness and a more natural display effect than the target image.

Benefits of technology

While improving image clarity, it maintains the naturalness of the enhanced image, avoiding unnatural display phenomena.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117173062B_ABST
    Figure CN117173062B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an image enhancement method, related equipment, a storage medium and a computer product, which can be applied to cloud technology, artificial intelligence, intelligent transportation and the like. The method comprises: obtaining a target image and an image definition of the target image, and obtaining a reference image and an image definition of the reference image, the reference image being obtained by performing image enhancement processing on the target image through a preset image enhancement algorithm; determining an image fusion coefficient of the reference image according to the image definition of the target image and the image definition of the reference image; and performing image enhancement processing on the target image by using the image fusion coefficient and the reference image to obtain an enhanced image of the target image, the image definition of the enhanced image being higher than the image definition of the target image. By using the embodiments of the present application, the natural degree of the enhanced image obtained after the definition is improved can be ensured when the definition of the target image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, and in particular to an image enhancement method, related device, storage medium and computer product. BACKGROUND

[0002] With the development of image processing technology in computer vision (CV), the image quality of digital images displayed on a display screen is increasingly improved. In actual applications, image definition is regarded as an important indicator for measuring image quality. Generally, image enhancement processing is first performed on a target image to improve the image definition of the target image, and then the enhanced image of the target image is displayed. However, the enhanced image obtained by using a traditional image enhancement algorithm has a significantly improved definition, but has a poor display effect (for example, the image is not natural enough). Therefore, how to perform image enhancement processing on an image to ensure that the enhanced image obtained is relatively natural has become a research hotspot. SUMMARY

[0003] The embodiments of the present application provide an image enhancement method, related device, storage medium and program product, which can ensure the naturalness of an enhanced image obtained after improving the definition of a target image.

[0004] In one aspect, the embodiments of the present application provide an image enhancement method, comprising:

[0005] obtaining a target image and image definition of the target image, and obtaining a reference image and image definition of the reference image, the reference image being an image obtained by performing image enhancement processing on the target image by using a preset image enhancement algorithm;

[0006] determining an image fusion coefficient of the reference image according to the image definition of the target image and the image definition of the reference image;

[0007] performing image enhancement processing on the target image by using the image fusion coefficient and the reference image to obtain an enhanced image of the target image, the image definition of the enhanced image being higher than the image definition of the target image.

[0008] In another aspect, the embodiments of the present application provide an image enhancement device, comprising:

[0009] an obtaining unit configured to obtain a target image and image definition of the target image, and obtain a reference image and image definition of the reference image, the reference image being an image obtained by performing image enhancement processing on the target image by using a preset image enhancement algorithm;

[0010] determining, according to the image definition of the target image and the image definition of the reference image, an image fusion coefficient of the reference image;

[0011] enhancing, by using the image fusion coefficient and the reference image, the target image to obtain an enhanced image of the target image, the image definition of the enhanced image being higher than the image definition of the target image.

[0012] In another aspect, an embodiment of the present application provides a computer device, comprising:

[0013] a processor configured to implement one or more computer programs;

[0014] a computer storage medium storing one or more computer programs, the one or more computer programs being adapted to be loaded and executed by the processor:

[0015] obtaining a target image and an image definition of the target image, and obtaining a reference image and an image definition of the reference image, the reference image being obtained by performing image enhancement processing on the target image by using a preset image enhancement algorithm;

[0016] determining, according to the image definition of the target image and the image definition of the reference image, an image fusion coefficient of the reference image;

[0017] enhancing, by using the image fusion coefficient and the reference image, the target image to obtain an enhanced image of the target image, the image definition of the enhanced image being higher than the image definition of the target image.

[0018] In another aspect, an embodiment of the present application provides a computer storage medium storing one or more computer programs, the one or more computer programs being adapted to be loaded and executed by a processor:

[0019] obtaining a target image and an image definition of the target image, and obtaining a reference image and an image definition of the reference image, the reference image being obtained by performing image enhancement processing on the target image by using a preset image enhancement algorithm;

[0020] determining, according to the image definition of the target image and the image definition of the reference image, an image fusion coefficient of the reference image;

[0021] enhancing, by using the image fusion coefficient and the reference image, the target image to obtain an enhanced image of the target image, the image definition of the enhanced image being higher than the image definition of the target image.

[0022] In still another aspect, the embodiments of the present application provide a computer product, which comprises a computer program suitable for being loaded and executed by a processor:

[0023] obtaining a target image and an image definition of the target image, and obtaining a reference image and an image definition of the reference image, the reference image being obtained by performing image enhancement processing on the target image through a preset image enhancement algorithm;

[0024] determining an image fusion coefficient of the reference image according to the image definition of the target image and the image definition of the reference image;

[0025] performing image enhancement processing on the target image by using the image fusion coefficient and the reference image to obtain an enhanced image of the target image, the image definition of the enhanced image being higher than the image definition of the target image.

[0026] In the embodiments of the present application, when performing image enhancement processing on the target image, the computer device refers to the image definition of the target image itself, so that there is not too much difference between the image definition of the enhanced image and the image definition of the target image, thereby making the display effect of the enhanced image more natural when displayed. In addition, the generation of the enhanced image also refers to the reference image, and the image definition of the reference image is usually greater than the image definition of the target image, so the embodiments of the present application can also effectively improve the image definition of the enhanced image generated by the computer device. As can be seen from the above, the embodiments of the present application can ensure that the image definition of the enhanced image of the target image is higher than the image definition of the target image, while maintaining the naturalness of the enhanced image when displayed. BRIEF DESCRIPTION OF DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0028] Figure 1 is a schematic diagram of an enhanced image generation process provided by the embodiments of the present application;

[0029] Figure 2 is a schematic flow chart of an image enhancement method provided by the embodiments of the present application;

[0030] Figure 3 is a schematic diagram of a target image acquisition method provided by the embodiments of the present application;

[0031] Figure 4 is a schematic flowchart of still another image enhancement method provided by an embodiment of the present application;

[0032] Figure 5 is a structural schematic diagram of an image enhancement device provided by an embodiment of the present application;

[0033] Figure 6 is a structural schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the person in the technical field better understand the method provided by the embodiments of the present application, the technical method in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. It should be noted that each specific embodiment described in the embodiments of the present application is only a part of the embodiments of the present application, not all the embodiments. Based on each embodiment in the present application, all other embodiments obtained by the person of ordinary skill in the art without creative labor are within the scope of protection of the present application.

[0035] The development and wide application of computer vision technology undoubtedly provide many conveniences for people's daily life. The so-called computer vision technology refers to a science of studying how to make machines have the ability to "see". More specifically, using computer vision technology can realize that electronic devices (such as cameras, computers, etc.) replace human eyes to identify and measure targets in images, and further process images so that the processed images become more suitable for human eye observation or are transmitted to instruments for detection. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D (3 Dimensions) technology, virtual reality, augmented reality, simultaneous localization and mapping, and other technologies. It also includes common face recognition, fingerprint recognition and other biometric recognition technologies.

[0036] Based on the above description of the computer vision technology, it is not difficult to see that the computer vision technology has a wide range of application fields. Among the many application fields of computer vision technology, the image processing field is undoubtedly one of the more important ones. Among them, using computer vision technology to enhance the target image to obtain a higher definition image is an important application scenario in the field of image processing. The image enhancement referred to here mainly refers to enhancing the definition of the image to obtain a higher definition image. It can be understood that the image with reasonably improved definition can present a better visual display effect, and to some extent, it can also improve the application value of the corresponding image. Since the traditional image enhancement method obtains an enhanced image with higher definition after enhancing the target image, but the visual effect of the enhanced image is not natural enough. Therefore, in order to solve this problem, the embodiments of the present application make full use of computer vision technology and propose an image enhancement scheme, which points out that when performing image enhancement processing on a target image, reasonably referencing the original definition of the target image to determine the pixel value of each pixel point in the enhanced image can make the display effect of the enhanced image of the target image more real and natural.

[0037] In the actual application of the embodiments of the present application, the image enhancement scheme can be executed by a computer device. Among them, the computer device can be a terminal device, or a server, of course, it can also be a computing system composed of a terminal device and a server, and the embodiments of the present application do not limit this. And specifically, in the embodiments of the present application, the terminal device can include but is not limited to: a smart phone, a tablet computer, a notebook computer, a desktop computer, a vehicle-mounted terminal, a smart voice interaction device, a smart home appliance, an aircraft, etc. In specific embodiments, various application programs (Application, APP) and / or clients can also be run in the terminal device, such as: a multimedia playback client, a social client, a browser client, an information flow client, an education client, and an image processing client, etc. In addition, the above-mentioned server can include but is not limited to: a standalone physical server, a server cluster or distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms.

[0038] To facilitate subsequent more clearly illustrate the image enhancement method and application scenarios related to the embodiments of the present application, the following first to the specific principles of the image enhancement scheme proposed in the embodiments of the present application are described. In the image enhancement scheme proposed in the embodiments of the present application, if the image that needs to be enhanced is the target image, then the computer device can first use a preset image enhancement algorithm to enhance the target image to obtain a reference image corresponding to the target image. Then, the computer device can obtain the image clarity of the reference image and the image clarity of the target image. It can be understood that the image clarity of the reference image is usually higher than that of the target image. Further, after the computer device obtains the image clarity of both the target image and the reference image, the computer device can determine an image fusion coefficient according to the clarity of both, so as to fuse the reference image and the target image using the determined image fusion coefficient. The image obtained after image fusion can be used as the enhanced image of the target image in the embodiments of the present application.

[0039] Based on the above description of the principles of the embodiments of the present application, it can be seen that in the embodiments of the present application, when the computer device enhances the target image to obtain a higher clarity image, the image clarity of the target image itself is referred to, which constrains the clarity of the enhanced image of the target image. In this case, the clarity of the enhanced image can maintain a high similarity with the clarity of the target image, so as to maintain a high authenticity of the enhanced image, and further ensure the display effect of the enhanced image. For example, assuming that the clarity of the face contour of object a in the target image is lower than that of object b, then the clarity of the face contour of object a in the enhanced image obtained by using the embodiments of the present application to enhance the target image will also be lower than that of object b. In this example, the overall clarity of the enhanced image is higher than that of the target image, but the distribution of the clarity of the enhanced image is similar to that of the target image. Therefore, the display effect of the enhanced image determined by the embodiments of the present application is better than that of the target image. In addition, the clarity of the enhanced image obtained by using the embodiments of the present application for image enhancement processing usually has a small difference from the clarity of the target image, which can make the clarity of the enhanced image higher than that of the target image while effectively avoiding the unnatural display problem of the enhanced image due to over-enhancement.

[0040] To facilitate more clearly illustrate the enhancement effect of the embodiments of the present application in the actual application field, the following will be combined with the above principles and Figure 1 to visually demonstrate the embodiments of the present application. In this example, Figure 1The content shown is: when the embodiment of the present application is used to perform image enhancement on any image, the contrast results of the image definition of the relevant images. In Figure 1 The image marked by 101 is an image that needs to be enhanced (i.e., a target image), the image marked by 102 is an image obtained after the target image is enhanced by using a preset image enhancement algorithm (i.e., a reference image), and the image marked by 103 is an image obtained after the target image is enhanced by using the embodiment of the present application (i.e., an enhanced image of the target image). Based on Figure 1 It can be seen that the details of the face of the person in the target image 101 that has not been enhanced are not comprehensive enough (such as: the lines are not clear enough, the number of lines used to describe the outline is small, etc.); in the reference image 102 that is enhanced by using the preset image enhancement algorithm, the details of the face of the person are comprehensive but lack authenticity (such as: the lines are too obvious, the number of lines used to describe the outline is too large, etc.); the computer device references Figure 1 In the enhanced image 103 generated by the target image 101 and the reference image 102 in the computer device, the details of the face are basically comprehensive and the display effect is relatively natural. In addition, based on the enhanced image 103, it is not difficult to see that the enhanced image generated in the embodiment of the present application enhances the definition of the content of the target image on the basis of retaining the original image content of the target image, and obtains an enhanced image that has a natural display effect and a high image definition. That is to say, the image definition of the enhanced image obtained by the embodiment of the present application has the same characteristics as the image definition of the target image, and the image definition of the enhanced image will not be excessively higher than the image definition of the target image, so that the enhanced image has a more natural display effect in vision.

[0041] Based on the above description, it also needs to be explained that the embodiments of the present application can also be applied to the field of video processing. Specifically, the image enhancement method proposed in the embodiments of the present application can be applied to image enhancement processing of video frames in a video file. In order to ensure that there is no obvious image definition jump phenomenon in the video file during display (such as playing on the display of a mobile terminal), the difference between the image definition of adjacent video frames in the video file is usually small. Then, since the image definition of the enhanced image obtained after the target image is enhanced by the embodiments of the present application will not be too different from the image definition of the target image, it is not difficult to understand that if the target image is a plurality of video frames with similar image definition, the difference between the image definition of each enhanced image obtained after the plurality of target images are enhanced by the embodiments of the present application is also small. In this case, it can be seen that the image enhancement of each video frame by the embodiments of the present application not only can effectively improve the image definition of each video frame after enhancement processing, but also can maintain the feature that the difference between the image definition of each video frame to be played in the video file is small, so that the video file processed by the embodiments of the present application will not have obvious definition jump when displayed, thereby avoiding the phenomenon of video flicker during video file display.

[0042] Based on the above description of the principle of the image enhancement scheme, the embodiments of the present application propose an image enhancement method, which can also be executed by the computer device mentioned above. Please refer to Figure 2 , Figure 2 is a flowchart of the image enhancement method. As Figure 2 shown, the method includes steps S201-S203:

[0043] S201, obtaining a target image and the image definition of the target image, and obtaining a reference image and the image definition of the reference image, the reference image being an image obtained by performing image enhancement processing on the target image by a preset image enhancement algorithm.

[0044] In the embodiments of the present application, the target image can be a color image or a grayscale image, and the number of target images can be one or more. For ease of description, the related implementation modes of the embodiments of the present application will be described in detail below without special description. In actual application, the target image can be a complete photographed image or composed of part of the image region in an image. Figure 3As shown, there are multiple objects in the image marked by 30, including: a person marked by 301, a plant marked by 302, and a sign marked by 303. Then, in this case, the target image can be the image 30, can be the image region where the person 301 is located in the image 30, and can be the face region of the person 301 in the image 30 (such as the region marked by 3011), depending on the specific case.

[0045] The reference image is obtained by performing image enhancement processing on the target image by using a preset image enhancement algorithm, that is, the image definition of the reference image is different from the image definition of the target image, and in general, the image definition of the reference image is not lower than the image definition of the target image. In addition, it should be noted that when the number of target images is one, the number of reference images can be one or more; when the number of target images is multiple, the number of reference images can also be one or more. Specifically, when the target image is one, the reference image can be obtained by performing corresponding image enhancement processing on the target image by using different image enhancement algorithms by the computer device, and one image enhancement algorithm corresponds to one reference image. Alternatively, the reference image can also be obtained by performing image enhancement processing on the target image by using the same image enhancement algorithm by the computer device according to different enhancement degrees, and one enhancement degree corresponds to one reference image. When the number of target images is multiple, for example, when the target images are multiple images of the same image at different definitions, the reference image can be obtained by performing image enhancement processing on the target image according to a preset definition, and the number of reference images can be one at this time. Alternatively, the reference image can also be obtained by performing image enhancement processing on different target images by using a preset image enhancement algorithm, and one target image corresponds to one reference image, and the number of reference images can be multiple at this time.

[0046] Based on the above description, it is not difficult to understand that the preset image enhancement algorithm in the embodiment of the application can include one or more. Specifically, the preset image enhancement algorithm can be any algorithm that can be used to enhance the image definition. Exemplarily, the preset image enhancement algorithm can include but is not limited to: gamma transformation (i.e., gamma transformation), Laplace transformation (i.e., Laplace transformation), histogram equalization, etc.

[0047] S202, determining the image fusion coefficient of the reference image according to the image definition of the target image and the image definition of the reference image.

[0048] The image fusion coefficient is used to indicate the reference degree (or the fusion degree) of the computer device to the reference image when generating the enhanced image of the target image. The greater the image fusion coefficient, the higher the reference degree of the computer device to the reference image, and the more features of the reference image are fused in the enhanced image generated by the computer device, so that the image definition of the enhanced image is more affected by the image definition of the reference image. It is not difficult to understand that when the image definition of the reference image is higher than that of the target image, the greater the image fusion coefficient, the greater the difference between the image definition of the enhanced image and that of the target image, and the better the image enhancement effect of the computer device on the target image.

[0049] S203, performing image enhancement processing on the target image by using the image fusion coefficient and the reference image to obtain an enhanced image of the target image.

[0050] In specific embodiments, the image definition of the enhanced image obtained by the computer device after performing image enhancement processing on the target image is higher than the image definition of the target image. The manner in which the computer device performs image enhancement processing on the target image by using the image fusion coefficient and the reference image can be that the computer device performs image fusion on the reference image and the target image based on the image fusion coefficient, and further takes the fused image as the enhanced image of the target image. Specifically, the computer device can first determine the image fusion coefficient of the target image based on the image fusion coefficient of the reference image. In actual application, the sum of the image fusion coefficient of the reference image and the image fusion coefficient of the target image can be 1. The image fusion coefficient of the target image is used to indicate the reference degree of the computer device to the target image when generating the enhanced image. Further, the computer device can perform image fusion on the reference image and the target image according to the image fusion coefficient of the reference image and the image fusion coefficient of the target image to obtain the enhanced image of the target image. The specific manner in which the computer device obtains the enhanced image of the target image can be referred to the description of the specific embodiments of the image enhancement method shown in Figure 4

[0051] ​In the embodiment of the present application, when the computer device performs image enhancement processing on the target image to obtain an enhanced image with higher image definition than the target image, the image definition of the target image is referred to, so that the image definition of the enhanced image and the image definition of the target image will not have too much difference, thereby making the enhanced image not easy to have unnatural display in visual effect. In addition, the computer device also refers to the reference image, and the reference image is obtained by the computer device performing image enhancement processing on the target image by using the preset image enhancement algorithm. Generally, the image definition of the reference image is greater than the image definition of the target image, so that the embodiment of the present application can also effectively improve the image definition of the enhanced image generated by the computer device. As can be seen from the above, the embodiment of the present application can ensure that the image definition of the enhanced image of the target image is higher than the image definition of the target image, while maintaining the naturalness of the enhanced image when displayed.

[0052] Based on the principle of the above image enhancement scheme, the embodiment of the present application also proposes another image enhancement method. Similarly, the image enhancement method can also be executed by using a computer device. Please refer to Figure 4 , Figure 4 is the execution flowchart of the image enhancement method. As Figure 4 shown, the method comprises steps S401-S405:

[0053] S401, obtaining a target image and the image definition of the target image, and obtaining a reference image and the image definition of the reference image, the reference image being an image obtained by performing image enhancement processing on the target image by using a preset image enhancement algorithm.

[0054] In one embodiment, when the computer device obtains the image definition of any image, the computer device can determine the image definition of the image by obtaining the pixel variation amplitude of each pixel point in the image. Specifically, the computer device can first obtain the pixel value of each pixel point in the image, and then perform n-order derivation (n is a positive integer) on each pixel value to obtain an n-order derivation result. The derivation result includes a plurality of gradient values, one pixel point in the image corresponds to one gradient value, and the gradient value can be used to indicate the pixel variation amplitude of the corresponding pixel point. That is, in the embodiment of the present application, the computer device can take the average value of each gradient value as the image definition of the image.

[0055] In yet another embodiment, when the target image is a color image, the reference image can also be a color image. The color image can include, but is not limited to, any one or both of the following: an image in RGB color mode (hereinafter referred to as an RGB image) and an image in CMYK color mode. In practical applications, an RGB image refers to an image in which a pixel point is represented by three pixel values, i.e., an R (Red) channel pixel value, a G (Green) channel pixel value, and a B (Blue) channel pixel value. For ease of illustration, the embodiments of the present application will be described in detail with respect to an RGB image as an example of a color image, but this should not be considered as a limitation on the embodiments of the present application.

[0056] For any color image in the target image and the reference image, the computer device can obtain the image definition of the color image in the following manner: the computer device performs grayscale processing on the color image to obtain a grayscale image of the color image. Further, the computer device can obtain the variation amplitude of each pixel point in the grayscale image, and take the average variation amplitude of each pixel point as the image definition of the color image. The variation amplitude of any pixel point can be represented by a gradient value. In the embodiments of the present application, the gradient value can be specifically a gradient value calculated by the computer device based on the Sobel operator (a discrete difference operator). Of course, in other implementations, other operators can also be used for calculation, such as the Laplace operator, the Canny operator (a multi-level edge detection operator), the Krisch operator (a nonlinear edge detection operator), and the like. The manner in which the computer device obtains the image definition of the target image will be described in detail below with reference to specific examples. It should be noted that the manner in which the computer device obtains the image definition of the reference image is the same.

[0057] In a specific implementation, it is assumed that the target image is a color image I (hereinafter referred to as image I). In this case, the computer device can calculate the pixel value of each pixel point in the grayscale image (hereinafter referred to as image I_grey) of image I based on the manner shown in Equation 1, thereby performing grayscale processing on image I to obtain the grayscale image of image I.

[0058] I_grey(x, y) = 0.3 x I_R(x, y) + 0.59 x I_G(x, y) + 0.11 x I_B(x, y) Equation 1

[0059] wherein, I grey(x, y) represents a pixel point located at the xth row and yth column in the gray image of the image I, for the convenience of description, the pixel point at the xth row and yth column is referred to as pixel point (x, y) hereinafter; I R(x, y) represents a pixel value of the pixel point (x, y) in the R channel of the image I, I G(x, y) represents a pixel value of the pixel point (x, y) in the G channel of the image I, and I B(x, y) represents a pixel value of the pixel point (x, y) in the B channel of the image I.

[0060] Further, after the computer device obtains the gray image I grey of the target image, the computer device can perform image plane convolution on the gray image respectively by using a horizontal convolution factor and a vertical convolution factor in the Sobel operator, to obtain pixel change amplitudes of each pixel point in the gray image. For example, the computer device can perform convolution on the horizontal convolution factor and the gray image in the manner shown in formula 2, to obtain pixel change amplitudes of each pixel point in the gray image in the horizontal direction (i.e., the horizontal direction). In formula 2, the 3*3 matrix is the horizontal convolution factor in the Sobel operator; Gx is a convolution result of the horizontal convolution factor and the gray image I grey, which can include an approximate value of a luminance difference of each pixel point in the gray image in the horizontal direction, and can be regarded as a pixel change amplitude of the pixel point in the horizontal direction.

[0061]

[0062] In addition, the computer device can perform convolution on the vertical convolution factor and the gray image in the manner shown in formula 3, to obtain pixel change amplitudes of each pixel point in the gray image in the vertical direction (i.e., the vertical direction). In formula 3, the 3*3 matrix is the vertical convolution factor in the Sobel operator; Gy is a convolution result of the vertical convolution factor and the gray image I grey, which can include an approximate value of a luminance difference of each pixel point in the gray image in the vertical direction, and can be regarded as a pixel change amplitude of the pixel point in the vertical direction.

[0063]

[0064] Further, after the computer device determines Gx and Gy, for any pixel point (x, y) in the gray image, there is a pixel change amplitude in Gx and Gy, that is, there are pixel change amplitudes in two directions for any pixel point. In this case, the computer device can further calculate a final pixel change amplitude of the gray image in the manner shown in formula 4. In formula 4, G represents a gradient image of the gray image, and a pixel value of the pixel point (x, y) in the gradient image represents a final pixel change amplitude of the pixel point (x, y) in the image I.

[0065]

[0066] In the embodiments of the present application, the computer device can take the average pixel value of each pixel point in G as the image definition of the image I, and the definition of the image I can be denoted as C_I. Similarly, in the embodiments of the present application, the computer device can also determine the image definition of the reference image based on the above-mentioned formulas 1 to 4, and exemplarily, the reference image is denoted as image E, and the image definition of the reference image can be denoted as C_E.

[0067] S402, determining a first fusion coefficient according to the image definition of the target image and the definition threshold.

[0068] In specific embodiments, the first fusion coefficient is an image fusion coefficient determined by the computer device from the perspective of the image definition of the target image. Based on the description of step S202, the greater the image fusion coefficient, the more features of the reference image that the computer device needs to fuse when generating the enhanced image of the target image. Then, similarly, the greater the first fusion coefficient, which can represent that from the perspective of the image definition of the target image, the more features of the reference image that the computer device needs to fuse when generating the enhanced image, and the closer the image definition of the enhanced image to the image definition of the enhanced image. Based on this, the following describes in detail the way in which the computer device determines the first fusion coefficient:

[0069] In one embodiment, when the image definition of the target image is less than the definition threshold, the computer device can process the image definition of the target image by using a first fusion function to obtain the first fusion coefficient. In this case, the first fusion coefficient is positively correlated with the image definition of the target image. Exemplarily, the definition threshold can be 20, and the function expression of the first fusion function can be as shown in formula 5. In formula 5, F1 represents the first fusion coefficient, and C_I represents the image definition of the target image. Based on formula 5, it is not difficult to see that the first fusion function in the embodiments of the present application can be a monotonically increasing function, and the first fusion coefficient increases with the increase of the image definition of the target image. It needs to be particularly pointed out that in the embodiments of the present application, the expression of the first fusion function can change according to different preset image enhancement algorithms used by the computer device, because the image definition of the reference image obtained by different image enhancement algorithms is different, so when the target image is image enhanced based on the reference image and the image fusion coefficient, the image fusion coefficient also needs to be adjusted accordingly. Exemplarily, the first fusion function can also be a curve function (such as a quadratic function, a multivariate function, a piecewise function, etc.).

[0070] F1 = 0.035 x C_I Formula 5

[0071] In yet another embodiment, when the image definition of the target image is greater than or equal to the definition threshold, the computer device can directly take the preset fusion coefficient as the first fusion coefficient. In the actual application of the embodiments of the present application, by way of example, the preset fusion coefficient can be the same as the function maximum value of the first fusion function, i.e., the preset fusion coefficient can be 0.7. In addition, it should be noted that the preset fusion coefficient can be different according to different application scenarios of the embodiments of the present application, and therefore the preset fusion coefficient of 0.7 cannot be regarded as a limitation on the embodiments of the present application.

[0072] Based on the above two embodiments described in this step, it can be seen that in the embodiments of the present application, when the image definition of the target image is small (e.g., less than 20), the first fusion coefficient will change with the image definition of the target image. This can make the computer device generate an enhanced image that fuses less features of the reference image when the image definition of the target image is small, so that the image definition of the enhanced image is closer to the image definition of the target image. Then, in the case where the target image has special presentation effects (e.g., there are both out-of-focus pictures and in-focus pictures, or there are pictures with gradual changes in definition), this processing manner can make the enhanced image retain the original image features of the target image, thereby avoiding the problem of unnatural display of the enhanced image. Correspondingly, when the image definition of the target image is large (e.g., greater than 20), it can be said to some extent that there are no special presentation effects in the target image. Therefore, when the image definition of the reference image is higher than that of the target image, the more image features of the reference image that are fused in the enhanced image, the higher the image definition of the enhanced image will be, and the better the image quality will be. However, in actual applications, the image definition of the reference image can also be less than that of the target image, in which case if the computer device fuses too many image definitions of the reference image, the image definition of the enhanced image will be lower than that of the target image. Therefore, in the embodiments of the present application, in order to ensure the image quality of the enhanced image obtained by the computer device, it is necessary to limit the maximum value of the first fusion coefficient, such as the above-mentioned 0.7.

[0073] S403, determining a second fusion coefficient according to the definition difference between the image definition of the reference image and the image definition of the target image and the fusion coefficient threshold.

[0074] In specific embodiments, the second fusion coefficient is an image fusion coefficient determined by the computer device from the perspective of an enhancement degree of the preset enhancement algorithm. The enhancement degree can be measured by a definition difference between the definition of the reference image and the definition of the target image. The greater the enhancement degree, the greater the definition difference. Corresponding to the above explanation of the first fusion coefficient, the greater the second fusion coefficient, the more features of the reference image that the computer device needs to fuse when generating the enhanced image. Based on this, the following describes in detail the manner in which the computer device determines the second fusion coefficient: the computer device processes the definition difference using a second fusion function to obtain a candidate fusion coefficient. Then, the computer device can take the minimum value of the candidate fusion coefficient and a fusion coefficient threshold as the second fusion coefficient. Exemplarily, the fusion coefficient threshold can be 0.7.

[0075] In the process of determining the second fusion coefficient by the computer device, one feasible manner in which the computer device determines the candidate fusion coefficient can be as follows: the computer device takes the maximum value of the definition difference and a preset definition difference as a fusion parameter value. Further, the computer device processes the fusion parameter value using the second fusion function to obtain the candidate fusion coefficient. Exemplarily, the manner in which the computer device determines the fusion parameter value can refer to formula 6, and the manner in which the computer device determines the candidate fusion coefficient can refer to formula 7. In formula 6 and formula 7, M represents the fusion parameter value, max() represents a maximum value function, C_E represents the definition of the reference image, C_I represents the definition of the target image, and Fc represents the candidate fusion coefficient.

[0076] M = max(C_E - C_I, 0) Formula 6

[0077] Fc = 0.033 + 0.033 x M Formula 7

[0078] As can be seen from formula 6 and formula 7, in the embodiments of the present application, the candidate fusion coefficient Fc is positively correlated with the definition difference, and the second fusion coefficient is positively correlated with the candidate fusion coefficient within a certain range (for example, the range in which the value of the candidate fusion coefficient is less than the fusion coefficient threshold). Therefore, it can be understood that the second fusion coefficient can be positively correlated with the definition difference within a certain range, which indicates that in the embodiments of the present application, the computer device fuses more image features for the reference image with a better enhancement effect when generating the enhanced image, which can enable the definition of the enhanced image generated by the computer device to be improved to a greater extent. In addition, based on formula 6 and formula 7, it can be understood that the manner in which the computer device determines the second fusion coefficient in the embodiments of the present application can also refer directly to formula 8, in which F2 represents the second fusion coefficient.

[0079] F2 = min(0.033 + 0.033 x M, 0.7) Equation 8

[0080] Based on the above description about Equation 6, it can be seen that, in the embodiments of the present application, if there is a phenomenon of detail degradation in the process that the computer device adopts the preset image enhancement algorithm to perform image enhancement on the target image (i.e., the image sharpness of the reference image is less than the image sharpness of the target image), the computer device can directly determine the fusion parameter value as 0. At this time, the second fusion coefficient calculated by the computer device reaches the minimum value, indicating that the computer device needs to fuse the least features of the reference image when generating the enhanced image. This processing manner can make the computer device not only refer to the part of the optimized content in the reference image, but also avoid referring to too much part of the degraded content in the reference image. Therefore, it can be understood that, while ensuring that the computer device can utilize the optimized content in the reference image to obtain an enhanced image with optimized image sharpness, the computer device can effectively avoid the enhanced image generated by the computer device being greatly negatively affected by the reference image, thereby ensuring the image quality of the enhanced image of the target image to a certain extent.

[0081] S404, determining an image fusion coefficient according to the first fusion coefficient and the second fusion coefficient.

[0082] In specific embodiments, after obtaining the first fusion coefficient and the second fusion coefficient, the computer device can determine the finally adopted image fusion coefficient based on the first fusion coefficient and the second fusion coefficient. Since the first fusion coefficient is considered from the perspective of the image sharpness of the target image itself, and the second fusion coefficient is considered from the perspective of the enhancement effect of the preset image enhancement algorithm on the target image, therefore, the image fusion coefficient is determined by the computer device from multiple perspectives of image enhancement strategies. The enhanced image of the target image determined by the computer device using the image fusion coefficient can have a more reasonable image sharpness.

[0083] Wherein, the specific manner in which the computer device determines the image fusion coefficient can be as follows: the computer device obtains a target weight function associated with the sharpness interval to which the image sharpness of the target image belongs; then, the computer device can take the calculation result obtained by inputting the image sharpness of the target image into the target weight function as the weight of the first fusion coefficient; further, the computer device can obtain the weight of the second fusion coefficient, which can be exemplarily the difference between 1 and the weight of the first fusion coefficient. Then, on this basis, the computer device can perform weighted summation operation on the first fusion coefficient, the weight of the first fusion coefficient, the second fusion coefficient and the weight of the second fusion coefficient, and take the weighted summation operation result as the image fusion coefficient.

[0084] Exemplarily, the computer device can refer to formula 9 for determining the manner of the weight of the first fusion coefficient. The three expressions in formula 9 are target weight functions corresponding to the computer device when the image definition of the target image belongs to different definition intervals. Wherein, W represents the weight of the first fusion coefficient, and C_I represents the image definition of the target image. The computer device can refer to formula 10 for determining the manner of the image fusion coefficient. Wherein, k represents the image fusion coefficient, 1-W represents the weight of the second fusion coefficient, F1 represents the first fusion coefficient, and F2 represents the second fusion coefficient.

[0085]

[0086] k = WxF1 + (1-W)xF2 Formula 10

[0087] Based on the above formula 9 and formula 10, it can be seen that in the actual application process of the embodiment of the present application, the computer device exists the following three cases when determining the image fusion coefficient:

[0088] (1) The computer device only determines the image fusion coefficient according to the image definition of the target image. Specifically, the computer device can directly determine the first fusion coefficient as the image fusion coefficient. For example, when the image definition of the target image is small (for example, less than 14), the embodiment of the present application can only use the first fusion coefficient as the image fusion coefficient. Such a processing manner can make the computer device obtain a smaller image fusion coefficient when the image definition of the target image is small, thereby avoiding the problem that there is a large difference between the image definition of the enhanced image and the image definition of the target image, and also avoiding the problem that the computer device performs excessive enhancement processing on the target image, thereby causing the display effect of the enhanced image to be unnatural. The specific reason can be as follows: Since there is usually a large difference between the image definition of the reference image and the image definition of the target image, if the first fusion coefficient and the second fusion coefficient are used to determine the image fusion coefficient at the same time, it is easy to cause the computer device to determine a larger image fusion coefficient, thereby causing the computer device to generate an enhanced image with a larger definition difference between the image definition of the enhanced image and the image definition of the target image, and further causing the problem that the enhanced image is displayed unnaturally due to excessive enhancement. Therefore, the embodiment of the present application only considers the first fusion coefficient for image enhancement, which can enhance the image definition of the enhanced image while better avoiding the problem of unnatural display of the enhanced image.

[0089] (2) The computer device determines the image fusion coefficient according to the difference in sharpness between the image sharpness of the reference image and the image sharpness of the target image. Specifically, the computer device can directly use the determined second fusion coefficient as the image fusion coefficient. In the embodiments of the present application, when the image sharpness of the target image is large (for example, greater than 20), the computer device can only use the second fusion coefficient as the image fusion coefficient. At this time, the image fusion coefficient is positively correlated with the enhancement degree of the reference image. This can make the enhanced image fuse more image features of the reference image when the enhancement degree is strong, so that the enhanced image has higher image sharpness, and the enhanced image does not have the problem of unnatural display. The reason is as follows: under normal circumstances, the unnatural display of the enhanced image is due to the too large difference between the distribution of the edge lines in the enhanced image and the distribution of the edge lines in the target image. For example: there are many edge lines in the enhanced image that do not exist in the target image, or the target image is thickened for part of the edge lines (such as unclear edge lines) in the target image, resulting in that the lines in the enhanced image look harsh. When the image sharpness of the target image is large, it can be considered that the target image itself has clear image details (such as clear edge lines). In this case, when the preset image enhancement algorithm is used for image enhancement, it is more likely to enhance the sharpness of the existing edge lines, and it is not easy to have the problem of inaccurate recognition of edge lines by the computer device, so that the distribution of the edge lines in the reference image obtained by the computer device is consistent with the distribution of the edge lines in the target image to a large extent. Therefore, in this case, the computer device does not fuse a large amount of features of the reference image to generate the enhanced image, which does not cause the enhanced image to have the problem of unnatural display.

[0090] (3) The computer device determines the image fusion coefficient by comprehensively considering the image sharpness of the target image and the difference in sharpness between the image sharpness of the reference image and the image sharpness of the target image. Specifically, the computer device can determine the weights of the first image fusion coefficient and the second fusion coefficient, and then perform weighted summation based on the weights to obtain the image fusion coefficient. In the process of proposing the embodiments of the present application, relevant technical personnel found from experimental results that when the image sharpness of the target image is between 14 and 20, image enhancement processing of the target image according to only the first fusion coefficient or the second fusion coefficient cannot achieve good enhancement effect. Therefore, in the embodiments of the present application, when the image sharpness of the target image is between 14 and 20, the computer device can determine the image fusion coefficient by comprehensively considering the first fusion coefficient and the second fusion coefficient. This can make the computer device refer to the image sharpness of the target image and the enhancement degree of the reference image when performing image enhancement on the target image, so that the computer device can avoid the problem of unnatural display of the enhanced image from multiple angles, and to a certain extent, improve the image quality of the enhanced image.

[0091] S405, image enhancement processing is performed on the target image using the image fusion coefficient and the reference image to obtain an enhanced image of the target image.

[0092] In specific embodiments, when the computer device performs image enhancement processing on the image, the computer device can first perform fusion processing on the pixel values of each pixel point in the target image and the pixel values of the pixel points at the corresponding positions in the reference image to determine a plurality of new pixel values. Then, the computer device can construct an enhanced image based on each new pixel value. Specifically, the computer device can generate the enhanced image in the following manner: for any pixel point in the target image, the computer device obtains a first pixel value of the pixel point from the target image, and obtains a second pixel value of a target pixel point matching the pixel point in the reference image from the reference image. The target pixel point is a pixel point in the reference image whose position is the same as that of the corresponding pixel point in the target image. For example, for a pixel point located at the cth row and the dth column in the target image (hereinafter referred to as pixel point (c, d)), the target pixel point matching the pixel point (c, d) in the reference image is a pixel point located at the cth row and the dth column in the reference image. After the computer device obtains the first pixel value and the second pixel value, the computer device can obtain a target pixel value (i.e., a new pixel value) of the pixel point based on the first pixel value, the image fusion coefficient, and the second pixel value. Based on this manner, the computer device can obtain the target pixel value of each pixel point in the target image. In this case, the computer device can update the first pixel value of each pixel point in the target image to the target pixel value of each pixel point, thereby generating the enhanced image.

[0093] Specifically, the computer device can obtain the target pixel value of any pixel point in the following manner: the computer device takes the image fusion coefficient as the fusion weight of the second pixel value, and takes the difference between 1 and the fusion weight of the second pixel value as the fusion weight of the first pixel value. Further, the computer device performs weighted summation on the first pixel value, the fusion weight of the first pixel value, the second pixel value, and the fusion weight of the second pixel value to obtain the target pixel value. Based on this, the computer device can generate the enhanced image in an exemplary manner as shown in Equation 11. In Equation 11, Fusion represents the enhanced image, k represents the image fusion coefficient of the reference image, i.e., the fusion weight of the second pixel value corresponding to each pixel point in the reference image; E represents the reference image, which includes a plurality of target pixel points; (1-k) represents the fusion weight of the first pixel value corresponding to each pixel point in the target image; and I represents the target image, which includes a plurality of pixel points.

[0094] Fusion = k x E + (1-k) x I Equation 11

[0095] Based on the above description of the image enhancement method shown in Figure 4 It should be further pointed out that in the embodiments of the present application, the above-mentioned formulas 1 to 9 are exemplary descriptions. In actual applications, the expression for calculating the relevant data can be transformed according to the actual application scenario. Specifically, when the preset image enhancement algorithm adopted by the computer device is different, the expression of formulas 1 to 9 in the embodiments of the present application can be different from the above, and any expression can include one or more functions: linear function, quadratic function, multivariate function, piecewise function, inverse proportional function, and logarithmic function, etc. The relevant threshold values (such as the fusion coefficient threshold, the definition threshold) or the preset values (such as the preset definition difference) can also be changed accordingly. And exemplary, in the embodiments of the present application, any expression can be summarized by relevant technical personnel according to experimental data, or can be obtained by relevant technical personnel using machine learning, and the embodiments of the present application do not limit this.

[0096] In the embodiments of the present application, when the target image is subjected to image enhancement processing to obtain an enhanced image of the target image, the computer device generates the enhanced image of the target image by referring to the reference image and the image fusion coefficient of the reference image. Wherein, the larger the image fusion coefficient of the reference image, the more features of the reference image the enhanced image generated by the computer device needs to fuse, and the closer the image definition of the enhanced image to the image definition of the reference image. It can be seen that the image fusion coefficient plays an important role in generating the enhanced image in the embodiments of the present application, therefore, in order to ensure the rationality of the image fusion coefficient and thus the rationality of the image definition of the enhanced image, the image fusion coefficient of the reference image is determined comprehensively from the perspective of the image definition of the target image and the enhancement degree of the image definition of the reference image compared to the image definition of the target image in the embodiments of the present application. In this case, the image definition of the enhanced image generated by the computer device can be between the image definition of the target image and the image definition of the reference image, which can ensure that the image definition of the enhanced image is greater than the image definition of the target image, and at the same time, the difference between the image definition of the enhanced image and the image definition of the target image will not be too large, so that the image display effect of the enhanced image can be more natural.

[0097] Based on the above description of the image enhancement method, the embodiments of the present application also disclose an image enhancement device, which can run one of the computer programs (including program codes) mentioned above. In specific embodiments, the image enhancement device can be used to execute the image enhancement method shown in Figure 2 or Figure 4 Please refer to Figure 5The image enhancement device can include an acquisition unit 501, a determination unit 502, and an enhancement unit 503.

[0098] The acquisition unit 501 is configured to acquire a target image and an image definition of the target image, and acquire a reference image and an image definition of the reference image, the reference image being an image obtained by performing image enhancement processing on the target image by using a preset image enhancement algorithm.

[0099] The determination unit 502 is configured to determine an image fusion coefficient of the reference image according to the image definition of the target image and the image definition of the reference image.

[0100] The enhancement unit 503 is configured to perform image enhancement processing on the target image by using the image fusion coefficient and the reference image, to obtain an enhanced image of the target image, the image definition of the enhanced image being higher than the image definition of the target image.

[0101] In an embodiment, the determination unit 502 can be specifically configured to perform the following steps.

[0102] determine a first fusion coefficient according to the image definition of the target image and a definition threshold value;

[0103] determine a second fusion coefficient according to a definition difference between the image definition of the reference image and the image definition of the target image and a fusion coefficient threshold value;

[0104] determine the image fusion coefficient according to the first fusion coefficient and the second fusion coefficient.

[0105] In another embodiment, the determination unit 502 can be specifically configured to perform the following steps.

[0106] when the image definition of the target image is less than the definition threshold value, perform processing on the image definition of the target image by using a first fusion function to obtain the first fusion coefficient, the first fusion coefficient being positively correlated with the image definition of the target image;

[0107] when the image definition of the target image is greater than the definition threshold value, use a preset fusion coefficient as the first fusion coefficient.

[0108] In another embodiment, the determination unit 502 can be specifically configured to perform the following steps.

[0109] perform processing on the definition difference by using a second fusion function to obtain a candidate fusion coefficient, the candidate fusion coefficient being positively correlated with the definition difference;

[0110] The minimum value between the candidate fusion coefficient and the fusion coefficient threshold is taken as the second fusion coefficient.

[0111] In yet another implementation, the determining unit 502 can be specifically configured to perform:

[0112] The maximum value between the definition difference value and a preset definition difference value is taken as a fusion parameter value.

[0113] The fusion parameter value is processed by using the second fusion function to obtain the candidate fusion coefficient.

[0114] In yet another implementation, the determining unit 502 can be specifically configured to perform:

[0115] A target weight function associated with a definition interval to which the image definition of the target image belongs is obtained;

[0116] A calculation result obtained by inputting the image definition of the target image into the target weight function is taken as a weight of the first fusion coefficient;

[0117] A weight of the second fusion coefficient is obtained, and the weight of the second fusion coefficient is a difference between 1 and the weight of the first fusion coefficient;

[0118] The first fusion coefficient, the weight of the first fusion coefficient, the second fusion coefficient, and the weight of the second fusion coefficient are weighted and summed to obtain the image fusion coefficient.

[0119] In yet another implementation, the enhancing unit 503 can be specifically configured to perform:

[0120] For any pixel point in the target image, a first pixel value of the any pixel point is obtained, and a second pixel value of a target pixel point matched with the any pixel point in the reference image is obtained;

[0121] Based on the first pixel value, the image fusion coefficient, and the second pixel value, a target pixel value of the any pixel point is obtained;

[0122] The first pixel value of each pixel point in the target image is updated to the target pixel value of the each pixel point to generate the enhanced image.

[0123] In yet another implementation, the enhancing unit 503 can be specifically configured to perform:

[0124] The image fusion coefficient is taken as a fusion weight of the second pixel value, and a difference between 1 and the fusion weight of the second pixel value is taken as a fusion weight of the first pixel value;

[0125] The target pixel value is obtained by weighted summation of the first pixel value, the fusion weight of the first pixel value, the second pixel value, and the fusion weight of the second pixel value.

[0126] In another embodiment, the acquisition unit 501 may specifically be used to perform:

[0127] Perform grayscale processing on any of the images to obtain a grayscale image of any of the images;

[0128] Obtain the pixel change amplitude of each pixel in the grayscale image, and use the average pixel change amplitude of each pixel as the image sharpness of any image.

[0129] According to one embodiment of this application, Figure 2 as well as Figure 4 The steps involved in the method shown can be derived from... Figure 5 The image enhancement apparatus shown is executed by individual units. For example, Figure 2 The step S201 shown can be performed by Figure 5 Step S202 can be executed by the acquisition unit 501 in the image enhancement device shown in FIG. 5; step S203 can be executed by the determination unit 502 in the image enhancement device shown in FIG. 5. Figure 5 The enhancement unit 503 in the image enhancement apparatus shown performs this function. For example, Figure 4 Step S401 shown can be executed by the acquisition unit 501 in the image enhancement device shown in FIG5, and steps S402 to S404 can all be executed by... Figure 5 The determination unit 502 in the image enhancement device shown is responsible for executing step S405, which can be performed by... Figure 5 The enhancement unit 503 in the image enhancement device shown performs this function.

[0130] According to another embodiment of this application, Figure 5 The image enhancement device shown is divided into units based on logical functions. These units can be individually or entirely combined into one or more other units, or one or more of these units can be further subdivided into functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. In other embodiments of this application, the image enhancement device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and multiple units can assist in their implementation.

[0131] According to another embodiment of this application, a general-purpose computing device, such as a domain name management device, which includes processing elements and storage elements such as a central processing unit (CPU), random access storage medium (RAM), and read-only storage medium (ROM), can be used to run an application capable of performing tasks such as... Figure 2 and Figure 4 The computer program (including program code) involved in each step of the method shown is used to construct, for example... Figure 5 The image enhancement apparatus shown is illustrated, as well as the image enhancement method for implementing the embodiments of this application. A computer program may be recorded on, for example, a computer storage medium, loaded onto the aforementioned computing device via the computer storage medium, and run therein.

[0132] In this embodiment, the image enhancement device references the image sharpness of the target image when performing image enhancement processing, ensuring that the image sharpness of the enhanced image is not significantly different from that of the target image, thus making the enhanced image appear more natural when displayed. Furthermore, the generation of the enhanced image also references a reference image, which typically has a higher image sharpness than the target image. Therefore, this embodiment can effectively improve the image sharpness of the enhanced image generated by the image enhancement device. In summary, this embodiment can maintain the naturalness of the enhanced image when displayed while ensuring that the image sharpness of the enhanced image is higher than that of the target image.

[0133] Based on the descriptions of the above method and device embodiments, this application also provides a computer device. Please refer to [link to relevant documentation]. Figure 6 The computer device includes at least a processor 601 and a computer storage medium 602, and the processor 601 and the computer storage medium 602 can be connected via a bus or other means.

[0134] The computer storage medium 602 mentioned above is a memory device in the computer device, used for storing programs and data. It can be understood that the computer storage medium 602 herein can include an internal storage medium in the computer device, and of course can also include an extended storage medium supported by the computer device. The computer storage medium 602 provides a storage space that stores an operating system of the computer device. In addition, one or more computer programs suitable for being loaded and executed by the processor 601 are also stored in the storage space, and the computer programs can be one or more program codes. It should be noted that the computer storage medium herein can be a high-speed RAM memory, or a non-volatile memory such as at least one disk memory; optionally, it can also be at least one storage medium located away from the aforementioned processor. The processor 601 (or CPU (Central Processing Unit, Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing one or more computer programs, and is particularly suitable for loading and executing one or more computer programs to implement corresponding method processes or corresponding functions.

[0135] In one embodiment, one or more computer programs stored in the computer storage medium 602 can be loaded and executed by the processor 601 to implement the corresponding method steps in the method embodiment shown in the above Figure 2 and Figure 4 In a specific implementation, one or more computer programs in the computer storage medium 602 can be loaded and executed by the processor 601 to perform the following steps:

[0136] Obtain a target image and an image definition of the target image, and obtain a reference image and an image definition of the reference image, the reference image being an image obtained by performing image enhancement processing on the target image through a preset image enhancement algorithm;

[0137] According to the image definition of the target image and the image definition of the reference image, determine an image fusion coefficient of the reference image;

[0138] Perform image enhancement processing on the target image using the image fusion coefficient and the reference image to obtain an enhanced image of the target image, and the image definition of the enhanced image is higher than the image definition of the target image.

[0139] In an implementation, the processor 601 can be specifically used to load and execute:

[0140] According to the image definition of the target image and the definition threshold, determine a first fusion coefficient;

[0141] determine a second fusion coefficient according to a fusion coefficient threshold and a difference in sharpness between the sharpness of the reference image and the sharpness of the target image;

[0142] determine the image fusion coefficient according to the first fusion coefficient and the second fusion coefficient.

[0143] In yet another implementation, the processor 601 can be further specifically configured to load and execute:

[0144] when the sharpness of the target image is less than a sharpness threshold, process the sharpness of the target image using a first fusion function to obtain the first fusion coefficient, the first fusion coefficient being positively correlated with the sharpness of the target image;

[0145] when the sharpness of the target image is greater than the sharpness threshold, take a preset fusion coefficient as the first fusion coefficient.

[0146] In yet another implementation, the processor 601 can be further specifically configured to load and execute:

[0147] process the difference in sharpness using a second fusion function to obtain a candidate fusion coefficient, the candidate fusion coefficient being positively correlated with the difference in sharpness;

[0148] take the minimum of the candidate fusion coefficient and the fusion coefficient threshold as the second fusion coefficient.

[0149] In yet another implementation, the processor 601 can be further specifically configured to load and execute:

[0150] take the maximum of the difference in sharpness and a preset difference in sharpness as a fusion parameter value;

[0151] process the fusion parameter value using the second fusion function to obtain the candidate fusion coefficient.

[0152] In yet another implementation, the processor 601 can be further specifically configured to load and execute:

[0153] obtain a target weight function associated with a sharpness interval to which the sharpness of the target image belongs;

[0154] take a calculation result obtained by inputting the sharpness of the target image into the target weight function as a weight of the first fusion coefficient;

[0155] obtain a weight of the second fusion coefficient, the weight of the second fusion coefficient being a difference between 1 and the weight of the first fusion coefficient;

[0156] The first fusion coefficient, the weight of the first fusion coefficient, the second fusion coefficient and the weight of the second fusion coefficient are weighted and summed to obtain the image fusion coefficient.

[0157] In yet another implementation, the processor 601 can be further specifically configured to load and execute:

[0158] For any pixel point in the target image, a first pixel value of the any pixel point is obtained, and a second pixel value of a target pixel point matched with the any pixel point in the reference image is obtained;

[0159] Based on the first pixel value, the image fusion coefficient, the second pixel value, a target pixel value of the any pixel point is obtained;

[0160] The first pixel value of each pixel point in the target image is updated to the target pixel value of the each pixel point to generate the enhanced image.

[0161] In yet another implementation, the processor 601 can be further specifically configured to load and execute:

[0162] The image fusion coefficient is taken as a fusion weight of the second pixel value, and a difference between 1 and the fusion weight of the second pixel value is taken as a fusion weight of the first pixel value;

[0163] The first pixel value, the fusion weight of the first pixel value, the second pixel value and the fusion weight of the second pixel value are weighted and summed to obtain the target pixel value.

[0164] In yet another implementation, the processor 601 can be further specifically configured to load and execute:

[0165] The any image is subjected to a grayscale processing to obtain a grayscale image of the any image;

[0166] A pixel variation amplitude of each pixel point in the grayscale image is obtained, and an average pixel variation amplitude of each pixel point is taken as an image definition of the any image.

[0167] In the embodiments of the present application, when performing image enhancement processing on the target image, the computer device refers to the image definition of the target image itself, so that there is not too much difference between the image definition of the enhanced image and the image definition of the target image, thereby making the display effect of the enhanced image more natural when displayed. In addition, the generation of the enhanced image also refers to the reference image, and the image definition of the reference image is usually greater than the image definition of the target image. Therefore, the embodiments of the present application can also effectively improve the image definition of the enhanced image generated by the computer device. In summary, the embodiments of the present application can ensure that the image definition of the enhanced image of the target image is higher than the image definition of the target image, while maintaining the naturalness of the enhanced image when displayed.

[0168] The present application also provides a computer storage medium, which stores one or more computer programs corresponding to the image enhancement method described above. When one or more processors load and execute the one or more computer programs, the description of the image enhancement method in the embodiments can be implemented, which will not be described here. The description of the beneficial effects of using the same method will not be described here. It can be understood that the computer program can be executed on one or more devices that can communicate with each other.

[0169] It should be noted that according to one aspect of the present application, a computer program product or computer program is also provided, which includes a computer program stored in a computer storage medium. The processor in the computer device reads the computer program from the computer storage medium, and then executes the computer program, so that the computer device can perform the image enhancement method described above Figure 2 and Figure 4 the image enhancement method embodiments shown in the various optional ways.

[0170] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a computer storage medium. When the computer program is executed, it can include the processes of the above-mentioned image enhancement method embodiments. The computer storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0171] It can be understood that the above disclosure is only a partial embodiment of the present application, and of course cannot limit the scope of the rights of the present application. Those of ordinary skill in the art can understand that the above-mentioned embodiments can be implemented in whole or in part, and equivalent changes made in accordance with the claims of the present application still fall within the scope of the present application.

Claims

1. An image enhancement method, characterized in that, include: Acquire a target image and its image sharpness, and acquire a reference image and its image sharpness, wherein the reference image is an image obtained by performing image enhancement processing on the target image using a preset image enhancement algorithm; The first fusion coefficient is determined based on the image sharpness and sharpness threshold of the target image; The second fusion coefficient is determined based on the difference in image sharpness between the reference image and the target image and the fusion coefficient threshold. The image fusion coefficient of the reference image is determined based on the first fusion coefficient and the second fusion coefficient; The image fusion coefficients of the reference image, the reference image, the target image, and the target image are weighted and summed to obtain the enhanced image of the target image. The sum of the image fusion coefficients of the reference image and the target image is 1. The image sharpness of the enhanced image is higher than that of the target image.

2. The method according to claim 1, characterized in that, The step of determining the first fusion coefficient based on the image sharpness and sharpness threshold of the target image includes: When the image sharpness of the target image is less than the sharpness threshold, the image sharpness of the target image is processed by the first fusion function to obtain the first fusion coefficient, which is positively correlated with the image sharpness of the target image. When the image clarity of the target image is greater than the clarity threshold, the preset fusion coefficient is used as the first fusion coefficient.

3. The method according to claim 1, characterized in that, The step of determining the second fusion coefficient based on the sharpness difference between the reference image and the target image and a fusion coefficient threshold includes: The sharpness difference is processed using a second fusion function to obtain candidate fusion coefficients, which are positively correlated with the sharpness difference. The minimum value between the candidate fusion coefficient and the fusion coefficient threshold is taken as the second fusion coefficient.

4. The method according to claim 3, characterized in that, The process of using a second fusion function to process the sharpness difference to obtain candidate fusion coefficients includes: The maximum value between the aforementioned sharpness difference and the preset sharpness difference is used as the fusion parameter value; The second fusion function is used to process the fusion parameter values ​​to obtain the candidate fusion coefficients.

5. The method according to any one of claims 1-4, characterized in that, Determining the image fusion coefficient of the reference image based on the first fusion coefficient and the second fusion coefficient includes: Obtain the target weight function associated with the sharpness interval to which the image sharpness of the target image belongs; The image sharpness of the target image is input into the target weight function, and the calculated result is used as the weight of the first fusion coefficient. Obtain the weight of the second fusion coefficient, where the weight of the second fusion coefficient is the difference between 1 and the weight of the first fusion coefficient; The image fusion coefficient of the reference image is obtained by performing a weighted summation operation on the first fusion coefficient, the weight of the first fusion coefficient, the second fusion coefficient, and the weight of the second fusion coefficient.

6. The method according to claim 1, characterized in that, The step of weighted summing of the image fusion coefficients of the reference image, the reference image, the image fusion coefficients of the target image, and the target image to obtain the enhanced image of the target image includes: For any pixel in the target image, obtain the first pixel value of the pixel and obtain the second pixel value of the target pixel in the reference image that matches the pixel. Based on the first pixel value, the image fusion coefficient of the target image, the second pixel value, and the image fusion coefficient of the reference image, the target pixel value of any pixel is obtained; The first pixel value of each pixel in the target image is updated to the target pixel value of each pixel to generate the enhanced image.

7. The method according to claim 6, characterized in that, The step of obtaining the target pixel value of any pixel based on the first pixel value, the image fusion coefficient of the target image, the second pixel value, and the image fusion coefficient of the reference image includes: The image fusion coefficient of the reference image is used as the fusion weight of the second pixel value, and the difference between 1 and the fusion weight of the second pixel value is used as the fusion weight of the first pixel value; The target pixel value is obtained by weighted summation of the first pixel value, the fusion weight of the first pixel value, the second pixel value, and the fusion weight of the second pixel value.

8. The method according to claim 1, characterized in that, The target image and the reference image are color images; The methods for obtaining the image sharpness of any one of the target image and the reference image include: Perform grayscale processing on any of the images to obtain a grayscale image of any of the images; Obtain the pixel change amplitude of each pixel in the grayscale image, and use the average pixel change amplitude of each pixel as the image sharpness of any image.

9. An image enhancement device, characterized in that, include: An acquisition unit is used to acquire a target image and the image clarity of the target image, and to acquire a reference image and the image clarity of the reference image, wherein the reference image is an image obtained by performing image enhancement processing on the target image using a preset image enhancement algorithm; The determining unit is configured to determine a first fusion coefficient based on the image sharpness and sharpness threshold of the target image, determine a second fusion coefficient based on the sharpness difference between the image sharpness of the reference image and the image sharpness of the target image and the fusion coefficient threshold, and determine the image fusion coefficient of the reference image based on the first fusion coefficient and the second fusion coefficient. An enhancement unit is used to perform a weighted summation of the image fusion coefficients of the reference image, the reference image, the image fusion coefficients of the target image, and the target image to obtain an enhanced image of the target image. The sum of the image fusion coefficients of the reference image and the image fusion coefficients of the target image is 1, and the image sharpness of the enhanced image is higher than that of the target image.

10. A computer device, characterized in that, include: A processor for implementing one or more computer programs; A computer storage medium storing one or more computer programs adapted to be loaded by the processor and executed as described in any one of claims 1-8.

11. A computer storage medium, characterized in that, The computer storage medium stores one or more computer programs, which are adapted to be loaded by a processor and executed as described in any one of claims 1-8.

12. A computer product, characterized in that, The computer product includes a computer program adapted to be loaded by a processor and executed as described in any one of claims 1-8.

Citation Information

Patent Citations

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

    CN111340722A