Image processing method and device, terminal and storage medium

By determining the highlight area and diffraction area in the image processing method and reducing the brightness of the diffraction area, the image quality loss problem caused by the lens module being located below the display screen in the existing full-screen design is solved, and higher photo quality and lower power consumption are achieved.

CN114066785BActive Publication Date: 2025-05-23BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010761645.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-31
Publication Date
2025-05-23
Estimated Expiration
2040-07-31

AI Technical Summary

Technical Problem

In the existing full-screen design, the lens module is located below the display screen, resulting in a loss of image quality during photography due to the reduction in light transmittance, scattering and diffraction distribution of metal circuits.

Method used

In the image processing method, the highlight region and the diffraction region are determined, the brightness of the diffraction region is reduced, and the second image is obtained, thereby reducing the influence of overlapping images caused by diffraction.

Benefits of technology

It effectively reduces overlapping images generated by diffraction, improves the image quality of taking pictures, and does not need to adjust the exposure value to capture multiple frames of images, reducing the power consumption of the mobile terminal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114066785B_ABST
    Figure CN114066785B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image processing method and device, a terminal and a storage medium. The method comprises: determining a highlight area according to the brightness of pixels in a first image; wherein the brightness of pixels contained in the highlight area is greater than the brightness of pixels surrounding the highlight area; determining a diffraction area in the first image according to the highlight area; the diffraction area is: an image area distributed around the highlight area; reducing the brightness of the diffraction area to obtain a second image. Through this method, after reducing the brightness of the diffraction area, the overlapping images generated by diffraction are reduced, making the image more realistic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of electronic equipment, and in particular to an image processing method and device, a terminal and a storage medium. Background Art

[0002] With the continuous development of terminal technology, it brings more and more convenience to people's daily life, and users' requirements for the aesthetics of terminal equipment are gradually increasing. Among them, full screen has become the development trend of mobile terminals.

[0003] Currently, full-screen displays are all realized by lifting methods, such as module lifting, sliding cover, side rotation and other lifting mechanisms, as well as other design methods such as water drop screen and hole-punch screen.

[0004] In the above-mentioned full-screen design, the lens module used for taking pictures is located below the display screen. Since there are metal circuits on the display screen, these areas will reduce the light transmittance, and some light-transmitting areas of the circuit part have scattering and diffraction, so when taking pictures with the lens module located under the display screen, there is a problem of image quality loss. Summary of the invention

[0005] The present disclosure provides an image processing method and device, a terminal and a storage medium.

[0006] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, including:

[0007] Determine a highlight area according to the brightness of pixels in the first image; wherein the brightness of pixels included in the highlight area is greater than the brightness of surrounding pixels of the highlight area;

[0008] Determine a diffraction area in the first image according to the highlight area; the diffraction area is: an image area distributed around the highlight area;

[0009] The brightness of the diffraction area is reduced to obtain a second image.

[0010] Optionally, determining the diffraction area in the first image according to the highlighted area includes:

[0011] determining a light field distribution of brightness of pixels in the first image;

[0012] determining, according to the light field distribution, whether there is an image area satisfying the diffraction phenomenon in a brightness decreasing direction of the highlight area in the first image;

[0013] If there is an image area that satisfies the diffraction phenomenon, the image area is determined to be the diffraction area.

[0014] Optionally, determining, according to the light field distribution, whether there is an image area satisfying the diffraction phenomenon in a brightness decreasing direction of the highlight area in the first image includes:

[0015] Determine whether there is a high-order position according to the light field distribution and the brightness characteristics of the diffraction phenomenon; wherein the high-order position is: in the area of ​​the first image other than the highlighted area, when the difference between the pixel brightness of the first partial area and the pixel brightness of the second partial area is greater than a first threshold, the pixel brightness of the first partial area is greater than the pixel brightness of the second partial area;

[0016] If the high-order position exists, it is determined that the image area that satisfies the diffraction phenomenon exists.

[0017] Optionally, if the high-order position exists, determining that there is the image area satisfying the diffraction phenomenon includes:

[0018] Determine whether the similarity between the shape formed by the pixels at the high-order position and the shape of the highlight area is greater than a first similarity threshold;

[0019] If it is greater than the first similarity threshold, it is determined that the image area that satisfies the diffraction phenomenon exists.

[0020] Optionally, the first image includes K orders of high-order positions; wherein, K is greater than or equal to 2, and the pixel brightness of the high-order position of the Kth order is equal to the pixel brightness of the high-order position of the K-1th order or is negatively correlated with the K value.

[0021] Optionally, the method further includes:

[0022] Determining whether there is a dispersion phenomenon in the diffraction area according to the degree of color difference between pixels in the diffraction area and pixels outside the diffraction area;

[0023] The step of reducing the brightness of the diffraction region to obtain a second image comprises:

[0024] If the diffraction region has a dispersion phenomenon, the brightness and color saturation of the diffraction region are reduced to obtain the second image.

[0025] Optionally, determining whether there is a dispersion phenomenon in the diffraction area according to a color difference between pixels in the diffraction area and pixels outside the diffraction area includes:

[0026] Acquire a color difference value between the pixel color within the diffraction area and the pixel color outside the diffraction area;

[0027] If the color difference value is greater than a preset color threshold, it is determined that the dispersion phenomenon exists in the diffraction area.

[0028] Optionally, reducing the brightness of the diffraction area to obtain a second image includes:

[0029] According to the brightness value of each pixel point in the diffraction area, determining the brightness value to be adjusted in a positive correlation with the brightness value;

[0030] The brightness value to be adjusted corresponding to each pixel point is subtracted from the brightness value of each pixel point in the diffraction area to obtain the second image with Gaussian brightness distribution.

[0031] Optionally, reducing the brightness of the diffraction area to obtain a second image includes:

[0032] The brightness of the diffraction area is reduced according to an inverse Gamma function to obtain the second image with adjusted brightness.

[0033] Optionally, determining the highlight area according to the brightness of pixels in the first image includes:

[0034] Clustering is performed according to the brightness value of each pixel in the first image to divide different areas; the brightness difference between the pixels in any of the areas is within a preset difference range;

[0035] The area with the largest average brightness value among the divided areas is obtained as the highlight area.

[0036] Optionally, reducing the brightness of the diffraction area to obtain a second image includes:

[0037] The first image including the diffraction area is input into a preset image quality compensation model to obtain the second image after brightness adjustment; wherein the preset image quality compensation model is obtained by training using a neural network.

[0038] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, including:

[0039] A first determination module is configured to determine a highlight area according to the brightness of pixels in the first image; wherein the brightness of pixels included in the highlight area is greater than the brightness of surrounding pixels of the highlight area;

[0040] A second determination module is configured to determine a diffraction area in the first image according to the highlight area; the diffraction area is: an image area distributed around the highlight area;

[0041] The adjustment module is configured to reduce the brightness of the diffraction area to obtain a second image.

[0042] Optionally, the second determination module is specifically configured to determine the light field distribution of the brightness of pixels in the first image; determine, based on the light field distribution, whether there is an image area that satisfies the diffraction phenomenon in the brightness decreasing direction of the highlight area in the first image; if there is an image area that satisfies the diffraction phenomenon, determine that the image area is the diffraction area.

[0043] Optionally, the second determination module is specifically configured to determine whether there is a high-order position based on the light field distribution and the brightness characteristics of the diffraction phenomenon; wherein the high-order position is: in the area of ​​the first image other than the highlighted area, when the difference between the pixel brightness of the first partial area and the pixel brightness of the second partial area is greater than a first threshold, the position of the pixel of the first partial area is located; the pixel brightness of the first partial area is greater than the pixel brightness of the second partial area.

[0044] Optionally, the second determination module is specifically configured to determine whether the similarity between the shape formed by the pixels at the high-order position and the shape of the highlight area is greater than a first similarity threshold; if it is greater than the first similarity threshold, it is determined that there is the image area that satisfies the diffraction phenomenon. Optionally, the device further includes:

[0045] Optionally, the first image includes K orders of high-order positions; wherein, K is greater than or equal to 2, and the pixel brightness of the Kth order high-order positions is equal to the pixel brightness of the K-1th order high-order positions or is negatively correlated with the K value.

[0046] a third determination module, specifically configured to determine whether there is a dispersion phenomenon in the diffraction area according to the color difference between the pixels in the diffraction area and the pixels outside the diffraction area; if there is a dispersion phenomenon in the diffraction area, reduce the color saturation of the diffraction area;

[0047] The adjustment module is specifically configured to reduce the brightness and color saturation of the diffraction area if there is dispersion in the diffraction area to obtain the second image.

[0048] Optionally, the third determination module is specifically configured to obtain a color difference value between the pixel color within the diffraction area and the pixel color outside the diffraction area; if the color difference value is greater than a preset color threshold, it is determined that the dispersion phenomenon exists in the diffraction area.

[0049] Optionally, the adjustment module is specifically configured to determine the brightness value to be adjusted according to the brightness value of each pixel point in the diffraction area, in a positive correlation with the brightness value; subtract the brightness value to be adjusted corresponding to each pixel point from the brightness value of each pixel point in the diffraction area, to obtain the second image with Gaussian distribution of brightness values.

[0050] Optionally, the adjustment module is specifically configured to reduce the brightness of the diffraction area according to an inverse Gamma function to obtain the second image with adjusted brightness.

[0051] Optionally, the adjustment module is specifically configured to input the first image containing the diffraction area into a preset image quality compensation model to obtain the second image with brightness adjusted; wherein the preset image quality compensation model is obtained by training using a neural network.

[0052] Optionally, the first determination module is specifically configured to perform clustering according to the brightness value of each pixel in the first image to divide different areas; the brightness difference between the pixels in any of the areas is within a preset difference range; and the area with the largest average brightness value among the divided areas is the highlighted area.

[0053] According to a third aspect of an embodiment of the present disclosure, there is provided a terminal, comprising the image processing device in the second aspect. According to a fourth aspect of an embodiment of the present disclosure, there is provided a storage medium, comprising:

[0054] When the instructions in the storage medium are executed by a processor of a computer, the computer is enabled to execute the image processing method as described in the first aspect above.

[0055] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0056] The present disclosure first determines the highlight area in the first image, then determines the diffraction area based on the highlight area, and reduces the brightness of the diffraction area to obtain the second image. Compared with the method of synthesizing based on multiple sets of exposure value images to reduce the diffraction phenomenon, on the one hand, the method of reducing the brightness based on a single frame image to reduce the overlapping image caused by diffraction is more stable in reducing the overlapping image formed by diffraction because it only uses a single frame image for processing and is not affected by other images obtained under different exposures; on the other hand, it is not necessary to adjust the exposure value to shoot multiple frames of images, thereby reducing the power consumption of the mobile terminal for frequent photography; furthermore, it can avoid the adverse effects such as ghosting when synthesizing based on multiple sets of exposure value images.

[0057] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0059] Figure 1It is a flow chart of an image processing method shown in an embodiment of the present disclosure.

[0060] Figure 2a An example of an image in the embodiment of the present disclosure Figure 1 .

[0061] Figure 2b FIG2 is an example of an image in an embodiment of the present disclosure.

[0062] Figure 3 An example of a diffraction image in an embodiment of the present disclosure Figure 3 .

[0063] Figure 4 An example of a diffraction image in an embodiment of the present disclosure Figure 4

[0064] Figure 5a FIG5 is an example of a diffraction image in an embodiment of the present disclosure.

[0065] Figure 5b It is a schematic diagram of reducing the brightness of the diffraction area in an embodiment of the present disclosure.

[0066] Figure 6 This is an example diagram of an exposure image in an embodiment of the present disclosure.

[0067] Figure 7 It is the light intensity distribution curve corresponding to the diffraction phenomenon.

[0068] Figure 8a It is a schematic diagram of a dispersion phenomenon in a diffraction region in an embodiment of the present disclosure.

[0069] Figure 8b It is a schematic diagram of reducing the color saturation of the edge portion of the diffraction area in an embodiment of the present disclosure.

[0070] Fig. 9 It is a curve diagram of the inverse Gamma function.

[0071] Fig.10 The figure shows an image processing device according to an exemplary embodiment.

[0072] Fig.11 It is a block diagram of a terminal shown in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0073] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0074] Figure 1 is a flow chart of an image processing method shown in an embodiment of the present disclosure, such as Figure 1 As shown, the image processing method comprises the following steps:

[0075] S11, determining a highlight area according to the brightness of pixels in the first image; wherein the brightness of pixels included in the highlight area is greater than the brightness of surrounding pixels of the highlight area;

[0076] S12, determining a diffraction area in the first image according to the highlight area; the diffraction area is: an image area distributed around the highlight area;

[0077] S13, reducing the brightness of the diffraction area to obtain a second image.

[0078] The image processing method disclosed in the present invention can be applied to a mobile terminal or a server. When applied to a server, the mobile terminal can send a captured first image to the server, and the server processes the first image using steps S11-S13 to obtain a second image, and then sends the second image to the mobile terminal for display by the mobile terminal.

[0079] Taking the application of the image processing method to a mobile terminal as an example, the mobile terminal includes: a mobile phone, a tablet computer, a camera or a smart wearable device, etc. The mobile terminal includes an image acquisition module, such as a front camera or a rear camera in a mobile phone, which can perform image acquisition.

[0080] Figure 2a An example of an image in the embodiment of the present disclosure Figure 1 , Figure 2b FIG2 is an example of an image in an embodiment of the present disclosure. Figure 2a The image shown is obtained without the influence of obstructions such as display screen or glass. Figure 2b This is an image obtained without the influence of obstructions such as display screens or glass. Figure 2a and Figure 2b It can be seen that Figure 2a The clarity and contrast of the images shown are better than Figure 2b .

[0081] The above phenomenon of image quality degradation is most obvious when photographing objects with relatively high brightness, such as lighting sources or sunlight.

[0082] Figure 3 An example of a diffraction image in an embodiment of the present disclosure Figure 3 , Figure 4 An example of a diffraction image in an embodiment of the present disclosure Figure 4 .like Figure 3 and Figure 4 As shown, due to the influence of the display screen, when imaging the illumination light source, overlapping images caused by diffraction appear near the light source, making the image unreal.

[0083] In this regard, the present invention detects areas with greater brightness (highlight areas) in the image, and finds overlapping areas caused by image diffraction near the highlight areas for compensation, so as to remove overlapping images caused by diffraction and obtain a more realistic image.

[0084] In an embodiment of the present disclosure, a highlight area is determined based on the brightness of pixels in the first image, and the brightness of the pixels included in the highlight area is greater than the brightness of the surrounding pixels of the highlight area, wherein the brightness of the pixels included in the highlight area is greater than the brightness of the surrounding pixels of the highlight area can be that the difference between the brightness of the highlight area and the brightness of the surrounding pixels of the highlight area is greater than a predetermined difference, or the average brightness of the highlight area can be higher than the average brightness of the surrounding pixels of the highlight area.

[0085] In one embodiment, in step S11, the highlight area may be a continuous area with the highest brightness in the image, and the brightness of the pixels included in the highlight area is higher than the brightness of the surrounding pixels of the highlight area.

[0086] In another embodiment, in step S11, the highlight region may be one or more regions with higher brightness among multiple regions where the brightness of image pixels in the image changes suddenly. For example, if multiple discretely distributed lights are on in the captured space during image acquisition, multiple highlight regions corresponding to the lights will be formed in the image.

[0087] In one method, based on the fact that when taking photos of highlight objects such as light sources, the values ​​of each pixel after imaging the highlight object tend to the saturation value of the acquisition bit width, a threshold close to the saturation value can be preset to determine the highlight area. For example, when the acquisition bit width of the image is 8 bits, the pixel value range is 0 to 255, where 255 is the saturation value. At this time, the threshold can be set to 230, and pixels exceeding the threshold 230 are determined as pixels belonging to the highlight area.

[0088] In another embodiment, determining the highlight area according to the brightness of pixels in the first image includes:

[0089] Clustering is performed according to the brightness value of each pixel in the first image to divide different areas; the brightness difference between the pixels in any of the areas is within a preset difference range;

[0090] The area with the largest average brightness value among the divided areas is obtained as the highlight area.

[0091] In this embodiment, the image processing device clusters the brightness values ​​of each pixel in the first image, and clusters the pixels with similar brightness (i.e., the brightness difference is within a preset difference range) into one category, thereby dividing different areas. For the divided different brightness areas, the average brightness value of the area can be counted, and the area with the largest average brightness value is used as the highlight area.

[0092] It is understandable that, because the brightness difference in the region is within the preset range, when the region with the largest average brightness value is taken as the highlight region, the brightness of the pixels contained in the highlight region is greater than the brightness of the surrounding pixels of the highlight region. Compared with the threshold-based method to determine the highlight region, the clustering method is more universal.

[0093] In step S12, the image processing device determines the diffraction area distributed around the highlight area in the first image according to the highlight area. Diffraction is a physical phenomenon in which light deviates from the original straight line propagation when encountering obstacles during propagation, and forms a light intensity distribution. The diffraction area formed by diffraction includes sub-areas with alternating light and dark (i.e., uneven brightness), and there may be sub-areas with a shape similar to the highlight area.

[0094] by Figure 3 For example, the areas marked by L1 are all highlight areas, the highlight areas are ring-shaped, and there are diffraction areas with uneven brightness near the highlight areas, and the diffraction areas include sub-areas with a ring-like shape.

[0095] by Figure 4 For example, L2 is marked as a highlight area, and there are diffraction areas with uneven brightness on both sides of the highlight area, and the diffraction area includes sub-areas with a rectangular shape.

[0096] It should be noted that, since the diffraction phenomenon is more obvious when photographing an object with a relatively high brightness, such as an illumination source or the sun, the brightness of the diffraction area in the first image obtained by photographing may be greater than the brightness of the background area, wherein the background area refers to the area other than the diffraction area and the highlight area in the first image. In this regard, the present disclosure reduces the brightness of the diffraction area in step S13 to obtain the second image. It can be understood that by reducing the brightness of the diffraction area, that is, reducing the influence of the overlapping images generated by diffraction, a more realistic image can be obtained.

[0097] When reducing the brightness of the diffraction area, the adjustment value of the brightness of the diffraction area can be determined according to the brightness of the background area, so that the brightness of the diffraction area tends to be consistent with the background; the brightness of the diffraction area can also be reduced in the form of a fitting function, which is not limited in this embodiment of the present disclosure.

[0098] Figure 5a is an example diagram of a diffraction image in an embodiment of the present disclosure, Figure 5b FIG. 1 is a schematic diagram of reducing the brightness of the diffraction region in an embodiment of the present disclosure. Figure 5a As shown in FIG. 1 , the longitudinal area indicated by B is the part including the highlight area and the diffraction area. It can be seen from the figure that the brightness of the diffraction area around the highlight area is greater than that of the background area. Figure 5b As shown, after reducing the brightness of the diffraction area, the overlapping images caused by diffraction are reduced, making the image more realistic.

[0099] In one approach, to reduce artifacts caused by diffraction, a high-dynamic range (HDR) image may be used to synthesize an image obtained under normal exposure with one or more sets of images obtained when the exposure is reduced to reduce overlapping images caused by diffraction.

[0100] Figure 6 is an example diagram of an exposure image in an embodiment of the present disclosure, Figure 6 The image on the left is obtained with normal exposure, and the image on the right is obtained with an exposure value lower than normal exposure. Figure 6 As shown, there are overlapping images caused by diffraction in the normally exposed image, while the overlapping images caused by diffraction in the image corresponding to the low exposure value on the right are less obvious. Therefore, by synthesizing these two images, the overlapping image phenomenon caused by diffraction can be reduced, making the synthesized image more realistic.

[0101] However, in the above-mentioned method of utilizing HDR, since the exposure value is difficult to control, if the exposure value is adjusted too low, it will affect the synthesis of the originally bright area; and if the exposure value is not adjusted enough, it is possible that overlapping images caused by diffraction will still exist in the image obtained at low exposure, so there is a problem of not being able to eliminate the overlapping images caused by diffraction during synthesis.

[0102] With respect to the above-mentioned method, it can be understood that the present invention first determines the highlight area in the first image, then determines the diffraction area based on the highlight area, and reduces the brightness of the diffraction area to obtain the second image with adjusted brightness. On the one hand, there is no need to adjust the exposure value to shoot multiple frames of images, thereby reducing the power consumption of the mobile terminal when taking pictures frequently; on the other hand, based on a single frame image, the brightness is reduced to reduce the overlapping images caused by diffraction. Since it is not affected by other images obtained under different exposures, the effect of reducing the overlapping images caused by diffraction will be better.

[0103] In one embodiment, step S12 includes:

[0104] determining a light field distribution of brightness of pixels in the first image;

[0105] determining, according to the light field distribution, whether there is an image area satisfying the diffraction phenomenon in a brightness decreasing direction of the highlight area in the first image;

[0106] If there is an image area that satisfies the diffraction phenomenon, the image area is determined to be the diffraction area.

[0107] As mentioned above, diffraction is a light intensity distribution phenomenon caused by light encountering an obstacle during propagation and deviating from the original propagation path. Figure 7 is the light intensity distribution curve corresponding to the diffraction phenomenon, such as Figure 7 As shown, the horizontal axis represents the range of the light source extending outward, and the vertical axis represents the ratio of the light intensity in the corresponding extended range to the light intensity at the light source.

[0108] from Figure 7 It can be seen that the light intensity is the largest at the light source, and the light intensity is normally distributed in the local range away from the light source with the light source as the center. At the boundary of the normal distribution, the light intensity begins to gradually increase in the direction away from the light source. After increasing to the maximum value, the light intensity begins to decrease again, presenting a new phenomenon similar to the normal distribution, that is, Figure 7 K1 shown. Figure 7 It can be seen that the normal distribution phenomenon appears repeatedly, but the farther away from the light source, the smaller the peak value of the normal distribution. There is also a normal distribution K2 in the light intensity distribution curve. Of course, there may be other normal distribution phenomena with gradually decreasing peak values. Figure 7 The variation trend of the above light intensity distribution is the phenomenon that there are light and dark sub-regions in the diffraction region.

[0109] Figure 7 The light intensity distribution curve shown is a curve corresponding to the point spread function (PSF). Since the brightness of an image is a reflection of the light intensity, the brightness of each pixel in the first image can be fitted with the PSF model to determine the light field distribution of the brightness of the pixel in the first image. It can be understood that if diffraction exists, the light field distribution of the brightness of each pixel in the first image is similar to Figure 7 Light intensity distribution curve in .

[0110] In this embodiment, based on the light field distribution of each pixel in the first image, it is determined whether there is an image area that satisfies the diffraction phenomenon in the brightness decreasing direction of the highlight area in the first image. It should be noted that the diffraction phenomenon can be obtained by fitting the light intensity distribution in the diffraction according to the diffraction experiment. Figure 7 An image pattern is determined by the phenomenon of recurring normal distribution (such as parts K1 and K2) in the light intensity distribution curve. In this image pattern, there are light and dark alternating areas, that is, there are light and dark alternating sub-areas in the diffraction area.

[0111] Therefore, in the embodiment of the present disclosure, if the diffraction phenomenon exists, there will be a light and dark pattern on the first image. At this time, the image area including the light and dark pattern is determined to be the diffraction area.

[0112] In one embodiment, determining, according to the light field distribution, whether there is an image area satisfying the diffraction phenomenon in a brightness decreasing direction of the highlight area in the first image includes:

[0113] Determine whether a high-order position exists according to the light field distribution and the brightness characteristics of the diffraction phenomenon; wherein the high-order position is: in the area of ​​the first image other than the highlighted area, when the difference between the pixel brightness of the first partial area and the pixel brightness of the second partial area is greater than a first threshold, the pixel brightness of the first partial area is greater than the pixel brightness of the second partial area;

[0114] If the high-order position exists, it is determined that the image area that satisfies the diffraction phenomenon exists.

[0115] In the embodiments of the present disclosure, the brightness characteristics of the diffraction phenomenon can be determined according to experiments. For example, according to the diffraction experiment, Figure 7 In the light intensity distribution curve shown, the normal distribution identified by K1 is the first-order position; the normal distribution identified by K2 is the second-order position, and the light intensity value corresponding to the second-order position is less than the light intensity value corresponding to the first-order position. It should be noted that the first-order position and the second-order position are both positions where the brightness of the partial area caused by diffraction is increased relative to the actual brightness, the pixel brightness of the first-order position is higher than the pixel brightness of the partial area surrounding the first-order position, and the pixel brightness of the second-order position is also higher than the pixel brightness of the partial area surrounding the second-order position. In the embodiment of the present disclosure, the first-order position and the second-order position are both high-order positions. There are high-order positions, and the brightness of the pixels at the high-order positions may have a certain proportional relationship with the brightness at the light source, the pixel brightness of the high-order position is higher than the pixel brightness of the partial area surrounding, and as the order increases, the pixel brightness of the high-order position decreases. The above characteristics are all brightness characteristics of the diffraction phenomenon.

[0116] It should be noted that in the present disclosure, the high-order position is not limited to the first-order position and the second-order position. For example, when the brightness of the light source is strong enough, it may also include higher-order positions of more orders such as the third-order position and the fourth-order position, wherein the brightness at the third-order position is lower than the brightness at the second-order position, and the brightness at the fourth-order position is lower than the brightness at the third-order position. It should be noted that when the diffraction phenomenon occurs, there is at least a first-order position.

[0117] Based on the brightness characteristics of the diffraction phenomenon, the present disclosure can determine whether there is a high-order position according to the light field distribution of the first image and the brightness characteristics of the diffraction phenomenon. Specifically, according to the light field distribution of the brightness of each pixel in the first image, determine whether there is a similar Figure 7 The high-order position included in the light intensity distribution curve in the first image. The high-order position is: in the area other than the highlight area of ​​the first image, when the difference between the pixel brightness of the first partial area and the pixel brightness of the second partial area is greater than the first threshold, the pixel brightness of the first partial area is greater than the pixel brightness of the second partial area.

[0118] In this embodiment, the area outside the highlight area includes a first partial area and a second partial area. When the difference in pixel brightness between the first partial area and the second partial area is greater than a first threshold, the position of the pixel in the first area with greater pixel brightness is determined as a high-order position. The first partial area and the second partial area are adjacent areas.

[0119] It should be noted that in the embodiments of the present disclosure, a clustering algorithm can be used to perform brightness clustering on the brightness of each pixel in the area outside the highlight area, determine partial areas of different brightness, and compare whether the brightness difference between adjacent partial areas is greater than a first threshold to determine the high-order position.

[0120] In one embodiment, the first image includes a high-order position, for example, the image processing device determines whether there is a similar Figure 7 The first-order position marked by K1.

[0121] In another embodiment, the first image includes K orders of the high-order positions, wherein K is greater than or equal to 2, and the pixel brightness of the K-th order high-order position is equal to the pixel brightness of the K-1-th order high-order position or is negatively correlated with the K value. For example, when there are 2 orders of high-order positions, the image processing device determines whether there are first-order positions identified by K1 and second-order positions identified by K2 in the light field distribution; wherein the pixel brightness of the first-order position is greater than the pixel brightness of the second-order position. For another example, when there are 3 high-order positions, the image processing device also determines whether there are any positions that are not in the image processing device. Figure 7The third-order position identified in , where the pixel brightness at the third-order position is less than the pixel brightness at the second-order position.

[0122] In addition, it should be noted that, in the embodiments of the present disclosure, when determining high-order positions of different orders, the first threshold may be variable, for example, the first threshold may be negatively correlated with the K value.

[0123] In one embodiment, if the high-order position exists, determining that the image area that satisfies the diffraction phenomenon exists includes:

[0124] Determine whether the similarity between the shape formed by the pixels at the high-order position and the shape of the highlight area is greater than a first similarity threshold;

[0125] If it is greater than the first similarity threshold, it is determined that the image area that satisfies the diffraction phenomenon exists.

[0126] When diffraction occurs, there may be a sub-region in the diffraction region that is similar in shape to the highlight region. The sub-region is the region composed of pixels at the first-order position or the second-order position in the corresponding high-order position. Therefore, in this embodiment, it is necessary to further determine whether the similarity between the shape composed of pixels at the high-order position and the shape of the highlight region is greater than a first similarity threshold. If it is greater than the first similarity threshold, it is determined that there is an image region that satisfies the diffraction phenomenon.

[0127] It should be noted that when the high-order position includes the first-order position, it is determined whether the similarity between the shape composed of the pixels of the first-order position and the shape of the highlight area is greater than the first similarity threshold; when the high-order position includes the first-order position and the second-order position, it is necessary to determine whether the similarity between the shape composed of the pixels of the first-order position and the second-order position and the shape of the highlight area is greater than the first similarity threshold.

[0128] by Figure 4 For example, Figure 4 A1 is the first-order position. The brightness of the pixels in A1 is second only to the brightness of the pixels in the highlight area L2. The shape of A1 is similar to a long strip. Figure 4 A2 is the second-order position, the brightness of the pixels in A2 is less than that in A1, and the shape of A2 is also similar to a long strip.

[0129] It should be noted that when determining the shape composed of pixels of the highlight area, the first-order position and the second-order position in the first image, the edge detection operator can be used to determine the contour, such as the Canny operator, the Sobel operator, etc. Based on the determined contour, the contour features corresponding to the first-order position and the contour features corresponding to the second-order position can be compared respectively, and the similarity with the contour features of the highlight area. Among them, the contour features can be the curvature of the contour, the similarity of the length and diameter of the contour, etc. The present disclosure does not specifically limit how to determine the similarity of the shape.

[0130] It can be understood that in the embodiments of the present disclosure, when determining whether there is a diffraction area, not only is it determined whether there is a high-order position based on the brightness characteristics when the diffraction phenomenon occurs, but also whether there is a diffraction area based on whether the shape similarity between the high-order position and the highlight area meets the conditions, which can improve the accuracy of the diffraction area determination.

[0131] In one embodiment, the method further comprises:

[0132] Determining whether there is a dispersion phenomenon in the diffraction area according to the degree of color difference between pixels in the diffraction area and pixels outside the diffraction area;

[0133] The step of reducing the brightness of the diffraction region to obtain a second image comprises:

[0134] If the diffraction region has a dispersion phenomenon, the brightness and color saturation of the diffraction region are reduced to obtain the second image. The dispersion phenomenon of the second image refers to the phenomenon that complex light is decomposed into multiple monochromatic lights. For example, white light is synthesized by light of different wavelengths. When white light passes through a medium (such as a prism), seven colors of monochromatic light are seen, which belongs to the dispersion phenomenon. It can be understood that when the dispersion phenomenon occurs, the color of the image will change.

[0135] The dispersion phenomenon of the diffraction zone sometimes occurs in the edge area, because when there is no dispersion, the color of the edge pixels in the diffraction zone is more consistent with the background part. Among them, the background part refers to the part outside the highlight area and the diffraction area. If dispersion occurs, the color of the edge pixels in the diffraction area will be different from the background part. In the embodiment of the present disclosure, the degree of color difference between the edge pixels in the diffraction area and the pixels outside the diffraction area is reflected in the following aspects, including: 1. Whether the color mode of the edge pixels in the diffraction area is consistent with the color mode of the pixels outside the diffraction area. For example, if the pixels outside the diffraction area are a single color, and the edge pixels in the diffraction area have multiple colors, it is considered that the color modes are different, and different color modes may cause dispersion. 2. Whether there is a difference in the color saturation of the edge pixels in the diffraction area and the color saturation of the pixels outside the diffraction area.

[0136] In this regard, the present disclosure determines whether there is dispersion in the diffraction region based on the degree of color difference between pixels in the diffraction region and pixels outside the diffraction region. In this embodiment, if there is dispersion in the diffraction region, the color saturation of the dispersion in the diffraction region is reduced to alleviate the dispersion.

[0137] Figure 8a is a schematic diagram of a dispersion phenomenon in a diffraction region in an embodiment of the present disclosure, Figure 8bFIG. 1 is a schematic diagram of reducing the color saturation of the edge portion of the diffraction region in an embodiment of the present disclosure. Figure 8a As shown, there is a diffraction area around the illumination source, and after the white light illumination source is diffracted, the diffraction area includes multiple color components, that is, there is a dispersion phenomenon in the diffraction area. Figure 8b As shown, after reducing the color saturation of the dispersion phenomenon in the diffraction area, the color at the edge of the diffraction area tends to the background part.

[0138] In this embodiment, if there is dispersion in the diffraction area, not only the brightness of the diffraction area is reduced, but also the color saturation of the edge of the diffraction area with dispersion is reduced to obtain the second image. It can be understood that in this way, not only the overlapping images generated by diffraction can be reduced by reducing the brightness of the diffraction area, but also the false color problem caused by dispersion can be reduced, so that a more realistic image can be further obtained.

[0139] In one embodiment, determining whether there is a dispersion phenomenon in the diffraction area according to the degree of color difference between pixels in the diffraction area and pixels outside the diffraction area includes:

[0140] Acquire a color difference value between the color of a pixel with dispersion phenomenon in the diffraction area and the color of a pixel outside the diffraction area;

[0141] If the color difference value is greater than a preset color threshold, it is determined that the dispersion phenomenon exists in the diffraction area.

[0142] In this embodiment, when determining whether there is a dispersion phenomenon in the diffraction area according to the degree of color difference between pixels in the diffraction area and pixels outside the diffraction area, the judgment can be made based on the color difference value and the preset color threshold.

[0143] When determining the color difference value, the mean of the R component, the mean of the G component, and the mean of the B component can be determined respectively according to the color information of the pixels in the diffraction area and the pixels outside the diffraction area, for example, the color components of each pixel in the RGB color space: red pixel (R), green pixel (G), and blue pixel (B), and the mean of the color component of the pixel with dispersion phenomenon in the diffraction area is subtracted from the mean of the corresponding color component of the pixel outside the diffraction area. At the same time, based on the preset color threshold for each color component, when it is determined that the difference between the mean values ​​of each color component is greater than the corresponding preset color threshold, it is determined that there is dispersion phenomenon in the diffraction area.

[0144] Since the values ​​of each color component are closely related to the brightness in the RGB space, that is, as long as the brightness changes, the values ​​of each color component will change accordingly. Therefore, the RGB space may not be able to more intuitively reflect the color-related information. In this regard, the present disclosure can convert the first image belonging to the RGB space into the HSV / HSL space, and obtain the color difference value between the pixel color with dispersion phenomenon in the diffraction area and the pixel outside the diffraction area in the HSV / HSL space.

[0145] In the HSV / HSL space, hue (H) reflects the hue, and saturation (S) reflects the saturation of the color in the hue space. Both H and S reflect the information of the color. Therefore, the color difference value can be determined based on the information of H and S after the color space conversion to improve the accuracy of color difference determination.

[0146] In the HSV / HSL space, for example, the mean of the H component and the mean of the S component of the pixels inside and outside the diffraction area can be counted respectively, and based on the difference between the means and the preset color thresholds of the corresponding components, when it is determined that the difference between the means of each component is greater than the corresponding preset color threshold, it is determined that there is dispersion in the diffraction area.

[0147] In one embodiment, step S13 includes:

[0148] According to the brightness value of each pixel point in the diffraction area, determining the brightness value to be adjusted in a positive correlation with the brightness value;

[0149] The brightness value to be adjusted corresponding to each pixel point is subtracted from the brightness value of each pixel point in the diffraction area to obtain the second image with Gaussian brightness distribution.

[0150] In this embodiment, when the brightness of the diffraction area is reduced to obtain the second image after brightness adjustment, the brightness value to be adjusted can be determined according to the brightness value of each pixel point in the diffraction area in a positive correlation with the brightness value. Wherein, the positive correlation means that the larger the brightness value of the pixel point in the diffraction area, the larger the determined brightness value to be adjusted.

[0151] As mentioned above, the light field distribution of the brightness of each pixel in the first image is similar to Figure 7In the light intensity distribution curve, the diffraction area includes the normally distributed part including K1 and K2. Taking K1 as an example, when determining the brightness value to be adjusted, the value to be adjusted at the peak value can be set to be the largest, and the values ​​to be adjusted corresponding to the pixels around the peak value can be relatively small, so that the values ​​to be adjusted in the K1 part present a curve similar to an inverse normal distribution. After the values ​​to be adjusted are determined based on the above method, the brightness values ​​of each pixel point in the K1 part can be subtracted from the values ​​to be adjusted corresponding to the part, so that the K1 part approaches a straight line. Similarly, for the K2 part, the values ​​to be adjusted are determined in the same way, and the values ​​to be adjusted corresponding to the part are subtracted from the brightness values ​​of each pixel point in the K2 part, so that the normally distributed curve of the K2 part also changes to approach a straight line.

[0152] It can be understood that after subtracting the brightness value to be adjusted corresponding to each pixel from the brightness value of each pixel in the diffraction area, Figure 7 The normal distribution phenomenon of K1 and K2 disappears, and the overall curve presents a Gaussian distribution (ie, normal distribution) of brightness. That is, the brightness value of the obtained second image presents a Gaussian distribution.

[0153] In one embodiment, step S13 includes:

[0154] The brightness of the diffraction area is reduced according to an inverse Gamma function to obtain the second image with adjusted brightness.

[0155] In the embodiment of the present disclosure, the brightness of the diffraction area may also be reduced according to the inverse Gamma function. Fig. 9 It is a curve diagram of the inverse Gamma function, based on Fig. 9 As shown in the inverse Gamma function curve, it can be understood that when the inverse Gamma function is used to reduce the brightness based on the first image, Figure 7 As shown, the brightness of the K1 and K2 parts belonging to the diffraction area will decrease, while the light source part other than K1 and K2 remains unchanged. Therefore, the second image after brightness adjustment obtained by this method can also reduce the overlapping images caused by diffraction to a certain extent, making the second image more realistic than the first image.

[0156] In one embodiment, step S13 includes:

[0157] The first image including the diffraction area is input into a preset image quality compensation model to obtain the second image after brightness adjustment; wherein the preset image quality compensation model is obtained by training using a neural network.

[0158] In an embodiment of the present disclosure, the image quality of the first image can also be compensated by a preset image quality compensation model. It should be noted that the image quality compensation model can adjust the brightness of the input image to improve the image quality. Therefore, after the first image is input into the model, a second image with adjusted brightness can be obtained.

[0159] In this embodiment, the preset image quality compensation model is obtained after training using a neural network. For example, the image quality compensation model is a model obtained after training a large number of sample images using a convolutional neural network or a deep neural network. Specifically, the sample image can be an image acquisition of the same target object before the terminal leaves the factory, and an actual image containing a diffraction phenomenon and a reference image not containing a diffraction phenomenon are obtained respectively. Among them, the actual image containing the diffraction phenomenon is obtained in a scene where a display screen is set on the camera of the terminal, and the reference image not containing the diffraction phenomenon is obtained in a scene where there is no display screen on the camera of the terminal. Based on the actual image obtained without the diffraction phenomenon, a neural network model is used for training. During the training process, the loss function is used to measure the image quality difference between the training value of the actual image and the reference image, so as to continuously optimize the parameters in the network by back propagation to obtain a trained image quality compensation model.

[0160] Fig.10 FIG. 1 is a diagram showing an image processing device according to an exemplary embodiment. Fig.10 , the image processing device comprises:

[0161] The first determination module 101 is configured to determine a highlight area according to the brightness of pixels in the first image; wherein the brightness of the pixels included in the highlight area is greater than the brightness of the surrounding pixels of the highlight area;

[0162] The second determination module 102 is configured to determine a diffraction area in the first image according to the highlight area; the diffraction area is: an image area distributed around the highlight area;

[0163] The adjustment module 103 is configured to reduce the brightness of the diffraction area to obtain a second image.

[0164] Optionally, the second determination module 102 is specifically configured to determine the light field distribution of the brightness of pixels in the first image; determine, based on the light field distribution, whether there is an image area that satisfies the diffraction phenomenon in the brightness decreasing direction of the highlight area in the first image; if there is an image area that satisfies the diffraction phenomenon, determine that the image area is the diffraction area.

[0165] Optionally, the second determination module 102 is specifically configured to determine whether there is a high-order position based on the light field distribution and the brightness characteristics of the diffraction phenomenon; wherein the high-order position is: in the area of ​​the first image other than the highlighted area, when the difference between the pixel brightness of the first partial area and the pixel brightness of the second partial area is greater than a first threshold, the position of the pixel of the first partial area is located; the pixel brightness of the first partial area is greater than the pixel brightness of the second partial area.

[0166] Optionally, the second determination module is specifically configured to determine whether the similarity between the shape formed by the pixels at the high-order position and the shape of the highlight area is greater than a first similarity threshold; if it is greater than the first similarity threshold, it is determined that there is an image area that satisfies the diffraction phenomenon. If it is greater than the first similarity threshold, it is determined that there is an image area that satisfies the diffraction phenomenon.

[0167] Optionally, the first image includes K orders of high-order positions; wherein, K is greater than or equal to 2, and the pixel brightness of the high-order position of the Kth order is equal to the pixel brightness of the high-order position of the K-1th order or is negatively correlated with the K value.

[0168] Optionally, the device further comprises:

[0169] The third determination module 104 is specifically configured to determine whether there is a dispersion phenomenon in the diffraction area according to the color difference between the pixels in the diffraction area and the pixels outside the diffraction area; if there is a dispersion phenomenon in the diffraction area, reduce the color saturation of the diffraction area;

[0170] The adjustment module 103 is specifically configured to reduce the brightness and color saturation of the diffraction area if there is dispersion in the diffraction area, so as to obtain the second image.

[0171] Optionally, the third determination module 104 is specifically configured to obtain a color difference value between the pixel color within the diffraction area and the pixel color outside the diffraction area; if the color difference value is greater than a preset color threshold, it is determined that the dispersion phenomenon exists in the diffraction area.

[0172] Optionally, the adjustment module 103 is specifically configured to determine the brightness value to be adjusted according to the brightness value of each pixel point in the diffraction area, in a positive correlation with the brightness value; subtract the brightness value to be adjusted corresponding to each pixel point from the brightness value of each pixel point in the diffraction area, to obtain the second image with Gaussian distribution of brightness values.

[0173] Optionally, the adjustment module 103 is specifically configured to reduce the brightness of the diffraction area according to an inverse Gamma function to obtain the second image with adjusted brightness.

[0174] Optionally, the adjustment module 103 is specifically configured to input the first image containing the diffraction area into a preset image quality compensation model to obtain the second image with brightness adjusted; wherein the preset image quality compensation model is obtained by training using a neural network.

[0175] Optionally, the first determination module 101 is specifically configured to perform clustering according to the brightness value of each pixel in the first image to divide different areas; the brightness difference between the pixels in any of the areas is within a preset difference range; and the area with the largest average brightness value among the divided areas is the highlight area.

[0176] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0177] Fig.11 8 is a block diagram of a terminal device 800 according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a mobile computer, etc.

[0178] Reference Fig.11 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0179] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0180] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0181] The power component 806 provides power to the various components of the device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.

[0182] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0183] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0184] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0185] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0186] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as Wi-Fi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0187] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0188] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0189] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a terminal, enables the terminal to perform a control method, the method comprising:

[0190] Determine a highlight area according to the brightness of pixels in the first image; wherein the brightness of pixels included in the highlight area is greater than the brightness of surrounding pixels of the highlight area;

[0191] Determine a diffraction area in the first image according to the highlight area; the diffraction area is: an image area distributed around the highlight area;

[0192] The brightness of the diffraction area is reduced to obtain a second image.

[0193] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0194] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image processing method, It is characterized in that The method comprises: Determine a highlight area according to the brightness of pixels in the first image; wherein the brightness of pixels included in the highlight area is greater than the brightness of surrounding pixels of the highlight area; Determine a diffraction area in the first image according to the highlight area; the diffraction area is: an image area distributed around the highlight area; reducing the brightness of the diffraction area to obtain a second image; The step of determining the highlight area according to the brightness of pixels in the first image includes: Clustering is performed according to the brightness value of each pixel in the first image to divide different areas; the brightness difference between the pixels in any of the areas is within a preset difference range; Among the divided regions, the region with the largest average brightness value is the highlight region.

2. The method according to claim 1, It is characterized in that The step of determining the diffraction area in the first image according to the highlighted area includes: determining a light field distribution of brightness of pixels in the first image; determining, according to the light field distribution, whether there is an image area satisfying the diffraction phenomenon in a brightness decreasing direction of the highlight area in the first image; If there is an image area that satisfies the diffraction phenomenon, the image area is determined to be the diffraction area.

3. The method according to claim 2, It is characterized in that The determining, according to the light field distribution, whether there is an image area satisfying the diffraction phenomenon in the brightness decreasing direction of the highlight area in the first image includes: Determine whether a high-order position exists according to the light field distribution and the brightness characteristics of the diffraction phenomenon; wherein the high-order position is: in the area of ​​the first image other than the highlighted area, when the difference between the pixel brightness of the first partial area and the pixel brightness of the second partial area is greater than a first threshold, the pixel brightness of the first partial area is greater than the pixel brightness of the second partial area; If the high-order position exists, it is determined that the image area that satisfies the diffraction phenomenon exists.

4. The method according to claim 3, It is characterized in that If the high-order position exists, determining that there is the image area satisfying the diffraction phenomenon includes: Determine whether the similarity between the shape formed by the pixels at the high-order position and the shape of the highlight area is greater than a first similarity threshold; If it is greater than the first similarity threshold, it is determined that the image area that satisfies the diffraction phenomenon exists.

5. The method according to claim 3, It is characterized in that The first image includes K orders of high-order positions; wherein K is greater than or equal to 2, and the pixel brightness of the Kth order high-order position is equal to the pixel brightness of the K-1th order high-order position or is negatively correlated with the K value.

6. The method according to claim 1, It is characterized in that The method further comprises: Determining whether there is a dispersion phenomenon in the diffraction area according to the degree of color difference between pixels in the diffraction area and pixels outside the diffraction area; The step of reducing the brightness of the diffraction region to obtain a second image comprises: If the diffraction region has a dispersion phenomenon, the brightness and color saturation of the diffraction region are reduced to obtain the second image.

7. The method according to claim 6, It is characterized in that The determining whether there is a dispersion phenomenon in the diffraction area according to the color difference between the pixels in the diffraction area and the pixels outside the diffraction area includes: Acquire a color difference value between the pixel color within the diffraction area and the pixel color outside the diffraction area; If the color difference value is greater than a preset color threshold, it is determined that the dispersion phenomenon exists in the diffraction area.

8. The method according to claim 1, It is characterized in that The step of reducing the brightness of the diffraction region to obtain a second image comprises: According to the brightness value of each pixel point in the diffraction area, determining the brightness value to be adjusted in a positive correlation with the brightness value; The brightness value to be adjusted corresponding to each pixel point is subtracted from the brightness value of each pixel point in the diffraction area to obtain the second image with Gaussian brightness distribution.

9. The method according to claim 1, It is characterized in that The step of reducing the brightness of the diffraction region to obtain a second image comprises: The brightness of the diffraction area is reduced according to an inverse Gamma function to obtain the second image with adjusted brightness.

10. The method according to claim 1, It is characterized in that The step of reducing the brightness of the diffraction region to obtain a second image comprises: The first image including the diffraction area is input into a preset image quality compensation model to obtain the second image after brightness adjustment; wherein the preset image quality compensation model is obtained by training using a neural network.

11. An image processing device, It is characterized in that The device comprises: The first determination module is determined to determine a highlight area according to the brightness of pixels in the first image; wherein the brightness of the pixels included in the highlight area is greater than the brightness of the surrounding pixels of the highlight area; wherein the determination of the highlight area according to the brightness of the pixels in the first image includes: clustering according to the brightness value of each pixel in the first image to divide different areas; the brightness difference between the pixels in any of the areas is within a preset difference range; and obtaining the area with the largest average brightness value among the divided areas as the highlight area; A second determination module is configured to determine a diffraction area in the first image according to the highlight area; the diffraction area is: an image area distributed around the highlight area; The adjustment module is configured to reduce the brightness of the diffraction area to obtain a second image.

12. The device according to claim 11, It is characterized in that The second determination module is specifically configured to determine the light field distribution of the brightness of the pixels in the first image; determine, based on the light field distribution, whether there is an image area that satisfies the diffraction phenomenon in the brightness decreasing direction of the highlight area in the first image; if there is an image area that satisfies the diffraction phenomenon, determine that the image area is the diffraction area.

13. The device according to claim 12, It is characterized in that The second determination module is specifically configured to determine whether there is a high-order position based on the brightness characteristics of the light field distribution and the diffraction phenomenon; wherein the high-order position is: in the area of ​​the first image other than the highlighted area, when the difference between the pixel brightness of the first partial area and the pixel brightness of the second partial area is greater than a first threshold, the position of the pixels in the first partial area is located; the pixel brightness of the first partial area is greater than the pixel brightness of the second partial area. In the area of ​​the first image other than the highlighted area, when the difference between the pixel brightness of the first partial area and the pixel brightness of the second partial area is greater than the first threshold, the position of the pixels in the first partial area is located; the pixel brightness of the first partial area is greater than the pixel brightness of the second partial area.

14. The device according to claim 13, It is characterized in that The second determination module is specifically configured to determine whether the similarity between the shape formed by the pixels located at the high-order position and the shape of the highlight area is greater than a first similarity threshold; if it is greater than the first similarity threshold, it is determined that there is the image area that satisfies the diffraction phenomenon.

15. The device according to claim 13, It is characterized in that The first image includes K orders of high-order positions; wherein K is greater than or equal to 2, and the pixel brightness of the Kth order high-order position is equal to the pixel brightness of the K-1th order high-order position or is negatively correlated with the K value.

16. The device according to claim 11, It is characterized in that The device also includes: A third determination module is specifically configured to determine whether there is a dispersion phenomenon in the diffraction area according to the color difference between the pixels in the diffraction area and the pixels outside the diffraction area; The adjustment module is specifically configured to reduce the brightness and color saturation of the diffraction area if there is dispersion in the diffraction area to obtain the second image.

17. The device according to claim 16, It is characterized in that The third determination module is specifically configured to obtain a color difference value between the pixel color within the diffraction area and the pixel color outside the diffraction area; if the color difference value is greater than a preset color threshold, it is determined that the dispersion phenomenon exists in the diffraction area.

18. The device according to claim 11, It is characterized in that The adjustment module is specifically configured to determine the brightness value to be adjusted according to the brightness value of each pixel point in the diffraction area, in a positive correlation with the brightness value; subtract the brightness value to be adjusted corresponding to each pixel point from the brightness value of each pixel point in the diffraction area, to obtain the second image with Gaussian distribution of brightness values.

19. The device according to claim 11, It is characterized in that The adjustment module is specifically configured to reduce the brightness of the diffraction area according to an inverse Gamma function to obtain the second image after brightness adjustment.

20. The device according to claim 11, It is characterized in that The adjustment module is specifically configured to input the first image containing the diffraction area into a preset image quality compensation model to obtain the second image after brightness adjustment; wherein the preset image quality compensation model is obtained after training using a neural network.

21. A terminal, It is characterized in that The invention comprises the image processing device as claimed in any one of claims 11 to 20.

22. A non-transitory computer-readable storage medium, It is characterized in that When the instructions in the storage medium are executed by a processor of a computer, the computer is enabled to execute the image processing method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Image processing device, imaging device, evaluation device, image processing method, and optical system evaluation method

    CN101861599A

  • Image processing method and method for adjusting diffraction screen structure based on point spread function

    CN111123538A