WO2020173320A1 - 一种图像增强方法、装置及存储介质 - Google Patents

一种图像增强方法、装置及存储介质 Download PDF

Info

Publication number
WO2020173320A1
WO2020173320A1 PCT/CN2020/075472 CN2020075472W WO2020173320A1 WO 2020173320 A1 WO2020173320 A1 WO 2020173320A1 CN 2020075472 W CN2020075472 W CN 2020075472W WO 2020173320 A1 WO2020173320 A1 WO 2020173320A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
original image
original
enhanced
training
Prior art date
Application number
PCT/CN2020/075472
Other languages
English (en)
French (fr)
Inventor
王瑞星
陶鑫
沈小勇
贾佳亚
戴宇荣
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2020173320A1 publication Critical patent/WO2020173320A1/zh
Priority to US17/324,336 priority Critical patent/US11790497B2/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4046Scaling of whole images or parts thereof, e.g. expanding or contracting using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/60Image enhancement or restoration using machine learning, e.g. neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Definitions

  • Image enhancement method device and storage medium
  • This application relates to the field of image processing, and in particular to an image enhancement method, device, and storage medium. Background of the invention
  • the current method for image enhancement is to train the network model from the original image to the labeled image to obtain a network model that can enhance the image, but the efficiency of training the network model in this way is low.
  • the embodiments of the present application provide an image enhancement method, device, and storage medium, which can improve the efficiency of image enhancement.
  • an image enhancement method including:
  • the resolution is the same as the resolution of the original image;
  • an image enhancement device including:
  • a feature synthesis module configured to perform synthesis processing on the features of the original image to obtain a first illumination map corresponding to the original image, where the resolution of the first illumination map is lower than the resolution of the original image;
  • a zero-radiation relationship acquisition module configured to acquire a mapping relationship for mapping an image into a second illumination map based on the first illumination map
  • a mapping module configured to perform a mapping process on the original image based on the mapping relationship to obtain a second light map, where the resolution of the second light map is the same as the resolution of the original image;
  • An image enhancement module configured to perform image enhancement processing on the original image according to the second illumination map, Get the target image.
  • a storage medium shared by the embodiments of the present application has a computer program stored thereon, and when the computer program runs on a computer, the computer is caused to execute the image enhancement method provided in any embodiment of the present application.
  • the embodiment of the application obtains the original image, performs synthesis processing on the features of the original image, and obtains the first illumination map corresponding to the original image.
  • the resolution of the first illumination map is lower than that of the original image.
  • the original image is mapped based on the mapping relationship to obtain the second light map.
  • the resolution of the second light map is the same as the resolution of the original image.
  • the original image undergoes image enhancement processing to obtain the target image. This solution can improve the efficiency of image enhancement.
  • Fig. 1 is a schematic diagram of an application scenario of an image enhancement method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of the first charging process of the image enhancement method provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of the second charging process of the image enhancement method provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of the third charging process of the image enhancement method provided by an embodiment of the present application.
  • Fig. 5 is a second illumination diagram provided by an embodiment of the present application.
  • Fig. 6 is a schematic diagram of a convolutional network structure provided by an embodiment of the present application.
  • Fig. 7 is a schematic diagram of image enhancement charging provided by an embodiment of the present application.
  • Fig. 8 is a schematic diagram of input and output of an image enhancement method provided by an embodiment of the present application.
  • Fig. 9 is a schematic diagram of the first experimental result provided by the embodiment of the present application.
  • FIG. 10 is a schematic diagram of the second experiment result provided by the embodiment of the present application.
  • FIG. 11 is a schematic diagram of the third experiment result provided by the embodiment of the present application.
  • FIG. 12 is a schematic diagram of the fourth experiment result provided by the embodiment of the present application.
  • FIG. 13 is a schematic diagram of the fifth experiment result provided by the embodiment of the present application.
  • FIG. 14 is a schematic diagram of the sixth experiment result provided by the embodiment of the present application.
  • FIG. 15 is a schematic diagram of the first structure of the image enhancement device provided by an embodiment of the present application.
  • FIG. 16 is a schematic diagram of the second structure of the image intensifying device provided by an embodiment of the present application.
  • Figure 17 is a schematic diagram of a network device provided by an embodiment of the present application. Ways to implement the invention
  • the computer execution referred to herein includes the operation of a computer processing unit that represents an electronic signal of data in a structured form. This operation converts the data or maintains it in a position in the computer's memory system, which can be reconfigured or otherwise changed in a manner well known to testers in the art to change the operation of the computer.
  • the data structure maintained by the data is the physical location of the memory, which has specific characteristics defined by the data format.
  • Testers in the field will understand that the various steps and operations described below can also be implemented in hardware.
  • module used in this article can be regarded as a software object executed on the operating system.
  • the different components, modules, engines, and services described in this article can be regarded as implementation objects on the computing system.
  • the devices and methods described herein can be implemented in software, and of course they can also be implemented on hardware, and they all fall within the protection scope of this application.
  • the embodiment of the application provides an image enhancement method
  • the execution subject of the image enhancement method may be the image enhancement device provided in the embodiment of the application, or a network device integrated with the image enhancement device, wherein the image enhancement device may use hardware or Realized by software.
  • the network device may be a device such as a smart phone, a tablet computer, a palmtop computer, a notebook computer, or a desktop computer.
  • FIG. 1 is a schematic diagram of an application scenario of an image enhancement method provided by an embodiment of the application.
  • Figure 1 takes the image enhancement device integrated in the network device as an example.
  • the network device can obtain the original image, perform synthesis processing on the features of the original image, and obtain the first light map corresponding to the original image, and the resolution of the first light map is lower than that of the original image Resolution, based on the first light map, acquiring a mapping relationship for mapping the image to a second light map, and performing a mapping process on the original image based on the mapping relationship to obtain the second light map.
  • the resolution of the second light map and the original image The resolution is the same, and the original image is image-enhanced according to the second illumination map to obtain the target image.
  • FIG. 2 is a schematic flowchart of an image enhancement method provided by an embodiment of the application. Please refer to FIG. 2, the image enhancement method provided by the embodiment of the present application may be as follows.
  • the original image is an image that needs image enhancement.
  • the original image can be an image obtained in a variety of shooting situations.
  • the original image may include a normally exposed image, an underexposed image, an under-lighted image, or a backlit image during shooting.
  • the content included in the original image may not be limited.
  • the image enhancement method can perform image enhancement on the original image in a variety of shooting situations, and is not limited to image enhancement on the normally exposed image, thereby expanding the application scope of the image enhancement method.
  • the driving image can be obtained from the local storage, or the original image can be obtained from the network side device, and so on.
  • the currently captured image may be selected as the original image.
  • an image shooting interface such as an image preview interface
  • the image displayed on the current interface can be intercepted as the original image, and so on.
  • the original image may also be obtained from a local or external storage unit.
  • the original image can also be obtained from the local image database.
  • image enhancement can be used to enhance the useful information in the image to realize the application of the image and improve the visual effect of the image accordingly.
  • Image enhancement can make the original unclear image clear by purposefully emphasizing the overall or local features of the image; or, by emphasizing certain features of interest, to enlarge the difference between the features of different objects in the image; or By suppressing uninteresting features, improving image quality, enriching image information, and enhancing image interpretation and recognition effects, so as to meet the needs of some special analysis situations.
  • the illumination map is the shadow map after the decomposition of the intrinsic image.
  • the intrinsic image includes the reflection image and the illumination image obtained after decomposing the original image.
  • the illumination map is an image that reflects the lighting conditions of the original image, and the reflection map refers to the part of the image that can remain unchanged under changing lighting conditions, that is, the original image after removing the highlights.
  • the resolution of the first illumination map is lower than the resolution of the original image.
  • the first light map may be an image form of the light map at one resolution.
  • the first light map may be a light map with a resolution lower than that of the original image, for example, the first light map may be a low-resolution light map.
  • the image resolution represents the amount of information stored in the image, and the image resolution can be represented by the number of pixels per inch of the image.
  • the network model obtained by regression learning from the original image to the labeled image is usually used for image enhancement.
  • image enhancement Since the current deep learning method is used to enhance the image, the network model obtained by regression learning from the original image to the labeled image is usually used for image enhancement.
  • Such a method will make the learning efficiency of the network model low.
  • the robustness is not strong, and there are also defects in image contrast.
  • the image enhancement network model obtained by performing regression learning from the original image to the illumination map may be used to perform the image enhancement operation.
  • the image enhancement network model obtained by regression learning from the original image to the illumination map has high learning efficiency and strong robustness of the network model, and it is easy to perform more advanced operations on the image.
  • the image enhancement method can be applied to the image enhancement network model.
  • the image enhancement network model uses the mapping relationship between the original image and the light map instead of the mapping relationship between the original image and the annotated image.
  • the advantage of this method is that the mapping between the original image and the light map usually has a relatively simple form and a known prior. Therefore, the image enhancement network model has a strong generalization ability, and can effectively process the original images acquired under complex photography conditions in different situations.
  • the first illumination map corresponding to the original image can be obtained through feature synthesis. For example, it is possible to first extract the features of the original image, and perform feature synthesis on the extracted features to generate the first illumination map.
  • the feature extraction of the original image may be performed through a network structure including a convolution operation.
  • the method of adjusting the distribution curve of the image histogram is usually adopted to enhance the image globally, but this method will cause local problems such as over-brightness, over-exposure, and over-darkness, and the generated image color Not very bright.
  • the step of "compositing features of the original image to obtain a first illumination map corresponding to the original image” may include:
  • a convolutional network is a network structure that can extract features of an image, for example, in a convolutional network It can include a convolutional layer, and the convolutional layer can extract image features through convolution operations.
  • the local feature of the image is the local expression of the image feature, and the local feature of the image can reflect the local characteristics of the image.
  • the local features of an image can include contrast, detail definition, shadow and high
  • the global features of the image can represent the overall features of the image, and the global features are relative to the local features, and can be used to describe the overall features such as the color and shape of the image or the target.
  • the global characteristics of an image can include color distribution, average brightness, scene category, and so on.
  • the original image can be input into the convolutional network to extract the local features and global features of the original image, and then the extracted local features and global features are combined to obtain the first illumination map.
  • a network model can be used to extract image features.
  • the step of "extracting local features and global features of the original image based on a convolutional network” may include:
  • the convolutional network may include a primary feature extraction network, a local feature extraction network, and a global feature extraction network.
  • the local feature extraction network and the global feature extraction network are connected in parallel and connected in series with the primary feature extraction network.
  • the primary feature extraction network is a network model that can extract primary features of the original image.
  • the primary feature extraction network can include a pre-trained VGG16 network model.
  • the VGG16 network model can include a 16-layer structure.
  • the VGG16 network model can include a convolutional eyebrow, a fully connected layer, a pooling layer, and so on.
  • the original image may be convolved based on the pre-trained VGG16 network model to extract the primary features of the original image.
  • the original image can be input into the VGG16 network model, and the convolution operation can be performed through the convolution layer.
  • the convolution operation can be performed through the convolution layer.
  • a new matrix is generated. After that, the size of the parameter matrix is reduced through the pooling layer, thereby reducing the number of parameters in the final fully connected layer.
  • the primary features of the original image are extracted.
  • the local feature extraction network is a network model that can extract local features of an image, for example, local
  • the feature extraction network may include two convolutional layers, and the convolutional layer may be used to extract local features.
  • the global feature extraction network is a network model that can extract global features.
  • the global feature extraction network can include a two-layer convolutional layer and a three-layer fully connected layer, and the convolutional layer can be used for global feature extraction.
  • the original image can be input into the primary feature extraction network to extract the primary features of the original image.
  • the primary features are input into the parallel local feature extraction network and global feature extraction network at the same time, and the local features and global features are extracted.
  • the resolution of the image can be converted by downsampling.
  • the step of "compositing features of the original image to obtain a first illumination map corresponding to the original image” may include:
  • the image can be reduced by down-sampling the image so that the image fits the size of the display area, and a thumbnail of the corresponding image is generated.
  • a down-sampling operation is performed on the image by s times, and a low-resolution image with a size of (m/s) * (n/s) can be obtained.
  • s should be the common divisor of m and n.
  • the down-sampling of the image is to turn the image pixel in the s*s window into an image pixel.
  • the value of this pixel can be the average value of all image pixels in the s*s window, and the value of the pixel can also be obtained by other calculation methods according to the actual situation, and so on.
  • a matrix with a preset size s*s can be obtained from a matrix formed by pixels of the original image, and then a pixel in the preset size matrix can be converted into a pixel.
  • This pixel can be obtained according to a preset rule, for example, this pixel can be the average value of all pixels in a matrix of preset sizes.
  • the resolution of the second light map is the same as the resolution of the original image.
  • the second light map may be an image form of the light map at one resolution.
  • the second lighting map may be a lighting map with the same resolution as the original image resolution, for example, the second lighting map may be called the original resolution lighting map.
  • the mapping relationship may map the image to a light map, for example, the original image may be mapped to the second light map through the mapping relationship.
  • the mapping relationship may be a matrix mapping relationship or a mapping transformation matrix. The map can be mapped to a map through this mapping relationship.
  • the original image can be mapped according to the mapping transformation matrix. Transform to get the second light map.
  • the mapping relationship can be obtained based on the first illumination map.
  • a bilateral grid can be used, based on the first illumination Figure to get the mapping relationship.
  • the step "obtain a mapping relationship based on the first illumination map” may include:
  • the bilateral grid is a way of sampling the spatial domain and brightness domain of the image and dividing it into grids.
  • the bilateral in the bilateral grid refers to space and brightness. After the discrete processing, the coordinates and brightness information of each point in the image are rounded to the corresponding grid. Through filtering and other processing in the grid, and then interpolating through the up-sampling method, the processed image can be obtained.
  • the pixels of the first illumination map may be sampled in the spatial domain and the value domain to obtain the sampled pixels, and then the position of the corresponding pixel in the grid is found, and the grid difference operation is performed to obtain the mapping transformation matrix.
  • the step of "obtaining a mapping relationship for mapping an image to a second light map based on the first light map” may include: using preset training images and sample enhancements corresponding to the training images Image to obtain the mapping relationship such that the loss information between the predicted enhanced image corresponding to the training image and the sample enhanced image meets a preset condition; wherein, the predicted enhanced image uses the mapping relationship to compare the training image The enhanced image obtained by the mapping process.
  • the loss information may be at least one of contrast loss information, smoothness loss information, and color loss information.
  • the contrast loss information can be obtained by calculating the Euclidean distance between the predicted enhanced image and the sample enhanced image, or can be obtained by calculating the Euclidean distance between the training image and the restored image.
  • the restored image refers to the use of
  • the mapping relationship is an image obtained by performing inverse mapping (that is, removing the enhancement effect) on the sample enhanced image.
  • the smoothness loss information may be obtained by summing the spatial variation (for example, the variation in each direction of the space) of the values of the three color channels at each pixel of the mapping relationship.
  • the color loss information can be obtained by summing the similarity between the color vectors of each pixel in the predicted enhanced image and the sample enhanced image.
  • the color vector is a vector that uses the color components of pixels (for example, R, G, and B components).
  • the original image can be mapped through a bilateral grid.
  • the step of "mapping the original image based on the mapping relationship to obtain a second illumination map” may include: Performing a mapping process on the original image based on the mapping relationship to obtain a mapped image; and up-sampling the mapped image to obtain a second illumination map.
  • the principle of bilateral grid upsampling is to select a reference image, sample the pixels in any space of the reference image in spatial and value domain, and then find its position in the grid, and realize the unknown through the method of trilinear interpolation. Calculation of the brightness value of the range.
  • the mapping transformation matrix can be obtained according to the first illumination map, and then the original image can be mapped through the mapping transformation matrix to obtain the mapped image, which is An image with a lower resolution than the original image.
  • a bilateral grid upsampling operation can be performed on the mapped image, and on the basis of the mapped image pixels, a suitable interpolation algorithm is used to insert new elements between the pixels to obtain the second illumination map.
  • the target image may be an image obtained after image enhancement.
  • the problem of image enhancement can be regarded as a problem of finding the mapping relationship between the original image and the target image.
  • the mapping function F can be expressed by the following formula:
  • S can be used to represent the matrix corresponding to the second illumination image
  • / to represent the matrix corresponding to the target image
  • I can be used to represent the matrix corresponding to the original image.
  • the target image can be obtained through the original image and the second light map.
  • the target image can be obtained as follows:
  • the image enhancement method may further include a training process of an image enhancement network model. Such as As shown in FIG. 3, the image enhancement method may further include the following process.
  • the training image may be an image applied by the network model in the training process, and the training image includes a sample enhanced image.
  • the sample enhanced image is an annotation related to image enhancement performed on the training image.
  • training images can be obtained from local storage, or training images can be obtained from network-side devices, and training images can also be obtained by shooting with a shooting device.
  • the training image After strong, the sample enhanced image is obtained; the training image can also be annotated by the expert, and the sample enhanced image can be obtained.
  • the predicted enhanced image may be an image obtained after the training image is enhanced by the network model. There may be a certain difference between the predicted enhanced image and the real sample enhanced image, but this difference can be reduced by training the network model.
  • the training image can be input into the image enhancement network model, and the predicted enhancement image corresponding to the training image can be obtained.
  • the image enhancement method of the training image through the image enhancement network model is the same as the image enhancement method of the original image through the image enhancement network model, which has been described above and will not be repeated here.
  • the training image can be randomly cropped into multiple 512x512 size images to increase the diversity of the samples.
  • Training images can include images of various shooting situations, such as images of normal exposure, underexposure, insufficient light, or backlight, etc.
  • the network model trained based on such training images can adapt to different actual shooting situations. image.
  • a standard condition data set and a special condition data set can be acquired, and a training image including multiple shooting types can be constructed according to the standard condition data set and the special condition data set.
  • the standard condition data set is a data set that includes normal exposure images.
  • the standard condition data set can be MIT-Adobe Five K Dataset.
  • the standard condition data set includes multiple original images taken by a group of different photographers with SLR cameras. Format images, which means that all the information recorded by the camera sensor will be saved. These images cover a wide range of scenes, subjects, and lighting conditions. Afterwards, the captured images were retouched with software specially used to adjust the images, so as to obtain the standard condition data set.
  • the standard condition data set may use the MIT-Adobe Five K Dataset, and the annotation of the training samples in the data set may be the annotation of expert C.
  • the standard condition data set since the creation of the standard condition data set is mainly to enhance general images, rather than underexposed images, the standard condition data set only includes very small -Part (about 4%) of unexposed images, so the standard condition data set lacks special shooting conditions, such as images taken at night and images obtained under uneven lighting conditions. In order to increase the diversity of samples, special condition data sets can also be imported.
  • the special condition data set is a data set that includes abnormally exposed images.
  • the special condition data set may include images acquired under special shooting conditions such as underexposure, insufficient light, and backlight, and so on.
  • This special condition data set can include various shooting situations, scenes, themes and styles.
  • the training of the network model based on the cut-and-shoot images constructed based on the standard condition data set and the special condition data set can make the trained network model adapt to various shooting situations, thereby improving the accuracy of image enhancement.
  • the loss information may include one or more of contrast loss information, color loss information, and smoothness loss information.
  • the loss information may represent the difference between the predicted enhanced image and the sample enhanced image. This difference can be measured by the network The training of the model is reduced.
  • the loss function can be used to estimate the degree of inconsistency between the predicted value of the network model and the true value.
  • the loss information between the predicted enhanced image and the sample enhanced image can be obtained through the target loss function.
  • the loss information can be the difference between the predicted enhanced image and the sample enhanced image, which is determined by the network model. Training can reduce this loss of information.
  • the target loss function can be flexibly set according to actual application requirements.
  • the image is usually enhanced by adjusting the illumination map of the image and performing local smoothing optimization operations of the illumination map.
  • this method will cause some halo artifacts and partial overexposure of the image, resulting in excessive image enhancement.
  • a target loss function may be designed, and the target loss function may include one or more of a reconstruction loss function, a local smoothing loss function, and a color loss function.
  • the image enhancement method may further include:
  • the sample enhanced image is an enhanced image corresponding to the training image
  • the predicted enhanced image and the sample enhanced image are converged to obtain a trained image enhancement network model.
  • the reconstruction loss function can obtain the contrast loss information of the image.
  • the reconstruction loss function can be obtained by measuring the Euclidean distance error. That is, the Euclidean distance between the predicted enhanced image generated by the image enhancement network model and the sample enhanced image marked by the expert is calculated.
  • Euclidean distance is the straight line distance between two points in Euclidean space.
  • the reconstruction loss function may be obtained according to the Euclidean distance error metric.
  • S can be used to indicate the original resolution illumination map matrix corresponding to the predicted enhanced image, 7/ to indicate the sample enhancement image, and 7 ⁇ to indicate the training image, and the original resolution illumination map matrix S corresponding to the enhanced image can be predicted and sample enhancement image Multiply, calculate the Euclidean distance error metric with the training image 7 ⁇ to obtain the reconstruction loss function.
  • Reconstruction loss function The formula can be as follows:
  • the multi-channel illumination range can be PU 1 , and all pixel channels of the sample enhanced image ⁇ and the training image 7 are standardized to [0,1].
  • # ⁇ represents the channel of pixel color, which can include RGB (red, green and blue) three pixel color channels. Due to You can set ⁇ as the lower limit of S to ensure that all color channels of 7 ⁇ after image enhancement have 1 as the upper limit, so as to prevent colors from exceeding the color gamut. Setting 1 as the upper limit of S can avoid erroneously darkening the underexposed area.
  • the constraint range of the illumination map in the reconstruction loss function can also be adjusted to meet the actual requirements of different situations. For example, you can also add different constraints to S to adjust the brightness of the image, the vividness of the image, and so on.
  • the obtained enhanced image can be made clearer and the image contrast can be better.
  • the objective function only includes the reconstruction loss function, and there is still the risk of not being able to correctly generate image contrast details and image accurate colors.
  • a local smoothing loss function can also be added to the target loss function to improve the accuracy of image enhancement.
  • the image enhancement method may further include:
  • image enhancement is usually performed by adjusting the histogram distribution curve of the image and local smoothing of the light map of the optimized image.
  • this type of method usually uses a single-channel light map for image enhancement, which will lead to image enhancement. There is deviation in the color control, and there is a lack of image color enhancement.
  • the RGB three channels of the image can be optimized at the same time, and the learning ability of the network model can be used to learn the light map to improve the accuracy of image enhancement.
  • the local smoothing loss function can obtain the smoothness loss information of the image, and the local smoothing loss function can be obtained by summing the three channels of image pixels.
  • the local smoothing loss function can be obtained by summing the three channels of image pixels.
  • P can be used to represent the image pixel
  • S can be used to represent the illumination map.
  • the calculation formula of the local smoothing loss function ⁇ can be as follows:
  • the three channels of the pixel can be summed to obtain the local smooth loss function 4, and the partial derivative of the horizontal and vertical directions of the image space can be represented by and, using ⁇ and Represents the smoothness weight of the three-channel spatial change of the pixel,
  • the calculation formula can be as follows:
  • is the logarithmic image of the training image
  • a constant usually set to 0.0001 to prevent division by zero.
  • using the local smoothing loss function to train the network model can reduce overfitting, improve the generalization ability of the network model, and restore good image contrast and clearer details in the image.
  • the Euclidean distance measurement can only measure the color difference numerically, and cannot guarantee that the color vector directions are consistent, which may cause obvious The colors do not match.
  • a color loss function can also be introduced.
  • the image enhancement method may further include:
  • the predicted enhanced image and the sample enhanced image are converged to obtain To the image enhancement network model after training.
  • the color loss function can obtain the color loss information of the image.
  • the color loss function can be obtained by calculating the vector angle formed by the three channels of the image pixels.
  • the color loss function can be obtained by the angle of the vector formed by the three channels of image pixels.
  • the color loss function can be used to make the predicted enhanced image obtained through the network model correspond to the color between the sample enhanced image.
  • the RGB value of the image can be regarded as a spatial vector, so as to calculate the angle between the predicted enhanced image and the corresponding color channel vector of the sample enhanced image. The smaller the angle, the closer the directions between the vectors.
  • (/ ⁇ ) may be used to represent the predicted enhanced image
  • the sample enhanced image may be used to represent the image.
  • the calculation formula of the color loss function may be as follows:
  • the objective loss function may include a reconstruction loss function, a local smoothing loss function, and a color loss function.
  • may be used to represent the reconstruction loss function
  • may be used to represent the local smoothing loss function
  • may be used to represent the color loss function.
  • L represents the objective loss function.
  • the weight of the reconstruction loss function in training can be used
  • is used to represent the weight of the local smooth loss function in training
  • % is used to represent the weight of the color loss function in training.
  • the calculation formula of the objective loss function can be as follows:
  • the predicted enhanced image and the sample enhanced image can be converged based on the loss information, and a trained image enhancement network model can be obtained.
  • a loss function may be used to converge the predicted enhanced image and the sample enhanced image, and the error between the predicted enhanced image and the sample enhanced image may be reduced by P, and continuous training may be performed to adjust the weight to a suitable value. Numerical value, you can get the image enhancement network model after training.
  • Training the network model through the image enhancement method, and using the trained network model to enhance the image can speed up the network operation, improve the efficiency of image enhancement, without compromising the effect of enhancement, and improve the accuracy of image enhancement.
  • the network model trained by the above-mentioned method can implement the customization of the image enhancement effect by restricting the illumination. For example, the contrast can be enhanced by enhancing the local smooth lighting, the preferred exposure level can be set by limiting the light size, and so on.
  • the image enhancement method can also adjust the constraints on the light map in the loss function, so that the user can adjust the image according to personal preferences, such as the brightness of the image, the vividness of the colors in the image, and so on.
  • the image enhancement method may also add image denoising processing and supplementary generation processing for completely missing details of the image to obtain an image with better enhancement effect.
  • the image enhancement method can be widely used in various shooting conditions, and the image enhancement method can be used to enhance the image that is insufficiently dark in the daytime, the image captured in the backlight, or the original image at night. You can also solve the problem of uneven lighting when taking photos.
  • the original image can be input, and the enhanced target image can be directly obtained through the image enhancement method.
  • image enhancement processing can also be performed in real time. Therefore, the image enhancement method can also be extended to image enhancement for images in the moving area.
  • the image enhancement method can generate high-quality images.
  • the enhanced images are specifically expressed in image details, obvious contrast, moderate exposure, and no partial overexposure or overdarkness. At the same time, the color of the image is more vivid and beautiful.
  • This image enhancement method can process images of different pixels, for example, it can enhance the 1080P size image in real time, and it can also process the 4k resolution image taken by the SLR camera.
  • the image enhancement method of the present application is compared with five latest image enhancement methods for accuracy rate.
  • the five latest image enhancement methods include the image enhancement method based on Retinex JieP and the image enhancement method based on deep learning. HDRNet, DPE, White-Box and Distort-and-Recover.
  • the recommended parameters are used for public experiments, and the image enhancement results are obtained respectively.
  • the four deep learning-based image enhancement methods are retrained on the special condition data set and the standard condition data set. Experimental results show that the correct rate of the image enhancement method of this application is about three times that of other methods.
  • a visual comparison between the image enhancement method of this application and other image enhancement methods is also performed.
  • Two special images are used for visual comparison, one of which is an unevenly exposed image, which includes imperceptible windmill details (the image comes from a special condition data set), and the other is an overall low-light image.
  • the image includes a small amount of portrait details (the image comes from the standard condition data set).
  • visual comparison is performed.
  • the comparison result shows that the image enhancement method of the present application can restore more details in the foreground and background, and obtain better contrast, without significantly sacrificing overexposed or underexposed parts of the image.
  • the image enhancement method of the present application can display more vivid and natural colors, so that the image effect after image enhancement is more realistic.
  • PSNR Peak Signal to Noise Ratio
  • SSIM structural similarity index, structural similarity
  • the image enhancement method of this application is superior to other image enhancement methods, indicating that the image enhancement method of this application is not only applicable to special condition data sets, but also can be extended to U MIT-Adobe Five K Dataset data set.
  • the image enhancement method of the application is Map mapping is better than learning image-to-image mapping.
  • the table also shows the different types of loss functions and the improvement of the results, which proves the role of each loss function.
  • the embodiment of the present application obtains the original image, performs synthesis processing on the features of the original image, and obtains the first illumination map corresponding to the original image.
  • the resolution of the first illumination map is lower than the resolution of the original image, based on the first illumination Figure, acquiring a mapping relationship used to map an image into a second light map, and performing a mapping process on the original image based on the mapping relationship to obtain a second light map.
  • the resolution of the second light map is the same as the resolution of the original image.
  • This solution uses deep learning for image enhancement, which improves the efficiency and accuracy of image enhancement.
  • the network model required for image enhancement is obtained, which makes the training of the network model easier, the network model is more robust, and is convenient for further operations on the image.
  • three loss functions are designed to improve the accuracy of the enhanced image in terms of color and contrast. And by constraining the illumination map during the network model training process, the image will not be overexposed or overenhanced.
  • the image enhancement device is specifically integrated in a network device as an example for description.
  • the network device obtains an original image.
  • network devices can acquire original images of various shooting situations for image enhancement.
  • the original images can be normally exposed images, underexposed images, under-lighted images, or backlit images during shooting. It is not limited to image enhancement of normally exposed images, which expands the application of image enhancement methods.
  • the network device can obtain the driving image in many ways, for example, the original image can be obtained from local storage, or the original image can be obtained from the network side device, and so on.
  • the network device may also select the currently captured image as the original image when capturing an image through the camera device.
  • the image displayed on the current interface can be intercepted as the original image, and so on.
  • the network device may also obtain the original image from a local or external storage unit; for example, it may also obtain the original image from a local image database.
  • the network device performs synthesis processing on the features of the original image to obtain a low-resolution illumination map corresponding to the original image.
  • the network model obtained by regression learning from the original image to the labeled image is usually used for image enhancement.
  • image enhancement Since the current deep learning method is used to enhance the image, the network model obtained by regression learning from the original image to the labeled image is usually used for image enhancement.
  • Such a method will make the learning efficiency of the network model low.
  • the robustness is not strong, and there are also defects in image contrast.
  • the network device can use the image enhancement network model obtained from the original image to the illumination map for regression learning to perform image enhancement operations.
  • the image enhancement network model obtained by using the original image to the illumination map for regression learning has high learning efficiency and strong robustness of the network model, and it is easy to perform further operations on the image.
  • the image enhancement method can be applied to the image enhancement network model.
  • the image enhancement network model uses the mapping relationship between the original image and the light map instead of the mapping relationship between the original image and the annotated image. This way
  • the advantage is that the mapping between the original image and the light map usually has a relatively simple form and a known prior. Therefore, the image enhancement network model has a strong generalization ability, and can effectively process original images acquired under complex photography conditions in different situations.
  • the low-resolution illumination map corresponding to the original image can be obtained through feature synthesis.
  • the network device can first extract the features of the original image, and perform feature synthesis on the extracted features to generate a low-resolution illumination map.
  • the method of adjusting the distribution curve of the image histogram is usually adopted to enhance the image globally, but this method will cause problems such as local brightness, overexposure, and overdarkness, and the color of the generated image is not It will be very bright.
  • the network device can input the original image into the convolutional network, extract the local features and global features of the original image, and then perform feature synthesis on the extracted local features and global features to obtain a low-resolution illumination map.
  • a network model can be used to extract image features.
  • the convolutional network may include a primary feature extraction network, a local feature extraction network, and a global feature extraction network.
  • the local feature extraction network and the global feature extraction network are connected in parallel and connected in series with the primary feature extraction network.
  • the network device can input the original image into the primary feature extraction network including the pre-trained VGG16 network structure, extract the primary features of the original image, and then input the primary features into the parallel local feature extraction network and global feature at the same time
  • the extraction network local features and global features are extracted.
  • the local feature extraction network includes two convolutional layers
  • the global feature extraction network includes two convolutional layers and three fully connected layers.
  • the network device can obtain a matrix with a preset size s*s from the matrix formed by the pixels of the original image, and then turn the pixel in the matrix with the preset size into a pixel, which can be processed according to preset rules Obtain, for example, this pixel may be the average value of all pixels in a matrix of a preset size.
  • a down-sampled low-resolution input image can be obtained.
  • the low-resolution input image can be input into a convolutional network for feature extraction, and subsequent steps can be performed. 403.
  • the network device Based on the low-resolution illumination map, the network device obtains a mapping transformation matrix for mapping the image into a second illumination map.
  • the network device can sample the pixels of the low-resolution illumination map in the spatial domain and the value domain to obtain the sampled pixels, and then find the position of the corresponding pixel in the grid, and perform the grid difference operation to obtain the mapping transformation matrix.
  • the network device performs mapping processing on the original image based on the mapping transformation matrix to obtain the original resolution illumination map.
  • the original image can be mapped through a bilateral grid.
  • the network device can obtain the mapping transformation matrix according to the low-resolution illumination map, and then can perform the mapping process on the original image through this mapping relationship to obtain the mapped image.
  • the image is a low-resolution image.
  • a bilateral grid up-sampling operation can be performed on the mapped image.
  • a suitable interpolation algorithm is used to insert new elements between the pixels to obtain the original resolution illumination map.
  • the network device performs image enhancement processing on the original image according to the original resolution illumination map to obtain the target image.
  • the problem of image enhancement can be regarded as a problem of finding the mapping relationship between the original image and the target image.
  • Use/represent the matrix corresponding to the target image use I to represent the matrix corresponding to the original image, and use function F to represent the mapping function between the original image and the target image.
  • the mapping function F can be expressed by the following formula:
  • the network device can obtain the target image through the original image and the original resolution illumination map.
  • the target image is obtained as shown in the following formula:
  • the network device first obtains the original image, and down-samples the original image to obtain a low-resolution input image of 256 ⁇ 256 pixels. Then input the low-resolution input image into the primary feature extraction network including the pre-trained VGG16 network model to extract the primary features of the original image, and then input the primary features into the parallel local feature extraction network and global feature extraction network respectively In, the local feature and the global feature are extracted, and the local feature and the global feature are combined to obtain a low resolution Rate light map. Then, through bilateral grid upsampling, the mapping transformation matrix is obtained, and the original resolution illumination map is obtained according to the mapping transformation matrix. Finally, the target image is obtained through the formula. By enhancing the image in this way, the process of image enhancement can be accelerated, thereby improving the efficiency of image enhancement.
  • the image enhancement method also includes the training process of the image enhancement network model, and the image enhancement method also includes the following process:
  • the network device obtains the predicted enhanced image corresponding to the training image based on the image enhancement network model and the training image.
  • the network device can input the training image into the image enhancement network model to obtain the predicted enhancement image corresponding to the training image.
  • the image enhancement method of the training image is performed through the image enhancement network model and the image enhancement network
  • the image enhancement method of the original image by the model is the same, which has been described above, and will not be repeated here.
  • network equipment can also increase the diversity of training samples by randomly cropping training images.
  • the training image is randomly cropped into multiple 512x512 size images to increase the diversity of samples.
  • Training images can include images of various shooting situations, such as images of normal exposure, underexposure, insufficient light, or backlight, etc.
  • the network model trained based on such training images can adapt to different actual shooting situations. image.
  • a network device can obtain a standard condition data set and a special condition data set, and according to the standard condition data set and the special condition data set, construct a practical image including multiple shooting types.
  • the standard condition data set is a data set that includes normally exposed images.
  • the standard condition data set uses the MIT-Adobe Five K Dataset, and the annotation of the training samples in the data set selects the annotation of expert C.
  • the standard condition data set since the creation of the standard condition data set is mainly to enhance general images, rather than underexposed images, the standard condition data set includes only a small part (about 4%) of unexposed images, so the standard condition data set lacks special shooting Conditional conditions, such as images taken at night and images acquired under non-uniform lighting conditions.
  • special condition data sets are introduced.
  • the special condition data set is a data set that includes abnormally exposed images.
  • the special condition data set may include images acquired under special shooting conditions such as underexposure, insufficient light, and backlight, and so on.
  • This special condition data set can include various shooting situations, scenes, themes and styles.
  • the training of the network model based on the cut-through images constructed based on the standard condition data set and the special condition data set can make the trained network model adapt to various shooting situations, thereby improving the accuracy of image enhancement.
  • the network device obtains loss information between the predicted enhanced image and the sample enhanced image based on the target loss function.
  • the network device can obtain the loss information between the predicted enhanced image and the sample enhanced image through the target loss function.
  • the loss information can be the difference between the predicted enhanced image and the sample enhanced image, which is determined by the network model. Training can reduce this loss of information.
  • the image is usually enhanced by adjusting the illumination map of the image and performing local smoothing optimization operations of the illumination map.
  • this method will cause some halo artifacts and partial overexposure of the image, leading to excessive image enhancement. Therefore, it is possible to design a target loss function including a reconstruction loss function, a local smoothing loss function, and a color loss function. By constraining the illumination map, the image will not be over-exposed and over-enhanced.
  • the objective loss function includes reconstruction loss function, local smoothing loss function, and color loss function.
  • is used to represent reconstruction loss function
  • is used to represent local smoothing loss function
  • is used to represent color loss function
  • L is used to represent Objective loss function.
  • Use ⁇ to represent the weight of the reconstruction loss function in training, use to represent the weight of the local smooth loss function in training, and use to represent the weight of the color loss function in training.
  • the calculation formula of the objective loss function is as follows:
  • the network device uses S to indicate the original resolution illumination map matrix corresponding to the predicted enhanced image, uses the representative sample enhancement image, and uses /; to indicate the training image.
  • the original resolution illumination map matrix S and corresponding to the enhanced image can be predicted by
  • the sample-enhanced image ⁇ is multiplied, and the Euclidean distance error metric with the training image 7 ⁇ is calculated to obtain the reconstruction loss function.
  • the formula for reconstructing the loss function ⁇ can be as follows:
  • the multi-channel illumination range is available, and all the pixel channels of the sample enhanced image ⁇ and the training image 7 are standardized to [0 pixel color channel, which can include RGB (red, green and blue) three pixel color channels.
  • Ii , 7 can be set as the lower limit of S to ensure that all color channels of 7 ⁇ after image enhancement have an upper limit of 1, so as to prevent colors from exceeding the color gamut.
  • Setting 1 as the upper limit of S can avoid erroneously darkening the underexposed area.
  • the network device can also adjust the constraint range of the illumination map in the reconstruction loss function to meet the actual needs of different situations.
  • the network device adds different constraints to S to adjust the brightness of the image, the vividness of the color of the image, and so on.
  • the objective function only includes the reconstruction loss function, and there is still the risk of not being able to correctly generate image contrast details and image accurate colors.
  • image enhancement is usually performed by adjusting the histogram distribution curve of the image and local smoothing of the light map of the optimized image.
  • this type of method usually uses a single-channel light map for image enhancement, which will lead to image enhancement. There is deviation in the color control, and there is a lack of image color enhancement.
  • the RGB three channels of the image can be optimized at the same time, and the learning ability of the network model can be used to learn the light map to improve the accuracy of image enhancement.
  • the local smoothing loss function can obtain the smoothness loss information of the image, and the local smoothing loss function can be obtained by summing the three channels of image pixels.
  • the network device obtains the local smoothing loss function by summing the three channels of image pixels, using p to represent the image pixel and S to represent the light map.
  • the calculation formula of the local smoothing loss function can be as follows:
  • the network device sums the three channels of the pixels to obtain the local smooth loss function 4, and uses the sum to represent the partial derivatives in the horizontal and vertical directions of the image space, and uses ⁇ and Represents the smoothness weight of the three-channel spatial change of the pixel,
  • the calculation formula can be as follows:
  • is the logarithmic image of the training image
  • a constant usually set to 0.0001 to prevent division by zero.
  • using the local smoothing loss function to train the network model can reduce overfitting, improve the generalization ability of the network model, and restore good image contrast and clearer details in the image.
  • the Euclidean distance measurement can only measure the color difference numerically, and cannot guarantee the consistency of the color vector directions, so it may cause obvious color mismatch.
  • a color loss function can also be introduced.
  • the color loss function can obtain the color loss information of the image, and the color loss function can be obtained by calculating the vector angle formed by the three channels of image pixels.
  • the network device can obtain the color loss function through the vector angle formed by the three channels of image pixels.
  • the color loss function can make the predicted enhanced image obtained through the network model correspond to the color between the sample enhanced image.
  • the RGB value of the image can be regarded as a spatial vector to calculate the corresponding color channels of the predicted enhanced image and the sample enhanced image The angle between the vectors, the smaller the angle, the closer the directions between the vectors.
  • F(/ ⁇ ) is used to represent the predicted enhanced image
  • sample is used to represent the enhanced image.
  • the calculation formula of the color loss function can be as follows:
  • the network device converges the predicted enhanced image and the sample enhanced image based on the loss information to obtain the trained image enhanced network model.
  • the network equipment can converge the predicted enhanced image and the sample enhanced image based on the loss information, and obtain a trained image enhancement network model.
  • network equipment can use reconstruction loss function, local smoothing loss function, and color loss function to converge the predicted enhanced image and the sample enhanced image, and reduce the error between the predicted enhanced image and the sample enhanced image by P , Perform continuous training to adjust the weight to a suitable value, and then the image enhancement network model after training can be obtained.
  • Training the network model through the image enhancement method, and using the trained network model to enhance the image can speed up the network operation, improve the efficiency of image enhancement, without compromising the effect of enhancement, and improve the accuracy of image enhancement.
  • the network model trained by the above method can be used to constrain the illumination to realize the customization of the image enhancement effect.
  • the contrast can be enhanced by enhancing the local smooth illumination
  • the preferred exposure level can be set by limiting the illumination size, etc. .
  • the image enhancement method may also adjust the constraints on the light map in the loss function, so that the user can adjust the image according to personal preferences, such as the brightness of the image, the vividness of the colors in the image, and so on.
  • the image enhancement method may also add image denoising processing and supplementary generation processing for completely missing details of the image to obtain an image with better enhancement effect.
  • the image enhancement method needs to have a graphics processing unit (GPU) that meets the performance requirements, and a TensorFlow deep learning platform needs to be configured, on which the image enhancement method can be directly run.
  • GPU graphics processing unit
  • the image enhancement method can be widely used in various shooting conditions, and the image enhancement method can be used to enhance the image taken in the daytime with insufficient dark light, backlit, or the original image at night. You can also solve the problem of uneven lighting when taking pictures.
  • the original image can be input, and the enhanced target image can be directly obtained through the image enhancement method.
  • Real-time image enhancement processing can also be performed on the 1080P high-definition large image. Therefore, the image enhancement method can also be extended to perform image enhancement on the image in the moving area.
  • the image enhancement method can generate high-quality images, and the enhanced images are specifically manifested in image details, obvious contrast, moderate exposure, and no partial overexposure or over-darkness. At the same time, the color of the image is more vivid and beautiful.
  • This image enhancement method can process images of different pixels, for example, it can enhance real-time images of 1080P size, and can also process images with a resolution of 4k taken by a single-lens reflex camera.
  • the embodiment of the present application obtains the original image through the network device, performs synthesis processing on the characteristics of the original image, and obtains the low-resolution illumination map corresponding to the original image.
  • the mapping transformation matrix of the light map the original image is mapped based on the mapping transformation matrix to obtain the original resolution light map, and the original image is image enhanced according to the original resolution light map to obtain the target image.
  • This solution uses deep learning for image enhancement, which improves the efficiency and accuracy of image enhancement.
  • Regression learning is also performed on the original image and the labeled illumination map to obtain the network model required for image enhancement, which makes the training of the network model easier, the network model is more robust, and is convenient for further operations on the image.
  • three loss functions are designed to improve the accuracy of the enhanced image in terms of color and contrast. And by constraining the illumination map during the network model training process, the image will not be overexposed or overenhanced.
  • an embodiment of the present application also provides an image enhancement device, which can be specifically integrated in a network device.
  • the image enhancement device may include an acquisition module 151, a feature synthesis module 152, an acquisition module 153, an acquisition module 154, and an image enhancement module 155.
  • the obtaining module 151 is used to obtain the original image
  • the feature synthesis module 152 is configured to perform synthesis processing on the features of the original image to obtain a first illumination map corresponding to the original image, where the resolution of the first illumination map is lower than the resolution of the original image;
  • the central beam relationship acquisition module 153 is configured to acquire a mapping relationship for mapping an image into a second illumination map based on the first illumination map;
  • a mapping module 154 configured to perform a mapping process on the original image based on the mapping relationship to obtain a second light map, where the resolution of the second light map is the same as the resolution of the original image;
  • the image enhancement module 155 is configured to perform image enhancement processing on the original image according to the second illumination map to obtain a target image.
  • the feature synthesis module 152 may include:
  • the feature extraction sub-module 1521 is configured to extract the local features and global features of the original image based on the convolutional network
  • the feature synthesis sub-module 1522 is configured to perform feature synthesis on the local feature and the global feature to obtain the first illumination map corresponding to the original image.
  • each of the above units can be implemented as an independent entity, or can be combined in any way. It is originally implemented as the same or several implementations, and the specific implementation of each of the above units can be referred to the previous method embodiments, which will not be repeated here.
  • the original image is obtained by the obtaining module 151, and the features of the original image are synthesized by the feature synthesis module 152 to obtain the first illumination map corresponding to the original image.
  • the resolution of the first illumination map is lower than the original image.
  • the resolution of the image is obtained by the mapping relationship obtaining module 153 based on the first illumination map to obtain the mapping relationship for mapping the image to the second illumination map, and the mapping module 154 performs the mapping process on the original image based on the mapping relationship to obtain the second illumination
  • the resolution of the second light map is the same as the resolution of the original image
  • the image enhancement module 155 performs image enhancement processing on the original image according to the second light map to obtain the target image.
  • This scheme uses deep learning to enhance the image, which improves the efficiency and accuracy of image enhancement. Also through regression learning on the original image and the labeled illumination map, the network model required for image enhancement is obtained, which makes the training of the network model easier, the network model is more robust, and is convenient for further operations on the image. At the same time, three loss functions are designed to improve the accuracy of the enhanced image in terms of color and contrast. And by constraining the illumination map during the network model training process, the image will not be overexposed and overenhanced.
  • FIG. 17 is a schematic structural diagram of a computer device provided by an embodiment of the present application, and originally:
  • the computer device may include one or more processing core processors 171, one or more computer-readable storage media of memory 172, power supply 173, and input unit 174.
  • the structure of the computer device shown in FIG. 17 does not constitute a limitation on the network device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange different components.
  • the processor 171 is the control center of the computer equipment, and uses various interfaces and lines to connect various parts of the entire computer equipment, by running or executing software programs and/or modules stored in the memory 172, and calling and storing in the memory 172
  • the data inside performs various functions and processing data of the computer equipment, so as to monitor the computer equipment as a whole.
  • the processor 171 may include one or more processing cores; preferably, the processor 171 may integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user interfaces, application programs, etc. , The modem processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 171.
  • the memory 172 can be used to store software programs and modules, and the processor 171 is stored in the memory by running
  • the memory 172 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may store Data created based on the use of network equipment, etc.
  • the memory 172 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the memory 172 may further include a memory controller to provide the processor 171 with access to the memory 172.
  • the computer equipment also includes a power supply 173 for supplying power to various components.
  • the power supply 173 may be logically connected to the processor 171 through a power management system, so that functions such as charging, discharging, and power consumption management can be managed through the power management system.
  • the power supply 173 may also include one or more direct charging or AC charging sources, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
  • the computer device may further include an input unit 174, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • an input unit 174 which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • the computer device may also include a display unit, etc., which will not be repeated here.
  • the processor 171 in the computer device loads the executable file corresponding to the process of one or more application programs into the memory 172 according to the following instructions, and the processor 171 runs and stores the executable file
  • the application programs in the memory 172 are as follows:
  • the original image is acquired, and the features of the original image are synthesized to obtain a first illumination map corresponding to the original image.
  • the resolution of the first illumination map is lower than that of the original image.
  • the acquisition is used to map the image
  • the original image is mapped into a second light map based on the mapping relationship to obtain a second light map.
  • the resolution of the second light map is the same as the resolution of the original image, and the original image is imaged according to the second light map. Enhance processing to obtain the target image.
  • the embodiment of the present application obtains the original image, performs synthesis processing on the features of the original image, and obtains the first illumination map corresponding to the original image.
  • the resolution of the first illumination map is lower than the resolution of the original image, Figure, acquiring the mapping relationship used to map the image into the second light map, and performing the mapping process on the original image based on the mapping relationship to obtain the second light map.
  • the resolution of the second light map is the same as the resolution of the original image.
  • the second light map performs image enhancement processing on the original image to obtain the target image. This solution uses deep learning to enhance the image, which improves the efficiency and accuracy of image enhancement.
  • Regression learning is also performed on the original image and the labeled illumination map to obtain the network model required for image enhancement, which makes the training of the network model easier, the network model is more robust, and facilitates further operations on the image.
  • three loss functions are designed to improve the accuracy of the enhanced image in terms of color and contrast. And by constraining the illumination map during the network model training process, the image will not be overexposed or overenhanced.
  • an embodiment of the present application provides a storage medium in which multiple instructions are stored, and the instructions can be loaded by a processor to execute steps in any image enhancement method provided in the embodiments of the present application.
  • the instruction can perform the following steps:
  • the original image is acquired, and the features of the original image are synthesized to obtain a first illumination map corresponding to the original image.
  • the resolution of the first illumination map is lower than that of the original image.
  • the acquisition is used to map the image
  • the original image is mapped into a second light map based on the mapping relationship to obtain a second light map.
  • the resolution of the second light map is the same as the resolution of the original image, and the original image is imaged according to the second light map. Enhance processing to obtain the target image.
  • the storage medium may include: read only memory (ROM, Read Only Memory), Pit machine access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
  • the instructions stored in the storage medium can execute the steps in any image enhancement method provided in the embodiments of this application, it can achieve what can be achieved by any image enhancement method provided in the embodiments of this application.
  • any image enhancement method provided in the embodiments of this application For the beneficial effects, refer to the previous embodiment for details, which will not be repeated here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Image Processing (AREA)

Abstract

本申请实施例公开了一种图像增强方法、装置及存储介质,其中,本申请实施例获取原始图像,对原始图像的特征进行合成处理,得到原始图像对应的第一光照图,第一光照图的分辨率低于原始图像的分辨率,基于第一光照图,获取用于将图像映射成第二光照图的映射关系,基于映射关系对原始图像进行映射处理,得到第二光照图,第二光照图的分辨率与原始图像的分辨率相同,根据第二光照图对原始图像进行图像增强处理,得到目标图像,该方案可以提高图像增强的效率。

Description

一种图像增强方法、 装置及存储介质
本申请要求于 2019年 02月 28日提交中国专利局、申请号为 201910148574.6、 发明名称为“一种图像增强方法、 装置及存储介质”的中国专利申请的优先权, 其全 部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理领域, 具体涉及一种图像增强方法、 装置及存储介质。 发明背景
近年来, Pit着电子设备中拍摄技术的提升, 人们对于拍摄图像的质量要求也在 不断提升。由于光线不足或者背光等造成的曝光不足不仅会对图像的质量产生影响, 并且会捕捉不至晞望捕捉的细节等等。 因此, 可以通过图像增强的方式, 提高图像 的质量。 目前对于图像增强的方式是采用原始图像到标注图像的方式对网络模型进 行训练, 以得到可以增强图像的网络模型, 但这种方式训练网络模型的效率较低。 发明内容
有鉴于此, 本申请实施例提供了一种图像增强方法、 装置及存储介质, 能够提 高图像增强的效率。
第一方面, 本申请实施例提供了一种图像增强方法, 包括:
获取原始图像;
对所述原始图像的特征进行合成处理, 得到所述原始图像对应的第一光照图, 所述第一光照图的分辨率低于所述原始图像的分辨率;
基于所述第一光照图, 获取用于将图像映射成第二光照图的映射关系; 基于所述映射关系对所述原始图像进行映射处理, 得到第二光照图, 所述第二 光照图的分辨率与所述原始图像的分辨率相同;
根据所述第二光照图对所述原始图像进行图像增强处理, 得到目标图像。
第二方面, 本申请实施例提供了一种图像增强装置, 包括:
获取模块, 用于获取原始图像;
特征合成模块, 用于对所述原始图像的特征进行合成处理, 得到所述原始图像 对应的第一光照图, 所述第一光照图的分辨率低于所述原始图像的分辨率;
0央射关系获取模块, 用于基于所述第一光照图, 获取用于将图像映射成第二光 照图的映射关系;
映射模块, 用于基于所述映射关系对所述原始图像进行映射处理, 得到第二光 照图, 所述第二光照图的分辨率与所述原始图像的分辨率相同;
图像增强模块, 用于根据所述第二光照图对所述原始图像进行图像增强处理, 得到目标图像。
第三方面, 本申请实施例樹共的存储介质, 其上存储有计算机程序, 当所述计 算机程序在计算机上运行时, 使得所述计算机执行如本申请任一实施例提供的图像 增强方法。
本申请实施例获取原始图像, 对原始图像的特征进行合成处理, 得到原始图像 对应的第一光照图,第一光照图的分辨率低于原始图像的分辨率,基于第一光照图, 获取用于将图像映射成第二光照图的映射关系, 基于映射关系对原始图像进行映射 处理, 得到第二光照图, 第二光照图的分辨率与原始图像的分辨率相同, 根据第二 光照图对原始图像进行图像增强处理, 得到目标图像。 该方案可以提高图像增强的 效率。
附图简要说明
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中所需要 使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实 施例, 对于本领域技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些 附图获得其他的附图。
图 1是本申请实施例提供的图像增强方法的应用场景示意图。
图 2是本申请实施例提供的图像增强方法的第一充程示意图。
图 3是本申请实施例提供的图像增强方法的第二充程示意图。
图 4是本申请实施例提供的图像增强方法的第三充程示意图。
图 5是本申请实施例提供的第二光照图。
图 6是本申请实施例提供的卷积网络结构示意图。
图 7是本申请实施例提供的图像增强充程示意图。
图 8是本申请实施例提供的图像增强方法输入输出示意图。
图 9是本申请实施例提供的第一实验结果示意图。
图 10是本申请实施例提供的第二实验结果示意图。
图 11是本申请实施例提供的第三实验结果示意图。
图 12是本申请实施例提供的第四实验结果示意图。
图 13是本申请实施例提供的第五实验结果示意图。
图 14是本申请实施例提供的第六实验结果示意图。
图 15是本申请实施例提供的图像增强装置的第 _结构示意图。
图 16是本申请实施例提供的图像增强装置的第二结构示意图。
图 17是本申请实施例提供的网络设备示意图。 实施本发明的方式
请参照图式, 其中相同的组件符号代表相同的组件, 本申请的原理是以实施在 一适当的运算环境中来举例说明。 以下的说明是基于所例示的本申请具体实施例, 其不应被视为限制本申请未在此详述的其它具体实施例。
在以下的说明中, 本申请的具体实施例将参考由一部或多部计算机所执行的步 骤及符号来说明, 除非另有述明。 因此, 这些步骤及操作将有数次提到由计算机执 行, 本文所指的计算机执行包括了由代表了以一结构化型式中的数据的电子信号的 计算机处理单元的操作。 此操作转换该数据或将其维持在该计算机的内存系统中的 位置处, 其可重新配置或另外以本领域测试人员所熟知的方式来改变该计算机的运 作。 该数据所维持的数据结构为该内存的实体位置, 其具有由该数据格式所定义的 特定特性。 但是, 本申请原理以上述文字来说明, 其并不代表为一种限制, 本领域 测试人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。
本文所使用的术语 "模块" 可看作为在该运算系统上执行的软件对象。 本文所 述的不同组件、 模块、 引擎及服务可看作为在该运算系统上的实施对象。 而本文所 述的装置及方法可以以软件的方式进行实施, 当然也可在硬件上进行实施, 均在本 申请保护范围之内。
本申请中的术语 "第一〃、 "第二〃 和 "第三〃 等是用于区别不同对象, 而不是 用于描述特定 JII页序。 此外, 术语 "包括〃 和 "具有〃 以及它们任何变形, 意图在于 覆盖不排他的包含。 例如包含了一系列步骤或模块的过程、 方法、 系统、 产品或设 备没有限定于已列出的步骤或模块,而是某些实施例还包括没有列出的步骤或模块, 或某些实施例还包括对于这些过程、 方法、 产品或设备固有的其它步骤或模块。
在本文中提及 "实施例〃 意味着, 结合实施例描述的特定特征、 结构或特性可 以包含在本申请的至少一个实施例中。 在说明书中的各个位置出现该短语并不一定 均是指相同的实施例, 也不是与其它实施例互斥的独立的或备选的实施例。 本领域 技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
本申请实施例提供一种图像增强方法, 该图像增强方法的执行主体可以是本申 请实施例提供的图像增强装置, 或者集成了该图像增强装置的网络设备, 其中该图 像增强装置可以采用硬件或者软件的方式实现。 其中, 网络设备可以是智能手机、 平板电脑、 掌上电脑、 笔记本电脑、 或者台式电脑等设备。
图 1为本申请实施例提供的图像增强方法的应用场景示意图。 图 1以图像增强 装置集成在网络设备中为例。 网络设备可以获取原始图像, 对原始图像的特征进行 合成处理, 得到原始图像对应的第一光照图, 第一光照图的分辨率低于原始图像的 分辨率, 基于第一光照图, 获取用于将图像映射成第二光照图的映射关系, 基于映 射关系对原始图像进行映射处理, 得到第二光照图, 第二光照图的分辨率与原始图 像的分辨率相同, 根据第二光照图对原始图像进行图像增强处理, 得到目标图像。
图 2为本申请实施例提供的图像增强方法的流程示意图。 请参阅图 2, 本申请 实施例提供的图像增强方法的可以如下。
201、 获取原始图像。
其中, 原始图像为需要进行图像增强的图像。 原始图像可以为多种拍摄情况下 得到的图像。 比如, 原始图像可以包括拍摄时正常曝光的图像、 曝光不足的图像、 光线不足的图像或者背光的图像等等。 对原始图像中包括的内容可以不进行限定。
由于原始图像拍摄情况的多样化, 因此该图像增强方法可以对多种拍摄情况的 原始图像进行图像增强, 而不仅限于对正常曝光的图像进行图像增强, 从而扩大了 图像增强方法的适用范围。
其中, 获驅始图像的方式可以有多种。 比如, 可以从本地存储中获驅始图 像, 或者从网络侧设备获取原始图像, 等等。
在_实施例中, 比如, 还可以在通过摄像设备采集图像时, 选择当前采集到的 图像作为原始图像。 又比如, 当通过摄像设备采集图像并在图像拍摄界面 (如图像 预览界面) 中显示时, 可以截取当前界面显示的图像作为原始图像, 等等。
在一实施例中, 还可以从本地或者外部存储单元中获取原始图像。 比如, 还可 以从本地图像数据库中获取原始图像。
其中, 图像增强可以通过对图像中有用信息进行增强, 以实现针对图像的应用 场合, 相应地改善图像的视觉效果。 图像增强可以通过有目的地强调图像的整体特 征或者局部特征, 将原来不清晰的图像变得清晰; 或者, 通过强调某些感兴趣的特 征, 以放大图像中不同物体特征之间的差别; 或者, 通过抑制不感兴趣的特征, 改 善图像质量, 丰富图像的信息量, 加强图像的判读和识别效果, 从而满足某些特殊 分析情况的需要。
202、 对原始图像的特征进行合成处理, 得到原始图像对应的第一光照图。 其中, 如图 5所示, 光照图 (illumination map) 是本征图像分解后的阴影图。 本征图像包括将原图像分解后得到的反射图和照射图。 照射图是反应原图像光照情 况的图像, 反射图是指在变化的光照条件下能够维持不变的图像部分, 即原图像去 掉高光后的图像。
其中, 第一光照图的分辨率低于原始图像的分辨率。 第一光照图可以为光照图 在一种分辨率下的图像形式。 其中, 该第一光照图可以为分辨率低于原始图像分辨 率的光照图, 比如, 第一光照图可以成为低分辨率光照图。 其中, 图像分辨率代表图像中存储的信息量, 可以通过每英寸图像内的像素点 数目表示图像分辨率。
由于目前采用深度学习的方法对图像进行图像增强时, 通常是采用原始图像到 标注图像进行回归学习得到的网络模型进行图像增强操作, 但是这样的方法, 会使 得网络模型的学习效率低, 网络模型的鲁棒性不强, 并且在图像对比度方面也存在 缺陷。
在一实施例中, 可以采用原始图像到光照图进行回归学习得到的图像增强网络 模型, 进行图像增强操作。 采用原始图像到光照图进行回归学习得到的图像增强网 络模型, 网络模型的学习效率高, 网络模型的鲁棒性强, 并且容易对图像进行更进 —步的操作。
该图像增强方法可以适用于图像增强网络模型。 图像增强网络模型采用原始图 像到光照图之间的映射关系, 替代原始图像到标注图像之间的映射关系。 这种方式 的优势在于, 原始图像到光照图之间的映射, 通常具有相对简单的形式和已知的先 验。 因此, 使得该图像增强网络模型具有较强的泛化能力, 能够有效处理复杂摄影 条件下获取的不同情况的原始图像。
在实际应用中, 原始图像对应的第一光照图可以通过特征合成得到。 比如, 可 以首先提取出原始图像的特征, 并对该提取出的特征进行特征合成, 生成第一光照 图。
在一实施例中, 比如, 可以通过包括卷积运算的网络结构对原始图像的特征进 行特征提取。
其中, 由于在传统方法中, 通常采用调整图像直方图分布曲线的方法, 从全局 上对图像进行增强, 但是这种方法会导致局部过亮、 过曝、 过暗等问题, 并且生成 的图像颜色不会很鲜艳。
又由于增强曝光不足的图像需要同时对图像的局部特征 (比如对比度、 细节清 晰度、阴影和高光,等等)和全局特征(比如颜色分布、平均亮度和场景类别等等) 进行调整。 因此, 可以通过分别提取出原始图像的局部特征和全局特征, 来提高图 像增强的准确性。
在一实施例中, 具体地, 步骤 "对所述原始图像的特征进行合成处理, 得到所 述原始图像对应的第一光照图" 可以包括:
基于卷积网络提取所述原始图像的局部特征和全局特征;
对所觸部特征和所述全局特征进行特征合成, 得到所勝、始图像对应的第一 光照图。
其中, 卷积网络为可以对图像的特征进行提取的网络结构, 比如, 卷积网络中 可以包括卷积层, 卷积层可以通过卷积运算提取图像的特征。
其中, 图像的局部特征是图像特征的局部表达, 图像的局部特征可以反应图像 具有的局部特性。 比如, 图像的局部特征可以包括对比度、 细节清晰度、 阴影和高
Figure imgf000008_0001
其中, 图像的全局特征可以表示图像整体的特征, 全局特征是相对于局部特征 而言的, 可以用于描述图像或者目标的颜色和形状等整体特征。 比如, 图像的全局 特征可以包括颜色分布、 平均亮度和场景类别等等。
在实际应用中, 比如, 可以将原始图像输入卷积网络中, 提取出原始图像的局 部特征和全局特征, 之后将提取出的局部特征和全局特征进行特征合成, 得到第一 光照图。
其中, 为了提高图像特征提取的准确性, 可以采用网络模型对图像的特征进行 提取。
在一实施例中, 具体地, 步骤 "基于卷积网络提取所述原始图像的局部特征和 全局特征" 可以包括:
将所述原始图像输入至卷积网络;
基于所述初级特征提取网络对所勝、始图像进行卷积运算, 提取出所舰始图 像的初级特征;
基于所述局部特征提取网络对所述初级特征进行卷积运算, 提取出局部特征; 基于所述全局特征提取网络对所述初级特征进行卷积运算, 提取出全局特征。 其中, 如图 6所示, 卷积网络可以包括初级特征提取网络、 局部特征提取网络 和全局特征提取网络, 其中, 局部特征提取网络和全局特征提取网络并联, 并与初 级特征提取网络串联。
其中, 初级特征提取网络为可以提取出原始图像初级特征的网络模型, 比如, 该初级特征提取网络可以包括预训练好的 VGG16网络模型。 VGG16网络模型可以 包括 16层结构,比如 VGG16网络模型可以包括卷积眉、全连接层、池化层,等等。
在一实施例中, 可以基于预训练好的 VGG16网络模型对原始图像进行卷积运 算,提取出原始图像的初级特征。比如,可以将原始图像输入 VGG16网络模型中, 通过卷积层进行卷积运算。 每经过一个卷积核扫描图像, 就生成一个新的矩阵。 之 后经过池化层缩小参数矩阵的尺寸, 从而减少最后全连层中的参数数量。 Pit后经过 全连接层, 提取出原始图像的初级特征。
在一实施例中, 还可以根据实际情况, 选择包括若干卷积层的其他类型网络模 型, 对原始图像进行卷积运算, 以提取原始图像的初级特征。
其中, 局部特征提取网络为可以提取出图像局部特征的网络模型, 比如, 局部 特征提取网络可以包括两层卷积层, 可以采用卷积层进行局部特征的提取。 全局特 征提取网络为可以提取出全局特征的网络模型, 比如, 全局特征提取网络可以包括 两层卷积层和三层全连接层, 可以采用卷积层进行全局特征的提取。
在实际应用中, 比如, 可以将原始图像输入初级特征提取网络中, 提取出原始 图像的初级特征。 之后将初级特征同时输入并联的局部特征提取网络和全局特征提 取网络中, 提取出局部特征和全局特征。
为了能够实时处理高分辨率图像, 可以使得大多数网络计算都在低分辨率中完 成, 比如, 可以通过下采样的方式对图像进行分辨率的转换。
在一实施例中, 具体地, 步骤 "对所述原始图像的特征进行合成处理, 得到所 述原始图像对应的第一光照图" 可以包括:
对所述原始图像的像素进行下采样, 得到输入图像;
对所述输入图像的特征进行合成处理, 得到所述原始图像对应的第一光照图。 其中, 可以通过对图像进行下采样的操作以缩小图像, 使得图像符合显示区域 的大小, 并且生成对应图像的缩略图。 比如, 对于尺寸为 m*n的图像, 对该图像进 行 s倍下采样操作, 可以得到尺寸为 (m/s) * (n/s) 的低分辨率图像。 其中, s应当 为 m和 n的公约数。 当考虑矩阵形式的图像像素时, 图像的下采样就是把 s*s窗口 内的图像像素变成一个图像像素。 该像素点的值可以为 s*s窗口内所有图像像素的 均值, 还可以根据实际情况以其他计算方法获取像素点的值, 等等。
在实际应用中, 比如, 可以在原始图像像素构成的矩阵中, 获取一个预设尺寸 s*s的矩阵,之后将预设尺寸矩阵内的像素变成一个像素。这个像素可以根据预设规 则进行获取, 比如这个像素可以是预设尺寸矩阵内所有像素的均值。 将整张原始图 像的像素都进行变换后, 可以得到下采样后的分辨率低于原始图像分辨率的输入图 像。之后可以将该输入图像输入到卷积网络中进行特征提取,以及进行后续的步骤。
203、 基于第一光照图, 获取用于将图像映射成第二光照图的映射关系。
其中, 第二光照图的分辨率与原始图像的分辨率相同。 第二光照图可以为光照 图在一种分辨率下的图像形式。 其中, 如图 5所示, 该第二光照图可以为分辨率与 原始图像分辨率相同的光照图, 比如, 第二光照图可以称为原分辨率光照图。
其中, 该映射关系可以将图像映射为光照图, 比如, 通过该映射关系可以实现 将原始图像映射为第二光照图。 比如, 该映射关系可以为一种矩阵式的映射关系, 为一种映射变换矩阵, 图与图之间可以通过这种映射关系实现映射变换, 比如, 原 始图像可以根据该映射变换矩阵, 经过映射变换得到第二光照图。
在实际应用中, 可以基于第一光照图获取该映射关系。
其中, 为了提高图像增强的准确性, 可以通过双边网格的方式, 基于第一光照 图获取映射关系。
在一实施例中, 具体地, 步骤 "基于所述第一光照图, 获取映射关系" 可以包 括:
对所述第一光照图的像素进行采样, 得到采样后的像素;
将所述采样后的像素对应至双边网格中, 获取映射关系。
其中, 双边网格是通过对图像的空间域和亮度域进行采样, 并划分成网格的一 种方式。 双边网格中的双边指的是空间和亮度。 离散处理后, 将图像中每个点的坐 标和亮度信息取整到对应的网格内。 通过在网格内进行滤波等处理, 再通过上采样 方法进行插值, 可以得到处理后的图像。
比如, 可以对第一光照图的像素进行空域和值域的采样, 得到采样后的像素, 之后找到对应像素在网格中的位置, 并进行网格差值运算, 得到映射变换矩阵。
在一实施例中,具体地,步骤 "基于第一光照图,获取用于将图像映射成第二光 照图的映射关系〃 可以包括: 利用预设的训练图像和所述训练图像对应的样本增强 图像, 获得使所述训练图像对应的预测增强图像与样本增强图像之间的损失信息满 足预设条件的所述映射关系; 其中, 所述预测增强图像为利用所述映射关系对所述 训练图像进行映射处理得到的增强图像。
一些实施例中,该损失信息可以是对比度损失信息、平滑度损失信息、颜色损失 信息中的至少一个。
其中,对比度损失信息可以通过计算所述预测增强图像与所述样本增强图像之 间的欧式距离获得,也可以通过计算所述训练图像与还原图像之间的欧式距离获得, 还原图像是指利用所述映射关系对所述样本增强图像进行逆映射 (也即, 去除增强 效果) 得到的图像。
平滑度损失信息可以通过对所述映射关系在各个像素处的三个色彩通道的值 的空间变化量 (例如, 空间各方向上的变化量) 进行求和来获得。
颜色损失信息可以通过对预测增强图像与样本增强图像中各个像素的色彩向 量之间的相似度进行求和来获得。色彩向量爵旨,利用像素的各个色彩分量(例如, R、 G、 B分量) 组成的向量。
通过对图像的各个色彩通道同时进行优化, 可以提高图像增强的效果。
204、 基于映射关系对原始图像进行映射处理, 得到第二光照图。
其中, 为了提高图像增强的准确性, 可以通过双边网格的方式, 对原始图像进 行映射处理。
在一实施例中, 具体地, 步骤 "基于所述映射关系对所述原始图像进行映射处 理, 得到第二光照图" 可以包括: 基于所述映射关系对所述原始图像进行映射处理, 得到映射后图像; 对所述映射后图像进行上采样, 得到第二光照图。
其中, 双边网格上采样的原理是选择一个参考图像, 对参考图像任意一个空间 的像素进行空域和值域的采样, 然后找到其在网格中的位置, 通过三线性插值的方 法, 实现未知范围的亮度值的计算。
在实际应用中,比如,如图 7所示,可以根据第一光照图,得到映射变换矩阵, 之后可以通过该映射变换矩阵, 对原始图像进行映射处理, 得到映射后图像, 该映 射后图像为一种分辨率低于原始图像分辨率的图像。 之后可以对该映射后图像进行 双边网格上采样操作, 在映射后图像像素的基础上, 在像素点之间采用合适的插值 算法插入新的元素, 得到第二光照图。
205、 根据第二光照图对原始图像进行图像增强处理, 得到目标图像。
其中, 目标图像可以为经过图像增强后获得的图像。
其中, 可以将图像的增强问题看作是寻找原始图像与目标图像之间映射关系的 问题。 比如, 可以采用/代表目标图像对应的矩阵, 采用 I代表原始图像对应的矩 阵, 采用函数 F代表原始图像与目标图像之间的映射函数, 那么映射函数 F可以通 过下式进行表示:
I = F(I)
由于目标图像、 原始图像和第二光照图之间存在关系, 比如, 可以采用 S表示 第二光照图对应的矩阵,采用/表示目标图像对应的矩阵,采用 I代表原始图像对应 的矩阵, SP么目标图像、 原始图像和第二光照图之间的关系可以如下式所示:
7 = 5 *7
因此, 可以通过原始图像和第二光照图, 获得目标图像。 根据原始图像 I和第 二光照图 S , 获得目标图像 /可以如下式所示:
F(I) = S 1 I
在一实施例中, 比如, 如图 7所示, 可以首先获取原始图像, 并对原始图像进 行下采样, 得到 256x256像素的输入图像。 之后将该输入图像输入至包括预训练好 的 VGG16网络模型的初级特征提取网络中,提取原始图像的初级特征,之后将该初 级特征分别输入并联的局部特征提取网络和全局特征提取网络中, 提取出局部特征 和全局特征, 并将局部特征和全局特征进行合并操作, 得到第一光照图。 之后通过 双边网格上采样, 得到映射关系, 并根据这种映射关系, 得到第二光照图。 最后通 过公式 / =
Figure imgf000011_0001
,得到目标图像。通过这种方式增强图像,可以加速图像增强的过程, 从而提高图像增强的效率。
在一实施例中, 该图像增强方法还可以包括图像增强网络模型的训练过程。 如 图 3所示, 该图像增强方法还可以包括如下流程。
301、基于图像增强网络模型和训练图像,获取训练图像对应的预测增强图像。 其中, 训练图像可以为网络模型在训练过程中所应用的图像, 该训练图像中包 括样本增强图像。 该样本增强图像为对训练图像进行的与图像增强相关的标注。
其中, 获取训练图像的方式可以有多种。 比如, 可以从本地存储中获取训练图 像, 或者从网络侧设备获取训练图像, 还可以通过拍摄设备进行拍摄, 获取到训练 图像等等。
其中, 对训练图像进行标注的方式可以有多种。 强后, 获取到样本增强图像; 还可以通过专家对训练图像进行标注, 获取到样本增强图像等等。
其中, 预测增强图像可以为训练图像经过网络模型增强后得至啲图像。 该预测 增强图像与真实的样本增强图像之间可以具有一定的差异, 但这种差异可以通过对 网络模型进行训练而缩小。
在实际应用中, 比如, 可以将训练图像输入图像增强网络模型中, 获取到训练 图像对应的预测增强图像。 其中, 通过该图像增强网络模型进行训练图像的图像增 强方法, 与通过该图像增强网络模型进行原始图像的图像增强方法相同, 上文已经 叙述, 此处不再赘述。
在一实施例中, 还可以通过对训练图像进行随机裁剪的方式, 提高训练样本的 多样性。 比如, 还可以将训练图像随机裁剪为多张 512x512尺寸的图像, 以增加样 本的多样性。
其中, 可以通过提高训练图像的多样性, 提高网络模型的准确性。 训练图像中 可以包括多种拍摄情况的图像, 比如正常曝光、 曝光不足、 光线不足或者背光等多 种情况的图像, 根据这样的训练图像训练出的网络模型, 能够适应不同实际拍摄情 况下获取的图像。
在一实施例中, 比如, 可以通过获取标准条件数据集、 以及特殊条件数据集, 并根据标准条件数据集以及特殊条件数据集, 构建包括多种拍摄类型的切 I练图像。
其中, 标准条件数据集为包括正常曝光图像的数据集, 比如, 标准条件数据集 可以为 MIT- Adobe Five K Dataset, 该标准条件数据集中包括多张由一组不同摄影师 用单反相机拍摄的原始格式的图像, 也就是说摄像机传感器记录的所有信息都会被 保存下来, 这些图像涵盖了广泛的场景、 主题和光照条件。 之后采用专门用于调整 图像的软件对拍摄的图像进行了重新润色, 从而获取到标准条件数据集。
在一实施例中, 比如, 标准条件数据集可以使用 MIT- Adobe Five K Dataset, 数 据集中训练样本的标注可以选择专家 C的标注。 但是由于标准条件数据集的创建主 要是为了增强一般图像, 而不是曝光不足的图像, 标准条件数据集中只包括很小的 -部分(约 4%)的未曝光图像, 因此标准条件数据集中缺乏特殊拍摄条件的情况, 比 如夜间拍摄的图像和在非均匀光照情况下获取的图像等等。为了增加样本的多样性, 还可以弓 I入特殊条件数据集。
其中, 特殊条件数据集为包括非正常曝光图像的数据集, 比如, 特殊条件数据 集中可以包括曝光不足、 光线不足、 背光等特殊拍摄条件下获取的图像等等。 这种 特殊条件数据集可以包括多样的拍摄情况、 场景、 主题和样式等。 通过增加特殊条 件数据集, 可以对标准条件数据集中缺乏的图像种类进行补充。
比如, 可以使用相机捕获分辨率为 6000x4000的图像,然后通过搜索 "曝光不 足〃、 "光线不足〃、 "背光〃 等关键字, 从图片分享数据库中收集大约 15%的图像。 之后专家利用图形工具软件为收集到的每一幅图像进行重新润色, 得到对应的参考 图像, 建立特殊条件数据集。 最后, 可以将数据集中图像随机分成两个子集, 2750 张用于网络模型的训练, 2750张用于网络模型的测试。
根据标准条件数据集以及特殊条件数据集构建的切 I练图像, 进行网络模型的训 练,可以使得训练后的网络模型适应多种拍摄情况,从而提高了图像增强的准确性。
302、 基于目标损失函数获取预测增强图像与样本增强图像之间的损失信息。 其中, 损失信息可以包括对比度损失信息、 颜色损失信息、 平滑度损失信息中 的一种或多种, 该损失信息可以表示预测增强图像与样本增强图像之间的差异, 这 种差异可以通过对网络模型的训练缩小。
其中, 损失函数可以用来对网络模型的预测值与真实值的不一致程度进行估量 的函数。 损失函数越小, 说明网络模型的鲁棒性越好。
在实际应用中, 比如, 可以通过目标损失函数, 对预测增强图像与样本增强图 像之间的损失信息进行获取, 该损失信息可以为预测增强图像与样本增强图像之间 的差异, 通过网络模型的训练可以减少该损失信息。
其中, 该目标损失函数可以根据实际应用需求进行灵活设置。 目前通常通过调 整图像的光照图, 进行光照图的局部平滑优化操作, 来增强图像。 但是这种方法会 造成一些光环的人工痕迹, 以及图像局部过度曝光的情况, 导致图像过度增强。
在一实施例中, 因此, 可以设计一种目标损失函数, 该目标损失函数可以包括 重构损失函数、 局部平滑损失函数、 以及颜色损失函数中的一种或几种损失函数。 通过对于光照图进行约束, 使得图像不会产生过度曝光, 过度增强的情况。
具体地, 该图像增强方法还可以包括:
基于所述图像增强网络模型和训练图像, 获取所述训练图像对应的预测增强图 像;
基于重构损失函数获取所述预测增强图像与样本增强图像之间的对比度损失 信息, 所述样本增强图像为所述训练图像对应的增强图像;
基于所述对比度损失信息对所述预测增强图像与所述样本增强图像进行收敛, 得到训练后图像增强网络模型。
其中, 重构损失函数可以获取图像的对比度损失信息, 比如, 重构损失函数可 以通过度量欧式距离误差来获取。即,计算图像增强网络模型生成的预测增强图像, 与经过专家标注的样本增强图像之间的欧氏距离。
其中, 欧式距离为欧几里得空间中两点间直线的距离。
在一实施例中, 比如, 可以根据欧式距离误差度量获取重构损失函数。 比如, 可以采用 S表示预测增强图像对应的原分辨率光照图矩阵, 采用7 /表示样本增强图 像, 采用 7<表示训练图像, 可以通过预测增强图像对应的原分辨率光照图矩阵 S和 样本增强图像
Figure imgf000014_0001
相乘, 计算与训练图像7<之间欧式距离误差度量, 以得到重构损失 函数。 重构损失函数
Figure imgf000014_0002
的公式可以如下:
4 =|,, /,|2
其中, 多通道光照范围可以为 PU 1 , 样本增强图像 ^和训练图像 7呻 的所有像素通道都被标准化为[0,1]。 中#}表示像素颜色的通道, 可以包括 RGB (红绿蓝) 三种像素颜色通道。 由于
Figure imgf000014_0003
可以将 ^设为 S的下限, 以确 保图像经过图像增强后7^ 的所有颜色通道都以 1 为上限, 以此避免颜色超出色 域。 而将 1设置为 S的上限, 可以避免错误地使曝光不足的区域变暗。
在一实施例中, 还可以对重构损失函数中光照图的约束范围进行调整, 以满足 不同情况的实际需求。 比如, 还可以通过对 S添加不同的约束, 以调节图像的亮暗 程度、 图像的颜色鲜艳程度, 等等。
通过重构损失函数, 可以使得获得的增强后图像更加清晰, 以及使得图像对比 度更好。 但是目标函数中仅仅包括重构损失函数, 仍然存在无法正确生成图像对比 度细节和图像准确颜色的风险。
因此, 在一实施例中, 还可以在目标损失函数中添加局部平滑损失函数, 以提 升图像增强的准确性。
具体地, 该图像增强方法还可以包括:
基于所述图像增强网络模型和训练图像, 获取所述训练图像对应的预测增强图 像;
基于局部平滑损失函数获取所述预测增强图像与样本增强图像之间的平滑度 损失信息, 所述样本增强图像为所述训练图像对应的增强图像; 基于所述平滑度损失信息对所述预测增强图像与所述样本增强图像进行收敛, 得到训练后图像增强网络模型。
由于在传统方法里, 通常利用调整图像的直方图分布曲线, 以及利用优化图像 的光照图局部平滑, 来进行图像增强, 但是这类方法通常使用单通道的光照图进行 图像增强,会导致对于图像颜色的把控出现偏差,在图像颜色增强的方面出现欠缺。
因此, 可以通过对图像的 RGB三通道同时进行优化, 并利用网络模型的学习 能力, 对光照图进行学习的方式, 提高图像增强的准确性。
其中, 局部平滑损失函数可以获取图像的平滑度损失信息, 该局部平滑损失函 数可以通过对图像像素三通道进行求和获取。
在实际应用中,可以通过对图像像素三通道求和获取局部平滑损失函数,比如, 可以采用 P表示图像像素, 采用 S表示光照图, 局部平滑损失函数 ^的计算公式可 以如下:
Figure imgf000015_0001
其中,可以对像素的三通道进行求和得到局部平滑损失函数 4 ,可以采用 和 表示图像空间水平和垂直方向的偏导数,采用 <和
Figure imgf000015_0002
表示像素三通道空间变化 的平滑度权重,
Figure imgf000015_0003
计算公式可以如下:
Figure imgf000015_0004
其中, ^是训练图像 的对数图像, 0 = 1_2是控制图像灵敏度的参数,
Figure imgf000015_0005
个常量, 通常设置为 0.0001 , 以防止被零除。
其中, 采用局部平滑损失函数对网络模型进行训练, 可以减少过拟合, 提高网 络模型的泛化能力, 还可以恢复良好的图像对比度和图像中更清晰的细节。
在一实施例中, 虽然重构损失函数中已经隐式地测量了色差的欧式距离, 但是 欧式距离的度量仅可以对色差进行数值上的测量, 而无法保证颜色向量方向一致, 因此可能导致明显的颜色不匹配。 为了准确还原图像中颜色信息, 还可以引入颜色 损失函数。
具体地, 该图像增强方法还可以包括:
基于所述图像增强网络模型和训练图像, 获取所述训练图像对应的预测增强图 基于颜色损失函数获取所述预测增强图像与样本增强图像之间的颜色损失信 息, 所述样本增强图像为所述训练图像对应的增强图像;
基于所述颜色损失信息对所述预测增强图像与所述样本增强图像进行收敛, 得 到训练后图像增强网络模型。
其中, 颜色损失函数可以获取图像的颜色损失信息, 比如, 颜色损失函数可以 通过计算图像像素三通道构成的向量夹角来获取。
在实际应用中, 可以通过图像像素三通道构成的向量夹角获取颜色损失函数。 比如, 可以通过颜色损失函数使得经过网络模型得到的预测增强图像与样本增强图 像之间的颜色相对应。 对于预测增强图像与样本增强图像, 可以将图像的 RGB值, 视为空间上的向量, 从而计算预测增强图像与样本增强图像对应颜色通道向量之间 的夹角。 夹角越小, 说明向量之间的方向越接近。
在一实施例中,比如,可以采用 (/<)表示预测增强图像,采用 表示样本增强 图像, 颜色损失函数 的计算公式可以如下:
Figure imgf000016_0001
在一实施例中, 目标损失函数可以包括重构损失函数、 局部平滑损失函数、 以 及颜色损失函数, 比如, 可以采用 ^表示重构损失函数, 采用 表示局部平滑损失 函数, 采用 ^表示颜色损失函数,采用 L表示目标损失函数。 其中, 可以采用 表 示重构损失函数在训练中所占的权重,采用 ^表示局部平滑损失函数在训练中所占 的权重,采用%表示颜色损失函数在训练中所占的权重。 目标损失函数的计算公式 可以如下所示:
Figure imgf000016_0002
在一实施例中,比如,可以使得图像增强网络模型训练过程中, ^=1, ^=2, ®c =3。
303、基于损失信息对预测增强图像与样本增强图像进行收敛,得到训练后图像 增强网络模型。
在实际应用中, 可以基于损失信息对预测增强图像与样本增强图像进行收敛, 并得到训练后图像增强网络模型。
在一实施例中, 比如, 可以采用损失函数, 对预测增强图像与样本增强图像进 行收敛, 通过 P牵低预测增强图像与样本增强图像之间的误差, 进行不断的训练, 以 调整权重至合适数值, 便可得到切 I练后图像增强网络模型。
通过图像增强方法对网络模型进行训练, 并采用训练后的网络模型进行图像的 增强, 可以加快网络运行的速度, 提升图像增强的效率, 并且不损害增强的效果, 提升图像增强的准确率。 采用上述方法切 I练出的网络模型可以通过对光照进行约束, 从而实现图像增强 效果的自定义。 比如, 可以通过增强局部平滑光照来增强对比度, 通过限制光照大 小来设置首选曝光级别, 等等。
在一实施例中, 该图像增强方法还可以通过调整损失函数中对光照图的约束, 使得用户能够根据个人喜好对图像进行调整, 比如图像的亮暗、 图像中颜色的鲜艳 程度等等。
在一实施例中, 该图像增强方法还可以通过增加图像去噪处理以及对图像完全 丟失细节的补充生成处理, 以获得增强效果更好的图像。
该图像增强方法可以广泛应用在各种拍摄条件中, 对于白天暗光不足、 背光拍 摄的图像或者夜晚的原始图像, 都可以运用该图像增强方法进行增强。 还可以在拍 照的时彳 I吴解决部分光照不均匀的问题。 如图 8所示, 可以将原始图像输入, 通过该 图像增强方法可以直接得到增强后的目标图像。 对于 1080P的高清大图也可以实时 进行图像增强处理, 因此, 该图像增强方法也可以拓展到对于挪顷中的图像进行图 像增强。
该图像增强方法可以生成高质量的图像, 增强后图像具体表现在图像细节清晰、 对比度明显、 曝光适中、 不会产生局部过曝或者过暗等问题, 同时图像的颜色方面 更加鲜艳,更加美观。该图像增强方法可以处理不同像素的图像,比如,可以对 1080P 大小的图像进行实时的增强, 还可以处理单反相机拍摄的分辨率 4k的图像。
在一实施例中, 将本申请的图像增强方法与五种最新的图像增强方法进行正确 率的比较,五种最新的图像增强方法包括基于 Retinex的图像增强方法 JieP、基于深 度学习的图像增强方法 HDRNet、 DPE、 White-Box以及 Distort-and-Recover。 对于 以上方法都采用推荐的参数进行公开实验, 并分别得到图像增强结果, 其中, 对于 四种基于深度学习的图像增强方法, 都在特殊条件数据集和标准条件数据集上进行 了重新的训练。 实验结果表明, 本申请的图像增强方法正确率大约为其他方法正确 率的三倍。
在一实施例中, 还进行了本申请图像增强方法与其他图像增强方法之间的视觉 比较。 使用了两张特殊的图像进行视觉对比, 其中一张为曝光不均匀的图像, 该图 像中包括难以察觉的风车细节(该图像来自特殊条件数据集),另一张为整体低光的 图像,该图像中包括少量的肖像细节(该图像来自标准条件数据集)。将这两张图像 分别通过不同的图像增强方法进行图像增强后, 进行视觉对比。 对比结果显示, 本 申请的图像增强方法能够在前景和背景中恢复更多的细节, 并得到更好的对比度, 且不会明显牺牲图像中过度曝光或者曝光不足的部分图像。 其次, 本申请的图像增 强方法能够展现更生动自然的色彩, 使得经过图像增强后的图像效果更加逼真。 在一实施例中, 为了评估深度学习网络模型的学习效率和泛化能力, 可以使用 PSNR(Peak Signal to Noise Ratio ,峰值信噪比)和 SSIM(structural similarity index, 结构相似性) 对多种图像增强方法进行度量。 为了保证度量结果的准确性, 将所有 图像增强方法的网络模型都在特殊条件数据集和标准条件数据集上进行重新训练。 表一为在特殊条件数据集和标准条件数据集上进行重新训练后, 多种图像增强方法 之间 PSNR和 SSIM的比较。 表二为在 MIT-Adobe FiveK Dataset数据集上进行重新 训练后, 多种图像增强方法之间 PSNR和 SSIM的比较。 如表一和表二所示, 本申 请的图像增强方法优于其他图像增强方法, 说明本申请的图像增强方法不仅能够适 用于特殊条件数据集, 而且可以推广至 U MIT-Adobe Five K Dataset数据集。
Figure imgf000018_0001
表 1
Figure imgf000018_0002
Figure imgf000019_0001
表 2
由表 1和表 2所示, 通过比较两表中包括三种损失函数的本申请图像增强方法 和不包括三种损失函数的本申请图像增强方法发现, 本申请图像增强方法在学习图 像到光照图的映射优于学习图像到图像的映射。 另外, 表中还显示了损失函数种类 的不同, 对结果的改进情况, 从而证明了每种损失函数起到的作用。
在一实施例中,还进行了对用户评价的研究,以进行图像增强方法之间的比较。 首先从图片分享数据库中通过 "City”、 "Flower”、 "Food”、 "Landscape”和 "Portrait” 等关键字搜索了 100张图像,这些图像中超过 50%的像素强度低于 0.3。然后使用多 种图像增强方法对上述图像进行图像增强, 并通过参与者对每种图像增强方法对应 的增强结果进行评级。 为了保证结果的准确性, 这些增强结果以随机的方式呈现给 参与者。
如图 9至图 14所示,参与者对图中所示的六个问题分别给出评分,从 1分至 5 分。 六个问题分别为 "容易辨认出图像中的细节吗?〃 "图像颜色鲜艳吗?〃 "结果 图像视觉上真实吗?〃 "结果图像是否没有过度曝光?〃 "结果图像比输入图像更吸 引人吗? 〃 "你的总分是多少? 〃。 每张图显示了特定问题的评分情况。 比较结果显 示, 本申请的图像增强方法获得的高分更多, 更受用户的青睐。
由上可知, 本申请实施例获取原始图像, 对原始图像的特征进行合成处理, 得 到原始图像对应的第一光照图, 第一光照图的分辨率低于原始图像的分辨率, 基于 第一光照图, 获取用于将图像映射成第二光照图的映射关系, 基于映射关系对原始 图像进行映射处理, 得到第二光照图, 第二光照图的分辨率与原始图像的分辨率相 同, 根据第二光照图对原始图像进行图像增强处理, 得到目标图像。 该方案通过深 度学习进行图像增强, 提高了图像增强的效率和准确性。 还通过对原始图像和标注 过的光照图进行回归学习, 获取图像增强所需的网络模型, 使得网络模型的训练更 加容易, 网络模型的鲁棒性更强, 并且便于对图像进行进一步的操作。 同时设计了 三种损失函数, 提升增强图像在颜色、 对比度方面的准确性。 并且通过在网络模型 训练过程中, 对光照图进行约束, 使得图像不会产生过度曝光、 过度增强的情况。
根据上述实施例所描述的方法, 以下将举例作进一步详细说明。
在本实施例中, 如图 4所示, 将以该图像增强装置具体集成在网络设备中为例 进行说明。
401、 网络设备获取原始图像。
在实际应用中, 网络设备可以获取多种拍摄情况的原始图像进行图像增强, 比 如, 原始图像可以为拍摄时正常曝光的图像、 曝光不足的图像、 光线不足的图像或 者背光的图像等等。 而不仅限于对正常曝光的图像进行图像增强, 从而扩大了图像 增强方法应用的广泛性。
在实际应用中, 网络设备获驅始图像的方式可以有多种, 比如, 可以从本地 存储中获取原始图像, 或者从网络侧设备获取原始图像, 等等。
在一实施例中, 比如, 网络设备还可以在通过摄像设备采集图像时, 选择当前 采集到的图像作为原始图像。 又比如, 当通过摄像设备采集图像并在图像拍摄界面 (如图像预览界面)中显示时,可以截取当前界面显示的图像作为原始图像,等等。
在一实施例中, 网络设备还可以从本地或者外部存储单元中获取原始图像; 比 如, 还可以从本地图像数据库中获取原始图像。
402、网络设备对原始图像的特征进行合成处理,得到原始图像对应的低分辨率 光照图。
由于目前采用深度学习的方法对图像进行图像增强时, 通常是采用原始图像到 标注图像进行回归学习得到的网络模型进行图像增强操作, 但是这样的方法, 会使 得网络模型的学习效率低, 网络模型的鲁棒性不强, 并且在图像对比度方面也存在 缺陷。
在实际应用中, 网络设备可以采用原始图像到光照图进行回归学习得到的图像 增强网络模型, 进行图像增强操作。 采用原始图像到光照图进行回归学习得到的图 像增强网络模型, 网络模型的学习效率高, 网络模型的鲁棒性强, 并且容易对图像 进行更近一步的操作。
该图像增强方法可以适用于图像增强网络模型。 图像增强网络模型采用原始图 像到光照图之间的映射关系, 替代原始图像到标注图像之间的映射关系。 这种方式 的优势在于, 原始图像到光照图之间的映射, 通常具有相对简单的形式和已知的先 验。 因此, 使得该图像增强网络模型具有较强的泛化能力, 能够有效处理复杂摄影 条件下获取的不同情况的原始图像。
在实际应用中, 原始图像对应的低分辨率光照图可以通过特征合成得到。 网络 设备可以首先提取出原始图像的特征, 并对该提取出的特征进行特征合成, 生成低 分辨率光照图。
其中, 由于在传统方法中, 通常采用调整图像直方图分布曲线的方法, 从全局 上对图像进行增强, 但是这种方法会导致局部光亮、 过曝、 过暗等问题, 并且生成 的图像颜色不会很鲜艳。
又由于增强曝光不足的图像需要同时对图像的局部特征 (比如对比度、 细节清 晰度、阴影和高光,等等)和全局特征(比如颜色分布、平均亮度和场景类别等等) 进行调整。 因此, 可以通过分别提取出原始图像的局部特征和全局特征, 来提高图 像增强的准确性。
在实际应用中, 网络设备可以将原始图像输入卷积网络中, 提取出原始图像的 局部特征和全局特征, 之后将提取出的局部特征和全局特征进行特征合成, 得到低 分辨率光照图。
其中, 为了提高图像特征提取的准确性, 可以采用网络模型对图像的特征进行 提取。
其中, 如图 6所示, 卷积网络可以包括初级特征提取网络、 局部特征提取网络 和全局特征提取网络, 其中, 局部特征提取网络和全局特征提取网络并联, 并与初 级特征提取网络串联。
在实际应用中, 网络设备可以将原始图像输入包括预训练好的 VGG16网络结 构的初级特征提取网络中, 提取出原始图像的初级特征, 之后将初级特征同时输入 并联的局部特征提取网络和全局特征提取网络中, 提取出局部特征和全局特征, 该 局部特征提取网络包括两层卷积层, 该全局特征提取网络包括两层卷积层和三层全 连接层。
为了能够实时处理高分辨率图像, 可以使得大多数网络计算都在低分辨率中完 成, 可以通过下采样的方式对图像进行分辨率的转换。
在实际应用中, 网络设备可以在原始图像像素构成的矩阵中, 获取一个预设尺 寸 s*s的矩阵, 之后将预设尺寸矩阵内的像素变成一个像素, 这个像素可以根据预 设规则进行获取, 比如这个像素可以是预设尺寸矩阵内所有像素的均值。 将整张原 始图像的像素都进行变换后, 可以得到下采样后的低分辨率输入图像。 之后可以将 该低分辨率输入图像输入到卷积网络中进行特征提取, 以及进行后续的步骤。 403、网络设备基于低分辨率光照图,获取用于将图像映射成第二光照图的映射 变换矩阵。
比如, 网络设备可以对低分辨率光照图的像素进行空域和值域的采样, 得到采 样后的像素, 之后找到对应像素在网格中的位置, 并进行网格差值运算, 得到映射 变换矩阵。
404、网络设备基于映射变换矩阵对原始图像进行映射处理,得到原分辨率光照 图。
其中, 为了提高图像增强的准确性, 可以通过双边网格的方式, 对原始图像进 行映射处理。
在实际应用中, 如图 7所示, 网络设备可以根据低分辨率光照图, 得到映射变 换矩阵, 之后可以通过这种映射关系, 对原始图像进行映射处理, 得到映射后的图 像, 该映射后的图像为一种低分辨率图像。 之后可以对该映射后图像进行双边网格 上采样操作, 在映射后图像像素的基础上, 在像素点之间采用合适的插值算法插入 新的元素, 得到原分辨率光照图。
405、网络设备根据原分辨率光照图对原始图像进行图像增强处理,得到目标图 像。
其中, 可以将图像的增强问题看作是寻找原始图像与目标图像之间映射关系的 问题。采用/代表目标图像对应的矩阵,采用 I代表原始图像对应的矩阵,采用函数 F代表原始图像与目标图像之间的映射函数, 那么映射函数 F可以通过下式进行表 示:
I = F(I)
由于目标图像、 原始图像和原分辨率光照图之间存在关系, 可以采用 S表示原 分辨率光照图对应的矩阵,采用 /表示目标图像对应的矩阵,采用 I代表原始图像对 应的矩阵, 那么目标图像、 原始图像和原分辨率光照图之间的关系如下式所示:
I = S *I
因此, 网络设备可以通过原始图像和原分辨率光照图, 获得目标图像。 根据原 始图像 I和原分辨率光照图 S , 获得目标图像 /如下式所示:
F(I) = S 1 I
在实际应用中, 如图 7所示, 网络设备首先获取原始图像, 并对原始图像进行 下采样, 得到 256x256像素的低分辨率输入图像。 之后将该低分辨率输入图像输入 至包括预训练好的 VGG16网络模型的初级特征提取网络中, 提取原始图像的初级 特征,之后将该初级特征分别输入并联的局部特征提取网络和全局特征提取网络中, 提取出局部特征和全局特征, 并将局部特征和全局特征进行合并操作, 得到低分辨 率光照图。 之后通过双边网格上采样, 得到映射变换矩阵, 并根据映射变换矩阵, 得到原分辨率光照图。最后通过公式 得到目标图像。通过这种方式增强图 像, 可以加速图像增强的过程, 从而提高图像增强的效率。
在实际应用中, 该图像增强方法还包括图像增强网络模型的训练过程, 该图像 增强方法还包括如下流程:
A、 网络设备基于图像增强网络模型和训练图像, 获取训练图像对应的预测增 强图像。
在实际应用中, 网络设备可以将训练图像输入图像增强网络模型中, 获取到训 练图像对应的预测增强图像, 其中, 通过该图像增强网络模型进行训练图像的图像 增强方法, 与通过该图像增强网络模型进行原始图像的图像增强方法相同, 上文已 经叙述, 此处不再赘述。
在实际应用中, 网络设备还可以通过对训练图像进行随机裁剪的方式, 提高训 练样本的多样性。 将训练图像随机裁剪为多张 512x512尺寸的图像, 以增加样本的 多样性。
其中, 可以通过提高训练图像的多样性, 提高网络模型的准确性。 训练图像中 可以包括多种拍摄情况的图像, 比如正常曝光、 曝光不足、 光线不足或者背光等多 种情况的图像, 根据这样的训练图像训练出的网络模型, 能够适应不同实际拍摄情 况下获取的图像。
在实际应用中,网络设备可以通过获取标准条件数据集、以及特殊条件数据集, 并根据标准条件数据集以及特殊条件数据集, 构建包括多种拍摄类型的切 I练图像。 标准条件数据集为包括正常曝光图像的数据集, 该标准条件数据集使用 MIT-Adobe Five K Dataset, 数据集中训练样本的标注选择专家 C的标注。 但是由于标准条件数 据集的创建主要是为了增强一般图像, 而不是曝光不足的图像, 标准条件数据集中 只包括很小的一部分(约 4%)的未曝光图像, 因此标准条件数据集中缺乏特殊拍摄条 件的情况, 比如夜间拍摄的图像和在非均匀光照情况下获取的图像等等。 为了增加 样本的多样性, 引入特殊条件数据集。
其中, 特殊条件数据集为包括非正常曝光图像的数据集, 比如, 特殊条件数据 集中可以包括曝光不足、 光线不足、 背光等特殊拍摄条件下获取的图像等等。 这种 特殊条件数据集可以包括多样的拍摄情况、 场景、 主题和样式等。 通过增加特殊条 件数据集, 可以对标准条件数据集中缺乏的图像种类进行补充。
根据标准条件数据集以及特殊条件数据集构建的切 I练图像, 进行网络模型的训 练,可以使得训练后的网络模型适应多种拍摄情况,从而提高了图像增强的准确性。 B、 网络设备基于目标损失函数获取预测增强图像与样本增强图像之间的损失 信息。
在实际应用中, 网络设备可以通过目标损失函数, 对预测增强图像与样本增强 图像之间的损失信息进行获取, 该损失信息可以为预测增强图像与样本增强图像之 间的差异, 通过网络模型的训练可以减少该损失信息。
目前通常通过调整图像的光照图, 进行光照图的局部平滑优化操作, 来增强图 像。 但是这种方法会造成一些光环的人工痕迹, 以及图像局部过度曝光的情况, 导 致图像过度增强。 因此, 可以设计一种包括重构损失函数、 局部平滑损失函数、 以 及颜色损失函数的目标损失函数, 通过对于光照图进行约束, 使得图像不会产生过 度曝光, 过度增强的情况。
在实际应用中, 目标损失函数包括重构损失函数、 局部平滑损失函数、 以及颜 色损失函数,采用 ^表示重构损失函数,采用 ^表示局部平滑损失函数,采用 ^表 示颜色损失函数, 采用 L表示目标损失函数。 采用 ^表示重构损失函数在训练中所 占的权重,采用 表示局部平滑损失函数在训练中所占的权重,采用 表示颜色损 失函数在训练中所占的权重。 目标损失函数的计算公式如下所示:
Figure imgf000024_0001
在实际应用中, 使得图像增强网络模型训练过程中, ^ =1 , ^ =2, =3。 在实际应用中,网络设备采用 S表示预测增强图像对应的原分辨率光照图矩阵, 采用 表示样本增强图像, 采用 /;表示训练图像, 可以通过预测增强图像对应的原 分辨率光照图矩阵 S和样本增强图像 ^相乘, 计算与训练图像7<之间欧式距离误差 度量, 以得到重构损失函数。 重构损失函数 ^的公式可以如下:
,f
其中, 多通道光照范围可以 , 样本增强图像 ^和训练图像 7呻 的所有像素通道都被标准化为[0 像素颜色的通道, 可以包括 RGB (红绿蓝) 三种像素颜色通道。
Figure imgf000024_0002
Ii , 可以将 7设为 S的下限, 以确 保图像经过图像增强后7^ 的所有颜色通道都以 1 为上限, 以此避免颜色超出色 域。 而将 1设置为 S的上限, 可以避免错误地使曝光不足的区域变暗。
在实际应用中, 网络设备还可以对重构损失函数中光照图的约束范围进行调整, 以满足不同情况的实际需求。 网络设备通过对 S添加不同的约束, 以调节图像的亮 暗程度、 图像的颜色鲜艳程度, 等等。 通过重构损失函数, 可以使得获得的增强后图像更加清晰, 以及使得图像对比 度更好。 但是目标函数中仅仅包括重构损失函数, 仍然存在无法正确生成图像对比 度细节和图像准确颜色的风险。
由于在传统方法里, 通常利用调整图像的直方图分布曲线, 以及利用优化图像 的光照图局部平滑, 来进行图像增强, 但是这类方法通常使用单通道的光照图进行 图像增强,会导致对于图像颜色的把控出现偏差,在图像颜色增强的方面出现欠缺。
因此, 可以通过对图像的 RGB三通道同时进行优化, 并利用网络模型的学习 能力, 对光照图进行学习的方式, 提高图像增强的准确性。
其中, 局部平滑损失函数可以获取图像的平滑度损失信息, 该局部平滑损失函 数可以通过对图像像素三通道进行求和获取。
在实际应用中, 网络设备通过对图像像素三通道求和获取局部平滑损失函数, 采用 p表示图像像素, 采用 S表示光照图, 局部平滑损失函数 的计算公式可以如 下:
Figure imgf000025_0001
其中,网络设备对像素的三通道进行求和得到局部平滑损失函数 4 ,采用 和 表示图像空间水平和垂直方向的偏导数,采用 <和
Figure imgf000025_0002
表示像素三通道空间变化 的平滑度权重,
Figure imgf000025_0003
计算公式可以如下:
Figure imgf000025_0004
其中, ^是训练图像 的对数图像, 0 = 1_2是控制图像灵敏度的参数,
Figure imgf000025_0005
个常量, 通常设置为 0.0001 , 以防止被零除。
其中, 采用局部平滑损失函数对网络模型进行训练, 可以减少过拟合, 提高网 络模型的泛化能力, 还可以恢复良好的图像对比度和图像中更清晰的细节。
虽然重构损失函数中已经隐式地测量了色差的欧式距离, 但是欧式距离的度量 仅可以对色差进行数值上的测量, 而无法保证颜色向量方向一致, 因此可能导致明 显的颜色不匹配。 为了准确还原图像中颜色信息, 还可以引入颜色损失函数。
其中, 颜色损失函数可以获取图像的颜色损失信息, 颜色损失函数可以通过计 算图像像素三通道构成的向量夹角来获取。
在实际应用中, 网络设备可以通过图像像素三通道构成的向量夹角获取颜色损 失函数, 比如, 可以通过颜色损失函数使得经过网络模型得到的预测增强图像与样 本增强图像之间的颜色相对应。 对于预测增强图像与样本增强图像, 可以将图像的 RGB值,视为空间上的向量,从而计算预测增强图像与样本增强图像对应颜色通道 向量之间的夹角, 夹角越小, 说明向量之间的方向越接近。
在实际应用中,采用 F(/<)表示预测增强图像,采用 表示样本增强图像,颜色 损失函数 的计算公式可以如下:
Figure imgf000026_0001
C、 网络设备基于损失信息对预测增强图像与样本增强图像进行收敛, 得到训 练后图像增强网络模型。
在实际应用中, 网络设备可以基于损失信息对预测增强图像与样本增强图像进 行收敛, 并得到训练后图像增强网络模型。
在实际应用中, 网络设备可以采用重构损失函数、 局部平滑损失函数、 以及颜 色损失函数, 对预测增强图像与样本增强图像进行收敛, 通过 P牵低预测增强图像与 样本增强图像之间的误差, 进行不断的训练, 以调整权重至合适数值, 便可得到训 练后图像增强网络模型。
通过图像增强方法对网络模型进行训练, 并采用训练后的网络模型进行图像的 增强, 可以加快网络运行的速度, 提升图像增强的效率, 并且不损害增强的效果, 提升图像增强的准确率。
采用上述方法切 I练出的网络模型可以通过对光照进行约束, 从而实现图像增强 效果的自定义, 比如, 可以通过增强局部平滑光照来增强对比度, 通过限制光照大 小来设置首选曝光级别, 等等。
在一实施例中, 该图像增强方法还可以通过调整损失函数中对光照图的约束, 使得用户能够根据个人喜好对图像进行调整, 比如图像的亮暗、 图像中颜色的鲜艳 程度等等。
在一实施例中, 该图像增强方法还可以通过增加图像去噪处理以及对图像完全 丟失细节的补充生成处理, 以获得增强效果更好的图像。
在实际应用中, 该图像增强方法需要拥有一个满足性能要求的图形处理器 (GPU) , 并且需要配置好 TensorFlow深度学习平台, 在该深度学习平台上可以对 图像增强方法进行直接的运行。
该图像增强方法可以广泛应用在各种拍摄条件中, 对于白天暗光不足、 背光拍 摄的图像或者夜晚的原始图像, 都可以运用该图像增强方法进行增强。 还可以在拍 照的时彳 I吴解决部分光照不均匀的问题。 如图 8所示, 可以将原始图像输入, 通过该 图像增强方法可以直接得到增强后的目标图像。 对于 1080P的高清大图也可以实时 进行图像增强处理, 因此, 该图像增强方法也可以拓展到对于挪顷中的图像进行图 像增强。 该图像增强方法可以生成高质量的图像, 增强后图像具体表现在图像细节清晰、 对比度明显、 曝光适中、 不会产生局部过曝或者过暗等问题, 同时图像的颜色方面 更加鲜艳,更加美观。该图像增强方法可以处理不同像素的图像,比如,可以对 1080P 大小的图像进行实时的增强, 还可以处理单反相机拍摄的分辨率 4k的图像。
由上可知, 本申请实施例通过网络设备获取原始图像, 对原始图像的特征进行 合成处理, 得到原始图像对应的低分辨率光照图, 基于低分辨率光照图, 获取用于 将图像映射成第二光照图的映射变换矩阵, 基于映射变换矩阵对原始图像进行映射 处理, 得到原分辨率光照图, 根据原分辨率光照图对原始图像进行图像增强处理, 得到目标图像。 该方案通过深度学习进行图像增强, 提高了图像增强的效率和准确 性。 还通过对原始图像和标注过的光照图进行回归学习, 获取图像增强所需的网络 模型, 使得网络模型的训练更加容易, 网络模型的鲁棒性更强, 并且便于对图像进 行进一步的操作。 同时设计了三种损失函数, 提升增强图像在颜色、 对比度方面的 准确性。 并且通过在网络模型训练过程中, 对光照图进行约束, 使得图像不会产生 过度曝光、 过度增强的情况。
为了更好地实施以上方法, 本申请实施例还提供一种图像增强装置, 该图像增 强装置具体可以集成在网络设备中。
例如, 如图 15所示, 该图像增强装置可以包括获取模块 151、 特征合成模块 152、 0央射关系获取模块 153、 0央射模块 154和图像增强模块 155。
获取模块 151 , 用于获取原始图像;
特征合成模块 152, 用于对所述原始图像的特征进行合成处理, 得到所述原始 图像对应的第一光照图, 所述第一光照图的分辨率低于所述原始图像的分辨率;
0央射关系获取模块 153 , 用于基于所述第_光照图, 获取用于将图像映射成第 二光照图的映射关系;
映射模块 154, 用于基于所述映射关系对所述原始图像进行映射处理, 得到第 二光照图, 所述第二光照图的分辨率与所述原始图像的分辨率相同;
图像增强模块 155 , 用于根据所述第二光照图对所述原始图像进行图像增强处 理, 得到目标图像。
在一实施例中, 参考图 16, 所述特征合成模块 152, 可以包括:
特征提取子模块 1521 ,用于基于卷积网络提取所述原始图像的局部特征和全局 特征;
特征合成子模块 1522,用于对所述局部特征和所述全局特征进行特征合成,得 到所述原始图像对应的第一光照图。
具体实施时,以上各个单元可以作为独立的实彳本来实现,也可以进行任意组合, 作为同一或若干个实彳本来实现,以上各个单元的具体实施可参见前面的方法实施例, 在此不再赘述。
由上可知, 本申请实施例通过获取模块 151获取原始图像, 通过特征合成模块 152对原始图像的特征进行合成处理, 得到原始图像对应的第一光照图, 第一光照 图的分辨率低于原始图像的分辨率, 通过映射关系获取模块 153基于第一光照图, 获取用于将图像映射成第二光照图的映射关系, 通过映射模块 154基于映射关系对 原始图像进行映射处理, 得到第二光照图, 第二光照图的分辨率与原始图像的分辨 率相同, 通过图像增强模块 155根据第二光照图对原始图像进行图像增强处理, 得 到目标图像。该方案通过深度学习进行图像增强,提高了图像增强的效率和准确性。 还通过对原始图像和标注过的光照图进行回归学习,获取图像增强所需的网络模型, 使得网络模型的训练更加容易, 网络模型的鲁棒性更强, 并且便于对图像进行进一 步的操作。同时设计了三种损失函数,提升增强图像在颜色、对比度方面的准确性。 并且通过在网络模型训练过程中,对光照图进行约束,使得图像不会产生过度曝光、 过度增强的情况。
本申请实施例还提供一种计算机设备, 该计算机设备可以为服务器或终端等设 备, 其集成了本申请实施例所提供的任一种图像增强装置, 例如上文所述的网络设 备。 如图 17所示, 图 17是本申请实施例提供的计算机设备的结构示意图, 具彳本来 讲:
该计算机设备可以包括一个或者一个以上处理核心的处理器 171、 一个或一个 以上计算机可读存储介质的存储器 172、 电源 173和输入单元 174等部件。 本领域 技术人员可以理解,图 17中示出的计算机设备结构并不构成对网络设备的限定,可 以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中: 处理器 171是该计算机设备的控制中心, 利用各种接口和线路连接整个计算机 设备的各个部分, 通过运行或执行存储在存储器 172内的软件程序和 /或模块, 以及 调用存储在存储器 172内的数据, 执行计算机设备的各种功能和处理数据, 从而对 计算机设备进行整体监控。 可选的, 处理器 171可包括一个或多个处理核心; 优选 的, 处理器 171可集成应用处理器和调制解调处理器, 其中, 应用处理器主要处理 操作系统、 用户界面和应用程序等, 调制解调处理器主要处理无线通信。 可以理解 的是, 上述调制解调处理器也可以不集成到处理器 171中。
存储器 172可用于存储软件程序以及模块, 处理器 171通过运行存储在存储器
172的软件程序以及模块, 从而执行各种功能应用以及数据处理。 存储器 172可主 要包括存储程序区和存储数据区, 其中, 存储程序区可存储操作系统、 至少一个功 能所需的应用程序 (比如声音播放功能、 图像播放功能等) 等; 存储数据区可存储 根据网络设备的使用所创建的数据等。 此外, 存储器 172可以包括高速随机存取存 储器, 还可以包括非易失性存储器, 例如至少一个磁盘存储器件、 闪存器件、 或其 他易失性固态存储器件。 相应地, 存储器 172还可以包括存储器控制器, 以提供处 理器 171对存储器 172的访问。
计算机设备还包括给各个部件供电的电源 173。 其中, 电源 173可以通过电源 管理系统与处理器 171逻辑相连, 从而通过电源管理系统实现管理充电、 放电、 以 及功耗管理等功能。 电源 173还可以包括一个或一个以上的直充或交充电源、 再充 电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
该计算机设备还可包括输入单元 174, 该输入单元 174可用于接收输入的数字 或字符信息, 以及产生与用户设置以及功能控制有关的键盘、 鼠标、 操作杆、 光学 或者轨迹球信号输入。
尽管未示出, 计算机设备还可以包括显示单元等, 在此不再赘述。 具体在本实 施例中, 计算机设备中的处理器 171会按照如下的指令, 将一个或一个以上的应用 程序的进程对应的可执行文件加载到存储器 172中, 并由处理器 171来运行存储在 存储器 172中的应用程序, 从而实现各种功能, 如下:
获取原始图像, 对原始图像的特征进行合成处理, 得到原始图像对应的第一光 照图, 第一光照图的分辨率低于原始图像的分辨率, 基于第一光照图, 获取用于将 图像映射成第二光照图的映射关系, 基于映射关系对原始图像进行映射处理, 得到 第二光照图, 第二光照图的分辨率与原始图像的分辨率相同, 根据第二光照图对原 始图像进行图像增强处理, 得到目标图像。
以上各个操作的具体实施可参见前面的实施例, 在此不再赘述。
由上可知, 本申请实施例获取原始图像, 对原始图像的特征进行合成处理, 得 到原始图像对应的第一光照图, 第一光照图的分辨率低于原始图像的分辨率, 基于 第一光照图, 获取用于将图像映射成第二光照图的映射关系, 基于映射关系对原始 图像进行映射处理, 得到第二光照图, 第二光照图的分辨率与原始图像的分辨率相 同, 根据第二光照图对原始图像进行图像增强处理, 得到目标图像。 该方案通过深 度学习进行图像增强, 提高了图像增强的效率和准确性。 还通过对原始图像和标注 过的光照图进行回归学习, 获取图像增强所需的网络模型, 使得网络模型的训练更 加容易, 网络模型的鲁棒性更强, 并且便于对图像进行进一步的操作。 同时设计了 三种损失函数, 提升增强图像在颜色、 对比度方面的准确性。 并且通过在网络模型 训练过程中, 对光照图进行约束, 使得图像不会产生过度曝光、 过度增强的情况。
本领域普通技术人员可以理解, 上述实施例的各种方法中的全部或部分步骤可 以通过指令来完成, 或通过指令控制相关的硬件来完成, 该指令可以存储于一计算 机可读存储介质中, 并由处理器进行加载和执行。
为此, 本申请实施例提供一种存储介质, 其中存储有多条指令, 该指令能够被 处理器进行加载, 以执行本申请实施例所提供的任一种图像增强方法中的步骤。 例 如, 该指令可以执行如下步骤:
获取原始图像, 对原始图像的特征进行合成处理, 得到原始图像对应的第一光 照图, 第一光照图的分辨率低于原始图像的分辨率, 基于第一光照图, 获取用于将 图像映射成第二光照图的映射关系, 基于映射关系对原始图像进行映射处理, 得到 第二光照图, 第二光照图的分辨率与原始图像的分辨率相同, 根据第二光照图对原 始图像进行图像增强处理, 得到目标图像。
以上各个操作的具体实施可参见前面的实施例, 在此不再赘述。
其中, 该存储介质可以包括: 只读存储器 (ROM, Read Only Memory) , Pit机 存取记忆体 (RAM, Random Access Memory)、 磁盘或光盘等。
由于该存储介质中所存储的指令, 可以执行本申请实施例所提供的任一种图像 增强方法中的步骤, 因此, 可以实现本申请实施例所提供的任一种图像增强方法所 能实现的有益效果, 详见前面的实施例, 在此不再赘述。
以上对本申请实施例所提供的一种图像增强方法、 装置及存储介质进行了详细 介绍, 本文中应用了具体个例对本申请的原理及实施方式进行了阐述, 以上实施例 的说明只是用于帮助理解本申请的方法及其核心思想; 同时, 对于本领域的技术人 员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述, 本说明书内容不应理解为对本申请的限制。

Claims

权利要求书
1、 一种图像增强方法, 由一网络设备执行, 包括:
获取原始图像;
对所述原始图像的特征进行合成处理, 得到所述原始图像对应的第一光照图, 所述第一光照图的分辨率低于所述原始图像的分辨率;
基于所述第一光照图, 获取用于将图像映射成第二光照图的映射关系; 基于所述映射关系对所述原始图像进行映射处理, 得到第二光照图, 所述第二 光照图的分辨率与所述原始图像的分辨率相同;
根据所述第二光照图对所述原始图像进行图像增强处理, 得到目标图像。
2、 根据权利要求 1所述的图像增强方法,其中,对所述原始图像的特征进行合 成处理, 得到所述原始图像对应的第 _光照图, 包括:
基于卷积网络提取所述原始图像的局部特征和全局特征;
对所述局部特征和所述全局特征进行特征合成, 得到所述原始图像对应的第 _ 光照图。
3、 根据权利要求 2所述的图像增强方法,其中,基于卷积网络提取所勝、始图 像的局部特征和全局特征, 包括:
将所述原始图像输入至卷积网络,其中,所述卷积网络包括初级特征提取网络、 局部特征提取网络和全局特征提取网络, 其中, 局部特征提取网络和全局特征提取 网络并联, 并与初级特征提取网络串联;
基于所述初级特征提取网络对所述原始图像进行卷积运算, 提取出所述原始图 像的初级特征;
基于所述局部特征提取网络对所述初级特征进行卷积运算, 提取出局部特征; 基于所述全局特征提取网络对所述初级特征进行卷积运算, 提取出全局特征。
4、 根据权利要求 1所述的图像增强方法,其中,对所述原始图像的特征进行合 成处理, 得到所述原始图像对应的第 _光照图, 包括:
对所述原始图像的像素进行下采样, 得到输入图像;
对所述输入图像的特征进行合成处理, 得到所述原始图像对应的第一光照图。
5、 根据权利要求 1所述的图像增强方法,其中,基于所述映射关系对所述原始 图像进行映射处理, 得到第二光照图, 包括:
基于所述映射关系对所述原始图像进行映射处理, 得到映射后图像; 对所述映射后图像进行上采样, 得到第二光照图。
6、 根据权利要求 1所述的图像增强方法,其中,获取用于将图像映射成第二光 照图的映射关系包括:
利用预设的训练图像和所述训练图像对应的样本增强图像, 获得使所述训练图 像对应的预测增强图像与所述样本增强图像之间的对比度损失信息满足预设条件的 所述映射关系; 其中, 所述预测增强图像为利用所述映射关系对所述训练图像进行 0央射处理得到的增强图像。
7、 根据权利要求 1所述的图像增强方法, 其中, 获取用于将图像映射成第二光 照图的映射关系包括:
利用预设的训练图像和所述训练图像对应的样本增强图像, 获得使所述训练图 像对应的预测增强图像与所述样本增强图像之间的平滑度损失信息; '茜足预设条件的 所述映射关系; 其中, 所述预测增强图像为利用所述映射关系对所述训练图像进行 0央射处理得到的增强图像。
8、 根据权利要求 1所述的图像增强方法, 其中, 获取用于将图像映射成第二光 照图的映射关系包括:
利用预设的训练图像和所述训练图像对应的样本增强图像, 获得使所述训练图 像对应的预测增强图像与所述样本增强图像之间的颜色损失信息; '茜足预设条件的所 述映射关系; 其中, 所述预测增强图像为利用所述映射关系对所述训练图像进行映 射处理得到的增强图像。
9、 一种图像增强装置, 包括:
获取模块, 用于获取原始图像;
特征合成模块, 用于对所述原始图像的特征进行合成处理, 得到所述原始图像 对应的第一光照图, 所述第一光照图的分辨率低于所述原始图像的分辨率;
映射关系获取模块, 用于基于所述第一光照图, 获取用于将图像映射成第二光 照图的映射关系;
映射模块, 用于基于所述映射关系对所述原始图像进行映射处理, 得到第二光 照图, 所述第二光照图的分辨率与所述原始图像的分辨率相同;
图像增强模块, 用于根据所述第二光照图对所述原始图像进行图像增强处理, 得到目标图像。
10、 根据权利要求 9所述的图像增强装置, 其中, 所述特征合成模块用于: 基于卷积网络提取所述原始图像的局部特征和全局特征;
对所述局部特征和所述全局特征进行特征合成, 得到所述原始图像对应的第 _ 光照图。
11、 根据权利要求 10所述的图像增强装置, 其中, 所述特征合成模块用于: 将所述原始图像输入至卷积网络,其中,所述卷积网络包括初级特征提取网络、 局部特征提取网络和全局特征提取网络, 其中, 局部特征提取网络和全局特征提取 网络并联, 并与初级特征提取网络串联;
基于所述初级特征提取网络对所述原始图像进行卷积运算, 提取出所述原始图 像的初级特征;
基于所述局部特征提取网络对所述初级特征进行卷积运算, 提取出局部特征; 基于所述全局特征提取网络对所述初级特征进行卷积运算, 提取出全局特征。
12、 根据权利要求 9所述的图像增强装置, 其中, 所述特征合成模块用于: 对所述原始图像的像素进行下采样, 得到输入图像;
对所述输入图像的特征进行合成处理, 得到所述原始图像对应的第一光照图。
13、 根据权利要求 9所述的图像增强装置, 其中, 所述映射模块用于: 基于所述映射关系对所述原始图像进行映射处理, 得到映射后图像; 对所述映射后图像进行上采样, 得到第二光照图。
14、根据权利要求 9所述的图像增强装置,其中,所述映射关系获取模块用于: 利用预设的训练图像和所述训练图像对应的样本增强图像, 获得使所述训练图 像对应的预测增强图像与所述样本增强图像之间的对比度损失信息满足预设条件的 所述映射关系; 其中, 所述预测增强图像为利用所述映射关系对所述训练图像进行 0央射处理得到的增强图像。
15、根据权利要求 9所述的图像增强装置,其中,所述映射关系获取模块用于: 利用预设的训练图像和所述训练图像对应的样本增强图像, 获得使所述训练图 像对应的预测增强图像与所述样本增强图像之间的平滑度损失信息; '茜足预设条件的 所述映射关系; 其中, 所述预测增强图像为利用所述映射关系对所述训练图像进行 0央射处理得到的增强图像。
16、根据权利要求 9所述的图像增强装置,其中,所述映射关系获取模块用于: 利用预设的训练图像和所述训练图像对应的样本增强图像, 获得使所述训练图 像对应的预测增强图像与所述样本增强图像之间的颜色损失信息; '茜足预设条件的所 述映射关系; 其中, 所述预测增强图像为利用所述映射关系对所述训练图像进行映 射处理得到的增强图像。
17、 一种存储介质, 其上存储有计算机程序, 其特征在于, 当所述计算机程序 在计算机上运行时, 使得所述计算机执行如权利要求 1-8任_项所述的图像增强方 法。
18、 一种计算机设备, 包括: 处理器和存储器, 所述存储器中存储有计算机可 读指令, 所述指令可以使所述处理器执行用于实现根据权利要求 1-8中任 _权利要 求所述的方法。
PCT/CN2020/075472 2019-02-28 2020-02-17 一种图像增强方法、装置及存储介质 WO2020173320A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/324,336 US11790497B2 (en) 2019-02-28 2021-05-19 Image enhancement method and apparatus, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910148574.6 2019-02-28
CN201910148574.6A CN109919869B (zh) 2019-02-28 2019-02-28 一种图像增强方法、装置及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/324,336 Continuation US11790497B2 (en) 2019-02-28 2021-05-19 Image enhancement method and apparatus, and storage medium

Publications (1)

Publication Number Publication Date
WO2020173320A1 true WO2020173320A1 (zh) 2020-09-03

Family

ID=66962576

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/075472 WO2020173320A1 (zh) 2019-02-28 2020-02-17 一种图像增强方法、装置及存储介质

Country Status (3)

Country Link
US (1) US11790497B2 (zh)
CN (1) CN109919869B (zh)
WO (1) WO2020173320A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112330788A (zh) * 2020-11-26 2021-02-05 北京字跳网络技术有限公司 图像处理方法、装置、可读介质及电子设备
CN113436105A (zh) * 2021-06-30 2021-09-24 北京百度网讯科技有限公司 模型训练和图像优化方法、装置、电子设备及存储介质
CN113436107A (zh) * 2021-07-05 2021-09-24 鹏城实验室 图像增强方法、智能设备、计算机存储介质
CN114708250A (zh) * 2022-04-24 2022-07-05 上海人工智能创新中心 一种图像处理方法、装置及存储介质
CN115423809A (zh) * 2022-11-04 2022-12-02 江西电信信息产业有限公司 图像质量评价方法、装置、可读存储介质及电子设备
CN114708250B (zh) * 2022-04-24 2024-06-07 上海人工智能创新中心 一种图像处理方法、装置及存储介质

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109919869B (zh) * 2019-02-28 2021-06-04 腾讯科技(深圳)有限公司 一种图像增强方法、装置及存储介质
CN110838084B (zh) * 2019-09-24 2023-10-17 咪咕文化科技有限公司 一种图像的风格转移方法、装置、电子设备及存储介质
CN110766682A (zh) * 2019-10-29 2020-02-07 慧影医疗科技(北京)有限公司 肺结核定位筛查装置及计算机设备
CN111145097B (zh) * 2019-12-31 2023-09-01 华为技术有限公司 图像处理方法、装置和图像处理系统
WO2021138797A1 (en) * 2020-01-07 2021-07-15 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method of adjusting captured image and electrical device
CN113284054A (zh) * 2020-02-19 2021-08-20 华为技术有限公司 图像增强方法以及图像增强装置
CN111654746B (zh) * 2020-05-15 2022-01-21 北京百度网讯科技有限公司 视频的插帧方法、装置、电子设备和存储介质
CN111626954B (zh) * 2020-05-22 2022-05-06 兰州理工大学 壁画图像色彩还原方法、装置、存储介质及计算机设备
CN112232307B (zh) * 2020-11-20 2022-07-05 四川轻化工大学 夜视环境下的安全帽佩戴检测方法
CN112435197A (zh) * 2020-12-02 2021-03-02 携程计算机技术(上海)有限公司 图像美化方法、装置、电子设备和存储介质
KR20220114209A (ko) * 2021-02-08 2022-08-17 삼성전자주식회사 연사 영상 기반의 영상 복원 방법 및 장치
CN113505848B (zh) * 2021-07-27 2023-09-26 京东科技控股股份有限公司 模型训练方法和装置
CN113643202A (zh) * 2021-07-29 2021-11-12 西安理工大学 一种基于噪声注意力图指导的微光图像增强方法
CN113744169A (zh) * 2021-09-07 2021-12-03 讯飞智元信息科技有限公司 图像增强方法、装置、电子设备和存储介质
CN114255193A (zh) * 2021-12-28 2022-03-29 湖南云箭智能科技有限公司 一种板卡图像增强方法、装置、设备及可读存储介质
CN114511462B (zh) * 2022-02-11 2023-04-18 电子科技大学 一种视觉图像增强方法
CN115018729B (zh) * 2022-06-17 2024-04-02 重庆米弘科技有限公司 一种面向内容的白盒图像增强方法
CN115082427B (zh) * 2022-07-20 2022-11-11 山东智领新材料有限公司 基于人工智能的铝材压延工艺参数控制方法
CN116188332B (zh) * 2023-04-27 2023-07-28 深圳思谋信息科技有限公司 一种图像处理方法、装置、设备及存储介质
CN117078561B (zh) * 2023-10-13 2024-01-19 深圳市东视电子有限公司 基于rgb的自适应颜色校正与对比度增强方法及装置
CN117372307B (zh) * 2023-12-01 2024-02-23 南京航空航天大学 一种多无人机协同探测分布式图像增强方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109003231A (zh) * 2018-06-11 2018-12-14 广州视源电子科技股份有限公司 一种图像增强方法、装置和显示设备
CN109102483A (zh) * 2018-07-24 2018-12-28 厦门美图之家科技有限公司 图像增强模型训练方法、装置、电子设备及可读存储介质
CN109102468A (zh) * 2018-06-27 2018-12-28 广州视源电子科技股份有限公司 图像增强方法、装置、终端设备及存储介质
CN109345485A (zh) * 2018-10-22 2019-02-15 北京达佳互联信息技术有限公司 一种图像增强方法、装置、电子设备及存储介质
CN109919869A (zh) * 2019-02-28 2019-06-21 腾讯科技(深圳)有限公司 一种图像增强方法、装置及存储介质

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100562067C (zh) * 2007-07-26 2009-11-18 上海交通大学 带有去噪功能的实时数字图像处理增强方法
CN101102398B (zh) * 2007-07-26 2010-05-19 上海交通大学 全自动的实时数字图像处理增强系统
EP2187620B1 (en) * 2007-07-26 2014-12-24 Omron Corporation Digital image processing and enhancing system and method with function of removing noise
CN105096278B (zh) * 2015-09-22 2016-08-17 南阳理工学院 基于光照调整的图像增强方法和设备
US9836820B2 (en) * 2016-03-03 2017-12-05 Mitsubishi Electric Research Laboratories, Inc. Image upsampling using global and local constraints
CN108021933B (zh) * 2017-11-23 2020-06-05 深圳市华尊科技股份有限公司 神经网络识别装置及识别方法
CN108305236B (zh) * 2018-01-16 2022-02-22 腾讯科技(深圳)有限公司 图像增强处理方法及装置
CN108764250B (zh) * 2018-05-02 2021-09-17 西北工业大学 一种运用卷积神经网络提取本质图像的方法
CN109086656B (zh) * 2018-06-06 2023-04-18 平安科技(深圳)有限公司 机场异物检测方法、装置、计算机设备及存储介质
CN108764202B (zh) * 2018-06-06 2023-04-18 平安科技(深圳)有限公司 机场异物识别方法、装置、计算机设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109003231A (zh) * 2018-06-11 2018-12-14 广州视源电子科技股份有限公司 一种图像增强方法、装置和显示设备
CN109102468A (zh) * 2018-06-27 2018-12-28 广州视源电子科技股份有限公司 图像增强方法、装置、终端设备及存储介质
CN109102483A (zh) * 2018-07-24 2018-12-28 厦门美图之家科技有限公司 图像增强模型训练方法、装置、电子设备及可读存储介质
CN109345485A (zh) * 2018-10-22 2019-02-15 北京达佳互联信息技术有限公司 一种图像增强方法、装置、电子设备及存储介质
CN109919869A (zh) * 2019-02-28 2019-06-21 腾讯科技(深圳)有限公司 一种图像增强方法、装置及存储介质

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112330788A (zh) * 2020-11-26 2021-02-05 北京字跳网络技术有限公司 图像处理方法、装置、可读介质及电子设备
CN113436105A (zh) * 2021-06-30 2021-09-24 北京百度网讯科技有限公司 模型训练和图像优化方法、装置、电子设备及存储介质
CN113436107A (zh) * 2021-07-05 2021-09-24 鹏城实验室 图像增强方法、智能设备、计算机存储介质
CN113436107B (zh) * 2021-07-05 2023-06-20 鹏城实验室 图像增强方法、智能设备、计算机存储介质
CN114708250A (zh) * 2022-04-24 2022-07-05 上海人工智能创新中心 一种图像处理方法、装置及存储介质
CN114708250B (zh) * 2022-04-24 2024-06-07 上海人工智能创新中心 一种图像处理方法、装置及存储介质
CN115423809A (zh) * 2022-11-04 2022-12-02 江西电信信息产业有限公司 图像质量评价方法、装置、可读存储介质及电子设备

Also Published As

Publication number Publication date
CN109919869A (zh) 2019-06-21
US20210272236A1 (en) 2021-09-02
US11790497B2 (en) 2023-10-17
CN109919869B (zh) 2021-06-04

Similar Documents

Publication Publication Date Title
WO2020173320A1 (zh) 一种图像增强方法、装置及存储介质
Li et al. Low-light image and video enhancement using deep learning: A survey
WO2020192483A1 (zh) 图像显示方法和设备
WO2018136373A1 (en) Image fusion and hdr imaging
US20150117783A1 (en) Iterative saliency map estimation
JP2016516378A (ja) ゴーストのない高ダイナミックレンジ画像の生成
WO2020143257A1 (zh) 一种抗运动伪影的hdr方法及便携式终端
CN108510557B (zh) 图像色调映射方法及装置
CN112734650A (zh) 一种基于虚拟多曝光融合的不均匀光照图像增强方法
Kotwal et al. An optimization-based approach to fusion of multi-exposure, low dynamic range images
TW202137133A (zh) 圖像處理方法、電子設備及電腦可讀儲存介質
CN116012232A (zh) 图像处理方法、装置及存储介质、电子设备
WO2021128593A1 (zh) 人脸图像处理的方法、装置及系统
WO2023081399A1 (en) Integrated machine learning algorithms for image filters
Song et al. Multi-scale joint network based on Retinex theory for low-light enhancement
CN117152182B (zh) 一种超低照度网络相机图像处理方法、装置及电子设备
CN113034412B (zh) 视频处理方法及装置
CN114240767A (zh) 一种基于曝光融合的图像宽动态范围处理方法及装置
US20220398704A1 (en) Intelligent Portrait Photography Enhancement System
Ko et al. IceNet for interactive contrast enhancement
CN112991236B (zh) 一种基于模板的图像增强方法及装置
US11625886B2 (en) Storage medium storing program, training method of machine learning model, and image generating apparatus
Li et al. Rendering nighttime image via cascaded color and brightness compensation
Mu et al. Little Strokes Fell Great Oaks: Boosting the Hierarchical Features for Multi-exposure Image Fusion
CN112132923A (zh) 一种基于风格小图高清化的两阶段数字图像风格变换方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20763501

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20763501

Country of ref document: EP

Kind code of ref document: A1