WO2020168706A1 - 图像处理方法及装置、电子设备和存储介质 - Google Patents

图像处理方法及装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2020168706A1
WO2020168706A1 PCT/CN2019/104247 CN2019104247W WO2020168706A1 WO 2020168706 A1 WO2020168706 A1 WO 2020168706A1 CN 2019104247 W CN2019104247 W CN 2019104247W WO 2020168706 A1 WO2020168706 A1 WO 2020168706A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
brightness
pixel
reflection
neural network
Prior art date
Application number
PCT/CN2019/104247
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 WO2020168706A1 publication Critical patent/WO2020168706A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • 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
    • 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

  • the present disclosure relates to the field of computer vision, and in particular to an image processing method and device, electronic equipment, and storage medium.
  • the captured images may be distorted due to restrictions on time, location, and low-light environments.
  • the video images acquired in this environment have low contrast and distorted information. Therefore, the efficiency and accuracy of intelligent video analysis such as face recognition and behavior analysis are low.
  • Embodiments of the present disclosure provide an image processing method and device, electronic equipment, and storage medium, which can improve image processing efficiency and image quality.
  • an image processing method including:
  • an enhanced image of the input image is obtained.
  • the element in the first brightness feature represents the brightness component of each pixel of the input image
  • the acquiring the first brightness feature of the input image includes:
  • the maximum value in the multiple color channels corresponding to each pixel is determined as the brightness component of the corresponding pixel in the first brightness feature to obtain the first brightness feature.
  • an element in the first reflection feature represents a reflection component of a pixel corresponding to the input image
  • the use of the first brightness feature to obtain the first reflection feature of the input image includes :
  • the first reflection characteristic is determined according to the first reflection component of each color channel of the pixel of the input image.
  • an element in the first reflection feature represents a reflection component of a pixel corresponding to the input image
  • the use of the first brightness feature to obtain the first reflection feature of the input image includes :
  • the first reflection characteristic is determined according to the second reflection component of each color channel of the pixel of the input image.
  • the obtaining an enhanced image of the input image based on the first brightness feature and the first reflection feature includes:
  • an enhanced image of the input image is obtained.
  • performing optimization processing on the first brightness feature to obtain the second brightness feature includes:
  • a decoding process is performed on the encoded first brightness feature to obtain the second brightness feature.
  • the obtaining an enhanced processed image of the input image based on the second brightness feature and the first reflection feature includes:
  • the enhanced image is determined based on the reconstruction feature.
  • the performing optimization processing on the first brightness feature includes: performing optimization processing on the first brightness feature through a first neural network;
  • the training process of the first neural network includes:
  • the loss function of the first neural network is:
  • L s1 is the loss function of the first neural network
  • y i represents the brightness component of pixel i in the first brightness feature
  • N represents the number of pixels
  • W (l) represents the neural network parameters of the lth layer of the first neural network
  • w i represents the structural weight of the i-th pixel Value
  • F represents Frobenius norm
  • L 1 represents the number of network layers in the first neural network
  • is a constant.
  • obtaining the structural weight feature of the image sample includes:
  • the obtaining the structure information of the image sample includes at least one of the following manners:
  • the structure information of the image sample is obtained by using a rolling guide filter.
  • the expression for obtaining the structural weight feature by using the gradient information is:
  • w(x) represents the structural weight of x pixels
  • g(x) represents the gradient information of x pixels.
  • the method further includes: performing denoising processing on the first reflection component through a second neural network, wherein the expression of the loss function of the second neural network is:
  • L s2 is the loss function of the second neural network
  • R i represents the first reflection component
  • N represents the number of pixels
  • W (l) represents the neural network parameters of the first layer of the second neural network
  • F represents the Frobenius norm
  • L 2 represents the second The number of network layers in a neural network
  • ⁇ j represents the activity of the hidden layer in the second neural network
  • represents the divergence constant
  • is the constant.
  • an image processing apparatus including:
  • An obtaining module configured to obtain the first brightness feature of the input image
  • a conversion module configured to obtain the first reflection characteristic of the input image by using the first brightness characteristic
  • the enhancement module is configured to obtain an enhanced image of the input image based on the first brightness feature and the first reflection feature.
  • the acquiring module is further configured to acquire feature values of multiple color channels corresponding to each pixel in the input image; for each pixel, determine the feature values of the multiple color channels And determining the maximum value in the multiple color channels corresponding to each pixel as the brightness component of the corresponding pixel in the first brightness feature to obtain the first brightness feature; wherein, the first brightness feature The element in a brightness feature represents the brightness component of each pixel of the input image.
  • the element in the first reflection feature represents the reflection component of the pixel corresponding to the input image; the conversion module is further configured to combine the element in the first brightness feature with a preset constant Perform the addition process to obtain the addition feature; determine the ratio between the feature value of each color channel of the corresponding pixel in the input image and the feature value of the corresponding pixel in the addition feature as the corresponding pixel The first reflection component of each color channel of the input image; and determine the first reflection feature according to the first reflection component of each color channel of the pixel point of the input image; wherein, the element in the first reflection feature represents The reflection component of each pixel of the input image.
  • the element in the first reflection feature represents the reflection component of the pixel corresponding to the input image; the conversion module is further configured to combine the element in the first brightness feature with a preset constant Perform addition processing to obtain the sum feature; obtain the ratio of the feature value of each color channel of the corresponding pixel in the input image to the feature value of the corresponding pixel in the addition feature, and obtain each color of the pixel
  • the first reflection component of the channel performing denoising processing on the first reflection component to obtain the second reflection component of each color channel of the pixel; and according to the pixel of the input image for each color channel
  • the second reflection component determines the first reflection feature; wherein, the element in the first reflection feature represents the reflection component of each pixel of the input image.
  • the enhancement module includes:
  • An optimization unit configured to perform optimization processing on the first brightness feature to obtain a second brightness feature
  • the enhancement unit is configured to obtain an enhanced image of the input image based on the second brightness feature and the first reflection feature.
  • the optimization unit is further configured to perform encoding processing on the first brightness feature based on encoding parameters to obtain the encoded first brightness feature; based on the decoding parameters, perform encoding processing on the encoded first brightness feature; Perform decoding processing on a brightness feature to obtain the second brightness feature.
  • the enhancement unit is further configured to perform product processing on the second brightness feature and the first reflection feature to obtain a reconstruction feature; and determine the enhanced image based on the reconstruction feature.
  • the optimization unit is configured to perform optimization processing on the first brightness feature of the first neural network;
  • the device further includes a training module configured to train the first neural network and train The process of the first neural network includes: obtaining an image sample; obtaining a first brightness feature and a structure weight feature of the image sample, and an element in the structure weight feature represents each pixel in the first brightness feature The weight of the brightness component; input the first brightness feature and the structural weight feature to the first neural network to obtain the predicted second brightness feature; adjust according to the loss value corresponding to the predicted second brightness feature The parameters of the first neural network until the loss value meets a preset requirement.
  • the loss function of the first neural network is:
  • L s1 is the loss function of the first neural network
  • y i represents the brightness component of pixel i in the first brightness feature
  • N represents the number of pixels
  • W (l) represents the neural network parameters of the lth layer of the first neural network
  • w i represents the structural weight of the i-th pixel Value
  • F represents Frobenius norm
  • L 1 represents the number of network layers in the first neural network
  • is a constant.
  • the training module is configured to obtain the structural weight characteristics of the image sample in the following manner: obtain the structural information of the image sample; obtain the gradient information of the structural information based on a preset operator; The gradient information obtains the structure weight feature.
  • the training module is further configured to obtain the structure information of the image sample by using at least one of the following methods: using a structure-texture decomposition algorithm to obtain the structure information of the image sample; using a rolling guide filter Obtain the structural information of the image sample.
  • the expression that the training module uses the gradient information to obtain the structure weight feature is:
  • w(x) represents the structural weight of x pixels
  • g(x) represents the gradient information of x pixels.
  • the conversion module is further configured to perform denoising processing on the first reflection component through a second neural network, wherein the expression of the loss function of the second neural network is:
  • L s2 is the loss function of the second neural network
  • R i represents the first reflection component
  • N represents the number of pixels
  • W (l) represents the neural network parameters of the first layer of the second neural network
  • F represents the Frobenius norm
  • L 2 represents the second The number of network layers in a neural network
  • ⁇ j represents the activity of the hidden layer in the second neural network
  • represents the divergence constant
  • is the constant.
  • an electronic device including:
  • a memory for storing processor executable instructions
  • the processor is configured to execute the method described in any one of the first aspect.
  • a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the method described in any one of the first aspects is implemented .
  • the embodiments of the present disclosure can utilize the combination of the brightness feature and the reflection feature of the image to achieve the purpose of image enhancement.
  • the embodiments of the present disclosure may first obtain the brightness feature of the input image, and further determine the reflection feature of the input image according to the brightness feature, and then perform the enhancement processing of the input image through the obtained brightness feature and reflection feature to obtain an enhanced image.
  • the process has the characteristics of simplicity and convenience and high processing efficiency, and can also improve the image enhancement effect.
  • Fig. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure
  • Fig. 2 shows a flowchart of step S100 in an image processing method according to an embodiment of the present disclosure
  • Fig. 3 shows a flowchart of step S200 in an image processing method according to an embodiment of the present disclosure
  • FIG. 4 shows another flowchart of step S200 in an image processing method according to an embodiment of the present disclosure
  • Fig. 5 shows a flowchart of step S300 in an image processing method according to an embodiment of the present disclosure
  • Fig. 6 shows a flowchart of step S301 in an image processing method according to an embodiment of the present disclosure
  • FIG. 7 shows a schematic diagram of the structure of each layer of the first neural network according to an embodiment of the present disclosure
  • Fig. 8 shows a flowchart of step S302 in an image processing method according to an embodiment of the present disclosure
  • FIG. 9 shows a flowchart of training a first neural network according to an embodiment of the present disclosure.
  • Fig. 10 shows a flow chart of obtaining the structural weight characteristics of the image sample according to an embodiment of the present disclosure
  • Fig. 11 shows a block diagram of an image processing device according to an embodiment of the present disclosure
  • FIG. 12 shows a block diagram of an electronic device 800 according to an embodiment of the present disclosure
  • FIG. 13 shows a block diagram of an electronic device 1900 according to an embodiment of the present disclosure.
  • the embodiments of the present disclosure provide an image processing method, which can be applied to an image processing device or an image acquisition device, or can also be applied to any terminal or server, as long as the device is related to image acquisition or processing. Apply the method of the embodiment of the present disclosure.
  • Fig. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure.
  • the image processing method of the embodiment of the present disclosure as shown in FIG. 1 may include:
  • the acquired input image may be a low-illuminance image acquired under low-illuminance conditions, or may also be an image whose contrast, sharpness, image quality, resolution, etc. are affected due to other factors.
  • the embodiments of the present disclosure can perform image enhancement processing on an input image to improve the image quality of the input image.
  • the image processing method provided by the embodiments of the present disclosure can be implemented through a neural network, such as a deep neural network, but the embodiments of the present disclosure do not specifically limit this, and the embodiments of the present disclosure can also implement the implementation of the present disclosure through corresponding image processing algorithms.
  • a neural network such as a deep neural network
  • the embodiment of the present disclosure may first extract the brightness feature (brightness component) of each pixel in the input image, and determine the first brightness feature of the input image based on the brightness component.
  • the first brightness feature can be expressed in a matrix form, and the brightness components of each element correspond to each pixel of the color image.
  • the feature value of each pixel on the R channel, G channel, and B channel can be obtained first, and the first image of the input image can be obtained according to the feature value of each color channel.
  • a brightness feature For other images, the feature values of other color channels on each pixel point can also be obtained, which is not illustrated one by one in the embodiment of the present disclosure.
  • the reflection component of each pixel of the input image can be obtained according to the obtained first brightness feature.
  • the reflection components of each color channel can be obtained in a preset manner, thereby forming the first reflection characteristic.
  • the first reflection characteristic of the embodiment of the present disclosure may include the reflection characteristic after denoising processing, and may also include the characteristic without denoising processing, and those skilled in the art can choose and set it according to different requirements.
  • the first reflection feature can also be expressed in a matrix form, and the reflection component of each element also corresponds to each pixel of the color image.
  • S300 Obtain an enhanced image of the input image based on the first brightness feature and the first reflection feature.
  • the brightness component and reflection component of each pixel can be used to obtain the enhanced feature value.
  • the two can be multiplied to obtain the enhanced feature value. image.
  • the element in the first brightness feature obtained in step S100 of the embodiment of the present disclosure may represent the brightness component of each pixel of the input image, and the first brightness feature can be determined by the feature value of each color channel .
  • Fig. 2 shows a flowchart of step S100 in an image processing method according to an embodiment of the present disclosure.
  • the acquiring the first brightness characteristic of the input image may include:
  • the feature value of each color channel on each pixel of the input image can be extracted.
  • each pixel of the input image can be obtained separately
  • the characteristic values of the three color channels at the point such as the characteristic value of the R channel, the characteristic value of the G channel, and the characteristic value of the B channel.
  • the characteristic values of different color channels may be obtained according to different image forms, which are not specifically limited in the present disclosure.
  • each pixel may include feature values of multiple color channels
  • the embodiment of the present disclosure may determine the largest feature value among the feature values of each color channel as the brightness component of the pixel. It can be obtained according to the following formula:
  • T(x) represents the brightness component of the x pixel
  • c is the color channel
  • L c (x) represents the characteristic value of the x pixel c color channel.
  • the maximum color channel value for each pixel can be obtained for the subsequent determination of the first brightness feature.
  • the input image if the input image is not in RGB format, the image can also be converted into RGB format.
  • the embodiment of the present disclosure does not specifically limit the conversion process of the image format, and those skilled in the art can choose an adaptive method to execute The above conversion.
  • S103 Determine the maximum value in the multiple color channels corresponding to each pixel as the brightness component of the corresponding pixel in the first brightness feature to obtain the first brightness feature.
  • the maximum value can be used as the brightness component of the pixel, and the first brightness feature can be formed according to the brightness component of each pixel.
  • the influence of noise on the image can be effectively reduced.
  • the first brightness feature of the input image of the embodiment of the present disclosure can be obtained through the foregoing embodiment. After the first brightness feature is obtained, the first reflection feature can be obtained according to the first brightness feature.
  • the element in the first reflection feature of the embodiment of the present disclosure may represent the reflection component of the pixel point corresponding to the input image, and this process will be described below.
  • Fig. 3 shows a flowchart of step S200 in an image processing method according to an embodiment of the present disclosure, wherein the obtaining the first reflection characteristic of the input image by using the first brightness characteristic may include:
  • S201 Perform addition processing on the element in the first brightness feature and a preset constant to obtain an addition feature.
  • the reflection component of each pixel of the input image can be obtained according to the first brightness feature.
  • the brightness component of each pixel in the first brightness feature can be added to a preset constant.
  • the preset constant can be a small value, usually less than 1, such as 0.01.
  • the sum value of each pixel is obtained, and the sum characteristic can be formed based on the sum value of each pixel.
  • the summation feature can also be expressed in a matrix form, where the elements can be the summation value corresponding to each pixel of the color image.
  • S202 Determine the ratio between the feature value of each color channel of the corresponding pixel in the input image and the feature value of the corresponding pixel in the addition feature as the first value of each color channel of the corresponding pixel. Reflection component.
  • the feature value of each color channel of each pixel of the input image can be obtained in step S100, and the reflection component can be obtained according to the feature value when step S202 is performed.
  • the feature value of each color channel of each pixel of the input image can be divided by the sum value of the corresponding pixel to obtain the feature value of each color channel of each pixel and the sum of the corresponding pixel.
  • the ratio between the sum values For RGB images, each pixel can get three ratios, that is, the ratio of the R channel characteristic value and the sum value of the pixel, and the G channel characteristic value and the sum value of the pixel. And the ratio of the characteristic value of the B channel to the sum of the pixel point.
  • the ratio of other feature values can be obtained, which is not limited in the embodiment of the present disclosure.
  • the ratio of each color channel can be obtained, and the ratio of each pixel can be used as the first reflection component of the pixel.
  • the R channel feature value, G channel feature value, and B channel feature value of each pixel can be divided by the sum of the pixel points to obtain three first reflection components, so that each pixel can be obtained The first reflection component of the three color channels.
  • S203 Determine the first reflection characteristic according to the first reflection component of each color channel of the pixel of the input image.
  • the first reflection feature After the first reflection component of each color channel of each pixel is obtained, the first reflection feature can be formed correspondingly.
  • the first reflection feature includes the first reflection component of each color channel corresponding to each pixel point.
  • R c (x) is the first reflection component of the c color channel of pixel x
  • L c (x) is the characteristic value of the c color channel of pixel x
  • T(x) is the first brightness of pixel x Component
  • is a preset constant.
  • the first reflection feature of the input image can be obtained.
  • the enhanced image that can be obtained conforms to the human visual characteristics.
  • the denoising process of the reflection component can also be performed, so that the influence of noise on the image can be reduced.
  • FIG. 4 shows another flowchart of step S200 in an image processing method according to an embodiment of the present disclosure, wherein the obtaining the first reflection characteristic of the input image by using the first brightness characteristic may include:
  • S201 Perform addition processing on the elements in the first brightness feature and a preset constant to obtain a sum feature.
  • step S2001 can add the brightness component of each pixel in the first brightness feature to a preset constant, and the preset constant can be a small value, usually less than 1, such as 0.01.
  • the preset constant can be a small value, usually less than 1, such as 0.01.
  • the sum value of each pixel is obtained, and the sum characteristic can be formed based on the sum value of each pixel.
  • the summation feature can also be expressed in a matrix form, where the elements can be the summation value corresponding to each pixel of the color image.
  • S202 Obtain the ratio of the feature value of each color channel of the corresponding pixel in the input image to the feature value of the corresponding pixel in the summation feature, and obtain the first reflection component of each color channel of the pixel.
  • step S2002 the feature value of each color channel of the input image can be divided by the corresponding summation value, and the feature value of each color channel of each pixel and the summation feature of the corresponding pixel can be obtained.
  • the ratio between the summation values in, that is, the ratio corresponding to each color channel can be obtained, and the ratio can be used as the first reflection component of the pixel.
  • the R channel feature value, G channel feature value, and B channel feature value of each pixel can be divided by the sum of the pixel points to obtain three first reflection components, so that each pixel can be obtained The first reflection component of the three color channels.
  • S203 Perform denoising processing on the first reflection component to obtain the second reflection component of each color channel of the pixel.
  • the embodiments of the present disclosure may use a second neural network (such as a denoising self-encoding neural network) to perform denoising processing on the first reflection component of each color channel.
  • the loss function used in the training process of the second neural network can be the following formula:
  • L s2 is the loss function of the second neural network
  • R i represents the first reflection component
  • N represents the number of pixels
  • W (l) represents the neural network parameters of the first layer of the second neural network
  • F represents the Frobenius norm (for example, 2)
  • L 2 represents the number of network layers in the second neural network
  • ⁇ j represents the activity of the hidden layer in the second neural network
  • represents the divergence constant
  • K is the number of hidden layers
  • represents the sparsity weight.
  • Training a second neural network may be inputted to the second neural network training samples, the training sample may for example include a reflective component composed of a first reflection component of each pixel of the sample image samples R i, embodiments of the present disclosure
  • the denoised reflection component samples can be obtained
  • the two reflection components before and after denoising are input to the above loss function L s2 to obtain the second loss value.
  • the training of the second neural network can be terminated, and the optimized first 2.
  • the second requirement of the embodiment of the present disclosure may be that the second loss value is less than or equal to the second threshold value.
  • the present disclosure does not specifically limit the value of the second threshold, and those skilled in the art can perform setting selection according to requirements.
  • the second neural network completed through training can perform denoising processing on the first reflection component to obtain the corresponding second reflection component, thereby reducing the noise component of the image.
  • S204 Determine the first reflection characteristic according to the second reflection component of each color channel of the pixel point of the input image.
  • the first reflection characteristic can be determined according to each second reflection component.
  • the embodiment of the present disclosure can achieve optimization processing for the reflection component, that is, the noise component in the reflection component can be reduced, and the quality of the reconstructed image can be further improved.
  • step S300 After the first reflection feature and the first brightness feature are obtained, the image restoration process of step S300 can be performed. That is, an enhanced image can be obtained.
  • the embodiment of the present disclosure can directly use the product between the first brightness feature and the first reflection feature to obtain the feature of each pixel of the enhanced image.
  • the reflection of each color channel of each pixel in the first reflection feature can be The component is multiplied by the brightness component of the corresponding pixel in the first brightness feature to obtain the feature value of each color channel of each pixel after the enhancement processing.
  • the corresponding image can be obtained based on the feature value of each color channel after the enhancement process, that is, the image after the enhancement process.
  • the embodiment of the present disclosure may also perform optimization processing of the first brightness feature, and use the optimized brightness feature and the enhanced first reflection feature.
  • Image the process is explained below in conjunction with the drawings.
  • FIG. 5 shows a flowchart of step S300 in the image processing method according to an embodiment of the present disclosure, wherein the enhanced image of the input image is obtained based on the first brightness feature and the first reflection feature (step S300 ), can include:
  • S301 Perform optimization processing on the first brightness feature to obtain a second brightness feature.
  • the embodiments of the present disclosure may perform optimization processing on the first brightness feature, and this step can initially improve the contrast of each brightness component of the image.
  • the second brightness feature and the first brightness feature have the same dimensions.
  • the optimization processing for the first brightness feature in the embodiment of the present disclosure may include an encoding step and a decoding step, for example, it may be implemented using a self-encoding network, but the embodiment of the present disclosure does not specifically limit this.
  • S302 Obtain an enhanced image of the input image based on the second brightness feature and the first reflection feature.
  • the product result of each corresponding element can be used to obtain the pixel feature of the enhanced image, so as to restore the enhanced image.
  • Fig. 6 shows a flowchart of step S301 in an image processing method according to an embodiment of the present disclosure.
  • the performing optimization processing on the first brightness feature to obtain the second brightness feature may include:
  • S3011 Perform coding processing on the first brightness feature based on the coding parameters to obtain the coded first brightness feature.
  • Step S301 of the embodiment of the present disclosure may be performed by a first neural network, which may perform the above-mentioned encoding processing and decoding processing, and the encoding parameter and the decoding parameter may be related to the weight of each brightness component of the image.
  • the embodiment of the present disclosure may form the first neural network of the embodiment of the present disclosure by introducing the weight information of the luminance component into the self-encoding network. Therefore, through the first neural network of the embodiment of the present disclosure, the adaptive adjustment of the first brightness characteristic can be realized, and the adjustment effect is better.
  • the encoding process of the first brightness feature may be performed according to the encoding parameters of the first neural network. For example, each brightness component in the first brightness feature may be multiplied by the encoding parameter to obtain the encoded first brightness feature.
  • FIG. 7 shows a schematic diagram of the structure of each layer of the first neural network according to an embodiment of the present disclosure, but is not a specific limitation of the first neural network in the embodiment of the present disclosure.
  • the first neural network may include an input layer, a hidden layer, and an output layer.
  • the encoding process can be completed, and the encoded first brightness feature can be obtained.
  • the encoding parameters can be determined according to the training optimization of the first neural network. The training process of the first neural network will be explained later. .
  • S3012 Perform decoding processing on the encoded first brightness feature based on the decoding parameter to obtain the second brightness feature.
  • the decoding parameters can be used to perform the decoding process on the encoded first brightness feature.
  • the decoding process can be performed by the output layer.
  • the decoded parameter and the encoded first brightness feature may be used to perform a multiplication operation to obtain the optimized reconstructed second brightness feature.
  • N is the number of pixels
  • M2 is the number of decoding parameters.
  • Fig. 8 shows a flowchart of step S302 in an image processing method according to an embodiment of the present disclosure.
  • the obtaining the enhanced image of the input image based on the second brightness feature and the first reflection feature may include:
  • S3021 Perform product processing on the second brightness feature and the first reflection feature to obtain a reconstruction feature.
  • the second brightness feature in the embodiment of the present disclosure represents the optimized brightness component
  • the first reflection feature represents the reflection component of the input image.
  • the reflection component and the brightness component of the corresponding pixel are multiplied to obtain the reconstruction of the corresponding pixel.
  • S3021 can be expressed by the following formula:
  • c represents the color channel of each pixel.
  • the reconstructed features obtained in the embodiments of the present disclosure can also be expressed in matrix form, where each element represents the reconstructed feature value corresponding to each pixel of the color image, for example, the R channel feature value and B channel feature of each pixel can be reconstructed Value and G channel characteristic value.
  • S3022 Determine an enhanced processed image of the input image based on the reconstruction feature.
  • a new image can be formed according to the reconstructed feature, and the image is the image after the enhancement of the input image.
  • the image processing method adopted in the embodiments of the present disclosure can perform image enhancement on images by combining optimized brightness characteristics and reflection components. This method is not susceptible to noise and does not require simultaneous processing of multiple images, which effectively improves real-time performance. At the same time, the embodiment of the present disclosure does not require additional definition of other parameters, and has good adaptability. After the enhancement processing in the embodiments of the present disclosure, the image quality of the input image can be improved, the contrast pair can be increased, and the image quality can be clearer.
  • the training process of the first neural network in the embodiment of the present disclosure will be described in detail below.
  • the embodiment of the present disclosure introduces the structural weight information of the image into the first neural network that realizes the optimization of the first brightness feature, so that the optimization efficiency of the brightness component can be further improved.
  • the structure weight information is the weight information of the brightness component of each pixel.
  • the first neural network of the embodiment of the present disclosure may be obtained from the self-encoding neural network, and the information of the structure weight is introduced into the self-encoding network.
  • FIG. 9 shows a flowchart of training the first neural network according to an embodiment of the present disclosure.
  • the step of training the first neural network includes:
  • the image samples used to train the first neural network can be obtained.
  • the image samples can be images obtained under low illumination conditions, or other images with lower image quality.
  • the number of image samples can be set according to requirements.
  • the contrast and definition of each image sample can be different, which can increase the differentiation of the image sample and improve the training accuracy of the network.
  • S502 Obtain a first brightness feature and a structure weight feature of the image sample, where elements in the structure weight feature represent the weight of the brightness component of the pixel in the first brightness feature.
  • the embodiment of the present disclosure may obtain the first brightness characteristic of the image sample in advance, which may be specifically executed according to step S100, which is not described in detail here.
  • the structure weight feature corresponding to the first brightness feature can also be obtained, and the structure weight feature can include weight information of each brightness component of the first brightness feature.
  • FIG. 10 shows a flowchart of obtaining the structural weight characteristics of the image sample according to an embodiment of the present disclosure
  • step S502 may include:
  • the image sample contains many levels of important structures, and the embodiments of the present disclosure can perform the smoothing process of the image sample in the first way to obtain the above-mentioned structure information.
  • the embodiment of the present disclosure may use a structure-texture decomposition algorithm to obtain the structure information of the image sample; or may also use a rolling guidance filter (Rolling Guidance filter) to obtain the structure information of the image sample.
  • the structure information of each image sample can be obtained by the above method.
  • S5022 Obtain gradient information of the structure information based on a preset operator.
  • the embodiment of the present disclosure may use a Sobel operator to perform processing on each structural information to obtain gradient information corresponding to the structural information.
  • the calculation method of the Sobel operator is not described in detail in the embodiments of the present disclosure, and can be implemented according to the existing technical means.
  • step S5023 can be performed according to the second method, where the expression of the second method is:
  • w(x) represents the structural weight of x pixels
  • g(x) represents the gradient information of x pixels.
  • the structural weight of each pixel can be determined according to the gradient information of each pixel, and the structural weight represents the weight of the brightness component of each pixel.
  • S503 Input the first brightness feature and the structure weight feature to the first neural network, and adjust the parameters of the first neural network according to the obtained loss value until the loss value meets a preset requirement.
  • the loss function of the first neural network is:
  • L s1 is the loss function of the first neural network
  • y i represents the brightness component of pixel i in the first brightness feature
  • N represents the number of pixels
  • W (l) represents the neural network parameters of the lth layer of the first neural network
  • w i represents the structural weight of the i-th pixel Value
  • F represents Frobenius norm
  • L 1 represents the number of network layers in the first neural network
  • is a constant.
  • the first loss value of the second brightness feature after each optimization process can be obtained.
  • the first loss value meets the first requirement, it means that the training of the first neural network is completed, and vice versa, Then adjust the network parameters of the first neural network until the obtained first loss value meets the first requirement. Satisfying the first requirement may include that the first loss value is less than or equal to the first threshold.
  • the value of the first threshold is implemented in the present disclosure The example is not specifically limited, you can choose and set it according to your needs.
  • the embodiments of the present disclosure can not only implement brightness correction on low-illuminance pictures, but also perform noise suppression.
  • structural information is added to the self-encoding neural network, the structural feature protection of the reconstructed image can be strengthened.
  • the embodiments of the present disclosure can optimize the brightness component of an image, and combine the optimized brightness component with the reflection component.
  • the embodiments of the present disclosure may first obtain the brightness feature of the input image, and further determine the reflection feature of the input image according to the brightness feature, and then perform the enhancement processing of the input image through the obtained brightness feature and reflection feature to obtain an enhanced image.
  • the process has the characteristics of simplicity and convenience and high processing efficiency, and can also improve the image enhancement effect.
  • the writing order of the steps does not mean a strict execution order but constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possibility.
  • the inner logic is determined.
  • the present disclosure also provides image processing devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any image processing method provided in the present disclosure.
  • image processing devices electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any image processing method provided in the present disclosure.
  • FIG. 11 shows a block diagram of an image processing device according to an embodiment of the present disclosure. As shown in FIG. 11, the image processing device includes:
  • the obtaining module 10 is configured to obtain the first brightness feature of the input image
  • the conversion module 20 is configured to obtain the first reflection characteristic of the input image by using the first brightness characteristic
  • the enhancement module 30 is configured to obtain an enhanced image of the input image based on the first brightness feature and the first reflection feature.
  • the acquiring module is further configured to acquire feature values of multiple color channels corresponding to each pixel in the input image; for each pixel, determine the feature values of the multiple color channels And determining the maximum value in the multiple color channels corresponding to each pixel as the brightness component of the corresponding pixel in the first brightness feature to obtain the first brightness feature; wherein, the first brightness feature The element in a brightness feature represents the brightness component of each pixel of the input image.
  • the element in the first reflection feature represents the reflection component of the pixel corresponding to the input image; the conversion module is further configured to combine the element in the first brightness feature with a preset constant Perform the addition process to obtain the addition feature; determine the ratio between the feature value of each color channel of the corresponding pixel in the input image and the feature value of the corresponding pixel in the addition feature as the corresponding pixel The first reflection component of each color channel of the input image; and determine the first reflection feature according to the first reflection component of each color channel of the pixel point of the input image; wherein, the element in the first reflection feature represents The reflection component of each pixel of the input image.
  • the element in the first reflection feature represents the reflection component of the pixel corresponding to the input image; the conversion module is further configured to combine the element in the first brightness feature with a preset constant Perform addition processing to obtain the sum feature; obtain the ratio of the feature value of each color channel of the corresponding pixel in the input image to the feature value of the corresponding pixel in the addition feature, and obtain each color of the pixel
  • the first reflection component of the channel; the denoising processing is performed on the first reflection component to obtain the second reflection component of each color channel of each pixel; and the total value of each color channel of each pixel of the input image
  • the second reflection component determines the first reflection feature; wherein, the element in the first reflection feature represents the reflection component of each pixel of the input image.
  • the enhancement module includes:
  • An optimization unit configured to perform optimization processing on the first brightness feature to obtain a second brightness feature
  • the enhancement unit is configured to obtain an enhanced image of the input image based on the second brightness feature and the first reflection feature.
  • the optimization unit is further configured to perform encoding processing on the first brightness feature based on encoding parameters to obtain the encoded first brightness feature; based on the decoding parameters, perform encoding processing on the encoded first brightness feature; Perform decoding processing on a brightness feature to obtain the second brightness feature.
  • the enhancement unit is further configured to perform product processing on the second brightness feature and the first reflection feature to obtain a reconstruction feature; and determine the enhanced image based on the reconstruction feature.
  • the optimization unit is configured to perform optimization processing on the first brightness feature of the first neural network;
  • the device further includes a training module configured to train the first neural network and train The process of the first neural network includes: obtaining an image sample; obtaining a first brightness feature and a structure weight feature of the image sample, and an element in the structure weight feature represents each pixel in the first brightness feature The weight of the brightness component; input the first brightness feature and the structural weight feature to the first neural network to obtain the predicted second brightness feature; adjust according to the loss value corresponding to the predicted second brightness feature The parameters of the first neural network until the loss value meets a preset requirement.
  • the loss function of the first neural network is:
  • L s1 is the loss function of the first neural network
  • y i represents the brightness component of pixel i in the first brightness feature
  • N represents the number of pixels
  • W (l) represents the neural network parameters of the lth layer of the first neural network
  • w i represents the structural weight of the i-th pixel Value
  • F represents Frobenius norm
  • L 1 represents the number of network layers in the first neural network
  • is a constant.
  • the training module is configured to obtain the structural weight characteristics of the image sample in the following manner: obtain the structural information of the image sample; obtain the gradient information of the structural information based on a preset operator; The gradient information obtains the structure weight feature.
  • the training module is further configured to obtain the structure information of the image sample by using at least one of the following methods: using a structure-texture decomposition algorithm to obtain the structure information of the image sample; using a rolling guide filter Obtain the structural information of the image sample.
  • the expression that the training module uses the gradient information to obtain the structure weight feature is:
  • w(x) represents the structural weight of x pixels
  • g(x) represents the gradient information of x pixels.
  • the conversion module is further configured to perform denoising processing on the first reflection component through a second neural network, wherein the expression of the loss function of the second neural network is:
  • L s2 is the loss function of the second neural network
  • R i represents the first reflection component
  • N represents the number of pixels
  • W (l) represents the neural network parameters of the first layer of the second neural network
  • F represents the Frobenius norm
  • L 2 represents the second The number of network layers in a neural network
  • ⁇ j represents the activity of the hidden layer in the second neural network
  • represents the divergence constant
  • is the constant.
  • the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
  • the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
  • brevity, here No longer refer to the description of the above method embodiments.
  • the embodiments of the present disclosure also provide a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above-mentioned method when executed by a processor.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium.
  • An embodiment of the present disclosure also provides an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured as the above method.
  • the electronic device can be provided as a terminal, server or other form of device.
  • FIG. 12 shows a block diagram of an electronic device 800 according to an embodiment of the present disclosure.
  • the electronic device 800 may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and other terminals.
  • the electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , And communication component 816.
  • the processing component 802 generally controls the overall operations of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the foregoing method.
  • the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components.
  • the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
  • the memory 804 is configured to store various types of data to support operations in the electronic device 800. Examples of these data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc.
  • the memory 804 can be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic Disk or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic Disk Magnetic Disk or Optical Disk.
  • the power supply component 806 provides power for various components of the electronic device 800.
  • the power supply component 806 may include a power management system, one or more power supplies, and other components associated with the generation, management, and distribution of power for the electronic device 800.
  • the multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC).
  • the microphone is configured to receive external audio signals.
  • the received audio signal may be further stored in the memory 804 or transmitted via the communication component 816.
  • the audio component 810 further includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module.
  • the peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
  • the sensor component 814 includes one or more sensors for providing the electronic device 800 with various aspects of state evaluation.
  • the sensor component 814 can detect the on/off status of the electronic device 800 and the relative positioning of the components.
  • the component is the display and the keypad of the electronic device 800.
  • the sensor component 814 can also detect the electronic device 800 or the electronic device 800.
  • the position of the component changes, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration/deceleration of the electronic device 800, and the temperature change of the electronic device 800.
  • the sensor component 814 may include a proximity sensor configured to detect the presence of nearby objects when there is no physical contact.
  • the sensor component 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
  • the electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof.
  • the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the electronic device 800 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field A programmable gate array (FPGA), controller, microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • ASIC application specific integrated circuits
  • DSP digital signal processors
  • DSPD digital signal processing devices
  • PLD programmable logic devices
  • FPGA field A programmable gate array
  • controller microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • a non-volatile computer-readable storage medium such as a memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to complete the foregoing method.
  • FIG. 13 shows a block diagram of an electronic device 1900 according to an embodiment of the present disclosure.
  • the electronic device 1900 may be provided as a server. 13
  • the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs.
  • the application program stored in the memory 1932 may include one or more modules each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above-described methods.
  • the electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on an operating system stored in the memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
  • a non-volatile computer-readable storage medium such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to complete the foregoing method.
  • the present disclosure may be a system, method, and/or computer program product.
  • the computer program product may include a computer-readable storage medium loaded with computer-readable program instructions for enabling a processor to implement various aspects of the present disclosure.
  • the computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a printer with instructions stored thereon
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory flash memory
  • SRAM static random access memory
  • CD-ROM compact disk read-only memory
  • DVD digital versatile disk
  • memory stick floppy disk
  • mechanical encoding device such as a printer with instructions stored thereon
  • the computer-readable storage medium used here is not interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or through wires Transmission of electrical signals.
  • the computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • the network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network, and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device .
  • the computer program instructions used to perform the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, or in one or more programming languages.
  • Source code or object code written in any combination, the programming language includes object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages.
  • Computer-readable program instructions can be executed entirely on the user's computer, partly on the user's computer, executed as a stand-alone software package, partly on the user's computer and partly executed on a remote computer, or entirely on the remote computer or server carried out.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to access the Internet connection).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by using the status information of the computer-readable program instructions.
  • the computer-readable program instructions are executed to realize various aspects of the present disclosure.
  • These computer-readable program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine such that when these instructions are executed by the processor of the computer or other programmable data processing device , A device that implements the functions/actions specified in one or more blocks in the flowchart and/or block diagram is produced. It is also possible to store these computer-readable program instructions in a computer-readable storage medium. These instructions make computers, programmable data processing apparatuses, and/or other devices work in a specific manner, so that the computer-readable medium storing instructions includes An article of manufacture, which includes instructions for implementing various aspects of the functions/actions specified in one or more blocks in the flowchart and/or block diagram.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of an instruction, and the module, program segment, or part of an instruction contains one or more functions for implementing the specified logical function.
  • Executable instructions may also occur in a different order from the order marked in the drawings. For example, two consecutive blocks can actually be executed in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Ultra Sonic Daignosis Equipment (AREA)
  • Holo Graphy (AREA)

Abstract

一种图像处理方法及装置、电子设备和存储介质,其中,所述方法包括:获取输入图像的第一亮度特征(S100);利用所述第一亮度特征得到所述输入图像的第一反射特征(S200);基于所述第一亮度特征和第一反射特征,得到所述输入图像的增强后的图像(S300)。该方法能够提高图像的处理效率并提高图像质量。

Description

图像处理方法及装置、电子设备和存储介质
相关申请的交叉引用
本申请基于申请号为201910133416.3、申请日为2019年2月22日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。
技术领域
本公开涉及计算机视觉领域,特别涉及一种图像处理方法及装置、电子设备和存储介质。
背景技术
在平安城市、智慧交通等安防监控场景中,采集的图像由于受到时间、位置以及低光照度环境等限制,可能会失真较大。在这种环境中获取的视频图像对比度低、信息失真。因此对人脸识别、行为分析等智能视频分析工作的效率和准确率较低。
发明内容
本公开实施例提供了一种图像处理方法及装置、电子设备和存储介质,其能够提高图像处理效率并提高图像质量。
根据本公开实施例的第一方面,提供了一种图像处理方法,包括:
获取输入图像的第一亮度特征;
利用所述第一亮度特征得到所述输入图像的第一反射特征;
基于所述第一亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
在一些可能的实施方式中,所述第一亮度特征中的元素表示所述输入图像的各像素点的亮度分量,所述获取输入图像的第一亮度特征,包括:
获得输入图像中每个像素点对应的多个颜色通道的特征值;
针对每个像素点,确定所述多个颜色通道的特征值中的最大值;
将每个像素点对应的多个颜色通道中的所述最大值确定为第一亮度特征中对应像素点的亮度分量,以得到所述第一亮度特征。
在一些可能的实施方式中,所述第一反射特征中的元素表示所述输入图像对应像素点的反射分量,所述利用所述第一亮度特征得到所述输入图像的第一反射特征,包括:
将所述第一亮度特征中的各元素与预设常量进行相加处理,得到加和特征;
将所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值之间的比值,确定为对应像素点的每个颜色通道的第一反射分量;
根据所述输入图像的像素点的每个颜色通道的第一反射分量确定所述第一反射特征。
在一些可能的实施方式中,所述第一反射特征中的元素表示所述输入图像对应像素点的反射分量,所述利用所述第一亮度特征得到所述输入图像的第一反射特征,包括:
将所述第一亮度特征中的各元素与预设常量进行相加处理,得到加和特征;
获得所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值的比值,得到各像素点的每个颜色通道的第一反射分量;
对所述第一反射分量执行去噪处理,得到像素点的每个颜色通道的第二反射分量;
根据所述输入图像的像素点的每个颜色通道的所述第二反射分量确定所述第一反射特征。
在一些可能的实施方式中,所述基于所述第一亮度特征和第一反射特征,得到所述输入图像的增强后的图像,包括:
对所述第一亮度特征进行优化处理,得到第二亮度特征;
基于所述第二亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
在一些可能的实施方式中,对所述第一亮度特征进行优化处理,得到第二亮度特征,包括:
基于编码参数,对所述第一亮度特征执行编码处理,得到编码后的第一亮度特征;
基于解码参数,对所述编码后的第一亮度特征执行解码处理,得到所述第二亮度特征。
在一些可能的实施方式中,所述基于所述第二亮度特征和第一反射特征,得到所述输入图像的增强处理后的图像,包括:
对所述第二亮度特征和第一反射特征执行乘积处理,得到重建特征;
基于所述重建特征确定所述增强后的图像。
在一些可能的实施方式中,所述对所述第一亮度特征进行优化处理包括:通过第一神经网络对所述第一亮度特征进行优化处理;
其中,所述第一神经网络的训练过程,包括:
获取图像样本;
获取所述图像样本的第一亮度特征和结构权值特征,所述结构权值特征中的元素表示所述第一亮度特征中各像素点的亮度分量的权值;
将所述第一亮度特征和结构权值特征输入至所述第一神经网络,得到预测的第二亮度特征;
根据所述预测的第二亮度特征对应的损失值调整所述第一神经网络的参数,直至所述损失值满足预设要求。
在一些可能的实施方式中,所述第一神经网络的损失函数为:
Figure PCTCN2019104247-appb-000001
其中,L s1为第一神经网络的损失函数,y i表示第一亮度特征中像素点i的亮度分量,
Figure PCTCN2019104247-appb-000002
表示优化的第二亮度特征中像素点i的亮度分量,N表示像素点的数量,W (l)表示第一神经网络第l层的神经网络参数,w i表示第i个像素点的结构权值,F表示弗罗贝尼乌斯范数,L 1表示第一神经网络中的网络层数,λ为常量。
在一些可能的实施方式中,获取所述图像样本的结构权值特征,包括:
获取图像样本的结构信息;
基于预设算子得到所述结构信息的梯度信息;
利用所述梯度信息得到所述结构权值特征。
在一些可能的实施方式中,所述获取图像样本的结构信息,包括以下方式中的至少一种:
利用结构-纹理分解算法获得所述图像样本的结构信息;
利用滚动导向滤波器获得所述图像样本的结构信息。
在一些可能的实施方式中,所述利用所述梯度信息得到所述结构权值特征的表达式为:
Figure PCTCN2019104247-appb-000003
其中,w(x)表示x像素点的结构权值,g(x)表示x像素点的梯度信息。
在一些可能的实施方式中,所述方法还包括:通过第二神经网络对所述第一反射分量执行去噪处理,其中,所述第二神经网络的损失函数的表达式为:
Figure PCTCN2019104247-appb-000004
其中,L s2为第二神经网络的损失函数,R i表示第一反射分量,
Figure PCTCN2019104247-appb-000005
表示去噪后的第二反射分量,N表示像素点的数量,W (l)表示第二神经网络第l层的神经网络参数,F表示弗罗贝尼乌斯范数,L 2表示第二神经网络中的网络层数,
Figure PCTCN2019104247-appb-000006
表示K-L散度,并且,
Figure PCTCN2019104247-appb-000007
ρ j表示第二神经网络中隐层的活跃度,ρ表示散度常量,λ为常量。
根据本公开实施例的第二方面,提供了一种图像处理装置,其包括:
获取模块,配置为获取输入图像的第一亮度特征;
转换模块,配置为利用所述第一亮度特征得到所述输入图像的第一反射特征;
增强模块,配置为基于所述第一亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
在一些可能的实施方式中,所述获取模块还配置为获得输入图像中每个像素点对应的多个颜色通道的特征值;针对每个像素点,确定所述多个颜色通道的特征值中的最大值;以及将每个像素点对应的多个颜色通道中的所述最大值确定为第一亮度特征中对应像素点的亮度分量,以得到所述第一亮度特征;其中,所述第一亮度特征中的元素表示所述输入图像的各像素点的亮度分量。
在一些可能的实施方式中,所述第一反射特征中的元素表示所述输入图像对应像素点的反射分量;所述转换模块还配置为将所述第一亮度特征中的元素与预设常量进行相加处理,得到加和特征;将所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值之间的比值,确定为对应像素点的每个颜色通道的第一反射分量;以及根据所述输入图像的像素点的每个颜色通道的第一反射分量确定所述第一反射特征;其中,所述第一反射特征中的元素表示所述输入图像各像素点的反射分量。
在一些可能的实施方式中,所述第一反射特征中的元素表示所述输入图像对应像素点的反射分量;所述转换模块还配置为将所述第一亮度特征中的元素与预设常量进行相加处理,得到加和特征;获得所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值的比值,得到像素点的每个颜色通道的第一反射分量;对所述第一反射分量执行去噪处理,得到像素点的每个颜色通道的第二反射分量;以及根据所述输入图像的像素点的每个颜色通道的所述第二反射分量确定所述第一反射特征;其中,所述第一反射特征中的元素表示所述输入图像各像素点的反射分量。
在一些可能的实施方式中,所述增强模块包括:
优化单元,配置为对所述第一亮度特征进行优化处理,得到第二亮度特征;
增强单元,配置为基于所述第二亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
在一些可能的实施方式中,所述优化单元还配置为基于编码参数,对所述第一亮度特征执行编码处理,得到编码后的第一亮度特征;基于解码参数,对所述编码后的第一亮度特征执行解码处理,得到所述第二亮度特征。
在一些可能的实施方式中,所述增强单元还配置为对所述第二亮度特征和第一反射特征执行乘积处理,得到重建特征;并且基于所述重建特征确定所述增强后的图像。
在一些可能的实施方式中,所述优化单元,配置为通过第一神经网络所述第一亮度特征进行优化处理;所述装置还包括训练模块,配置为训练所述第一神经网络,并且训练所述第一神经网络的过程包括:获取图像样本;获取所述图像样本的第一亮度特征和结构权值特征,所述结构权值特征中的元素表示所述第一亮度特征中各像素点的亮度分量的权值;将所述第一亮度特征和结构权值特征输入至所述第一神经网络,得到预测的第二亮度特征;根据所述预测的第二亮度特征对应的损失值调整所述第一神经网络的参数,直至所述损失值满足预设要求。
在一些可能的实施方式中,所述第一神经网络的损失函数为:
Figure PCTCN2019104247-appb-000008
其中,L s1为第一神经网络的损失函数,y i表示第一亮度特征中像素点i的亮度分量,
Figure PCTCN2019104247-appb-000009
表示优化的第二亮度特征中像素点i的亮度分量,N表示像素点的数量,W (l)表示第一神经网络第l层的神经网络参数,w i表示第i个像素点的结构权值,F表示弗罗贝尼乌斯范数,L 1表示第一神经网络中的网络层数,λ为常量。
在一些可能的实施方式中,所述训练模块,配置为采用以下方式获取图像样本的结构权值特征:获取图像样本的结构信息;基于预设算子得到所述结构信息的梯度信息;利用所述梯度信息得到所述结构权值特征。
在一些可能的实施方式中,所述训练模块还配置为采用以下方式中的至少一种获取图像样本的结构信息:利用结构-纹理分解算法获得所述图像样本的结构信息;利用滚动导向滤波器获得所述图像样本的结构信息。
在一些可能的实施方式中,所述训练模块利用所述梯度信息得到所述结构权值特征的表达式为:
Figure PCTCN2019104247-appb-000010
其中,w(x)表示x像素点的结构权值,g(x)表示x像素点的梯度信息。
在一些可能的实施方式中,所述转换模块还配置为通过第二神经网络对所述第一反射分量执行去噪处理,其中,所述第二神经网络的损失函数的表达式为:
Figure PCTCN2019104247-appb-000011
其中,L s2为第二神经网络的损失函数,R i表示第一反射分量,
Figure PCTCN2019104247-appb-000012
表示去噪后的第二反射分量,N表示像素点的数量,W (l)表示第二神经网络第l层的神经网络参数,F表示弗罗贝尼乌斯范数,L 2表示第二神经网络中的网络层数,
Figure PCTCN2019104247-appb-000013
表示K-L散度,并且,
Figure PCTCN2019104247-appb-000014
ρ j表示第二神经网络中隐层的活跃度,ρ表示散度常量,λ为常量。
根据本公开实施例的第三方面,提供了一种电子设备,其包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为:执行第一方面中任意一项所述的方法。
根据本公开实施例的第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现第一方面中任意一项所述的方法。
本公开实施例可以利用图像的亮度特征与反射特征结合的方式,实现图像增强的目的。本公开实施例可以首先获取输入图像的亮度特征,并根据该亮度特征进一步确定输入图像的反射特征,进而通过获得的亮度特征以及反射特征执行输入图像的增强处理,得到增强后的图像。该过程具有简单方便且处理效率高的特点,同时还能够提高图像增强效果。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。
根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1示出根据本公开实施例的一种图像处理方法的流程图;
图2示出根据本公开实施例的图像处理方法中步骤S100的流程图;
图3示出根据本公开实施例的一种图像处理方法中步骤S200的流程图;
图4示出根据本公开实施例的一种图像处理方法中步骤S200的另一流程图;
图5示出根据本公开实施例的一种图像处理方法中步骤S300的流程图;
图6示出根据本公开实施例的一种图像处理方法中步骤S301的流程图;
图7示出根据本公开实施例的第一神经网络的各层的结构示意图;
图8示出根据本公开实施例的一种图像处理方法中步骤S302的流程图;
图9示出根据本公开实施例中训练第一神经网络的流程图;
图10示出根据本公开实施例中获取所述图像样本的结构权值特征的流程图;
图11示出根据本公开实施例的一种图像处理装置的框图;
图12示出根据本公开实施例的一种电子设备800的框图;
图13示出根据本公开实施例的一种电子设备1900的框图。
具体实施方式
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
另外,为了更好地说明本公开实施例,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开实施例同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开实施例的主旨。
本公开实施例提供了一种图像处理方法,该方法可以应用在图像处理设备或者图像采集设备中,或者也可以应用在任意的终端或者服务器中,只要与图像采集或处理相关的设备,即可以应用本公开实施例的方法。
图1示出根据本公开实施例的一种图像处理方法的流程图。其中,如图1所示本公开实施例的图 像处理方法可以包括:
S100:获取输入图像的第一亮度特征。
本公开实施例中,获取的输入图像可以为低照度情况下获取的低照度图像,或者也可以为由于其他因素而使得图像的对比度、清晰度、图像质量、分辨率等受到影响的图像。本公开实施例可以对输入图像执行图像增强处理,提高输入图像的图像质量。
另外,本公开实施例提供的图像处理方法可以通过神经网络实现,如深度神经网络,但本公开实施例对此不进行具体限定,本公开实施例也可以通过相应的图像处理算法实现本公开实施例的相应功能。
在接收到输入图像时,本公开实施例可以首先提取输入图像中各像素点的亮度特征(亮度分量),基于该亮度分量确定输入图像的第一亮度特征。其中,第一亮度特征可以表示成矩阵形式,并且其中各元素的亮度分量与彩色图像的各像素点对应。
在一些可能的实施例中,对于RGB图像(彩色图像),可以首先获取每个像素点在R通道、G通道和B通道上的特征值,并根据各颜色通道的特征值获得输入图像的第一亮度特征。对于其他的图像,也可以获取每个像素点上其他各颜色通道的特征值,本公开实施例对此不进行一一举例说明。
S200:利用所述第一亮度特征得到所述输入图像的第一反射特征。
在步骤S100之后,可以根据得到的第一亮度特征获得输入图像各像素点的反射分量。其中,可以通过预设的方式获得各颜色通道的反射分量,从而形成第一反射特征。本公开实施例的第一反射特征可以包括经过去噪处理后的反射特征,也可以包括未经去噪处理的特征,本领域技术人员可以根据不同的需求自行选择设定。另外,第一反射特征同样也可以表示成矩阵形式,并且其中各元素的反射分量也与彩色图像的各像素点对应。
S300:基于所述第一亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
在获得输入图像的第一亮度特征以及第一反射特征之后,即可以利用各像素点的亮度分量和反射分量得到增强后的特征值,例如可以将二者执行乘积处理,以得到增强处理后的图像。
基于本公开实施例,可以实现根据图像各像素点的亮度特征和反射特征执行图像增强处理,其具有增强效果好且效率高的特点。
下面结合附图对本公开实施例的各个步骤进行详细说明。
如上述实施例所述,本公开实施例步骤S100获取的第一亮度特征中的元素可以表示所述输入图像的各像素点的亮度分量,通过各颜色通道的特征值即可以确定第一亮度特征。图2示出根据本公开实施例的一种图像处理方法中步骤S100的流程图。其中,所述获取输入图像的第一亮度特征,可以包括:
S101:获得输入图像中每个像素点对应的多个颜色通道的特征值;
在本公开实施例中,获取输入图像的第一亮度特征时,可以提取输入图像各像素点上每个颜色通道的特征值,例如在图像为RGB形式时,可以分别获取输入图像的每个像素点处的三个颜色通道的特征值(如R通道的特征值、G通道的特征值和B通道的特征值)。在本公开的其他实施例中,可以根据图像的形式的不同获取不同的颜色通道的特征值,本公开对此不进行具体限定。
S102:针对每个像素点,确定所述多个颜色通道的特征值中的最大值。
由于每个像素点可以包括多个颜色通道的特征值,本公开实施例可以将各个颜色通道的特征值中最大的特征值确定为该像素点的亮度分量。具体可以根据下式获得:
Figure PCTCN2019104247-appb-000015
其中,T(x)表示x像素点的亮度分量,c为颜色通道,L c(x)表示x像素点c颜色通道的特征值。
通过表达式(1),即可以获得针对每个像素点的最大颜色通道值,以用于后续的第一亮度特征的确定。
在本公开的其他实施例中,如果输入图像不是RGB形式,也可以将图像转换成RGB形式,本公开实施例对图像形式的转换过程不作具体限定,本领域技术人员可以选择适配的方式执行上述转换。
S103:将每个像素点对应的多个颜色通道中的所述最大值确定为第一亮度特征中对应像素点的亮度分量,以得到所述第一亮度特征。
如上所述,在获得各个像素点的颜色通道的最大值之后,可以将该最大值作为该像素点的亮度分量,并根据每个像素点的亮度分量形成所述第一亮度特征。
本公开实施例,通过利用每个像素点的颜色通道的最大值形成第一亮度特征,从而可以有效的减少噪声对图像的影响。
通过上述实施例即可以获得本公开实施例的输入图像的第一亮度特征,在获得第一亮度特征之后,可以根据该第一亮度特征得到第一反射特征。本公开实施例的第一反射特征中的元素可以表示所述输入图像对应像素点的反射分量,下面针对该过程进行说明。
图3示出根据本公开实施例的一种图像处理方法中步骤S200的流程图,其中,所述利用所述第一亮度特征得到所述输入图像的第一反射特征,可以包括:
S201:将所述第一亮度特征中元素与预设常量进行相加处理,得到加和特征。
本公开实施例在得到输入图像的第一亮度特征后,可以根据该第一亮度特征得到输入图像的各像素点的反射分量。其中,首先可以将第一亮度特征中每个像素点的亮度分量与一预设常量相加,该预设常量可以为一个较小的值,通常小于1,例如可以为0.01。在对每个像素点的亮度分量进行加和处理后,得到每个像素点的加和值,基于各像素点的加和值即可以构成所述加和特征。同样的,加和特征也可以表示成矩阵形式,其中的元素可以为与彩色图像的各像素点对应的加和值。
S202:将所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值之间的比值,确定为对应像素点的每个颜色通道的第一反射分量。
根据前述实施例,在步骤S100中可以获得输入图像的各像素点的每个颜色通道的特征值,在执行步骤S202时,可以根据该特征值得到反射分量。步骤S202中,可以将输入图像各像素点的每个颜色通道的特征值与对应像素点的加和值进行相除处理,得到每个像素点的各颜色通道的特征值与相应像素点的加和值之间的比值,对于RGB图像,则每个像素点可以得到三个比值,即R通道特征值和该像素点的加和值的比值,G通道特征值和该像素点的加和值的比值,以及B通道特征值和该像素点的加和值的比值。对于其他类型的图像或者图像特征,可以得到其他特征值的比值,本公开实施例对此不进行限定。
通过上述即可以得到每个颜色通道的比值,每个像素点的各比值即可以作为该像素点的第一反射分量。例如,可以将每个像素点的R通道特征值、G通道特征值和B通道特征值分别与该像素点的加和值相除,得到三个第一反射分量,从而可以获得每个像素点的三个颜色通道的第一反射分量。
S203:根据所述输入图像的像素点的每个颜色通道的第一反射分量确定所述第一反射特征。
在得到每个像素点的各颜色通道的第一反射分量之后,则可以对应的形成第一反射特征。该第一反射特征包括对应于每个像素点的各颜色通道的第一反射分量。
上述过程可以根据下式算法实现:
R c(x)=L c(x)/(T(x)+ε)       (2)
其中,R c(x)为像素点x的c颜色通道的第一反射分量,L c(x)为像素点x的c颜色通道的特征值,T(x)为像素点x的第一亮度分量,ε为预设常量。
通过表达式(2),即可以得到输入图像的第一反射特征。本公开实施例通过结合第一反射特征和第一亮度特征,可以得到的增强图像符合人类视觉特性。
另外,在本公开的一些实施例中,还可以执行反射分量的去噪过程,从而可以减小噪声对于图像的影响。
图4示出根据本公开实施例的一种图像处理方法中步骤S200的另一流程图,其中,所述利用所述第一亮度特征得到所述输入图像的第一反射特征,可以包括:
S201:将所述第一亮度特征中的元素与预设常量进行相加处理,得到加和特征。
与步骤S201相同,步骤S2001可以将第一亮度特征中每个像素点的亮度分量与一预设常量相加,该预设常量可以为一个较小的值,通常小于1,例如可以为0.01。在对每个像素点的亮度分量进行加和处理后,得到每个像素点的加和值,基于各像素点的加和值即可以构成所述加和特征。同样的,加和特征也可以表示成矩阵形式,其中的元素可以为与彩色图像的各像素点对应的加和值。
S202:获得所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值的比值,得到像素点的每个颜色通道的第一反射分量。
与步骤S202相同,步骤S2002中可以得到输入图像每个颜色通道的特征值与对应的加和值进行相除处理,得到每个像素点的各颜色通道的特征值与相应像素点的加和特征中的加和值之间的比值,即可以得到每个颜色通道对应的比值,该比值即可以作为该像素点的第一反射分量。例如,可以将每个像素点的R通道特征值、G通道特征值和B通道特征值分别与该像素点的加和值相除,得到三个第一反射分量,从而可以获得每个像素点的三个颜色通道的第一反射分量。
S203:对所述第一反射分量执行去噪处理,得到像素点的每个颜色通道的第二反射分量。
本公开实施例,在获得第一反射分量之后,可以对第一反射分量执行去噪处理,得到与各第一反射分量对应的第二反射分量,通过该去噪处理,可以减少图像中的噪声分量。本公开实施例可以利用第二神经网络(如去噪自编码神经网络)对各颜色通道的第一反射分量执行去噪处理。其中,该第二神经网络的训练过程中采用的损失函数可以为下式:
Figure PCTCN2019104247-appb-000016
其中,L s2为第二神经网络的损失函数,R i表示第一反射分量,
Figure PCTCN2019104247-appb-000017
表示去噪后的第二反射分量,N表示像素点的数量,W (l)表示第二神经网络第l层的神经网络参数,F表示弗罗贝尼乌斯范数(如为2),L 2表示第二神经网络中的网络层数,
Figure PCTCN2019104247-appb-000018
表示K-L散度,并且,
Figure PCTCN2019104247-appb-000019
ρ j表示第二神经网络中隐层的活跃度,ρ表示散度常量,K为隐层层数,β表示稀疏化权值。
在训练第二神经网络中,可以向第二神经网络输入训练样本,例如该训练样本可以包括由图像样本的各像素点的第一反射分量构成的反射分量样本R i,通过本公开实施例的第二神经网络执行去噪处理后可以得到去噪后的反射分量样本
Figure PCTCN2019104247-appb-000020
将去噪前后的两个反射分量输入至上述损失函数L s2,得到第二损失值,在该第二损失值满足第二要求时,即可以终止第二神经网络的训练,得到优化完成的第二神经网络。而在得到的第二损失值不满足第二要求时,需要调整第二神经网络的参数,如W (l)等参数,再进一步执行训练样本的去噪过程,直至得到的第二损失值满足第二要求。本公开实施例的第二要求可以为第二损失值小于或者等于第二阈值。对于第二阈值的取值本公开不进行具体的限定,本领域技术人员可以根据需求执行设定选取。
通过训练完成的第二神经网络即可以对第一反射分量执行去噪处理得到对应的第二反射分量,从而降低图像的噪声分量。
S204:根据所述输入图像的像素点的每个颜色通道的所述第二反射分量确定所述第一反射特征。
在得到每个像素点的各颜色通道的第二反射分量之后,即可以根据各第二反射分量确定第一反 射特征。
通过图4示出的实施例,本公开实施例可以实现对于反射分量的优化处理,即可以降低反射分量中的噪声分量,可以进一步提高重构的图像的质量。
在得到第一反射特征以及第一亮度特征之后,即可以执行步骤S300的图像恢复过程.即得到增强后的图像。
本公开实施例可以直接利用第一亮度特征和第一反射特征之间的乘积得到增强后的图像的各像素点的特征,例如可以将第一反射特征中每个像素点的各颜色通道的反射分量与第一亮度特征中相应像素点的亮度分量相乘,从而得到各像素点的每个颜色通道增强处理后的特征值。基于增强处理后的各颜色通道的特征值可以获得对应的图像,即为增强处理后的图像。
在本公开的一种可选实施例中,为了提高增强处理的效果,本公开实施例还可以执行第一亮度特征的优化处理,并利用优化后的亮度特征与第一反射特征得到增强后的图像,下面结合附图说明该过程。
图5示出根据本公开实施例的图像处理方法中步骤S300的流程图,其中,所述基于所述第一亮度特征和第一反射特征,得到所述输入图像的增强后的图像(步骤S300),可以包括:
S301:对所述第一亮度特征进行优化处理,得到第二亮度特征。
本公开实施例在获得输入图像的第一亮度特征之后,可以对该第一亮度特征执行优化处理,该步骤可以初步的提高图像的各亮度分量的对比度。其中,第二亮度特征和第一亮度特征的维度相同。另外,本公开实施例对于第一亮度特征的优化处理,可以包括编码步骤和解码步骤,例如可以利用自编码网络实现,但本公开实施例对此不进行具体限定。
S302:基于所述第二亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
本公开实施例,可以在得到优化的第二亮度特征以及第一反射矩阵之后,利用各对应元素的乘积结果得到增强图像的像素特征,从而恢复出增强后的图像。
图6示出根据本公开实施例的一种图像处理方法中步骤S301的流程图。其中,所述对所述第一亮度特征进行优化处理,得到第二亮度特征,可以包括:
S3011:基于编码参数,对所述第一亮度特征执行编码处理,得到编码后的第一亮度特征。
本公开实施例的步骤S301可以通过第一神经网络执行,该第一神经网络可以执行上述编码处理和解码处理,并且编码参数和解码参数可以与图像的各亮度分量的权值相关。具体的,本公开实施例可以通过向自编码网络中引入亮度分量的权值的信息,形成了本公开实施例的第一神经网络。因此,通过本公开实施例的第一神经网络,可以实现第一亮度特征的自适应调整,且调整效果更好。
在步骤S3011中,可以根据第一神经网络的编码参数执行第一亮度特征的编码处理,例如可以将第一亮度特征中的各亮度分量与编码参数相乘,继而得到编码后的第一亮度特征。图7示出根据本公开实施例的第一神经网络的各层的结构示意图,但不作为本公开实施例中第一神经网络的具体限定。其中,第一神经网络可以包括输入层、隐层和输出层。其中,在编码过中,可以通过H=W (1)T得到编码后的第一亮度特征,其中,H={h 1,h 2,...,h k}为隐层的编码结构,K为隐层的层数,
Figure PCTCN2019104247-appb-000021
表示编码参数,M1为编码参数的个数,T={T 1,...T N}为输入的第一亮度特征,N为像素点的个数。
通过上述方式,即可以完成编码处理的过程,得到编码后的第一亮度特征,其中编码参数的确定可以根据第一神经网络的训练优化来完成,后续会对第一神经网络的训练过程进行说明。
S3012:基于解码参数,对所述编码后的第一亮度特征执行解码处理,得到所述第二亮度特征。
在对第一亮度特征执行编码处理后,即可以利用解码参数对编码后的第一亮度特征执行解码处理。例如可以通过输出层执行该解码处理。例如,可以利用解码参数与编码后的第一亮度特征执行相乘操作,得到优化重建的第二亮度特征。
具体的,可以通过
Figure PCTCN2019104247-appb-000022
实现该解码的过程,其中,
Figure PCTCN2019104247-appb-000023
表示第二亮度特征,N为像素点的个数,
Figure PCTCN2019104247-appb-000024
表示该第二亮度特征中包括的每个像素点优化后的亮度分量,
Figure PCTCN2019104247-appb-000025
表示解码参数,M2为解码参数的个数。
通过上述方式,即可以完成解码处理的过程,得第二亮度特征,其中解码参数的确定可以根据第一神经网络的训练优化来完成,后续会对第一神经网络的训练过程进行说明。图8示出根据本公开实施例的一种图像处理方法中步骤S302的流程图。其中,所述基于所述第二亮度特征和第一反射特征,得到所述输入图像的增强后的图像,可以包括:
S3021:对所述第二亮度特征和第一反射特征执行乘积处理,得到重建特征。
本公开实施例中的第二亮度特征表示优化后的亮度分量,第一反射特征表示输入图像的反射分量,将对应像素点的反射分量以及亮度分量进行相乘处理,可以得到对应像素点的重建特征。其中,可以通过下式表示S3021:
Figure PCTCN2019104247-appb-000026
其中,
Figure PCTCN2019104247-appb-000027
表示像素点x的重建特征(像素值),
Figure PCTCN2019104247-appb-000028
表示像素点x的第一反射特征,
Figure PCTCN2019104247-appb-000029
表示像素点x的第二亮度特征。c表示每个像素点的颜色通道。
本公开实施例得到的重建特征同样也可以表示成矩阵形式,其中各元素表示与彩色图像的各像素点对应的重建后的特征值,例如可以重建各像素点的R通道特征值、B通道特征值和G通道特征值。
S3022:基于所述重建特征确定所述输入图像的增强处理后的图像。
在得到每个像素点的重建特征之后,可以根据该重建后的特征形成一个新的图像,该图像即为输入图像增强处理后的图像。
本公开实施例采用的图像处理方法,可以通过优化的亮度特征与反射分量结合,对图像执行图像增强,该方式不易受到噪声的影响,且不需要多张图像同时处理,有效的提高了实时性,同时本公开实施例不需要额外定义其他参数,适应性较好。本公开实施例增强处理后可以提高输入图像的图像质量,增加对比对,且更加清晰。
下面对本公开实施例的第一神经网络的训练过程进行详细说明。本公开实施例在实现第一亮度特征优化的第一神经网络中引入了图像的结构权值信息,从而可以进一步的提高亮度分量的优化效率。其中结构权值信息为每个像素点的亮度分量的权值信息。
其中,本公开实施例的第一神经网络可以为根据自编码神经网络得到的,在自编码网络中引入了结构权值的信息。其中,图9示出根据本公开实施例中训练第一神经网络的流程图。其中,训练所述第一神经网络的步骤,包括:
S501:获取图像样本。
首先,可以获取用于训练第一神经网络的图像样本,该图像样本可以为低照度情况下获取的图像,或者其他图像质量较低的图像,图像样本的数量可以根据需求设定,本公开实施例中,各图像样本的对比度、清晰度可以不同,从而可以加大图像样本的区别性,提高网络的训练精度。
S502:获取所述图像样本的第一亮度特征和结构权值特征,所述结构权值特征中的元素表示所述第一亮度特征中像素点的亮度分量的权值。
本公开实施例可以预先获取图像样本的第一亮度特征,具体可以根据步骤S100执行,在此不再具体说明。同时还可以获得第一亮度特征对应的结构权值特征,该结构权值特征中可以包括第一亮度特征的各亮度分量的权值信息。
其中,图10示出根据本公开实施例中获取所述图像样本的结构权值特征的流程图,可以步骤S502可以包括:
S5021:获取图像样本的结构信息。
图像样本中包含许多级别的重要结构,本公开实施例可以通过第一方式执行图像样本的平滑处理获得上述结构信息。例如,本公开实施例可以利用结构-纹理分解算法获得所述图像样本的结构信息;或者也可以利用滚动导向滤波器(Rolling guidance filter)获得所述图像样本的结构信息。通过上述方式可以得到各图像样本的结构信息。
S5022:基于预设算子得到所述结构信息的梯度信息。
作为一种示例,本公开实施例可以采用索贝尔(Sobel)算子对各结构信息执行处理,得到结构信息对应的梯度信息。其中,Sobel算子的运算方式,本公开实施例不进行具体说明,可以根据现有技术手段实现。
S5023:利用所述梯度信息得到所述结构权值特征。
在得到梯度信息后,本公开实施例根据梯度信息得到每个像素点的结构权值,其中可以根据第二方式执行步骤S5023,其中第二方式的表达式为:
Figure PCTCN2019104247-appb-000030
其中,w(x)表示x像素点的结构权值,g(x)表示x像素点的梯度信息。
通过上式即可以根据每个像素点的梯度信息确定每个像素点的结构权值,该结构权值表示每个像素点的亮度分量的权值。
S503:将所述第一亮度特征和结构权值特征输入至所述第一神经网络,并根据得到的损失值调整所述第一神经网络的参数,直至所述损失值满足预设要求。
其中,所述第一神经网络的损失函数为:
Figure PCTCN2019104247-appb-000031
其中,L s1为第一神经网络的损失函数,y i表示第一亮度特征中像素点i的亮度分量,
Figure PCTCN2019104247-appb-000032
表示优化的第二亮度特征中像素点i的亮度分量,N表示像素点的数量,W (l)表示第一神经网络第l层的神经网络参数,w i表示第i个像素点的结构权值,F表示弗罗贝尼乌斯范数,L 1表示第一神经网络中的网络层数,λ为常量。
根据上述损失函数L s1,即可以得到每次优化处理后的第二亮度特征的第一损失值,在该第一损失值满足第一要求时,即表示完成第一神经网络的训练,反之,则调整第一神经网络的网络参数,直至得到的第一损失值满足第一要求,其中满足第一要求可以包括第一损失值小于或者等于第一阈值,该第一阈值的取值本公开实施例不作具体限定,可以根据需求自行选取设定。
通过上述实施例,本公开实施例不仅可以实现对低照度图片进行亮度矫正,而且可以进行噪声压制,同时由于即将结构信息加入到自编码神经网络中,可以加强重建图像的结构特征保护。
综上所述,本公开实施例可以对图像的亮度分量进行优化,并将优化的亮度分量与反射分量结合。本公开实施例可以首先获取输入图像的亮度特征,并根据该亮度特征进一步确定输入图像的反射特征,进而通过获得的亮度特征以及反射特征执行输入图像的增强处理,得到增强后的图像。该过程具有简单方便且处理效率高的特点,同时还能够提高图像增强效果。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。
此外,本公开还提供了图像处理装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种图像处理方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。
图11示出根据本公开实施例的一种图像处理装置的框图,如图11所示,所述图像处理装置包括:
获取模块10,配置为获取输入图像的第一亮度特征;
转换模块20,配置为利用所述第一亮度特征得到所述输入图像的第一反射特征;
增强模块30,配置为基于所述第一亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
在一些可能的实施方式中,所述获取模块还配置为获得输入图像中每个像素点对应的多个颜色通道的特征值;针对每个像素点,确定所述多个颜色通道的特征值中的最大值;以及将每个像素点对应的多个颜色通道中的所述最大值确定为第一亮度特征中对应像素点的亮度分量,以得到所述第一亮度特征;其中,所述第一亮度特征中的元素表示所述输入图像的各像素点的亮度分量。
在一些可能的实施方式中,所述第一反射特征中的元素表示所述输入图像对应像素点的反射分量;所述转换模块还配置为将所述第一亮度特征中的元素与预设常量进行相加处理,得到加和特征;将所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值之间的比值,确定为对应像素点的每个颜色通道的第一反射分量;以及根据所述输入图像的像素点的每个颜色通道的第一反射分量确定所述第一反射特征;其中,所述第一反射特征中的元素表示所述输入图像各像素点的反射分量。
在一些可能的实施方式中,所述第一反射特征中的元素表示所述输入图像对应像素点的反射分量;所述转换模块还配置为将所述第一亮度特征中的元素与预设常量进行相加处理,得到加和特征;获得所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值的比值,得到像素点的每个颜色通道的第一反射分量;对所述第一反射分量执行去噪处理,得到各像素点的每个颜色通道的第二反射分量;以及根据所述输入图像的像素点的每个颜色通道的所述第二反射分量确定所述第一反射特征;其中,所述第一反射特征中的元素表示所述输入图像各像素点的反射分量。
在一些可能的实施方式中,所述增强模块包括:
优化单元,配置为对所述第一亮度特征进行优化处理,得到第二亮度特征;
增强单元,配置为基于所述第二亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
在一些可能的实施方式中,所述优化单元还配置为基于编码参数,对所述第一亮度特征执行编码处理,得到编码后的第一亮度特征;基于解码参数,对所述编码后的第一亮度特征执行解码处理,得到所述第二亮度特征。
在一些可能的实施方式中,所述增强单元还配置为对所述第二亮度特征和第一反射特征执行乘积处理,得到重建特征;并且基于所述重建特征确定所述增强后的图像。
在一些可能的实施方式中,所述优化单元,配置为通过第一神经网络所述第一亮度特征进行优化处理;所述装置还包括训练模块,配置为训练所述第一神经网络,并且训练所述第一神经网络的过程包括:获取图像样本;获取所述图像样本的第一亮度特征和结构权值特征,所述结构权值特征中的元素表示所述第一亮度特征中各像素点的亮度分量的权值;将所述第一亮度特征和结构权值特征输入至所述第一神经网络,得到预测的第二亮度特征;根据所述预测的第二亮度特征对应的损失值调整所述第一神经网络的参数,直至所述损失值满足预设要求。
在一些可能的实施方式中,所述第一神经网络的损失函数为:
Figure PCTCN2019104247-appb-000033
其中,L s1为第一神经网络的损失函数,y i表示第一亮度特征中像素点i的亮度分量,
Figure PCTCN2019104247-appb-000034
表示优化的第二亮度特征中像素点i的亮度分量,N表示像素点的数量,W (l)表示第一神经网络第l层的神经网络参数,w i表示第i个像素点的结构权值,F表示弗罗贝尼乌斯范数,L 1表示第一神经网络中的网络层数,λ为常量。
在一些可能的实施方式中,所述训练模块,配置为采用以下方式获取图像样本的结构权值特征:获取图像样本的结构信息;基于预设算子得到所述结构信息的梯度信息;利用所述梯度信息得到所述结构权值特征。
在一些可能的实施方式中,所述训练模块还配置为采用以下方式中的至少一种获取图像样本的结构信息:利用结构-纹理分解算法获得所述图像样本的结构信息;利用滚动导向滤波器获得所述图像样本的结构信息。
在一些可能的实施方式中,所述训练模块利用所述梯度信息得到所述结构权值特征的表达式为:
Figure PCTCN2019104247-appb-000035
其中,w(x)表示x像素点的结构权值,g(x)表示x像素点的梯度信息。
在一些可能的实施方式中,所述转换模块还配置为通过第二神经网络对所述第一反射分量执行去噪处理,其中,所述第二神经网络的损失函数的表达式为:
Figure PCTCN2019104247-appb-000036
其中,L s2为第二神经网络的损失函数,R i表示第一反射分量,
Figure PCTCN2019104247-appb-000037
表示去噪后的第二反射分量,N表示像素点的数量,W (l)表示第二神经网络第l层的神经网络参数,F表示弗罗贝尼乌斯范数,L 2表示第二神经网络中的网络层数,
Figure PCTCN2019104247-appb-000038
表示K-L散度,并且,
Figure PCTCN2019104247-appb-000039
ρ j表示第二神经网络中隐层的活跃度,ρ表示散度常量,λ为常量。
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是非易失性计算机可读存储介质。
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为上述方法。
电子设备可以被提供为终端、服务器或其它形态的设备。
图12示出根据本公开实施例的一种电子设备800的框图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。
参照图12,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组 件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。
图13示出根据本公开实施例的一种电子设备1900的框图。例如,电子设备1900可以被提供为一服务器。参照图13,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是但不限于是电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行 时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (28)

  1. 一种图像处理方法,包括:
    获取输入图像的第一亮度特征;
    利用所述第一亮度特征得到所述输入图像的第一反射特征;
    基于所述第一亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
  2. 根据权利要求1所述的方法,其中,所述第一亮度特征中的元素表示所述输入图像的各像素点的亮度分量,所述获取输入图像的第一亮度特征,包括:
    获得输入图像中每个像素点对应的多个颜色通道的特征值;
    针对每个像素点,确定所述多个颜色通道的特征值中的最大值;
    将每个像素点对应的多个颜色通道中的所述最大值确定为第一亮度特征中对应像素点的亮度分量,以得到所述第一亮度特征。
  3. 根据权利要求1或2所述的方法,其中,所述第一反射特征中的元素表示所述输入图像对应像素点的反射分量,所述利用所述第一亮度特征得到所述输入图像的第一反射特征,包括:
    将所述第一亮度特征中的元素与预设常量进行相加处理,得到加和特征;
    将所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值之间的比值,确定为对应像素点的每个颜色通道的第一反射分量;
    根据所述输入图像的像素点的每个颜色通道的第一反射分量确定所述第一反射特征。
  4. 根据权利要求1或2所述的方法,其中,所述第一反射特征中的元素表示所述输入图像对应像素点的反射分量,所述利用所述第一亮度特征得到所述输入图像的第一反射特征,包括:
    将所述第一亮度特征中的元素与预设常量进行相加处理,得到加和特征;
    获得所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值的比值,得到像素点的每个颜色通道的第一反射分量;
    对所述第一反射分量执行去噪处理,得到像素点的每个颜色通道的第二反射分量;
    根据所述输入图像的像素点的每个颜色通道的所述第二反射分量确定所述第一反射特征。
  5. 根据权利要求1-4中任意一项所述的方法,其中,所述基于所述第一亮度特征和第一反射特征,得到所述输入图像的增强后的图像,包括:
    对所述第一亮度特征进行优化处理,得到第二亮度特征;
    基于所述第二亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
  6. 根据权利要求5所述的方法,其中,对所述第一亮度特征进行优化处理,得到第二亮度特征,包括:
    基于编码参数,对所述第一亮度特征执行编码处理,得到编码后的第一亮度特征;
    基于解码参数,对所述编码后的第一亮度特征执行解码处理,得到所述第二亮度特征。
  7. 根据权利要求5或6所述的方法,其中,所述基于所述第二亮度特征和第一反射特征,得到所述输入图像的增强处理后的图像,包括:
    对所述第二亮度特征和第一反射特征执行乘积处理,得到重建特征;
    基于所述重建特征确定所述增强后的图像。
  8. 根据权利要求5-7中任意一项所述的方法,其中,所述对所述第一亮度特征进行优化处理包括:通过第一神经网络对所述第一亮度特征进行优化处理;
    其中,所述第一神经网络的训练过程,包括:
    获取图像样本;
    获取所述图像样本的第一亮度特征和结构权值特征,所述结构权值特征中的元素表示所述第一 亮度特征中像素点的亮度分量的权值;
    将所述第一亮度特征和结构权值特征输入至所述第一神经网络,得到预测的第二亮度特征;
    根据所述预测的第二亮度特征对应的损失值调整所述第一神经网络的参数,直至所述损失值满足预设要求。
  9. 根据权利要求8所述的方法,其中,其中,所述第一神经网络的损失函数为:
    Figure PCTCN2019104247-appb-100001
    其中,L s1为第一神经网络的损失函数,y i表示第一亮度特征中像素点i的亮度分量,
    Figure PCTCN2019104247-appb-100002
    表示优化的第二亮度特征中像素点i的亮度分量,N表示像素点的数量,W (l)表示第一神经网络第l层的神经网络参数,w i表示第i个像素点的结构权值,F表示弗罗贝尼乌斯范数,L 1表示第一神经网络中的网络层数,λ为常量。
  10. 根据权利要求8或9所述的方法,其中,获取所述图像样本的结构权值特征,包括:
    获取图像样本的结构信息;
    基于预设算子得到所述结构信息的梯度信息;
    利用所述梯度信息得到所述结构权值特征。
  11. 根据权利要求10所述的方法,其中,所述获取图像样本的结构信息,包括以下方式中的至少一种:
    利用结构-纹理分解算法获得所述图像样本的结构信息;
    利用滚动导向滤波器获得所述图像样本的结构信息。
  12. 根据权利要求10或11所述的方法,其中,所述利用所述梯度信息得到所述结构权值特征的表达式为:
    Figure PCTCN2019104247-appb-100003
    其中,w(x)表示x像素点的结构权值,g(x)表示x像素点的梯度信息。
  13. 根据权利要求4所述的方法,其中,所述方法包括:通过第二神经网络对所述第一反射分量执行去噪处理,其中,所述第二神经网络的损失函数的表达式为:
    Figure PCTCN2019104247-appb-100004
    其中,L s2为第二神经网络的损失函数,R i表示第一反射分量,
    Figure PCTCN2019104247-appb-100005
    表示去噪后的第二反射分量,N表示像素点的数量,W (l)表示第二神经网络第l层的神经网络参数,F表示弗罗贝尼乌斯范数,L 2表示第二神经网络中的网络层数,
    Figure PCTCN2019104247-appb-100006
    表示K-L散度,并且,
    Figure PCTCN2019104247-appb-100007
    ρ j表示第二神经网络中隐层的活跃度,ρ表示散度常量,λ为常量。
  14. 一种图像处理装置,包括:
    获取模块,配置为获取输入图像的第一亮度特征;
    转换模块,配置为利用所述第一亮度特征得到所述输入图像的第一反射特征;
    增强模块,配置为基于所述第一亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
  15. 根据权利要求14所述的装置,其中,所述获取模块还配置为获得输入图像中每个像素点对应 的多个颜色通道的特征值;针对每个像素点,确定所述多个颜色通道的特征值中的最大值;以及将每个像素点对应的多个颜色通道中的所述最大值确定为第一亮度特征中对应像素点的亮度分量,以得到所述第一亮度特征;其中,所述第一亮度特征中的元素表示所述输入图像的各像素点的亮度分量。
  16. 根据权利要求14或15所述的装置,其中,所述第一反射特征中的元素表示所述输入图像对应像素点的反射分量;
    所述转换模块还配置为将所述第一亮度特征中的元素与预设常量进行相加处理,得到加和特征;将所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值之间的比值,确定为对应像素点的每个颜色通道的第一反射分量;以及根据所述输入图像的像素点的每个颜色通道的第一反射分量确定所述第一反射特征;其中,所述第一反射特征中的元素表示所述输入图像各像素点的反射分量。
  17. 根据权利要求14或15所述的装置,其中,所述第一反射特征中的元素表示所述输入图像对应像素点的反射分量;
    所述转换模块还配置为将所述第一亮度特征中的元素与预设常量进行相加处理,得到加和特征;获得所述输入图像中对应像素点的每个颜色通道的特征值与所述加和特征中对应像素点的特征值的比值,得到像素点的每个颜色通道的第一反射分量;对所述第一反射分量执行去噪处理,得到像素点的每个颜色通道的第二反射分量;以及根据所述输入图像的像素点的每个颜色通道的所述第二反射分量确定所述第一反射特征;其中,所述第一反射特征中的元素表示所述输入图像各像素点的反射分量。
  18. 根据权利要求14-17中任意一项所述的装置,其中,所述增强模块包括:
    优化单元,配置为对所述第一亮度特征进行优化处理,得到第二亮度特征;
    增强单元,配置为基于所述第二亮度特征和第一反射特征,得到所述输入图像的增强后的图像。
  19. 根据权利要求18所述的装置,其中,所述优化单元还配置为基于编码参数,对所述第一亮度特征执行编码处理,得到编码后的第一亮度特征;基于解码参数,对所述编码后的第一亮度特征执行解码处理,得到所述第二亮度特征。
  20. 根据权利要求18或19所述的装置,其中,所述增强单元还配置为对所述第二亮度特征和第一反射特征执行乘积处理,得到重建特征;并且基于所述重建特征确定所述增强后的图像。
  21. 根据权利要求18-20中任意一项所述的装置,其中,所述优化单元,配置为通过第一神经网络所述第一亮度特征进行优化处理;所述装置还包括训练模块,配置为训练所述第一神经网络,并且训练所述第一神经网络的过程包括:获取图像样本;获取所述图像样本的第一亮度特征和结构权值特征,所述结构权值特征中的元素表示所述第一亮度特征中各像素点的亮度分量的权值;将所述第一亮度特征和结构权值特征输入至所述第一神经网络,得到预测的第二亮度特征;根据所述预测的第二亮度特征对应的损失值调整所述第一神经网络的参数,直至所述损失值满足预设要求。
  22. 根据权利要求21所述的装置,其中,所述第一神经网络的损失函数为:
    Figure PCTCN2019104247-appb-100008
    其中,L s1为第一神经网络的损失函数,y i表示第一亮度特征中像素点i的亮度分量,
    Figure PCTCN2019104247-appb-100009
    表示优化的第二亮度特征中像素点i的亮度分量,N表示像素点的数量,W (l)表示第一神经网络第l层的神经网络参数,w i表示第i个像素点的结构权值,F表示弗罗贝尼乌斯范数,L 1表示第一神经网络中的网络层数,λ为常量。
  23. 根据权利要求21或22所述的装置,其中,所述训练模块,配置为采用以下方式获取图像样本 的结构权值特征:获取图像样本的结构信息;基于预设算子得到所述结构信息的梯度信息;利用所述梯度信息得到所述结构权值特征。
  24. 根据权利要求23所述的装置,其中,所述训练模块还配置为采用以下方式中的至少一种获取图像样本的结构信息:利用结构-纹理分解算法获得所述图像样本的结构信息;利用滚动导向滤波器获得所述图像样本的结构信息。
  25. 根据权利要求23或24所述的装置,其中,所述训练模块利用所述梯度信息得到所述结构权值特征的表达式为:
    Figure PCTCN2019104247-appb-100010
    其中,w(x)表示x像素点的结构权值,g(x)表示x像素点的梯度信息。
  26. 根据权利要求17所述的装置,其中,所述转换模块还配置为通过第二神经网络对所述第一反射分量执行去噪处理,其中,所述第二神经网络的损失函数的表达式为:
    Figure PCTCN2019104247-appb-100011
    其中,L s2为第二神经网络的损失函数,R i表示第一反射分量,
    Figure PCTCN2019104247-appb-100012
    表示去噪后的第二反射分量,N表示像素点的数量,W (l)表示第二神经网络第l层的神经网络参数,F表示弗罗贝尼乌斯范数,L 2表示第二神经网络中的网络层数,
    Figure PCTCN2019104247-appb-100013
    表示K-L散度,并且,
    Figure PCTCN2019104247-appb-100014
    ρ j表示第二神经网络中隐层的活跃度,ρ表示散度常量,λ为常量。
  27. 一种电子设备,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为:执行权利要求1至13中任意一项所述的方法。
  28. 一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现权利要求1至13中任意一项所述的方法。
PCT/CN2019/104247 2019-02-22 2019-09-03 图像处理方法及装置、电子设备和存储介质 WO2020168706A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910133416.3A CN109859144B (zh) 2019-02-22 2019-02-22 图像处理方法及装置、电子设备和存储介质
CN201910133416.3 2019-02-22

Publications (1)

Publication Number Publication Date
WO2020168706A1 true WO2020168706A1 (zh) 2020-08-27

Family

ID=66898709

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/104247 WO2020168706A1 (zh) 2019-02-22 2019-09-03 图像处理方法及装置、电子设备和存储介质

Country Status (3)

Country Link
CN (1) CN109859144B (zh)
TW (1) TWI777112B (zh)
WO (1) WO2020168706A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113506323A (zh) * 2021-07-15 2021-10-15 清华大学 图像处理方法及装置、电子设备和存储介质
CN115209120A (zh) * 2021-04-09 2022-10-18 爱思开海力士有限公司 图像感测装置及其操作方法及图像处理装置

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859144B (zh) * 2019-02-22 2021-03-12 上海商汤智能科技有限公司 图像处理方法及装置、电子设备和存储介质
CN111462000B (zh) * 2020-03-17 2023-11-28 北京邮电大学 一种基于预训练自编码器的图像恢复方法及装置
CN111462268B (zh) * 2020-03-31 2022-11-11 北京市商汤科技开发有限公司 图像重建方法及装置、电子设备和存储介质
TWI768709B (zh) * 2021-01-19 2022-06-21 福邦科技國際股份有限公司 雙影像融合方法與裝置
CN113066019A (zh) * 2021-02-27 2021-07-02 华为技术有限公司 一种图像增强方法及相关装置
TWI800943B (zh) * 2021-10-08 2023-05-01 大陸商星宸科技股份有限公司 圖像處理裝置與圖像處理方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103236040A (zh) * 2013-04-19 2013-08-07 华为技术有限公司 一种色彩增强方法及装置
CN103530848A (zh) * 2013-09-27 2014-01-22 中国人民解放军空军工程大学 一种非均匀光照图像二次曝光的实现方法
CN103578084A (zh) * 2013-12-09 2014-02-12 西安电子科技大学 基于亮通道滤波的彩色图像增强方法
CN107358586A (zh) * 2017-07-06 2017-11-17 中山大学 一种图像增强方法、装置及设备
CN109859144A (zh) * 2019-02-22 2019-06-07 上海商汤智能科技有限公司 图像处理方法及装置、电子设备和存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140253601A1 (en) * 2013-03-11 2014-09-11 Samsung Electronics Co., Ltd. Display power reduction using sei information
CN103903229B (zh) * 2014-03-13 2017-01-04 中安消技术有限公司 一种夜晚图像增强方法和装置
CN105654437B (zh) * 2015-12-24 2019-04-19 广东迅通科技股份有限公司 一种对低照度图像的增强方法
TWI591583B (zh) * 2016-04-13 2017-07-11 瑞昱半導體股份有限公司 影像對比增強方法及其裝置
CN108205803B (zh) * 2017-07-19 2020-12-25 北京市商汤科技开发有限公司 图像处理方法、神经网络模型的训练方法及装置
CN112419354B (zh) * 2018-01-22 2023-03-14 海信视像科技股份有限公司 一种图像亮度处理方法及装置、电子设备
CN108628571B (zh) * 2018-03-29 2021-01-15 西安电子科技大学 一种显示屏节能方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103236040A (zh) * 2013-04-19 2013-08-07 华为技术有限公司 一种色彩增强方法及装置
CN103530848A (zh) * 2013-09-27 2014-01-22 中国人民解放军空军工程大学 一种非均匀光照图像二次曝光的实现方法
CN103578084A (zh) * 2013-12-09 2014-02-12 西安电子科技大学 基于亮通道滤波的彩色图像增强方法
CN107358586A (zh) * 2017-07-06 2017-11-17 中山大学 一种图像增强方法、装置及设备
CN109859144A (zh) * 2019-02-22 2019-06-07 上海商汤智能科技有限公司 图像处理方法及装置、电子设备和存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115209120A (zh) * 2021-04-09 2022-10-18 爱思开海力士有限公司 图像感测装置及其操作方法及图像处理装置
CN115209120B (zh) * 2021-04-09 2024-04-26 爱思开海力士有限公司 图像感测装置及其操作方法及图像处理装置
CN113506323A (zh) * 2021-07-15 2021-10-15 清华大学 图像处理方法及装置、电子设备和存储介质
CN113506323B (zh) * 2021-07-15 2024-04-12 清华大学 图像处理方法及装置、电子设备和存储介质

Also Published As

Publication number Publication date
TW202032425A (zh) 2020-09-01
CN109859144B (zh) 2021-03-12
TWI777112B (zh) 2022-09-11
CN109859144A (zh) 2019-06-07

Similar Documents

Publication Publication Date Title
WO2020168706A1 (zh) 图像处理方法及装置、电子设备和存储介质
WO2020224457A1 (zh) 图像处理方法及装置、电子设备和存储介质
WO2021196401A1 (zh) 图像重建方法及装置、电子设备和存储介质
CN109658401B (zh) 图像处理方法及装置、电子设备和存储介质
WO2020155711A1 (zh) 图像生成方法及装置、电子设备和存储介质
US11403489B2 (en) Target object processing method and apparatus, electronic device, and storage medium
EP2878121B1 (en) Method and apparatus for dual camera shutter
JP6134446B2 (ja) 画像分割方法、画像分割装置、画像分割デバイス、プログラム及び記録媒体
CN109345485B (zh) 一种图像增强方法、装置、电子设备及存储介质
WO2020192252A1 (zh) 图像生成方法及装置、电子设备和存储介质
KR101727169B1 (ko) 이미지 필터를 생성하기 위한 방법 및 장치
CN109636712B (zh) 图像风格迁移及数据存储方法、装置和电子设备
WO2020007241A1 (zh) 图像处理方法和装置、电子设备以及计算机可读存储介质
WO2017031901A1 (zh) 人脸识别方法、装置及终端
WO2020151176A1 (zh) 图像处理方法及装置、电子设备和存储介质
CN109165738B (zh) 神经网络模型的优化方法及装置、电子设备和存储介质
WO2019205605A1 (zh) 人脸特征点的定位方法及装置
CN109920016B (zh) 图像生成方法及装置、电子设备和存储介质
WO2022227394A1 (zh) 图像处理方法、装置、设备、存储介质及程序
CN110659690A (zh) 神经网络的构建方法及装置、电子设备和存储介质
CN111583142B (zh) 图像降噪方法及装置、电子设备和存储介质
CN109447258B (zh) 神经网络模型的优化方法及装置、电子设备和存储介质
CN107730443B (zh) 图像处理方法、装置及用户设备
TWI719777B (zh) 圖像重建方法、圖像重建裝置、電子設備和電腦可讀儲存媒體
CN115512116B (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: 19916417

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: 19916417

Country of ref document: EP

Kind code of ref document: A1