Image processing method and device

By segmenting the original image taken by the camera into sub-images and performing brightness compensation, the image exposure problem caused by the user's wrong angle and orientation is solved, and the image clarity is improved and it makes it more realistic.

CN113963007BActive Publication Date: 2025-02-18HANGZHOU EASTCOM SOFTWARE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111407845.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2025-02-18
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

The pictures taken by the camera are not correct when the user takes pictures, resulting in image exposure problems, resulting in blurred picture content and cannot truly reflect the current scene.

Method used

By segmenting the original image into at least two sub-images, image information in each sub-image, including brightness information in the image and brightness information between the image and other images, and brightness adjustment of the original image based on this information, each sub-image can be achieved by extracting the image information, including brightness information in the image and brightness information between the image and other images, and adjusting the brightness of the original image according to this information, the original image can be achieved by extracting the image information. brightness compensation.

Benefits of technology

It improves the clarity of the entire image, bringing the image closer to the real image, and solving the exposure problem caused by the user's wrong angle and orientation of the photo.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113963007B_ABST
    Figure CN113963007B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method and device, which relates to the field of image processing technology. The method includes: obtaining an original image; dividing the original image into at least two sub-images; extracting image information from each sub-image, the image information including brightness information within the image and brightness information between the image and other images; adjusting the brightness of the original image according to the image information in each sub-image. The present application divides the original image and then processes the brightness value of each sub-image to achieve brightness compensation for each sub-image, thereby improving the clarity of the entire image and making it closer to the real image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image processing method and device. Background Art

[0002] With the development of camera technology, the pictures taken by cameras are getting closer and closer to real scenes. However, the pictures taken by cameras are not only related to the hardware and software of the camera, but also to the user's photography skills. If the angle of the user is wrong when taking pictures, some or all areas of the pictures taken by the camera will be exposed, resulting in blurred content in the pictures, which cannot truly reflect the current scene. In order to improve the authenticity of the pictures taken by the camera, we cannot require every user to improve their photography skills and become a master of photography, so we can only start from the hardware and software of the camera to improve the problem of image exposure caused by the wrong angle and orientation when the user takes pictures. Summary of the invention

[0003] In order to solve the above-mentioned problems, an image processing method and device are provided in the embodiments of the present application, which divides the original image into segments and then processes the brightness values ​​of each sub-image to achieve brightness compensation for each sub-image, thereby improving the clarity of the entire image and making it closer to the real image.

[0004] To this end, the following technical solutions are adopted in the embodiments of the present application:

[0005] In a first aspect, an embodiment of the present application provides an image processing method, comprising: acquiring an original image; dividing the original image into at least two sub-images; extracting image information in each sub-image, wherein the image information includes brightness information within the image and brightness information between the image and other images; and adjusting the brightness of the original image according to the image information in each sub-image.

[0006] In one embodiment, before dividing the original image into at least two sub-images, the method further comprises: inputting the original image into a bilateral filtering algorithm to obtain a smooth original image with reduced noise.

[0007] In one embodiment, dividing the original image into at least two sub-images includes: inputting the original image into the brightness channel of the image brightness-chrominance color space to obtain at least two brightness levels of the original image, each brightness level is divided according to the brightness value; merging areas of the same brightness level in the original image to obtain the at least two sub-images.

[0008] In one embodiment, it also includes: determining the brightness difference value within each sub-image and the brightness difference value at the edge between two adjacent sub-images; when the brightness difference value at the edge between the two adjacent sub-images is not greater than the internal brightness difference value of the two adjacent sub-images, merging the two adjacent sub-images belonging to the building into one sub-image.

[0009] In one implementation, extracting the image information from each sub-image includes: inputting the at least two sub-images into a Canny edge operator algorithm to obtain image edge brightness information within each sub-image.

[0010] In one embodiment, when the original image is an underexposed image, before inputting the at least two sub-images into the Canny edge operator algorithm to obtain the image edge brightness information within each sub-image, it includes: inputting the at least two sub-images into a gamma transform algorithm to increase the grayscale value of each of the two sub-images; when the original image is an overexposed image, before inputting the at least two sub-images into the Canny edge operator algorithm to obtain the image edge brightness information within each sub-image, it includes: inputting the at least two sub-images into a gamma transform algorithm to reduce the grayscale value of each of the two sub-images.

[0011] In one embodiment, the extracting of image information from each sub-image includes: inputting the original image into a Markov random field energy function to calculate the number of sub-images; inputting the at least two sub-images and the number of sub-images into a particle swarm optimization algorithm to calculate the average brightness value of each sub-image; and calculating the brightness change of each sub-image based on the brightness level interval difference corresponding to each sub-image and the average brightness value of each sub-image.

[0012] In one embodiment, the brightness of the original image is adjusted according to the image information in each sub-image, including: inputting the brightness change of each sub-image into the least squares method to calculate the global mapping curve of the original image; and adjusting the brightness of the original image according to the global mapping curve of the original image.

[0013] In one implementation, the adjusting the brightness of the original image includes: adjusting the brightness L channel of the hue, saturation and brightness HSL channel of the original image.

[0014] In a second aspect, an embodiment of the present application provides an image processing device, comprising: a transceiver unit for acquiring an original image; a processing unit for dividing the original image into at least two sub-images; extracting image information from each sub-image, the image information including brightness information within the image and brightness information between the image and other images; and adjusting the brightness of the original image based on the image information in each sub-image.

[0015] In one embodiment, the processing unit is further configured to input the original image into a bilateral filtering algorithm to obtain a smooth original image with reduced noise.

[0016] In one embodiment, the processing unit is specifically used to input the original image into the brightness channel of the image brightness-chrominance color space to obtain at least two brightness levels of the original image, each brightness level is divided according to the brightness value; merge the areas of the same brightness level in the original image to obtain the at least two sub-images.

[0017] In one embodiment, the processing unit is further used to determine the brightness difference value within each sub-image and the brightness difference value at the edge between two adjacent sub-images; when the brightness difference value at the edge between the two adjacent sub-images is not greater than the internal brightness difference value of each of the two adjacent sub-images, the two adjacent sub-images belonging to the building are merged into one sub-image.

[0018] In one implementation, the processing unit is specifically configured to input the at least two sub-images into a Canny edge operator algorithm to obtain image edge brightness information within each sub-image.

[0019] In one embodiment, when the original image is an underexposed image, the processing unit is further used to input the at least two sub-images into a gamma transform algorithm to increase the grayscale values ​​of the two sub-images; when the original image is an overexposed image, the processing unit is further used to input the at least two sub-images into a gamma transform algorithm to reduce the grayscale values ​​of the two sub-images.

[0020] In one embodiment, the processing unit is specifically used to input the original image into a Markov random field energy function to calculate the number of sub-images; input the at least two sub-images and the number of sub-images into a particle swarm optimization algorithm to calculate the average brightness value of each sub-image; and calculate the brightness change of each sub-image based on the brightness level interval difference corresponding to each sub-image and the average brightness value of each sub-image.

[0021] In one embodiment, the processing unit is specifically configured to input the brightness variation of each sub-image into a least square method to calculate a global mapping curve of the original image; and adjust the brightness of the original image according to the global mapping curve of the original image.

[0022] In one implementation, the processing unit is specifically configured to adjust the brightness L channel of the original image in the hue, saturation and brightness HSL channel of the image.

[0023] In a third aspect, an embodiment of the present application provides a terminal device, comprising: at least one transceiver, at least one memory, and at least one processor, for executing various possible implementation embodiments of the first aspect.

[0024] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer executes the various possible embodiments of the first aspect.

[0025] In a fifth aspect, a computer program product is provided in an embodiment of the present application, characterized in that the computer program product stores instructions, and when the instructions are executed by a computer, the computer implements various possible embodiments of the first aspect.

[0026] In the embodiment of the present application, the components of image processing are: input image, image segmentation, information extraction within the image region and interval information extraction, estimation of brightness value between regions, statistics of brightness level change, fitting of brightness level change curve, detail adjustment, and output image. First, the brightness of the acquired image is evenly divided into ten levels, and the entire image is divided into multiple sub-images; then the image is converted into the acquired information of these regions that make up the image and processed, and according to the regional brightness values ​​before and after compensation, with the goal of increasing the edge details of the image, the image Markov random field energy function is defined, and the optimal average brightness value of each region is obtained by the particle swarm optimization algorithm. Then, the statistical information of the region is used to correct the brightness value increase of the image at each brightness level; finally, the least squares method is used to fit the brightness mapping curve of the image, and the brightness of the image is compensated and adjusted by region to restore the image details. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The following is a brief introduction to the drawings required for describing the embodiments or prior art.

[0028] Figure 1 A flowchart of an image processing method provided in an embodiment of the present application;

[0029] Figure 2 A schematic diagram of a flow chart of an image processing method provided in an embodiment of the present application;

[0030] FIG3( a ) is an underexposed original image provided in an embodiment of the present application;

[0031] FIG3( b ) is an overexposed original image provided in an embodiment of the present application;

[0032] Figure 4 A schematic diagram of brightness level division provided in an embodiment of the present application;

[0033] Figure 5 It is a grayscale image of the original image after being divided into multiple sub-images according to the pixels provided in the embodiment of the present application;

[0034] Figure 6 The grayscale image of the original image of multiple sub-images after merging some pixel blocks provided in the embodiment of the present application;

[0035] FIG. 7( a ) is a grayscale image of an original image in which a normal image is divided into multiple sub-images provided in an embodiment of the present application;

[0036] FIG. 7( b ) is a grayscale image of an original image obtained by dividing an overexposed image into a plurality of sub-images provided in an embodiment of the present application;

[0037] FIG. 7( c ) is a grayscale image of an original image obtained by segmenting an underexposed image into a plurality of sub-images provided in an embodiment of the present application;

[0038] Figure 8 A brightness level variation curve diagram provided in an embodiment of the present application;

[0039] Fig. 9 This is a brightness mapping curve diagram provided in an embodiment of the present application;

[0040] Fig.10 The original image of FIG. 3( b ) is obtained by adjusting the brightness of the original image provided in the embodiment of the present application;

[0041] Fig.11 This is a schematic diagram of the architecture of an image processing device in an embodiment of the present application;

[0042] Fig.12 This is a schematic diagram of the architecture of a terminal device in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.

[0044] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of the response messages.

[0045] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0046] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.

[0047] Figure 1 , Figure 2 This is a flow chart of an image processing method provided in an embodiment of the present application. As shown in the figure, the implementation process of the method is specifically as follows:

[0048] Step S201, obtaining an original image.

[0049] In the present application, the original image is generally obtained by taking a photo by the user. Due to the user's photography skills, the original image may appear as shown in Figure 3(a), which has an overexposure problem, or appear as shown in Figure 3(b), which has an underexposure problem. Regardless of whether the original image has an overexposure or underexposure problem, it cannot reflect the real scene and the details in the image. In the following introduction to the technical solution protected by the present application, the underexposed image of Figure 3(b) will be taken as an example. The present application is not limited here. The solution protected by the present application can also solve the overexposed image of Figure 3(a).

[0050] Step S202: dividing the original image into at least two sub-images.

[0051] Before the original image is segmented, the original image needs to be preprocessed. Exemplarily, the bilateral filtering method can be used to smooth the original image, which can reduce the noise in the original image and avoid excessive noise in the original image, which affects the subsequent segmentation effect of the original image. Since the bilateral filtering of the image is a compromise processing that combines the spatial proximity of the image and the similarity of the pixel points during sampling, and considers the spatial domain information and grayscale similarity, the original image can be smoothed and the edge can be retained by smoothing the original image.

[0052] After the original image is processed, the brightness value of the original image can be divided into N levels according to the maximum brightness value and the minimum brightness value of the pixels on the original image, where N is a positive integer greater than 1, so that different sub-images can be divided according to the brightness level when the image is subsequently segmented. Figure 4 As shown, the brightness channel Y of the original image input into the image brightness-chrominance (Y-UV) color space can be normalized to the range of 0-1, and then the brightness is evenly divided into 10 levels, Ω=(Ω1, Ω2, Ω3, Ω4, Ω5, Ω6, Ω7, Ω8, Ω9, Ω10), and each brightness level Ω corresponds to a brightness value range of 0.1. Among them, the lower the brightness level Ω, the smaller the brightness value of the pixel point, and the larger the brightness level Ω, the larger the brightness value of the pixel point.

[0053] In the present application, the original image is divided into at least two sub-images based on the dissimilarity between the pixels. For example, the original image is generally in the form of a red, green, blue (RGB) image. The minimum spanning tree (MST) can be used to merge the pixels with the same or similar brightness values ​​in the original image. The pixel block Cn formed by merging the pixels with the same or similar brightness values ​​is a sub-image. In the present application, the same pixels are merged in the image shown in FIG3(b), and the following is obtained: Figure 5 In the image shown, the shaded blocks of different colors represent a sub-image.

[0054] Optionally, for a pixel block Cn, the difference between the brightness values ​​of all the pixels at the edges inside it can be called intra-class difference; for different pixel blocks Cn, the difference between the brightness values ​​of the pixels at the edges of two adjacent pixel blocks Cn can be called inter-class difference. If the inter-class difference is smaller than the intra-class difference, the two adjacent pixel blocks Cn with inter-class difference can be merged, which can effectively reduce the number of pixel blocks Cn, the number of sub-images, and the workload of subsequent data processing. In this application, Figure 4 The pixel blocks Cn with relatively high similarity are merged to obtain Figure 6 In the image shown, shaded blocks of different colors represent a pixel block Cn, that is, a sub-image.

[0055] Step S203: extracting image information from each sub-image, wherein the image information includes brightness information within the image and brightness information between the image and other images.

[0056] Step S204: adjusting the brightness of the original image according to the image information in each sub-image.

[0057] In a normally shot image as shown in FIG7(a), if there is no problem of overexposure or underexposure, the contours of each object in the image are clear, and the image contour extraction algorithm can be used to directly extract the contours of each object in the image. Basically, all contours in the image can be extracted; if the image has an underexposure problem, as shown in FIG7(b), there are many sub-images with a relatively low brightness level Ω in the image. Since the objects are in a relatively dark situation, the contours of each object displayed in the image will be blurred or not displayed at all. At this time, the contours of all objects cannot be extracted; if the image has an overexposure problem, as shown in FIG7(c), there are many sub-images with a relatively high brightness level Ω in the image. Since the objects are in a high-light situation, the objects displayed in the image will be whitish and the contours cannot be clearly presented. At this time, the contours of all objects cannot be extracted.

[0058] In the present application, in order to solve the problem of overexposure or underexposure of the image, the contours of each object in the image are proposed. Each sub-image can be input into a gamma transform algorithm, and the overexposed or underexposed area of ​​the sub-image can be compensated. Each sub-image can be converted into a normal image, and then the contour of each object in each sub-image can be extracted through an image contour extraction algorithm.

[0059] For example, when a sub-image is underexposed, after gamma transformation (γ<1), the low grayscale values ​​in a narrow range of the image are mapped to grayscale values ​​in a wider range, so that the contrast is enhanced and more low-grayscale details can be displayed. The number of edges detected by the Canny edge operator will increase compared to before the transformation. Similarly, when a sub-image is overexposed, the high grayscale values ​​in a narrow range of the image can be mapped to grayscale values ​​in a wider range through (γ>1), and the Canny operator can detect more edges in the exposed part.

[0060] Whether a sub-image is a normal image, an underexposed image, or an overexposed image can be determined based on the grayscale value in the sub-image. Optionally, if the grayscale value of a sub-image is less than a first set threshold, the sub-image can be considered to be an underexposed image; if the grayscale value of a sub-image is greater than a second set threshold, the sub-image can be considered to be an overexposed image; if the grayscale value of a sub-image is between the first set threshold and the second set threshold, the sub-image can be considered to be a normal image.

[0061] In order to obtain the statistics of brightness level changes, it is necessary to estimate the brightness value of the sub-image first. The Markov random field energy function can be used to calculate the number of sub-images after the original image is divided. The Markov random field energy function is:

[0062]

[0063] Among them, Lnew Indicates the number of sub-images after the original image is segmented.

[0064] In order to quickly obtain the optimal solution of the energy equation (1), the particle swarm optimization method can be used to solve the optimal average brightness value of the sub-image. After obtaining the optimal sub-image brightness value, the optimal average grayscale value of each sub-image is used as a reference point to perform exposure correction, and the optimized value is directly mapped to each sub-image. However, since the information weight of some smaller sub-images is not large, the brightness values ​​of these sub-images may change suddenly or even be distorted, while the brightness level change mapping has good global information and will not be distorted. Therefore, the image can be statistically analyzed by 10 brightness levels Ω j The brightness change of each sub-image in i , to obtain each brightness level Ω=(Ω1,Ω2,…,Ω 10 ) is:

[0065] ΔΩ=(ΔΩ1,ΔΩ2,…,ΔΩ 10 ) (2).

[0066] The brightness change of the sub-image is Δl i is the difference between the initial average brightness value of the sub-image and the optimal average brightness value of the re-evaluated sub-image, that is:

[0067]

[0068] Among them, the change in image brightness level ΔΩ j Refers to the change in brightness value within each level range (0.1) of the image brightness value 0-1, according to the initial average gray value l of the sub-image i ∈(0,1), it can be determined that each sub-image must belong to the corresponding brightness level range, and the brightness change of the sub-image contained in the brightness level is calculated by counting the brightness change ∑Δl i The number of sub-images c within this brightness level j , the change in brightness level of each image can be calculated j , specifically:

[0069]

[0070] Since Ω defined previously is a brightness range rather than a specific value, in order to make the data points used as the fitting curve valid, we set (Q, ΔΩ) = {(Q1, ΔΩ1), (Q2, ΔΩ2), …, (Q n ,ΔΩ n )} is the data point data of the brightness level change, and then each brightness level Ω is calculated according to formula (5) iThe average value of the original brightness of the sub-images in , formula (5) is:

[0071]

[0072] Then, each brightness level Ω calculated by formula (5) i The average value of the original brightness of the sub-images within is fitted to obtain Figure 8 The brightness level change curve shown. Then combine Figure 8 The fitted brightness level change curve is used to calculate the global mapping curve of the original image through formula (6), which is:

[0073] g(x)=x+g Δ (x) (6)

[0074] Among them, g(x) is the brightness of the output image, x is the brightness value of the input image, and g Δ (x) is the change in image brightness value, and it can be obtained from formula (7):

[0075]

[0076] Among them, k2, k3 and k5, k6 control the correction range of shadow and highlight areas respectively.

[0077] Because g Δ (x) is the brightness level change curve, so we need to find six parameters k = (k1, k2, k3, k4, k5, k6) to satisfy the data point (Q, ΔΩ) and the target value g Δ The error between (Q, k) ε=(g Δ (Q,k)-ΔΩ) 2 Therefore, the least squares method can be used to fit g Δ (x), however, the model obtained by simply considering the error minimization may have overfitting or be difficult to solve, that is, the prediction effect is very poor. In order to solve this problem, it is often considered to add a regularization term to constrain the parameter k in the objective function, so that the fitted model is not too complicated. Therefore, the least squares fitting with regularization constraints can be used to achieve the minimum error, specifically:

[0078]

[0079] Among them, the first item is the penalty item for the degree of data fitting. The better the data fitting, the smaller the value of this item. However, it is also possible to overfit the sample data and make the model too complicated. The second item is the penalty item for the complexity of the model. The more complex the model, the larger the value of this item.

[0080] In order to minimize the objective function F(k), the data can be fitted and the model can be made not too complicated. In fact, a regularization term is added to the objective function of the basic least squares method. Therefore, combined with the regularization term, the Newton iteration method is used to solve the problem:

[0081] k(t+1)=(J T J+0.1×I) -1 ×J T ×(ΔΩ-gΔ(Q,k(t))+k(t)) (9)

[0082] Where t represents the t-th iteration, I is the 6×6 identity matrix, the iteration initial value k(0) = [0 15 1.6 0 151.6], and J is the Jacobian matrix of gΔ(Q, k) with respect to parameter k, which is:

[0083]

[0084] The iteration number t is set or the iteration is stopped when the error ε is less than a certain value. The t-th generation parameter k(t) obtained by formula (9) is used to fit the brightness level change curve gΔ(x) of the input image, and then the global mapping curve g(x) of the image brightness is obtained, as shown in Fig. 9 shown.

[0085] After obtaining the global mapping curve of the image, the image can be adjusted according to the curve. Since directly adjusting the RGB channels of the image will directly affect the saturation, hue, etc. of the image, and finally cause image distortion, the L channel can be adjusted separately in the HSL channel of the image, where the L channel is the brightness.

[0086] In addition, since some high-frequency information of the original image will be lost when the image is changed by the mapping curve, in order to make the output image retain the details of the original image, the final changed image f(x)=g(x)+Δx can be used. For example, Fig.10 The image shown, where Δx=xq(x), q(x) is the image after edge-preserving bilateral filtering is applied to the original image.

[0087] In the embodiment of the present application, the components of image processing are: input image, image segmentation, information extraction within the image region and interval information extraction, estimation of brightness value between regions, statistics of brightness level change, fitting of brightness level change curve, detail adjustment, and output image. First, the brightness of the acquired image is evenly divided into ten levels, and the entire image is divided into multiple sub-images; then the image is converted into the acquired information of these regions that make up the image and processed, and according to the regional brightness values ​​before and after compensation, with the goal of increasing the edge details of the image, the image Markov random field energy function is defined, and the optimal average brightness value of each region is obtained by the particle swarm optimization algorithm. Then, the statistical information of the region is used to correct the brightness value increase of the image at each brightness level; finally, the least squares method is used to fit the brightness mapping curve of the image, and the brightness of the image is compensated and adjusted by region to restore the image details.

[0088] The experimental results of the images processed by the technical solution protected by this application show that the algorithm improves the visual display effect of the image, making the image more realistic and the details clearer. The application experiment of an optical cross-image processing shows that the technical solution protected by this application can effectively deal with the underexposure and overexposure problems of the image and restore the details of the overexposed and underexposed areas of the image.

[0089] Fig.11 FIG. 1 is a schematic diagram of the architecture of an image processing device in an embodiment of the present application. Fig.11 As shown, the device 1100 includes a transceiver unit 1101 and a processing unit 1102. The collaborative working process between the various units is as follows:

[0090] The transceiver unit 1101 is used to obtain an original image; the processing unit 1102 is used to divide the original image into at least two sub-images; extract image information from each sub-image, the image information including brightness information within the image and brightness information between the image and other images; and adjust the brightness of the original image according to the image information in each sub-image.

[0091] In one implementation, the processing unit 1102 is further configured to input the original image into a bilateral filtering algorithm to obtain a smooth original image with reduced noise.

[0092] In one embodiment, the processing unit 1102 is specifically used to input the original image into the brightness channel of the image brightness-chrominance color space to obtain at least two brightness levels of the original image, each brightness level is divided according to the brightness value; merge the areas of the same brightness level in the original image to obtain the at least two sub-images.

[0093] In one embodiment, the processing unit 1102 is further used to determine the brightness difference value within each sub-image and the brightness difference value at the edge between two adjacent sub-images; when the brightness difference value at the edge between the two adjacent sub-images is not greater than the brightness difference value inside each of the two adjacent sub-images, the two adjacent sub-images belonging to the building are merged into one sub-image.

[0094] In one implementation, the processing unit 1102 is specifically configured to input the at least two sub-images into a Canny edge operator algorithm to obtain image edge brightness information within each sub-image.

[0095] In one embodiment, when the original image is an underexposed image, the processing unit 1102 is further used to input the at least two sub-images into a gamma transform algorithm to increase the grayscale values ​​of the two sub-images; when the original image is an overexposed image, the processing unit is further used to input the at least two sub-images into a gamma transform algorithm to reduce the grayscale values ​​of the two sub-images.

[0096] In one embodiment, the processing unit 1102 is specifically used to input the original image into a Markov random field energy function to calculate the number of sub-images; input the at least two sub-images and the number of sub-images into a particle swarm optimization algorithm to calculate the average brightness value of each sub-image; and calculate the brightness change of each sub-image based on the brightness level interval difference corresponding to each sub-image and the average brightness value of each sub-image.

[0097] In one implementation, the processing unit 1102 is specifically configured to input the brightness variation of each sub-image into a least square method to calculate a global mapping curve of the original image; and adjust the brightness of the original image according to the global mapping curve of the original image.

[0098] In one implementation, the processing unit 1102 is specifically configured to adjust the brightness L channel of the original image in the hue, saturation and brightness HSL channel of the image.

[0099] Fig.12 Schematic diagram of the architecture of a terminal device provided in an embodiment of the present application. Fig.12 As shown, the terminal device 1200 includes a transceiver 1201, a memory 1202, a processor 1203 and a bus 1204. The transceiver 1201, the memory 1202 and the processor 1203 are respectively connected to each other through the bus 1204 to achieve mutual communication.

[0100] Among them, the transceiver 1201 can realize the input (reception) and output (transmission) of signals. For example, the transceiver 1201 may include a transceiver or a radio frequency chip. The transceiver 1201 may also include a communication interface. Exemplarily, the terminal device 1200 can receive control instructions sent by external devices such as mobile phones, cameras, webcams, and clouds through the transceiver 1201, and can also send execution instructions to other devices through the transceiver 1201.

[0101] The memory 1202 may store a program (which may also be an instruction or code), which may be executed by the processor 1202, so that the processor 1203 executes Figure 1-Figure 10 The functions shown. Optionally, data may also be stored in the memory 1202. For example, the processor 1203 may read data stored in the memory 1202, and the data may be stored at the same storage address as the program, or the data may be stored at a different storage address than the program. In this solution, the processor 1203 and the memory 1202 may be provided separately or integrated together, for example, integrated on a single board or a system on chip (SOC).

[0102] The processor 1203 may be a general-purpose processor or a special-purpose processor. For example, the processor 1203 may include a central processing unit (CPU) and / or a baseband processor.

[0103] Exemplarily, the specific working process of processor 1203 can be divided into: input image, image segmentation, information extraction within image region and interval information extraction, brightness value estimation between regions, brightness level change statistics, brightness level change curve fitting, detail adjustment, and output image. Among them, the image segmentation divides the entire image into multiple sub-regions for analysis and processing, and the pixels in these sub-regions should have brightness values ​​as close as possible; the information extraction within image regions and the information extraction between regions are to achieve information enhancement within the segmented regions, obtain detail increments within the regions, and obtain the contrast relationship between regions by the difference between the average brightness values ​​of each region after image segmentation and its adjacent regions; the regional brightness value estimation needs to re-estimate the new optimal average brightness value of all regions, so that the brightness value of the region is as close to 0.5 as possible, and the optimal brightness average value is obtained; the brightness level change statistics obtain the variables of each brightness level by counting the brightness changes of each region within 10 brightness levels of the image; the brightness level change curve fitting uses the least squares method to fit the data points of brightness level changes to obtain the brightness change curve of the entire image, and after obtaining the global mapping curve of the image, the image is adjusted according to the curve to obtain the output image.

[0104] Exemplarily, the processor 1203 can divide the image into several regions based on the dissimilarity between pixels. Before segmenting the image, bilateral filtering is used to smooth the image and reduce the interference of noise on the segmentation effect, while considering the spatial information and grayscale similarity, so as to achieve the effect of smoothing the image and retaining the edge.

[0105] Exemplarily, the processor 1203 mainly applies gamma transform and Canny edge operator to process the image in information area extraction, obtains a good image by adjusting gamma transform (or) for underexposure and overexposure, and then applies Canny edge operator to extract image edges.

[0106] Exemplarily, in terms of regional brightness value estimation, the processor 1203 mainly uses the Markov random field energy function to solve the number of regions after image segmentation, and then uses the particle swarm optimization method to solve the optimal average brightness value of the region.

[0107] Exemplarily, processor 1203 obtains the change in brightness level by counting the brightness change in each area within 10 brightness levels of the image, and the change in regional brightness is the difference between the initial average brightness value of the area and the optimal average brightness value of the area after re-evaluation.

[0108] Exemplarily, in terms of brightness level change curve fitting, the processor 1203 fits the brightness level change curve of the image through the least square method to obtain the global mapping curve of the image. When adjusting the image according to the curve, the L channel is adjusted separately in the HSL channel of the image, where the L channel is brightness.

[0109] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 1100. In other embodiments of the present application, the terminal device 1100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0110] The present application also provides a terminal device in an embodiment. The terminal device includes a processor. The processor can execute the following steps: Figure 1-Figure 10 And the technical scheme corresponding to the above protection makes the terminal device have the technical effect of the technical scheme corresponding to the above protection.

[0111] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer executes the above Figure 1-Figure 10 and any method described in the corresponding description.

[0112] In an embodiment of the present application, a computer program product is also provided, wherein the computer program product stores instructions, and when the instructions are executed by a computer, the computer implements the above Figure 1-Figure 10 and any method described in the corresponding description.

[0113] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0114] In addition, various aspects or features of the embodiments of the present application can be implemented as methods, devices or products using standard programming and / or engineering techniques. The term "product" used in this application covers computer programs that can be accessed from any computer-readable device, carrier or medium. For example, computer-readable media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks or tapes, etc.), optical disks (e.g., compact discs (CDs), digital versatile discs (DVDs), etc.), smart cards and flash memory devices (e.g., erasable programmable read-only memory (EPROM), cards, sticks or key drives, etc.). In addition, the various storage media described herein may represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing and / or carrying instructions and / or data.

[0115] In the above embodiment, Fig.11The window management device 1100 in the embodiment can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0116] It should be understood that in various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0117] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0118] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0120] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or an access network device, etc.) to perform all or part of the steps of the method described in each embodiment of the embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0121] The above is only a specific implementation of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited to this. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application.

Claims

1. An image processing method, characterized in that: include: Get the original image; Splitting the original image into at least two sub-images; Extracting image information from each sub-image, wherein the image information includes brightness information within the image and brightness information between the image and other images; According to the image information in each sub-image, the brightness of the original image is adjusted; The extracting of image information from each sub-image includes: Inputting the original image into a Markov random field energy function to calculate the number of sub-images; Inputting the at least two sub-images and the number of the sub-images into a particle swarm optimization algorithm to calculate an average brightness value of each sub-image; Calculating the brightness variation of each sub-image according to the brightness level interval difference corresponding to each sub-image and the average brightness value of each sub-image; The step of adjusting the brightness of the original image according to the image information in each sub-image includes: Inputting the brightness variation of each sub-image into the least square method to calculate the global mapping curve of the original image; The brightness of the original image is adjusted according to the global mapping curve of the original image.

2. The method according to claim 1, characterized in that Before dividing the original image into at least two sub-images, the method further includes: The original image is input into a bilateral filtering algorithm to obtain a smooth original image with reduced noise.

3. The method according to claim 1 or 2, characterized in that: The step of dividing the original image into at least two sub-images comprises: Inputting the original image into a brightness channel of an image brightness-chrominance color space to obtain at least two brightness levels of the original image, each brightness level being divided according to a brightness value; Regions with the same brightness level in the original image are merged to obtain the at least two sub-images.

4. The method according to claim 3, characterized in that Also includes: Determine the brightness difference value within each sub-image and the brightness difference value at the edge between two adjacent sub-images; When the brightness difference value at the edge between the two adjacent sub-images is not greater than the brightness difference value inside each of the two adjacent sub-images, the two adjacent sub-images are merged into one sub-image.

5. The method according to claim 4, characterized in that The extracting of image information from each sub-image includes: The at least two sub-images are input into a Canny edge operator algorithm to obtain image edge brightness information within each sub-image.

6. The method according to claim 1, characterized in that The adjusting the brightness of the original image includes: The original image is adjusted in the brightness L channel of the HSL channel of the image.

7. An image processing device, characterized in that: include: at least one transceiver, at least one memory, At least one processor, wherein the processor is configured to execute instructions stored in the memory to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Enhancement of images for display on liquid crystal displays

    CN102726036A

  • Image exposure compensation method and device, and computer-readable storage medium

    CN107172364A