Image enhancement method, image enhancement device, electronic equipment and storage medium
By combining brightness and contrast enhancement features in the image enhancement model, the problems of low-illumination images in noise and color distortion are solved, the image recognition performance is improved, and the accuracy of vehicle damage assessment is ensured.
Patent Information
- Application Number
- CN202411530817.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-10-29
AI Technical Summary
The prior art has problems with noise and color distortion when image enhancement under low illumination conditions, resulting in poor image quality and it is difficult to accurately evaluate vehicle damage.
By acquiring image data under low illumination and normal lighting, use preset enhancement models for feature extraction, grayscale attribute enhancement, image encoding and decoding, determine model loss values and adjust model parameters, generate target images, and combine brightness and contrast enhancement features. , improve the image's detail retention and contrast.
Improves the enhanced accuracy of low-illumination images, avoids noise and color distortion, enhances image recognition performance, and ensures the accuracy of vehicle damage assessment.
Smart Images

Figure CN119295359A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, is applicable to the field of financial technology, and in particular to an image enhancement method and image enhancement device, electronic device, and storage medium. Background Art
[0002] Image enhancement refers to the technology of improving the visual effect of an image to make it more suitable for human observation or more suitable for machine analysis and processing. For example, in the insurance field of financial technology, when the claimant starts the automatic claim system for vehicle damage, the claimant can upload the vehicle damage image, so that the automatic claim system can judge the vehicle damage through the vehicle damage image and conduct a claim assessment. However, due to low light or backlight conditions such as at night, the low-light images captured by the mobile phone usually have quality degradation problems such as underexposure, loss of details, color distortion or blurring, which makes the image quality of the captured vehicle damage images insufficient. Therefore, by enhancing the uploaded vehicle damage images, the accuracy of the assessment of vehicle damage can be guaranteed.
[0003] However, current image enhancement methods can only enhance some low-light images without noise, and only by increasing the image contrast or brightness, there are still serious noise and color distortion, resulting in poor image enhancement effects. Therefore, how to improve the accuracy of image enhancement for low-light images and avoid serious noise and color distortion has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose an image enhancement method and an image enhancement device, an electronic device, and a storage medium, aiming to improve the enhancement accuracy of low-light images, avoid serious noise and color distortion, and thus improve the recognition performance of enhanced images.
[0005] To achieve the above object, a first aspect of an embodiment of the present application provides an image enhancement method, the method comprising:
[0006] Acquire sample data, wherein the sample data includes a sample original illumination map and a sample normal illumination map, wherein the sample original illumination map is an image containing the sample object acquired under low illumination, and the sample normal illumination map is an image containing the sample object acquired under normal illumination;
[0007] Based on the feature extraction layer of the preset enhancement model, feature extraction is performed on the original illumination image of the sample to obtain the low-illumination image features of the sample;
[0008] Performing image grayscale attribute enhancement on the sample original illumination image to obtain a sample brightness enhancement image and a sample contrast enhancement image;
[0009] Performing image encoding on the sample brightness enhancement map and the sample contrast enhancement map based on the image encoding layer of the preset enhancement model to obtain sample enhancement features;
[0010] Performing image decoding on the sample enhancement feature and the sample low-illumination image feature based on the decoding layer of the preset enhancement model to obtain a sample enhancement map;
[0011] Determining a model loss value based on the sample original illumination map, the sample normal illumination map and the sample enhancement map, and adjusting parameters of the preset enhancement model based on the model loss value to obtain an image enhancement model;
[0012] The target image is enhanced based on the image enhancement model to obtain a target enhanced image.
[0013] In some embodiments, the feature extraction layer based on the preset enhancement model extracts features from the sample original illumination map to obtain the sample low-illumination image features, including:
[0014] Performing image decomposition on the sample original illumination map to obtain a sample reflection map and a sample illumination map;
[0015] Based on the feature extraction layer, feature extraction is performed on the sample reflection image and the sample original illumination image to obtain the sample low-illuminance image feature.
[0016] In some embodiments, determining the model loss value based on the sample original illumination map, the sample normal illumination map, and the sample enhancement map includes:
[0017] Performing visual feature loss calculation based on the sample normal illumination map and the sample enhanced map to obtain a visual feature loss value;
[0018] Perform image decomposition loss calculation based on the sample original illumination map, the sample reflection map, and the sample illumination map to obtain an image decomposition loss value;
[0019] Performing image decomposition on the sample enhancement image to obtain a sample enhancement reflection image;
[0020] Performing image grayscale attribute loss calculation based on the sample enhanced reflection map, the sample enhanced map, and the sample normal illumination map to obtain an image grayscale attribute loss value;
[0021] The visual feature loss value, the image decomposition loss value and the image grayscale attribute loss value are weighted and calculated to obtain the model loss value.
[0022] In some embodiments, the performing visual feature loss calculation based on the sample normal illumination map and the sample enhancement map to obtain the visual feature loss value includes:
[0023] Performing color loss calculation on the sample normal illumination image and the sample enhanced image based on a preset color loss function to obtain an image color loss value;
[0024] Performing texture loss calculation on the sample normal illumination image and the sample enhanced image based on a preset texture loss function to obtain an image texture loss value;
[0025] Performing content loss calculation on the sample normal illumination image and the sample enhanced image based on a preset content loss function to obtain an image content loss value;
[0026] The image color loss value, the image texture loss value and the image content loss value are weighted and calculated to obtain a visual feature loss value.
[0027] In some embodiments, the image grayscale attribute loss calculation is performed based on the sample enhanced reflection map, the sample enhanced map and the sample normal illumination map to obtain the image grayscale attribute loss value, including:
[0028] Based on the preset three-channel weights and the preset brightness value, a color enhancement loss calculation is performed on the sample enhanced reflection map and the sample normal illumination map to obtain a color enhancement loss value; wherein the preset brightness value is used to indicate the degree of enhancement of the brightness attribute;
[0029] Performing image contrast loss calculation based on the sample enhancement image and the sample normal illumination image to obtain an image contrast loss value;
[0030] The color enhancement loss value and the image contrast loss value are weighted and calculated to obtain the image grayscale attribute loss value.
[0031] In some embodiments, the image coding layer based on the preset enhancement model performs image coding on the sample brightness enhancement map and the sample contrast enhancement map to obtain sample enhancement features, including:
[0032] Performing image encoding on the sample brightness enhancement map to obtain a brightness enhancement feature;
[0033] Performing image encoding on the sample contrast enhancement image to obtain a contrast enhancement feature;
[0034] Performing feature splicing on the brightness enhancement feature and the contrast enhancement feature to obtain a sample splicing feature;
[0035] Feature extraction is performed on the sample splicing features to obtain the sample enhancement features.
[0036] In some embodiments, the step of performing feature stitching on the brightness enhancement feature and the contrast enhancement feature to obtain a sample stitching feature includes:
[0037] Acquire a detection accuracy of the sample target based on the target type of the sample target;
[0038] Determining enhancement parameters based on the target type and the detection accuracy, the enhancement parameters comprising a brightness enhancement weight of the brightness enhancement feature and a contrast enhancement weight of the contrast enhancement feature;
[0039] The sample splicing feature is obtained by performing feature weighted splicing based on the brightness enhancement feature, the brightness enhancement weight, the contrast enhancement feature and the contrast enhancement weight.
[0040] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides an image enhancement device, the device comprising:
[0041] An acquisition module, used to acquire sample data, wherein the sample data includes a sample original illumination map and a sample normal illumination map, wherein the sample original illumination map is an image containing the sample object acquired under low illumination, and the sample normal illumination map is an image containing the sample object acquired under normal illumination;
[0042] An extraction module, used for extracting features from the sample original illumination image based on a feature extraction layer of a preset enhancement model to obtain features of the sample low-illuminance image;
[0043] An attribute enhancement module is used to enhance the image grayscale attribute of the sample original illumination map to obtain a sample brightness enhancement map and a sample contrast enhancement map;
[0044] A coding module, used for performing image coding on the sample brightness enhancement map and the sample contrast enhancement map based on the image coding layer of the preset enhancement model to obtain a sample enhancement feature;
[0045] A decoding module, configured to perform image decoding on the sample enhancement feature and the sample low-illumination image feature based on a decoding layer of the preset enhancement model to obtain a sample enhancement map;
[0046] A training module, used to determine a model loss value based on the sample original illumination map, the sample normal illumination map and the sample enhanced map, and adjust parameters of the preset enhancement model based on the model loss value to obtain an image enhancement model;
[0047] The image enhancement module is used to perform image enhancement on the target image based on the image enhancement model to obtain a target enhanced image.
[0048] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0049] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0050] The present application proposes an image enhancement method, an image enhancement device, an electronic device, and a storage medium. The method acquires sample data, wherein the sample data includes a sample original illumination map and a sample normal illumination map. The sample original illumination map is an image containing a sample object collected under low illumination, and the sample normal illumination map is an image containing a sample object collected under normal illumination. Further, a feature extraction layer based on a preset enhancement model performs feature extraction on the sample original illumination map to obtain sample low illumination image features. The sample original illumination map performs image grayscale attribute enhancement to obtain a sample brightness enhancement map and a sample contrast enhancement map. Further, an image encoding layer based on a preset enhancement model performs image encoding on the sample brightness enhancement map and the sample contrast enhancement map to obtain sample enhancement features. Further, a decoding layer based on a preset enhancement model performs image decoding on the sample enhancement features and the sample low illumination image features to obtain a sample enhancement map. Further, a model loss value is determined based on the sample original illumination map, the sample normal illumination map, and the sample enhancement map, and parameters of the preset enhancement model are adjusted based on the model loss value to obtain an image enhancement model. Finally, a target image is enhanced based on the image enhancement model to obtain a target enhanced image. Compared to the related art that can only enhance some low-light images without noise, and only by increasing the image contrast or brightness, the embodiment of the present application will consider both the brightness enhancement map and the contrast enhancement map of the image when enhancing the image, and can strengthen the learning of the detailed brightness and contrast features of the low-light image. In this way, the generated enhanced image can retain both the essential attributes of the image and the light-dark contrast. Therefore, the embodiment of the present application can improve the enhancement accuracy of the low-light image, avoid the existence of serious noise and color distortion, and thus improve the recognition performance of the enhanced image. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a flow chart of the image enhancement method provided in the embodiment of the present application;
[0052] Figure 2 yes Figure 1 A flowchart of step S120 in FIG.
[0053] Figure 3 yes Figure 1 A flowchart of step S140 in FIG.
[0054] Figure 4 yes Figure 3 A flowchart of step S330 in FIG.
[0055] Figure 5 yes Figure 1 A flowchart of step S160 in FIG.
[0056] Figure 6 yes Figure 5 A flowchart of step S510 in FIG.
[0057] Figure 7 yes Figure 5 A flowchart of step S540 in FIG.
[0058] Figure 8 It is a schematic diagram of a process of performing image enhancement based on an image enhancement model provided in an embodiment of the present application;
[0059] Fig. 9 is a structural schematic diagram of an image enhancement device provided in an embodiment of the present application;
[0060] Fig.10 It is a hardware structure diagram of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0062] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0064] First, some nouns involved in this application are analyzed:
[0065] Artificial Intelligence (AI): It is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science. AI attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0066] Image decomposition: refers to the process of decomposing an image into several components or parts to describe the different characteristics or properties of the image through these components. The purpose of image decomposition is to represent the information of the original image in a form that is easier to process or analyze, so as to facilitate further processing or analysis. The types of image decomposition may include: color space decomposition (i.e., decomposing the pixel values of the image into different color channels according to the color space (such as RGB, HSV, Lab, etc.), each channel represents a color component of the image), frequency domain decomposition (i.e., decomposing the image into different frequency components using methods such as Fourier transform), spatial domain decomposition (i.e., decomposing the image into different spatial scale components, such as decomposing into sub-band images of different resolutions through wavelet transform), illumination and reflectance decomposition (such as what the Retinex algorithm does, decomposing the image into illumination components and reflectance components, where the illumination component describes the illumination distribution in the image and the reflectance component describes the reflective characteristics of the object surface), etc.
[0067] Retinex image decomposition: It is a method of decomposing an image into two main components: illumination (such as the illumination map in the following embodiment) and reflectance (such as the reflectance map in the following embodiment). This decomposition simulates the human eye's perception of changes in illumination and aims to improve the brightness and contrast of the image, especially in low-light conditions.
[0068] Gaussian Blur Operator: is a blurring technique commonly used in image processing and computer vision. The Gaussian Blur Operator can use a Gaussian Function to reduce image noise and details, thereby blurring the image. Gaussian blur smoothes the image by taking a weighted average of the pixel values in the neighborhood, with the weights determined by the Gaussian distribution.
[0069] Image enhancement refers to the technology of improving the visual effect of an image to make it more suitable for human observation or more suitable for machine analysis and processing. For example, in the insurance field of financial technology, when the claimant starts the automatic claim system for vehicle damage, the claimant can upload the vehicle damage image, so that the automatic claim system can judge the vehicle damage through the vehicle damage image and conduct a claim assessment. However, due to low light or backlight conditions such as at night, the low-light images captured by the mobile phone usually have quality degradation problems such as underexposure, loss of details, color distortion or blurring, which makes the image quality of the captured vehicle damage images insufficient. Therefore, by enhancing the uploaded vehicle damage images, the accuracy of the assessment of vehicle damage can be guaranteed.
[0070] However, current image enhancement methods can only enhance some low-light images without noise, and only by increasing the image contrast or brightness, there are still serious noise and color distortion, resulting in poor image enhancement effects. Therefore, how to improve the accuracy of image enhancement for low-light images and avoid serious noise and color distortion has become a technical problem that needs to be solved urgently.
[0071] Based on this, the embodiments of the present application provide an image enhancement method and an image enhancement device, an electronic device, and a storage medium, which aim to improve the accuracy of image enhancement of low-illuminance images, avoid serious noise and color distortion, and thus improve the recognition performance of enhanced images.
[0072] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0073] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0074] The image enhancement method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The image enhancement method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the image enhancement method, etc., but is not limited to the above forms.
[0075] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0076] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the identity or characteristics of the object, such as object feedback data, object item data, etc., the permission or consent of the object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain sensitive personal information of the object, the separate permission or separate consent of the object will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the separate permission or separate consent of the object, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0077] See also Figure 1 , Figure 1 is an optional flow chart of the image enhancement method provided in the embodiment of the present application. In some embodiments of the present application, Figure 1 The method may specifically include but is not limited to steps S110 to S170.
[0078] Step S110, obtaining sample data;
[0079] Step S120, extracting features from the sample original illumination image based on the feature extraction layer of the preset enhancement model to obtain features of the sample low illumination image;
[0080] Step S130, performing image grayscale attribute enhancement on the sample original illumination image to obtain a sample brightness enhancement image and a sample contrast enhancement image;
[0081] Step S140, performing image encoding on the sample brightness enhancement map and the sample contrast enhancement map based on the image encoding layer of the preset enhancement model to obtain sample enhancement features;
[0082] Step S150, performing image decoding on the sample enhancement feature and the sample low-illumination image feature based on the decoding layer of the preset enhancement model to obtain a sample enhancement map;
[0083] Step S160, determining a model loss value based on the sample original illumination map, the sample normal illumination map, and the sample enhanced map, and adjusting parameters of a preset enhancement model based on the model loss value to obtain an image enhancement model;
[0084] Step S170, performing image enhancement on the target image based on the image enhancement model to obtain a target enhanced image.
[0085] Compared to the related art which can only perform image enhancement on some low-light images without noise, and only by increasing the contrast or brightness of the image, the steps S110 to S170 of the present application will consider both the brightness enhancement map and the contrast enhancement map of the image when enhancing the image, and can strengthen the learning of the detailed brightness and contrast features of the low-light image, while enhancing the image in combination with the backbone network. In this way, the generated enhanced image can retain both the essential attributes of the image and the light-dark contrast. Therefore, the embodiments of the present application can improve the enhancement accuracy of low-light images, avoid serious noise and color distortion, and thus improve the recognition performance of enhanced images.
[0086] In step S110 of some embodiments, a training sample set is obtained, and the training sample set is used to train an image enhancement model. The training sample set includes multiple sample data, and each sample data includes a pair of sample original illumination map and sample normal illumination map, the sample original illumination map is an image containing the sample object captured under low illumination, and the sample normal illumination map is an image containing the sample object captured under normal illumination. The sample normal illumination map and the sample original illumination map have the same image content, representing images taken under different illumination conditions, and the sample normal illumination map can be used as a reference label for the sample original illumination map.
[0087] It should be noted that the sample original illumination map is equivalent to an image captured under low-light environmental conditions with insufficient light, such as low-light or backlit conditions at night or indoors. In low-light conditions, image acquisition will have some disadvantages, such as increased image noise (the camera's photosensitive element may increase its sensitivity (ISO value), which will increase image noise and affect image quality), underexposure, color distortion, reduced dynamic range (that is, in low-light conditions, the dynamic range of the image (that is, the details of the brightest and darkest parts of the image) will be reduced, resulting in overexposure of highlights or loss of details in shadows), and difficulty in focusing (that is, in low-light environments, the autofocus system may have difficulty focusing accurately, resulting in blurred images). Although low-light images can be improved by using larger apertures, slower shutter speeds, and increasing ISO values, image enhancement algorithms can significantly improve the visibility and quality of images without increasing hardware costs.
[0088] In step S120 of some embodiments, during the model training process, the present application may input the sample original illumination map into a preset enhancement model, which may be a model constructed based on a convolutional neural network model, a machine learning model, or the like, without specific limitation. The preset enhancement model may include a feature extraction layer, an image encoding layer, and a decoding layer. Furthermore, the feature extraction layer in the preset enhancement model may be used to extract features from the sample original illumination map taken under low illumination conditions, and the obtained sample low illumination image features may represent key information in the sample original illumination map, such as texture, contour, etc., which is helpful for the subsequent image enhancement process.
[0089] See also Figure 2 , Figure 2 It is a specific flow chart of step S120 provided in an embodiment of the present application. In some embodiments of the present application, step S120 may specifically include but is not limited to steps S210 to S220.
[0090] Step S210, performing image decomposition on the sample original illumination map to obtain a sample reflection map and a sample illumination map;
[0091] Step S220: extract features from the sample reflection map and the sample original illumination map based on the feature extraction layer to obtain sample low-illuminance image features.
[0092] In step S210 of some embodiments, in order to better learn the detailed features of the low-light image, the present application may first perform image decomposition on the sample original illumination image to obtain a sample reflection image and a sample illumination image. Among them, the sample reflection image can reflect the color and material information of the image, and can remain relatively unchanged under different illumination conditions, so it is also called the true color image. The sample illumination image (also called a brightness image, a highlight image, etc.) can reflect the illumination conditions of the image, and can also reflect the brightness distribution of the image.
[0093] It should be noted that the image decomposition of the present application can adopt the Retinex image decomposition algorithm, that is, the image can be decomposed into two independent components: the reflection component (Reflectance) and the illumination component (Illumination). In this way, the image in any scene can be expressed as the product of the reflection component and the illumination component of the object. In other words, the final color and brightness of the image can be jointly determined by the color of the surface of the object (reflection component) and the light irradiated on the object (illumination component). In addition, the present application can also adopt other image decomposition algorithms, such as Fourier Transform (Fourier Transform), Wavelet Transform (Wavelet Transform), etc., without specific limitation.
[0094] In step S220 of some embodiments, further, feature extraction can be performed on the sample reflection map and the sample original illumination map based on the feature extraction layer to obtain sample low-light image features. The sample low-light image features refer to features extracted from the sample reflection map and the sample original illumination map, which contain both key information such as texture and contour and detail information such as color distribution. Among them, the feature extraction layer is usually composed of a series of convolutional layers, which can extract useful features from the image. By extracting these features, the system can better understand the content of the image and use this information to enhance the image in subsequent steps.
[0095] It should be noted that the specific process of extracting features from the sample reflection map and the sample original illumination map based on the feature extraction layer to obtain the sample low-light image features may include: image encoding the sample reflection map to obtain the reflection map encoding features; image encoding the sample original illumination map to obtain the original illumination map encoding features; feature fusion of the reflection map encoding features and the original illumination map encoding features to obtain the sample low-light image features. Feature fusion refers to adding feature maps extracted from different images to retain image information at different levels and enhance semantic information and spatial details.
[0096] It should be noted that, in some other embodiments, the present application can also perform feature extraction on the sample reflection map, the sample illumination map and the sample original illumination map based on the feature extraction layer to obtain the sample low-illumination image features, that is, the sample low-illumination image features at this time refer to the image features that integrate the features of the sample reflection map, the sample illumination map and the sample original illumination map, and the specific extraction process can be referred to the above steps and will not be repeated here.
[0097] In step S130 of some embodiments, since it is difficult to accurately estimate the scene brightness and contrast by only extracting the features of the sample original illumination map, the embodiment of the present application also performs image grayscale attribute enhancement on the sample original illumination map to obtain a sample brightness enhancement map and a sample contrast enhancement map, and compares the sample brightness enhancement map, the sample contrast enhancement map, the sample reflection map, the sample illumination map and the sample original illumination map. Figure 1 It is used to enhance the image of the sample original illumination map.
[0098] It should be noted that the image grayscale attributes of the present application include brightness and contrast. Brightness and contrast are different. Brightness is the degree of lightness and darkness, and contrast is the difference between different colors. People feel the two differently, and the methods of enhancing the two are also different. The image grayscale attribute enhancement of the present application includes the adjustment of brightness and contrast. The brightness enhancement map is intended to improve the overall brightness of the image, while the contrast enhancement map is intended to enhance the contrast between different areas in the image to make the image details clearer. For example, the image brightness of the sample original illumination map can be enhanced by histogram equalization to obtain a sample brightness enhancement map. And the image contrast of the sample original illumination map can be enhanced by linear transformation to obtain a sample contrast enhancement map. In addition, the present application can also use other methods to enhance the image brightness of the illumination map, such as gamma correction, linear transformation, etc., and can also use other methods to enhance the image contrast of the illumination map, such as adaptive histogram equalization, multi-scale contrast enhancement, etc., which are not specifically limited here.
[0099] In step S140 of some embodiments, further, the present application may use the coding layer of the preset enhancement model to perform image encoding on the sample brightness enhancement map and the sample contrast enhancement map respectively, so as to extract more significant sample enhancement features for further processing and enhancement of the image.
[0100] See also Figure 3 , Figure 3 It is a specific flow chart of step S140 provided in an embodiment of the present application. In some embodiments of the present application, step S140 may specifically include but is not limited to steps S310 to S340.
[0101] Step S310, performing image encoding on the sample brightness enhancement image to obtain a brightness enhancement feature;
[0102] Step S320, performing image encoding on the sample contrast enhancement image to obtain a contrast enhancement feature;
[0103] Step S330, performing feature splicing on the brightness enhancement feature and the contrast enhancement feature to obtain a sample splicing feature;
[0104] Step S340, extracting features from the sample splicing features to obtain sample enhancement features.
[0105] In steps S310 to S340 of some embodiments, the purpose of image encoding is to convert image data into a set of features that can represent the brightness, contrast information, etc. of the image. The present application can improve the visual differences between different areas in the image and make the details more obvious by encoding the sample brightness enhancement map and the sample contrast enhancement map respectively, and the encoding process converts these visual differences into numerical features to provide a basis for subsequent analysis. Further, the brightness enhancement features and the contrast enhancement features are merged or spliced together. This splicing can be a simple data-level merger or a fusion based on a certain algorithm, the purpose of which is to integrate the information contained in the two features into a unified feature representation. Finally, the spliced features are further extracted and processed, that is, a machine learning algorithm (such as a deep learning model) can be used to learn more abstract and representative features from the sample splicing features to obtain sample enhancement features, which can better represent the important information of the image after brightness and contrast enhancement.
[0106] In the above embodiment, the present application performs image encoding on the image after the image grayscale attribute enhancement of the sample original illumination map, extracts features that can represent the image enhancement effect, and uses these features for subsequent image analysis or machine learning tasks. This can improve the accuracy of image enhancement of low-light images, avoid serious noise and color distortion, and thus improve the recognition performance of enhanced images.
[0107] See also Figure 4 , Figure 4 It is a specific flow chart of step S330 provided in an embodiment of the present application. In some embodiments of the present application, step S330 may specifically include but is not limited to steps S410 to S430.
[0108] Step S410, obtaining the detection accuracy of the sample target based on the target type of the sample target;
[0109] Step S420, determining enhancement parameters based on target type and detection accuracy;
[0110] Step S430, performing feature weighted splicing based on the brightness enhancement feature, the brightness enhancement weight, the contrast enhancement feature and the contrast enhancement weight to obtain a sample splicing feature.
[0111] In step S410 of some embodiments, the sample original illumination map may include a sample target to be detected. For example, in the insurance field of financial technology, the sample original illumination map may be a vehicle damage image. Then, the sample target in the sample original illumination map may be the entire claim vehicle or a local detail of the claim vehicle (such as a door, a trunk, etc.). Therefore, the present application may obtain the detection accuracy of the target in the target detection task according to the target type of the sample target. For example, the detection accuracy of the rear mirror of the claim vehicle is higher when the sample target is the entire claim vehicle compared with the rear mirror of the claim vehicle.
[0112] In step S420 of some embodiments, further, the present application may determine enhancement parameters based on the target type and detection accuracy, and the enhancement parameters include a brightness enhancement weight of a brightness enhancement feature and a contrast enhancement weight of a contrast enhancement feature. These weights are used to adjust the degree of brightness and contrast enhancement to optimize image quality and improve the accuracy of target detection. For example, if the detection accuracy of a certain target type is low, the system may increase the weight of brightness or contrast enhancement in order to improve the detectability of the target.
[0113] In step S430 of some embodiments, the present application may further combine the brightness enhancement feature and the contrast enhancement feature, and their respective corresponding weights, to perform feature weighted splicing. This means that the brightness enhancement feature and the contrast enhancement feature are not simply merged, but are synthesized according to the corresponding weights to generate a more comprehensive sample splicing feature. In this way, it can be ensured that the contributions of different enhancement features are balanced and optimized in the final feature representation.
[0114] In the above embodiments, the present application can dynamically adjust the image enhancement strategy according to the target type and detection accuracy of the sample target in the sample original illumination image, in order to improve the performance of target detection.
[0115] In step S150 of some embodiments, the present application may further utilize the decoding layer of the preset enhancement model to combine the extracted sample enhancement features with the original low-light image features, perform image decoding, and generate an enhanced sample enhancement map. This sample enhancement map is the image effect under normal lighting conditions simulated by the model.
[0116] It should be noted that the present application performs image decoding on sample enhancement features and sample low-illumination image features based on the decoding layer of a preset enhancement model to obtain a sample enhancement map, which may specifically include: performing feature fusion on the sample enhancement features and the sample low-illumination image features to obtain sample target enhancement features; performing image decoding on the sample target enhancement features based on the decoding layer to obtain a sample enhancement map.
[0117] It should be noted that the decoding layer of the present application can be constructed based on the UNet network model or other CNN models without limitation.
[0118] In step S160 of some embodiments, a model loss value is further determined based on the sample original illumination map, the sample normal illumination map and the sample enhancement map, and the parameters of the preset enhancement model are adjusted based on the model loss value to obtain an image enhancement model. This model loss value can reflect the performance of the preset enhancement model, that is, the gap between the current performance of the model and the ideal state, so as to optimize the model performance and obtain an image enhancement model that can better improve the accuracy of image enhancement of low-light images.
[0119] It should be noted that the sample reflection map and sample illumination map of the present application are normalized RGB pixel maps obtained after image decomposition of the sample original illumination map.
[0120] See also Figure 5 , Figure 5 It is a specific flow chart of step S160 provided in an embodiment of the present application. In some embodiments of the present application, step S160 may specifically include but is not limited to steps S510 to S550.
[0121] Step S510, calculating the visual feature loss based on the sample normal illumination map and the sample enhanced map to obtain a visual feature loss value;
[0122] Step S520, performing image decomposition loss calculation based on the sample original illumination map, the sample reflection map, and the sample illumination map to obtain an image decomposition loss value;
[0123] Step S530, performing image decomposition on the sample enhancement image to obtain a sample enhancement reflection image;
[0124] Step S540, performing image grayscale attribute loss calculation based on the sample enhanced reflection map, the sample enhanced map, and the sample normal illumination map to obtain an image grayscale attribute loss value;
[0125] Step S550, weighted sum calculation is performed on the visual feature loss value, the image decomposition loss value and the image gray attribute loss value to obtain the model loss value.
[0126] In step S510 of some embodiments, in order to enhance the underexposed image, the present application may use a composite loss function including content, texture and color to calculate the visual feature loss value to retain the details in the image. And the composite loss function may be used as the loss function of the backbone network of the image enhancement model of the present application.
[0127] See also Figure 6 , Figure 6 It is a specific flow chart of step S510 provided in an embodiment of the present application. In some embodiments of the present application, step S510 may specifically include but is not limited to steps S610 to S640.
[0128] Step S610, performing color loss calculation on the sample normal illumination image and the sample enhanced image based on a preset color loss function to obtain an image color loss value;
[0129] Step S620, performing texture loss calculation on the sample normal illumination image and the sample enhanced image based on a preset texture loss function to obtain an image texture loss value;
[0130] Step S630, performing content loss calculation on the sample normal illumination image and the sample enhanced image based on a preset content loss function to obtain an image content loss value;
[0131] Step S640, performing weighted sum calculation on the image color loss value, the image texture loss value and the image content loss value to obtain a visual feature loss value.
[0132] In step S610 of some embodiments, the present application may perform color loss calculation on the sample normal illumination image and the sample enhancement image based on a preset color loss function to obtain an image color loss value, and the specific process of calculating the image color loss value may be as shown in the following formula 1:
[0133]
[0134] In formula 1, Represents the image color loss value, represents the sample enhancement map, Y represents the sample normal illumination map, and G(·) represents the Gaussian blur operator.
[0135] In step S620 of some embodiments, at the same time, the present application may perform texture loss calculation on the sample normal illumination map and the sample enhancement map based on a preset texture loss function to obtain an image texture loss value, and the specific process of calculating the image texture loss value may be shown in the following formula 2:
[0136]
[0137] In formula 2, represents the image texture loss value, D(·) represents the discriminative convolutional neural network (CNN), and can be the last layer of the decoding layer of the present application, or can be another network structure, without limitation, represents the sample enhancement map, and Y represents the sample normal illumination map.
[0138] In step S630 of some embodiments, at the same time, the present application may perform content loss calculation on the sample normal illumination image and the sample enhanced image based on a preset content loss function to obtain an image content loss value, and the specific process of calculating the image content loss value may be shown in the following formula 3:
[0139]
[0140] In formula 3, represents the image content loss value, ‖·‖2 represents the L2 norm of the vector (in mathematics, norm is a way to measure the size of a vector. Different norms give different “lengths” or “sizes” of the vector. The L2 norm (also called the Euclidean norm) is defined as the square root of the sum of the squares of the vector elements).
[0141] In step S640 of some embodiments, further, the image color loss value, the image texture loss value and the image content loss value may be weighted and calculated to obtain a visual feature loss value. Thus, the specific process of calculating the visual feature loss value may be as shown in the following formula 4:
[0142]
[0143] In formula 4, α1 represents the image content loss value The weight of α2 represents the image texture loss value The weight of α3 represents the image color loss value The weights of L1 represent the visual feature loss value. For example, α1 is 1, α2 is 0.4, and α3 is 0.1. These weights represent the contribution of the corresponding loss values to the visual feature loss value.
[0144] In step S520 of some embodiments, because the product of the sample reflection map and the sample illumination map obtained by image decomposition (such as retinex decomposition is also a process based on deep learning) is not exactly the same as the sample original illumination map. In this way, the present application can also perform image decomposition loss calculation based on the sample original illumination map, the sample reflection map, and the sample illumination map to obtain the image decomposition loss value. Therefore, the specific process of calculating the image decomposition loss value can be shown in the following formula 5:
[0145]
[0146] In Formula 5, L2 represents the image decomposition loss value, S represents the sample original illumination map, R represents the sample reflection map, and I represents the sample illumination map. represents the gradient, including horizontal and vertical directions, exp(·) represents the natural exponential function, ‖·‖1 represents the L1 norm of the vector (also known as the Manhattan distance, which is the sum of the absolute values of the components of the vector), λ1, λ2, λ3 and λ4 are weight parameters, indicating the contribution of the corresponding function to the calculation of the image decomposition loss value, which can be flexibly adjusted according to actual needs without specific limitation.
[0147] In step S530 of some embodiments, the present application may further decompose the enhanced image to obtain a sample enhanced reflection image. The image decomposition method used for decomposition here has been described in the above embodiment and will not be repeated. This step helps to further analyze and evaluate the quality of the enhanced image and the impact of the enhancement process on the image reflection component.
[0148] In step S540 of some embodiments, the present application may also perform image grayscale attribute loss calculation based on the sample enhanced reflection map, the sample enhanced map and the sample normal illumination map to obtain the image grayscale attribute loss value to standardize the brightness and contrast of the enhanced image.
[0149] See also Figure 7 , Figure 7 It is a specific flow chart of step S540 provided in an embodiment of the present application. In some embodiments of the present application, step S540 may specifically include but is not limited to steps S710 to S730.
[0150] Step S710, based on the preset three-channel weights and the preset brightness value, color enhancement loss calculation is performed on the sample enhanced reflection map and the sample normal illumination map to obtain a color enhancement loss value;
[0151] Step S720, performing image contrast loss calculation based on the sample enhancement image and the sample normal illumination image to obtain an image contrast loss value;
[0152] Step S730, performing weighted sum calculation on the color enhancement loss value and the image contrast loss value to obtain the image grayscale attribute loss value.
[0153] In step S710 of some embodiments, the preset three-channel weight refers to the preset enhancement weight corresponding to the RGB brightness attribute. The preset brightness value is used to indicate the degree of enhancement of the brightness attribute. Based on this, the specific process of calculating the color enhancement loss value can be seen in the following formula 6 and formula 7:
[0154]
[0155] In Formula 6, represents the color enhancement loss value, represents the sample enhanced reflection map, Y R In Formula 7, X1 represents the input parameter of function G, i represents the pixel number in the input parameter, n represents the total number of pixels in the input parameter, t represents the preset brightness value, and X1 iR Represents the R channel parameter in the RGB channel image of the sample normal illumination map, X1 iG Represents the G channel parameters in the RGB channel image of the sample normal illumination map, X1 iB represents the B channel parameter in the RGB channel image of the sample normal illumination map. β1, β2, and β3 represent the weights corresponding to each channel parameter, which can be flexibly adjusted as needed, such as β1 is 1, β2 is 1.5, and β3 is 0.6. K is a custom value determined based on the three weights of β1, β2, and β3. For example, when β1 is 1, β2 is 1.5, and β3 is 0.6, t is 2.2. Represents the weighted average of the RGB channels.
[0156] In step S720 of some embodiments, at the same time, the present application may perform image contrast loss calculation based on the sample enhancement map and the sample normal illumination map to obtain an image contrast loss value, and the specific process of calculating the image contrast loss value can be shown in the following formula 8:
[0157]
[0158] In formula 8, represents the image contrast loss value, represents the sample enhancement map, Y represents the sample normal illumination map, Where F(X2) is the sum of the color differences of the k nearest neighbors of the image, X2 represents the input parameter of the function F, k represents the number of neighboring points of pixel i in feature X2, n represents the total number of pixels in the input parameter, and X2 i represents the i-th pixel in feature X2, X2 j Represents the jth neighboring point of pixel i in feature X2.
[0159] In step S730 of some embodiments, after obtaining the color enhancement loss value and the image contrast loss value, the two loss values may be weighted and calculated. Thus, the specific process of obtaining the image grayscale attribute loss value may be shown in the following formula 9:
[0160]
[0161] In Formula 9, L3 represents the image grayscale attribute loss value, and γ1 represents the color enhancement loss value The corresponding weight, γ2 represents the image contrast loss value The corresponding weights are adjusted flexibly according to actual needs without specific limitation.
[0162] In the above embodiments, the present application calculates the difference in grayscale properties between the enhanced image and the image under normal lighting conditions based on the sample enhanced reflection image, the sample enhanced image and the sample normal lighting image, reflecting the accuracy and naturalness of the enhanced image in terms of grayscale level, that is, whether the enhanced image is close to the image under normal lighting conditions in terms of brightness and contrast, which can improve the enhancement accuracy of low-light images and avoid serious noise and color distortion.
[0163] In step S550 of some embodiments, the present application may further perform weighted sum calculation on the visual feature loss value L1, the image decomposition loss value L2, and the image grayscale attribute loss value L3. In this way, the specific process of calculating the model loss value can be shown in the following formula 10:
[0164] L = a·L1+b·L2+c·L3 (Formula 10)
[0165] In Formula 10, L represents the model loss value, a represents the weight corresponding to the visual feature loss value L1, b represents the weight corresponding to the image decomposition loss value L2, and c represents the weight corresponding to the image grayscale attribute loss value L3. These three weights can be flexibly adjusted according to actual needs without specific limitation.
[0166] Furthermore, the present application can perform iterative training according to the constructed model loss value L until the preset training end conditions of the model are reached, such as reaching a preset number of iterations or reaching a preset recognition accuracy, without limitation.
[0167] In the above embodiments, the present application can guide the model to learn how to improve the effect of low-light image enhancement by comprehensively evaluating different loss values, making it visually closer to the image under normal lighting conditions. It can help the model optimize its performance at multiple levels, improve the enhancement accuracy of low-light images, avoid severe noise and color distortion, and thus improve the recognition performance of enhanced images.
[0168] In step S170 of some embodiments, after the image enhancement model is trained, the present application can perform image enhancement on the target image input into the model based on the image enhancement model to obtain a target enhanced image. At this time, the obtained target enhanced image can retain both the essential attributes of the image and the light and dark contrast.
[0169] In some embodiments, see Figure 8 , Figure 88 is a flowchart of image enhancement based on an image enhancement model provided by an embodiment of the present application. The image enhancement model includes a feature extraction layer 810, an image encoding layer 820, and a decoding layer 830. The present application can enhance the grayscale attributes of the input target image to obtain a brightness enhancement map and a contrast enhancement map, and decompose the target image to obtain a target reflection map. Furthermore, the target image, the target reflection map, the brightness enhancement map, and the contrast enhancement map can be Figure 1 The image enhancement model is input to perform image enhancement. Specifically, based on the feature extraction layer 810, feature extraction can be performed on the target image and the target reflection map respectively to obtain the original image features and the target reflection map features, and the target image features and the target reflection map features can be feature fused to obtain the target image features. Based on the image coding layer 820, image encoding can be performed on the brightness enhancement map and the contrast enhancement map respectively to obtain the brightness enhancement features and the target contrast enhancement features, and feature extraction can be performed on the features after the brightness enhancement features and the target contrast enhancement features are concatenated to obtain the target enhancement features. Furthermore, the present application can perform feature fusion on the target image features and the target enhancement features based on the decoding layer 830, and perform image decoding on the fused features to obtain the target enhanced image.
[0170] It should be noted that the non-Company software tools or components appearing in the embodiments of the present application are merely examples and do not represent actual use.
[0171] Compared with the related art that can only enhance some low-light images without noise, and only by increasing the contrast or brightness of the image, the image enhancement method provided in the embodiment of the present application will consider both the brightness enhancement map and the contrast enhancement map of the image when enhancing the image, which can enhance the learning of the detailed brightness and contrast features of the low-light image. And through comparison calculations in multiple dimensions to obtain a more comprehensive loss function to train the model, so that the generated enhanced image can retain both the essential attributes of the image and the light-dark contrast. Therefore, the embodiment of the present application can improve the enhancement accuracy of low-light images, avoid serious noise and color distortion, and thus improve the recognition performance of enhanced images.
[0172] See also Fig. 9 The embodiment of the present application further provides an image enhancement device, which can implement the above-mentioned image enhancement method, and the device includes:
[0173] An acquisition module 910 is used to acquire sample data, where the sample data includes a sample original illumination map and a sample normal illumination map. The sample original illumination map is an image containing the sample object acquired under low illumination, and the sample normal illumination map is an image containing the sample object acquired under normal illumination.
[0174] An extraction module 920 is used to extract features from the sample original illumination image based on a feature extraction layer of a preset enhancement model to obtain features of the sample low illumination image;
[0175] The attribute enhancement module 930 is used to enhance the image grayscale attribute of the sample original illumination map to obtain a sample brightness enhancement map and a sample contrast enhancement map;
[0176] An encoding module 940 is used to perform image encoding on the sample brightness enhancement map and the sample contrast enhancement map based on an image encoding layer of a preset enhancement model to obtain a sample enhancement feature;
[0177] A decoding module 950 is used to perform image decoding on the sample enhancement feature and the sample low-illumination image feature based on a decoding layer of a preset enhancement model to obtain a sample enhancement map;
[0178] A training module 960 is used to determine a model loss value based on the sample original illumination map, the sample normal illumination map and the sample enhanced map, and adjust parameters of a preset enhancement model based on the model loss value to obtain an image enhancement model;
[0179] The image enhancement module 970 is used to perform image enhancement on the target image based on the image enhancement model to obtain a target enhanced image.
[0180] The specific implementation of the image enhancement device in the embodiment of the present application is basically the same as the specific implementation of the above-mentioned image enhancement method, and will not be repeated here.
[0181] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned image enhancement method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0182] See also Fig.10 , Fig.10 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0183] The processor 1010 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0184] The memory 1020 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1020 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1020, and the processor 1010 calls and executes the image enhancement method of the embodiment of the present application;
[0185] Input / output interface 1030, used to implement information input and output;
[0186] The communication interface 1040 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0187] Bus 1050 , which transmits information between various components of the device (e.g., processor 1010 , memory 1020 , input / output interface 1030 , and communication interface 1040 );
[0188] The processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 are connected to each other in communication within the device via the bus 1050 .
[0189] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned image enhancement method is implemented.
[0190] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0191] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0192] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0193] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0194] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0195] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0196] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0197] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0198] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0199] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0200] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0201] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. An image enhancement method, characterized in that: The method comprises: Acquire sample data, wherein the sample data includes a sample original illumination map and a sample normal illumination map, wherein the sample original illumination map is an image containing the sample object acquired under low illumination, and the sample normal illumination map is an image containing the sample object acquired under normal illumination; Based on the feature extraction layer of the preset enhancement model, feature extraction is performed on the original illumination image of the sample to obtain the low-illumination image features of the sample; Performing image grayscale attribute enhancement on the sample original illumination image to obtain a sample brightness enhancement image and a sample contrast enhancement image; Performing image encoding on the sample brightness enhancement map and the sample contrast enhancement map based on the image encoding layer of the preset enhancement model to obtain sample enhancement features; Performing image decoding on the sample enhancement feature and the sample low-illumination image feature based on the decoding layer of the preset enhancement model to obtain a sample enhancement map; Determining a model loss value based on the sample original illumination map, the sample normal illumination map and the sample enhancement map, and adjusting parameters of the preset enhancement model based on the model loss value to obtain an image enhancement model; The target image is enhanced based on the image enhancement model to obtain a target enhanced image.
2. The method according to claim 1, characterized in that The feature extraction layer based on the preset enhancement model extracts features from the sample original illumination map to obtain features of the sample low-illumination image, including: Performing image decomposition on the sample original illumination map to obtain a sample reflection map and a sample illumination map; Based on the feature extraction layer, feature extraction is performed on the sample reflection image and the sample original illumination image to obtain the sample low-illuminance image feature.
3. The method according to claim 2, characterized in that The determining of the model loss value based on the sample original illumination map, the sample normal illumination map and the sample enhanced map comprises: Performing visual feature loss calculation based on the sample normal illumination map and the sample enhanced map to obtain a visual feature loss value; Perform image decomposition loss calculation based on the sample original illumination map, the sample reflection map, and the sample illumination map to obtain an image decomposition loss value; Performing image decomposition on the sample enhancement image to obtain a sample enhancement reflection image; Performing image grayscale attribute loss calculation based on the sample enhanced reflection map, the sample enhanced map, and the sample normal illumination map to obtain an image grayscale attribute loss value; The visual feature loss value, the image decomposition loss value and the image grayscale attribute loss value are weighted and calculated to obtain the model loss value.
4. The method according to claim 3, characterized in that The calculating of visual feature loss based on the sample normal illumination map and the sample enhanced map to obtain a visual feature loss value includes: Performing color loss calculation on the sample normal illumination image and the sample enhanced image based on a preset color loss function to obtain an image color loss value; Performing texture loss calculation on the sample normal illumination image and the sample enhanced image based on a preset texture loss function to obtain an image texture loss value; Performing content loss calculation on the sample normal illumination image and the sample enhanced image based on a preset content loss function to obtain an image content loss value; The image color loss value, the image texture loss value and the image content loss value are weighted and calculated to obtain a visual feature loss value.
5. The method according to claim 3, characterized in that: The calculating the image grayscale attribute loss based on the sample enhanced reflection map, the sample enhanced map and the sample normal illumination map to obtain the image grayscale attribute loss value includes: Based on the preset three-channel weights and the preset brightness value, a color enhancement loss calculation is performed on the sample enhanced reflection map and the sample normal illumination map to obtain a color enhancement loss value; wherein the preset brightness value is used to indicate the degree of enhancement of the brightness attribute; Performing image contrast loss calculation based on the sample enhancement image and the sample normal illumination image to obtain an image contrast loss value; The color enhancement loss value and the image contrast loss value are weighted and calculated to obtain the image grayscale attribute loss value.
6. The method according to any one of claims 1 to 5, characterized in that: The image coding layer based on the preset enhancement model performs image coding on the sample brightness enhancement map and the sample contrast enhancement map to obtain sample enhancement features, including: Performing image encoding on the sample brightness enhancement map to obtain a brightness enhancement feature; Performing image encoding on the sample contrast enhancement image to obtain a contrast enhancement feature; Performing feature splicing on the brightness enhancement feature and the contrast enhancement feature to obtain a sample splicing feature; Feature extraction is performed on the sample splicing features to obtain the sample enhancement features.
7. The method according to claim 6, characterized in that The step of performing feature stitching on the brightness enhancement feature and the contrast enhancement feature to obtain a sample stitching feature includes: Acquire a detection accuracy of the sample target based on the target type of the sample target; Determining enhancement parameters based on the target type and the detection accuracy, the enhancement parameters comprising a brightness enhancement weight of the brightness enhancement feature and a contrast enhancement weight of the contrast enhancement feature; The sample splicing feature is obtained by performing feature weighted splicing based on the brightness enhancement feature, the brightness enhancement weight, the contrast enhancement feature and the contrast enhancement weight.
8. An image enhancement device, characterized in that: The device comprises: An acquisition module, used to acquire sample data, wherein the sample data includes a sample original illumination map and a sample normal illumination map, wherein the sample original illumination map is an image containing the sample object acquired under low illumination, and the sample normal illumination map is an image containing the sample object acquired under normal illumination; An extraction module, used for extracting features from the sample original illumination image based on a feature extraction layer of a preset enhancement model to obtain features of the sample low-illuminance image; An attribute enhancement module is used to enhance the image grayscale attribute of the sample original illumination map to obtain a sample brightness enhancement map and a sample contrast enhancement map; A coding module, used for performing image coding on the sample brightness enhancement map and the sample contrast enhancement map based on the image coding layer of the preset enhancement model to obtain a sample enhancement feature; A decoding module, configured to perform image decoding on the sample enhancement feature and the sample low-illumination image feature based on a decoding layer of the preset enhancement model to obtain a sample enhancement map; A training module, used to determine a model loss value based on the sample original illumination map, the sample normal illumination map and the sample enhanced map, and adjust parameters of the preset enhancement model based on the model loss value to obtain an image enhancement model; The image enhancement module is used to perform image enhancement on the target image based on the image enhancement model to obtain a target enhanced image.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image enhancement method and device, electronic equipment and computer readable storage medium
CN112819702A
Low-illumination image enhancement method, related equipment and readable storage medium
CN114549362A
Low-illumination image enhancement model and method, electronic equipment and storage medium
CN114638749A
Low-illumination image enhancement method using long-exposure compensation
WO2023236445A1