[go: up one dir, main page]

CN118674655B - Image enhancement method and enhancement system in low-light environment - Google Patents

Image enhancement method and enhancement system in low-light environment Download PDF

Info

Publication number
CN118674655B
CN118674655B CN202411163857.5A CN202411163857A CN118674655B CN 118674655 B CN118674655 B CN 118674655B CN 202411163857 A CN202411163857 A CN 202411163857A CN 118674655 B CN118674655 B CN 118674655B
Authority
CN
China
Prior art keywords
image
brightness
gain
raw domain
pixel
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202411163857.5A
Other languages
Chinese (zh)
Other versions
CN118674655A (en
Inventor
刘征
宋小民
李子清
虞建
王曼
王玮
王友全
邓义斌
孙忠武
李新宇
郑慧明
吴成志
李毅
刘彬
张咔
陆俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Guochuang Innovation Vision Ultra Hd Video Technology Co ltd
Original Assignee
Sichuan Guochuang Innovation Vision Ultra Hd Video Technology Co ltd
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 Sichuan Guochuang Innovation Vision Ultra Hd Video Technology Co ltd filed Critical Sichuan Guochuang Innovation Vision Ultra Hd Video Technology Co ltd
Priority to CN202411163857.5A priority Critical patent/CN118674655B/en
Publication of CN118674655A publication Critical patent/CN118674655A/en
Application granted granted Critical
Publication of CN118674655B publication Critical patent/CN118674655B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • G06V10/763Non-hierarchical techniques, e.g. based on statistics of modelling distributions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Processing (AREA)

Abstract

The invention provides an image enhancement method and an enhancement system under a low-light environment, which belong to the technical field of image processing, and comprise the steps of firstly obtaining an original Raw domain image of an image to be enhanced, calculating the brightness value of each pixel, then carrying out region segmentation on the image by adopting a clustering algorithm based on the brightness value of the pixel to generate a plurality of image regions, calculating the brightness average value of each image region as region brightness, inputting the region brightness into a pre-trained brightness gain model, outputting corresponding gain coefficients, carrying out brightness enhancement on the corresponding image regions by using the gain coefficients to obtain a gain Raw domain image, and finally carrying out denoising treatment on the gain Raw domain image by using a denoising model to eliminate or reduce noise in the image, thereby finally obtaining the enhanced image.

Description

一种低光环境下的图像增强方法及增强系统Image enhancement method and enhancement system in low light environment

技术领域Technical Field

本发明涉及图像处理技术领域,尤其涉及一种低光环境下的图像增强方法及增强系统。The present invention relates to the field of image processing technology, and in particular to an image enhancement method and enhancement system in a low-light environment.

背景技术Background Art

在图像处理领域,低光环境下的图像拍摄是一个普遍存在的挑战。不充分的光照条件会显著降低图像的视觉质量,导致细节损失、低对比度和颜色失真等问题。这些问题不仅影响了图像的观赏效果,还极大地限制了计算机视觉系统的性能,特别是在安全监控、自动驾驶、人脸识别等关键应用中。因此,开发一种有效的低光图像增强方法显得尤为重要。In the field of image processing, image capture in low-light environments is a common challenge. Insufficient lighting conditions can significantly degrade the visual quality of images, leading to problems such as loss of detail, low contrast, and color distortion. These problems not only affect the viewing effect of the image, but also greatly limit the performance of computer vision systems, especially in key applications such as security monitoring, autonomous driving, and face recognition. Therefore, it is particularly important to develop an effective low-light image enhancement method.

传统的低光图像增强方法主要包括直方图均衡化(HE)及其改进版本,如自适应直方图均衡化(AHE)和限制对比度自适应直方图均衡化(CLAHE)。这些方法通过重新分配图像的像素强度来增强对比度,但在实际应用中往往会导致图像过度增强、细节丢失或颜色失真等问题。此外,这些方法通常基于全局或局部统计信息,难以适应复杂多变的低光环境。Traditional low-light image enhancement methods mainly include histogram equalization (HE) and its improved versions, such as adaptive histogram equalization (AHE) and contrast-limited adaptive histogram equalization (CLAHE). These methods enhance the contrast by redistributing the pixel intensity of the image, but in practical applications they often lead to problems such as over-enhancement, loss of details or color distortion. In addition, these methods are usually based on global or local statistical information and are difficult to adapt to complex and changing low-light environments.

近年来,随着深度学习技术的快速发展,越来越多的研究者开始探索将深度学习方法应用于低光图像增强领域。深度学习算法通过训练大量图像数据,能够自动学习图像的特征并生成高质量的增强图像。其中,基于Retinex理论的深度学习模型表现出了良好的性能。Retinex理论模拟了人眼颜色感知机制,将观测图像分解为反射图和亮度图两部分,通过调整亮度图来实现图像增强。然而,现有的基于Retinex的深度学习模型大多需要精心设计人工约束条件与参数,这限制了模型在不同场景应用中的泛化性能。In recent years, with the rapid development of deep learning technology, more and more researchers have begun to explore the application of deep learning methods in the field of low-light image enhancement. By training a large amount of image data, deep learning algorithms can automatically learn the features of images and generate high-quality enhanced images. Among them, the deep learning model based on Retinex theory has shown good performance. Retinex theory simulates the color perception mechanism of the human eye, decomposes the observed image into two parts: a reflectance map and a brightness map, and achieves image enhancement by adjusting the brightness map. However, most of the existing Retinex-based deep learning models require careful design of artificial constraints and parameters, which limits the generalization performance of the model in different scene applications.

因此,有必要提供一种低光环境下的图像增强方法及增强系统解决上述技术问题。Therefore, it is necessary to provide an image enhancement method and enhancement system in a low-light environment to solve the above technical problems.

发明内容Summary of the invention

为解决上述技术问题,本发明提供一种低光环境下的图像增强方法及增强系统,结合传统图像处理技术和深度学习技术,实现对低光图像的高效、高质量增强。In order to solve the above technical problems, the present invention provides an image enhancement method and enhancement system in a low-light environment, which combines traditional image processing technology and deep learning technology to achieve efficient and high-quality enhancement of low-light images.

本发明提供的一种低光环境下的图像增强方法,所述增强方法包括以下步骤:The present invention provides an image enhancement method in a low-light environment, the enhancement method comprising the following steps:

S1:获取待增强图像的原始Raw域图像,并获取所述原始Raw域图像中每个像素的亮度值;S1: obtaining an original Raw domain image of the image to be enhanced, and obtaining the brightness value of each pixel in the original Raw domain image;

S2:基于每个像素的亮度值,采用聚类算法对所述原始Raw域图像进行区域分割,生成多个图像区域;S2: Based on the brightness value of each pixel, a clustering algorithm is used to perform region segmentation on the original Raw domain image to generate multiple image regions;

S3:根据所述图像区域中所有像素的亮度值计算得到图像区域的区域亮度,其中,所述区域亮度为所述图像区域的亮度均值;S3: Calculating the regional brightness of the image area according to the brightness values of all pixels in the image area, wherein the regional brightness is the average brightness of the image area;

S4:将每个所述图像区域的区域亮度输入预训练的亮度增益模型,输出每个所述图像区域的增益系数,并应用输出的增益系数对相应的图像区域进行亮度提升,得到增益Raw域图像;S4: inputting the regional brightness of each of the image regions into a pre-trained brightness gain model, outputting a gain coefficient of each of the image regions, and applying the output gain coefficient to enhance the brightness of the corresponding image region to obtain a gain Raw domain image;

S5:利用去噪模型对所述增益Raw域图像进行去噪处理,得到增强图像。S5: Perform denoising processing on the gain Raw domain image using a denoising model to obtain an enhanced image.

优选的,步骤S1包括以下步骤:Preferably, step S1 comprises the following steps:

S101:获取待增强图像的原始Raw域图像并进行格式解析;S101: obtaining an original Raw domain image of an image to be enhanced and performing format analysis;

S102:读取解析后的原始Raw域图像中每个像素的RGB值;S102: Reading the RGB value of each pixel in the parsed original Raw domain image;

S103:对像素的RGB值进行加权求和,得到像素对应的亮度值,其中,亮度值的计算公式为:S103: Perform weighted summation on the RGB values of the pixel to obtain the brightness value corresponding to the pixel, where the brightness value The calculation formula is:

其中,分别为值、的权重,且分别取值为0.299、0.587和0.114。in, , and They are value, and ’s weights, and their values are 0.299, 0.587 and 0.114 respectively.

优选的,步骤S2包括以下步骤:Preferably, step S2 comprises the following steps:

S201:根据原始Raw域图像的亮度值范围,通过随机初始化选择初始的聚类中心;S201: selecting an initial cluster center by random initialization according to the brightness value range of the original Raw domain image;

S202:遍历所述原始Raw域图像中的每个像素,根据每个像素的亮度值,将其分配给最近的聚类中心;S202: traverse each pixel in the original Raw domain image, and assign each pixel to the nearest cluster center according to its brightness value;

S203:在将所有像素分配给聚类中心后,根据每个聚类中所有像素的亮度值,重新计算每个聚类的中心;S203: after all pixels are assigned to cluster centers, the center of each cluster is recalculated according to the brightness values of all pixels in each cluster;

S204:重复上述步骤S202和S203进行迭代优化,直到聚类中心的变化小于预设阈值;S204: repeating the above steps S202 and S203 to perform iterative optimization until the change of the cluster center is less than a preset threshold;

S205:根据最终的聚类中心及对应的像素集合,将原始Raw域图像分割成多个图像区域,每个图像区域由一组属于同一聚类的像素组成。S205: According to the final cluster center and the corresponding pixel set, the original Raw domain image is divided into multiple image regions, each image region is composed of a group of pixels belonging to the same cluster.

优选的,所述图像区域包括图像上的连通区域和非连通区域。Preferably, the image region includes a connected region and a non-connected region on the image.

优选的,步骤S3包括以下步骤:Preferably, step S3 comprises the following steps:

S301:读取所述图像区域中所有像素的亮度值;S301: Read the brightness values of all pixels in the image area;

S302:基于所述图像区域中所有像素的亮度值,计算得到图像区域的亮度均值,并将亮度均值认定为区域亮度。S302: Based on the brightness values of all pixels in the image area, calculate the brightness mean of the image area, and identify the brightness mean as the area brightness.

优选的,步骤S4包括以下步骤:Preferably, step S4 comprises the following steps:

S401:将计算得到的每个图像区域的区域亮度输入所述亮度增益模型进行映射处理,得到对应的增益系数;S401: inputting the calculated regional brightness of each image region into the brightness gain model for mapping processing to obtain a corresponding gain coefficient;

S402:遍历所有图像区域,并将图像区域的每个像素的亮度值乘以增益系数,以实现亮度提升;S402: traversing all image regions, and multiplying the brightness value of each pixel in the image region by a gain coefficient to achieve brightness enhancement;

S403:在遍历所有图像区域后,将处理后的图像区域组合成增益Raw域图像。S403: After traversing all image regions, the processed image regions are combined into a gain Raw domain image.

优选的,所述亮度增益模型的训练包括:Preferably, the training of the brightness gain model includes:

收集相同场景下,且包含低光环境和正常光照环境下图像对的训练数据集;Collect training datasets containing image pairs in low-light and normal-light environments under the same scene;

对于训练数据集中的每张低光图像,按照步骤S1至S3的方法提取其图像区域的区域亮度;For each low-light image in the training data set, extract the regional brightness of its image area according to the method of steps S1 to S3;

对于每张低光图像对应的正常光照图像,同样提取其图像区域的区域亮度,并计算低光图像区域亮度到正常光照图像区域亮度的目标增益系数;For each normal light image corresponding to the low light image, the regional brightness of its image area is also extracted, and the target gain coefficient from the low light image regional brightness to the normal light image regional brightness is calculated;

使用提取的低光图像区域亮度和对应的目标增益系数作为训练数据和标签,构建并训练亮度增益模型,以使亮度增益模型学习区域亮度与目标增益系数之间的映射关系。The extracted low-light image area brightness and the corresponding target gain coefficient are used as training data and labels to construct and train a brightness gain model so that the brightness gain model learns the mapping relationship between the area brightness and the target gain coefficient.

优选的,步骤S5具体为:Preferably, step S5 is specifically:

将得到的增益Raw域图像输入到预训练的去噪模型中,通过去噪模型对图像中的噪声进行分析和消除,从而输出一张亮度提升且噪声减少的增强图像。The obtained gain Raw domain image is input into the pre-trained denoising model, and the noise in the image is analyzed and eliminated by the denoising model, so as to output an enhanced image with improved brightness and reduced noise.

本发明还提供了一种低光环境下的图像增强系统,用于执行所述的一种低光环境下的图像增强方法,所述增强系统包括:The present invention further provides an image enhancement system in a low-light environment, which is used to execute the image enhancement method in a low-light environment, and the enhancement system comprises:

亮度获取模块,用于获取待增强图像的原始Raw域图像,并获取所述原始Raw域图像中每个像素的亮度值;A brightness acquisition module, used to acquire an original Raw domain image of the image to be enhanced, and acquire the brightness value of each pixel in the original Raw domain image;

图像分割模块,用于基于每个像素的亮度值,采用聚类算法对所述原始Raw域图像进行区域分割,生成多个图像区域;An image segmentation module, used to perform region segmentation on the original Raw domain image based on the brightness value of each pixel by using a clustering algorithm to generate multiple image regions;

区域亮度计算模块,用于根据所述图像区域中所有像素的亮度值计算得到图像区域的区域亮度,其中,所述区域亮度为所述图像区域的亮度均值;A regional brightness calculation module, used to calculate the regional brightness of the image area according to the brightness values of all pixels in the image area, wherein the regional brightness is the brightness mean of the image area;

亮度增益调整模块,用于将每个所述图像区域的区域亮度输入预训练的亮度增益模型,输出每个所述图像区域的增益系数,并应用输出的增益系数对相应的图像区域进行亮度提升,得到增益Raw域图像;A brightness gain adjustment module, used for inputting the regional brightness of each of the image regions into a pre-trained brightness gain model, outputting a gain coefficient of each of the image regions, and applying the output gain coefficient to enhance the brightness of the corresponding image region to obtain a gain Raw domain image;

去噪增强模块,用于利用去噪模型对所述增益Raw域图像进行去噪处理,得到增强图像。The denoising and enhancement module is used to perform denoising processing on the gain Raw domain image by using a denoising model to obtain an enhanced image.

与相关技术相比较,本发明提供的一种低光环境下的图像增强方法及增强系统具有如下有益效果:Compared with the related art, the image enhancement method and enhancement system in a low-light environment provided by the present invention have the following beneficial effects:

本发明首先获取待增强图像的原始Raw域图像,并计算每个像素的亮度值,然后,基于像素亮度值采用聚类算法对图像进行区域分割,生成多个图像区域,通过计算每个图像区域的亮度均值作为区域亮度,将区域亮度输入预训练的亮度增益模型中,输出对应的增益系数,应用这些增益系数对相应的图像区域进行亮度提升,得到增益Raw域图像,最后,利用去噪模型对增益Raw域图像进行去噪处理,以消除或减少图像中的噪声,最终得到增强图像。The present invention first obtains the original Raw domain image of the image to be enhanced and calculates the brightness value of each pixel. Then, a clustering algorithm is used to perform regional segmentation on the image based on the pixel brightness value to generate multiple image regions. The brightness mean of each image region is calculated as the regional brightness, and the regional brightness is input into a pre-trained brightness gain model. The corresponding gain coefficients are output, and the brightness of the corresponding image regions is enhanced by using these gain coefficients to obtain a gain Raw domain image. Finally, a denoising model is used to perform denoising on the gain Raw domain image to eliminate or reduce the noise in the image, and finally an enhanced image is obtained.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明提供的一种低光环境下的图像增强方法的流程图;FIG1 is a flow chart of an image enhancement method in a low-light environment provided by the present invention;

图2为本发明提供的一种低光环境下的图像增强系统的模块结构图。FIG. 2 is a module structure diagram of an image enhancement system in a low-light environment provided by the present invention.

具体实施方式DETAILED DESCRIPTION

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。此外,在不冲突的情况下,本发明中的实施例及实施例中的特征可以互相组合。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings. In addition, the embodiments of the present invention and the features in the embodiments may be combined with each other without conflict.

另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部内容。在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序地处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。It should also be noted that, for ease of description, only the parts related to the present invention, but not all of the contents, are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the various operations (or steps) as being processed sequentially, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the various operations can be rearranged. The processing can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.

实施例一Embodiment 1

本发明提供的一种低光环境下的图像增强方法,参考图1所示,所述增强方法包括以下步骤:The present invention provides an image enhancement method in a low-light environment, as shown in FIG1 , the enhancement method comprises the following steps:

S1:获取待增强图像的原始Raw域图像,并获取所述原始Raw域图像中每个像素的亮度值。S1: Obtain an original Raw domain image of an image to be enhanced, and obtain the brightness value of each pixel in the original Raw domain image.

在本实施例中,通过图像传感器捕获低光环境下的原始Raw域图像,由于Raw域图像保留了最原始的图像数据,未经过色彩插值、白平衡等可能引入噪声或信息损失的处理步骤,因此能够确保获取的亮度值是最纯净、最准确的,这为后续的图像处理提供了坚实的基础,有助于提升图像增强的整体效果。In this embodiment, the original Raw domain image in a low-light environment is captured by an image sensor. Since the Raw domain image retains the most original image data and has not undergone processing steps such as color interpolation and white balance that may introduce noise or information loss, it can ensure that the acquired brightness value is the purest and most accurate. This provides a solid foundation for subsequent image processing and helps to improve the overall effect of image enhancement.

S2:基于每个像素的亮度值,采用聚类算法对所述原始Raw域图像进行区域分割,生成多个图像区域。S2: Based on the brightness value of each pixel, a clustering algorithm is used to perform region segmentation on the original Raw domain image to generate multiple image regions.

在本实施例中,采用K-means聚类算法,基于像素的亮度值将图像分割成多个区域,该算法通过迭代寻找最优的簇中心,将亮度相似的像素聚集在一起,形成不同的图像区域。这种区域分割方式不仅能够识别出图像中的暗区和亮区,为后续亮度增益调整提供精确的目标区域,还能够保留图像的边缘信息,避免因全局处理而导致的细节损失。In this embodiment, the K-means clustering algorithm is used to segment the image into multiple regions based on the brightness value of the pixels. The algorithm iteratively searches for the optimal cluster center and clusters pixels with similar brightness to form different image regions. This regional segmentation method can not only identify the dark and bright areas in the image, providing an accurate target area for subsequent brightness gain adjustment, but also retain the edge information of the image to avoid detail loss caused by global processing.

S3:根据所述图像区域中所有像素的亮度值计算得到图像区域的区域亮度,其中,所述区域亮度为所述图像区域的亮度均值。S3: Calculate the regional brightness of the image area according to the brightness values of all pixels in the image area, wherein the regional brightness is the average brightness of the image area.

在本实施例中,对于每个通过聚类得到的图像区域,计算其内所有像素亮度值的平均值,作为该区域的区域亮度。这个平均值代表了该区域的整体亮度水平,是后续亮度增益调整的重要依据。通过计算区域亮度,能够更加准确地把握每个区域的亮度特征,从而避免对整幅图像应用统一增益而导致的过曝或欠曝问题。In this embodiment, for each image region obtained by clustering, the average value of the brightness values of all pixels therein is calculated as the regional brightness of the region. This average value represents the overall brightness level of the region and is an important basis for subsequent brightness gain adjustment. By calculating the regional brightness, the brightness characteristics of each region can be more accurately grasped, thereby avoiding overexposure or underexposure problems caused by applying a uniform gain to the entire image.

S4:将每个所述图像区域的区域亮度输入预训练的亮度增益模型,输出每个所述图像区域的增益系数,并应用输出的增益系数对相应的图像区域进行亮度提升,得到增益Raw域图像。S4: inputting the regional brightness of each of the image regions into a pre-trained brightness gain model, outputting a gain coefficient of each of the image regions, and applying the output gain coefficient to enhance the brightness of the corresponding image region to obtain a gain Raw domain image.

在本实施例中,使用深度学习技术预训练一个亮度增益模型,该模型能够根据输入的区域亮度值输出相应的增益系数。将每个图像区域的区域亮度输入模型后,得到各自区域的增益系数。然后,根据这些增益系数对相应的图像区域进行亮度提升处理,即将每个像素的亮度值乘以对应的增益系数。这种基于区域的亮度调整方式能够智能地根据图像内容调整增益,避免全局增益可能带来的问题,同时亮度提升后的图像在保留细节和层次感的同时,整体亮度得到了显著提升,视觉效果更加明亮、清晰。In this embodiment, a brightness gain model is pre-trained using deep learning technology, and the model can output corresponding gain coefficients according to the input regional brightness values. After the regional brightness of each image area is input into the model, the gain coefficients of the respective areas are obtained. Then, the corresponding image areas are brightness-enhanced according to these gain coefficients, that is, the brightness value of each pixel is multiplied by the corresponding gain coefficient. This area-based brightness adjustment method can intelligently adjust the gain according to the image content, avoiding the problems that may be caused by the global gain. At the same time, the overall brightness of the image after the brightness enhancement is significantly improved while retaining the details and layering, and the visual effect is brighter and clearer.

S5:利用去噪模型对所述增益Raw域图像进行去噪处理,得到增强图像。S5: Perform denoising processing on the gain Raw domain image using a denoising model to obtain an enhanced image.

在本实施例中,在亮度提升过程中,可能会引入一些噪声。为了改善图像质量,使用深度学习中的去噪模型对增益Raw域图像进行去噪处理。这些去噪模型能够有效地识别和去除图像中的噪声成分,同时保留图像的边缘和细节信息。经过去噪处理后,图像质量得到了进一步提升,变得更加清晰、自然。去噪处理不仅消除了亮度提升过程中可能引入的噪声,还提升了图像的整体视觉效果和实用价值。In this embodiment, some noise may be introduced during the brightness enhancement process. In order to improve the image quality, the gain Raw domain image is denoised using the denoising model in deep learning. These denoising models can effectively identify and remove noise components in the image while retaining the edge and detail information of the image. After denoising, the image quality is further improved, becoming clearer and more natural. Denoising not only eliminates the noise that may be introduced during the brightness enhancement process, but also improves the overall visual effect and practical value of the image.

具体地,步骤S1包括以下步骤:Specifically, step S1 includes the following steps:

S101:获取待增强图像的原始Raw域图像并进行格式解析。S101: Acquire the original Raw domain image of the image to be enhanced and perform format analysis.

在本实施例中,首先通过图像传感器(如CMOS或CCD传感器)捕获低光环境下的原始Raw域图像。Raw域图像是直接从传感器读取的数据,包含了每个像素点的原始光强信息,但尚未进行色彩插值、白平衡等处理。接下来,需要对获取的Raw域图像进行格式解析,以便后续处理,具体为:解析Raw文件的元数据和图像数据本身,将其转换为可处理的格式。In this embodiment, the original Raw domain image in a low-light environment is first captured by an image sensor (such as a CMOS or CCD sensor). The Raw domain image is data directly read from the sensor, which contains the original light intensity information of each pixel, but has not yet been processed by color interpolation, white balance, etc. Next, the acquired Raw domain image needs to be format parsed for subsequent processing, specifically: the metadata of the Raw file and the image data itself are parsed and converted into a processable format.

格式解析是处理Raw域图像的第一步,它确保了后续步骤能够正确地访问和操作图像数据,将Raw数据转换为可处理的格式,为后续的亮度提取步骤提供了便利。Format parsing is the first step in processing Raw domain images. It ensures that subsequent steps can correctly access and operate image data, converting Raw data into a processable format, and facilitating subsequent brightness extraction steps.

S102:读取解析后的原始Raw域图像中每个像素的RGB值。S102: Read the RGB value of each pixel in the parsed original Raw domain image.

在本实施例中,在Raw域图像中,每个像素点通常并不直接存储RGB值,而是存储了不同颜色通道(如红、绿、蓝通道)的原始光强信息,因此,在读取每个像素的“RGB值”之前,需要先对Raw数据进行去马赛克(demosaicing)处理,将每个像素点的单一颜色值插值成完整的RGB值,在完成插值后,就可以读取解析后并插值得到的RGB值。In this embodiment, in the Raw domain image, each pixel point usually does not directly store the RGB value, but stores the original light intensity information of different color channels (such as red, green, and blue channels). Therefore, before reading the "RGB value" of each pixel, it is necessary to first perform demosaicing processing on the Raw data to interpolate the single color value of each pixel point into a complete RGB value. After the interpolation is completed, the parsed and interpolated RGB value can be read.

S103:对像素的RGB值进行加权求和,得到像素对应的亮度值,其中,亮度值的计算公式为:S103: Perform weighted summation on the RGB values of the pixel to obtain the brightness value corresponding to the pixel, where the brightness value The calculation formula is:

其中,分别为值、的权重,且分别取值为0.299、0.587和0.114。in, , and They are value, and ’s weights, and their values are 0.299, 0.587 and 0.114 respectively.

在本实施例中,根据人眼对不同颜色敏感度的差异,对像素的RGB值进行加权求和,以得到该像素的亮度值,通常使用的权重是基于心理物理学实验的结果,其中红色、绿色和蓝色的权重分别为0.299、0.587和0.114,通过对RGB值进行加权求和,可以得到一个能够反映像素亮度的单一数值。In this embodiment, based on the difference in sensitivity of the human eye to different colors, the RGB values of the pixel are weighted and summed to obtain the brightness value of the pixel. The weights commonly used are based on the results of psychophysical experiments, where the weights of red, green, and blue are 0.299, 0.587, and 0.114, respectively. By weighted summing the RGB values, a single value that can reflect the brightness of the pixel can be obtained.

具体地,步骤S2包括以下步骤:Specifically, step S2 includes the following steps:

S201:根据原始Raw域图像的亮度值范围,通过随机初始化选择初始的聚类中心。S201: According to the brightness value range of the original Raw domain image, an initial cluster center is selected by random initialization.

在本实施例中,首先确定K-means聚类算法中的聚类数量K,具体可以根据所需处理的精细程度来设定。然后,根据原始Raw域图像中所有像素的亮度值范围,随机选择K个不同的亮度值作为初始的聚类中心。这些初始聚类中心的选择对算法的最终结果有一定影响,但K-means算法通常能够通过迭代优化来减少这种影响。In this embodiment, the number of clusters K in the K-means clustering algorithm is first determined, which can be set according to the degree of refinement required for processing. Then, according to the brightness value range of all pixels in the original Raw domain image, K different brightness values are randomly selected as initial cluster centers. The selection of these initial cluster centers has a certain influence on the final result of the algorithm, but the K-means algorithm can usually reduce this influence through iterative optimization.

S202:遍历所述原始Raw域图像中的每个像素,根据每个像素的亮度值,将其分配给最近的聚类中心。S202: traverse each pixel in the original Raw domain image, and assign each pixel to the nearest cluster center according to its brightness value.

在本实施例中,遍历原始Raw域图像中的每一个像素,计算其亮度值与所有聚类中心之间的距离(采用欧氏距离表示),并将该像素分配给距离它最近的聚类中心。这样,每个像素都被分配到了一个聚类中。In this embodiment, each pixel in the original Raw domain image is traversed, the distance between its brightness value and all cluster centers is calculated (expressed in Euclidean distance), and the pixel is assigned to the cluster center closest to it. In this way, each pixel is assigned to a cluster.

通过将像素分配给最近的聚类中心,实现了图像的初步区域分割。这种基于亮度值的分配方式能够确保相似亮度的像素被划分到同一个区域中,为后续的区域亮度计算和亮度增益调整提供了基础。By assigning pixels to the nearest cluster center, the initial region segmentation of the image is achieved. This brightness value-based allocation method ensures that pixels of similar brightness are divided into the same region, providing a basis for subsequent regional brightness calculation and brightness gain adjustment.

S203:在将所有像素分配给聚类中心后,根据每个聚类中所有像素的亮度值,重新计算每个聚类的中心。S203: After all pixels are assigned to cluster centers, the center of each cluster is recalculated according to the brightness values of all pixels in each cluster.

在本实施例中,在将所有像素分配给聚类中心后,计算每个聚类中所有像素亮度值的平均值,并将该平均值作为新的聚类中心。这样,就得到了新的K个聚类中心,它们更加接近各自聚类中像素的亮度值分布中心。In this embodiment, after all pixels are assigned to cluster centers, the average value of the brightness values of all pixels in each cluster is calculated, and the average value is used as the new cluster center. In this way, new K cluster centers are obtained, which are closer to the brightness value distribution center of the pixels in each cluster.

通过不断迭代地更新聚类中心,算法能够逐渐收敛到全局或局部最优解。这种更新方式确保了聚类中心能够更好地反映各自聚类中像素的亮度特征。By continuously and iteratively updating the cluster centers, the algorithm can gradually converge to the global or local optimal solution. This updating method ensures that the cluster centers can better reflect the brightness characteristics of the pixels in each cluster.

S204:重复上述步骤S202和S203进行迭代优化,直到聚类中心的变化小于预设阈值。S204: Repeat the above steps S202 and S203 to perform iterative optimization until the change of the cluster center is less than a preset threshold.

在本实施例中,重复执行步骤S202和S203,直到聚类中心的变化量(即新聚类中心与旧聚类中心之间的距离差)小于预设的阈值。这个阈值是根据实际需求来设定,用于控制算法的迭代次数和收敛精度。In this embodiment, steps S202 and S203 are repeatedly performed until the change in the cluster center (i.e., the distance difference between the new cluster center and the old cluster center) is less than a preset threshold value. This threshold value is set according to actual needs and is used to control the number of iterations and convergence accuracy of the algorithm.

通过迭代优化,K-means算法能够逐渐减小聚类中心的变化量,直到算法收敛。这种迭代方式确保了算法能够找到稳定的聚类中心,并实现对图像的精确区域分割。Through iterative optimization, the K-means algorithm can gradually reduce the change in cluster centers until the algorithm converges. This iterative method ensures that the algorithm can find stable cluster centers and achieve accurate region segmentation of the image.

S205:根据最终的聚类中心及对应的像素集合,将原始Raw域图像分割成多个图像区域,每个图像区域由一组属于同一聚类的像素组成。S205: According to the final cluster center and the corresponding pixel set, the original Raw domain image is divided into multiple image regions, each image region is composed of a group of pixels belonging to the same cluster.

在本实施例中,根据最终的聚类中心和对应的像素集合,将原始Raw域图像分割成多个图像区域。每个图像区域由一组属于同一聚类的像素组成,这些像素在亮度值上具有相似的特征。In this embodiment, the original Raw domain image is segmented into multiple image regions according to the final cluster centers and the corresponding pixel sets. Each image region is composed of a group of pixels belonging to the same cluster, and these pixels have similar characteristics in terms of brightness values.

此外,所述图像区域包括图像上的连通区域和非连通区域。In addition, the image region includes a connected region and a non-connected region on the image.

在本实施例中,连通区域是指原始Raw域图像中一组相互连接的像素集合,这些像素在二维空间中具有相邻的边界,并且它们的亮度值或特征被聚类算法归为同一类别。在K-means聚类算法中,连通区域指的是属于同一个聚类中心的像素集合,这些像素在图像上不仅是亮度值相近,而且它们在空间位置上也是相互连接的,即每个像素至少与一个属于同一聚类的其他像素相邻。In this embodiment, a connected region refers to a set of interconnected pixels in the original Raw domain image, which have adjacent boundaries in two-dimensional space, and whose brightness values or features are classified as the same category by the clustering algorithm. In the K-means clustering algorithm, a connected region refers to a set of pixels belonging to the same cluster center, which not only have similar brightness values in the image, but also are interconnected in spatial position, that is, each pixel is adjacent to at least one other pixel belonging to the same cluster.

而非连通区域则是指图像中那些虽然亮度值或特征相近,但在空间位置上不相连接的像素集合。在K-means聚类算法的结果中,由于算法主要基于像素的亮度值进行聚类,而不考虑像素之间的空间位置关系,因此可能会产生一些非连通区域。这些区域中的像素虽然被聚类算法归为同一类别,但它们在图像上并不直接相连,而是被其他不属于该聚类的像素所分隔。Disconnected regions refer to a set of pixels in an image that have similar brightness values or features but are not connected in space. In the results of the K-means clustering algorithm, since the algorithm mainly clusters based on the brightness values of pixels without considering the spatial relationship between pixels, some disconnected regions may be generated. Although the pixels in these regions are classified into the same category by the clustering algorithm, they are not directly connected in the image, but are separated by other pixels that do not belong to the cluster.

具体地,步骤S3包括以下步骤:Specifically, step S3 includes the following steps:

S301:读取所述图像区域中所有像素的亮度值。S301: Read the brightness values of all pixels in the image area.

在本实施例中,针对步骤S2中分割得到的每一个图像区域,遍历该区域内的所有像素,并读取每个像素的亮度值。In this embodiment, for each image region obtained by segmentation in step S2, all pixels in the region are traversed, and the brightness value of each pixel is read.

S302:基于所述图像区域中所有像素的亮度值,计算得到图像区域的亮度均值,并将亮度均值认定为区域亮度。S302: Based on the brightness values of all pixels in the image area, calculate the brightness mean of the image area, and identify the brightness mean as the area brightness.

在本实施例中,在读取了图像区域中所有像素的亮度值之后,计算这些亮度值的平均值,即亮度均值。具体为:将区域内所有像素的亮度值相加,然后除以像素的总数。得到的亮度均值即为该图像区域的区域亮度,它代表了该区域在整体亮度上的平均水平。In this embodiment, after reading the brightness values of all pixels in the image area, the average value of these brightness values, i.e., the brightness mean value, is calculated. Specifically, the brightness values of all pixels in the area are added together and then divided by the total number of pixels. The obtained brightness mean value is the regional brightness of the image area, which represents the average level of the overall brightness of the area.

具体地,步骤S4包括以下步骤:Specifically, step S4 includes the following steps:

S401:将计算得到的每个图像区域的区域亮度输入所述亮度增益模型进行映射处理,得到对应的增益系数。S401: Inputting the calculated regional brightness of each image region into the brightness gain model for mapping processing to obtain a corresponding gain coefficient.

在本实施例中,设计一个亮度增益模型,这个模型是使用深度学习技术训练得到的,模型的输入是区域亮度,输出是对应的增益系数。增益系数用于调整图像区域的亮度,以实现所需的亮度提升效果。In this embodiment, a brightness gain model is designed. This model is trained using deep learning technology. The input of the model is the regional brightness, and the output is the corresponding gain coefficient. The gain coefficient is used to adjust the brightness of the image area to achieve the desired brightness enhancement effect.

将每个图像区域的区域亮度输入到亮度增益模型中,模型会根据预设的映射关系计算出相应的增益系数。这个增益系数是后续调整图像区域亮度时所需的乘数因子。The regional brightness of each image area is input into the brightness gain model, and the model will calculate the corresponding gain coefficient according to the preset mapping relationship. This gain coefficient is the multiplier factor required for subsequent adjustment of the brightness of the image area.

S402:遍历所有图像区域,并将图像区域的每个像素的亮度值乘以增益系数,以实现亮度提升。S402: traverse all image regions, and multiply the brightness value of each pixel in the image region by a gain coefficient to achieve brightness enhancement.

在本实施例中,在得到每个图像区域的增益系数后,遍历所有图像区域,并对每个区域内的像素进行亮度调整。具体地,将每个像素的原始亮度值乘以对应的增益系数,得到调整后的亮度值。这个过程实现了图像区域亮度的整体提升。In this embodiment, after obtaining the gain coefficient of each image area, all image areas are traversed, and the brightness of the pixels in each area is adjusted. Specifically, the original brightness value of each pixel is multiplied by the corresponding gain coefficient to obtain the adjusted brightness value. This process achieves an overall improvement in the brightness of the image area.

需要注意的是,在进行亮度调整时,需要考虑亮度值的溢出问题。如果调整后的亮度值超出了图像数据能够表示的范围(如0-255对于8位灰度图),则需要进行适当的裁剪和归一化,以解决亮度值出现的溢出问题。It should be noted that when adjusting the brightness, the overflow problem of the brightness value needs to be considered. If the adjusted brightness value exceeds the range that the image data can represent (such as 0-255 for an 8-bit grayscale image), appropriate cropping and normalization are required to solve the overflow problem of the brightness value.

S403:在遍历所有图像区域后,将处理后的图像区域组合成增益Raw域图像。S403: After traversing all image regions, the processed image regions are combined into a gain Raw domain image.

在本实施例中,在完成所有图像区域的亮度调整后,将处理后的图像区域按照它们在原始Raw域图像中的位置关系重新组合起来,形成一张完整的增益Raw域图像,并确保每个图像区域在组合后的图像中保持正确的位置和大小,以避免出现错位或重叠的情况。In this embodiment, after the brightness adjustment of all image areas is completed, the processed image areas are recombined according to their positional relationship in the original Raw domain image to form a complete gain Raw domain image, and it is ensured that each image area maintains the correct position and size in the combined image to avoid misalignment or overlap.

具体地,所述亮度增益模型的训练包括:Specifically, the training of the brightness gain model includes:

收集相同场景下,且包含低光环境和正常光照环境下图像对的训练数据集。Collect a training dataset of image pairs in the same scene, both in low-light and normal-light environments.

对于训练数据集中的每张低光图像,按照步骤S1至S3的方法提取其图像区域的区域亮度。For each low-light image in the training data set, the regional brightness of its image area is extracted according to the method of steps S1 to S3.

对于每张低光图像对应的正常光照图像,同样提取其图像区域的区域亮度,并计算低光图像区域亮度到正常光照图像区域亮度的目标增益系数。For each normal-light image corresponding to the low-light image, the regional brightness of its image area is also extracted, and a target gain coefficient from the low-light image regional brightness to the normal-light image regional brightness is calculated.

使用提取的低光图像区域亮度和对应的目标增益系数作为训练数据和标签,构建并训练亮度增益模型,以使亮度增益模型学习区域亮度与目标增益系数之间的映射关系。The extracted low-light image area brightness and the corresponding target gain coefficient are used as training data and labels to construct and train a brightness gain model so that the brightness gain model learns the mapping relationship between the area brightness and the target gain coefficient.

具体的,步骤S5具体为:Specifically, step S5 is as follows:

将得到的增益Raw域图像输入到预训练的去噪模型中,通过去噪模型对图像中的噪声进行分析和消除,从而输出一张亮度提升且噪声减少的增强图像。The obtained gain Raw domain image is input into the pre-trained denoising model, and the noise in the image is analyzed and eliminated by the denoising model, so as to output an enhanced image with improved brightness and reduced noise.

在本实施例中,将经过亮度增益处理后的增益Raw域图像输入到一个预训练的去噪模型中。这个去噪模型是基于大量包含噪声的图像数据进行训练的,旨在学习并识别图像中的噪声模式,并通过相应的算法或网络结构来减少或消除这些噪声。In this embodiment, the gain Raw domain image after brightness gain processing is input into a pre-trained denoising model. This denoising model is trained based on a large amount of image data containing noise, and is intended to learn and identify noise patterns in the image, and reduce or eliminate these noises through corresponding algorithms or network structures.

去噪模型的具体实现可以依赖于深度学习模型,当增益Raw域图像输入到去噪模型后,模型会对图像中的每个像素或像素块进行分析,判断其是否包含噪声,并据此调整像素值以减少或消除噪声。且该过程是迭代进行的,直到模型认为图像中的噪声已经减少到可接受的水平为止。The specific implementation of the denoising model can rely on a deep learning model. When the gain Raw domain image is input into the denoising model, the model will analyze each pixel or pixel block in the image to determine whether it contains noise, and adjust the pixel value accordingly to reduce or eliminate the noise. This process is iterative until the model believes that the noise in the image has been reduced to an acceptable level.

本发明提供的一种低光环境下的图像增强方法的工作原理如下:首先获取待增强图像的原始Raw域图像,并计算每个像素的亮度值,然后,基于像素亮度值采用聚类算法对图像进行区域分割,生成多个图像区域,通过计算每个图像区域的亮度均值作为区域亮度,将区域亮度输入预训练的亮度增益模型中,输出对应的增益系数,应用这些增益系数对相应的图像区域进行亮度提升,得到增益Raw域图像。最后,利用去噪模型对增益Raw域图像进行去噪处理,以消除或减少图像中的噪声,最终得到增强图像。The working principle of the image enhancement method in a low-light environment provided by the present invention is as follows: first, the original Raw domain image of the image to be enhanced is obtained, and the brightness value of each pixel is calculated. Then, the image is segmented into regions based on the pixel brightness value using a clustering algorithm to generate multiple image regions. The brightness mean of each image region is calculated as the regional brightness, and the regional brightness is input into a pre-trained brightness gain model, and the corresponding gain coefficient is output. These gain coefficients are applied to enhance the brightness of the corresponding image region to obtain a gain Raw domain image. Finally, the gain Raw domain image is denoised using a denoising model to eliminate or reduce the noise in the image, and finally an enhanced image is obtained.

基于此,本申请具有以下优点:Based on this, this application has the following advantages:

区域自适应亮度提升:通过聚类算法对图像进行区域分割,并计算每个区域的亮度均值,实现了区域自适应的亮度提升,这种方法能够根据不同区域的亮度特征进行针对性的增强,避免了全局增强方法可能导致的过度增强或细节丢失问题。Regional adaptive brightness enhancement: The image is segmented into regions through a clustering algorithm, and the mean brightness of each region is calculated to achieve regional adaptive brightness enhancement. This method can perform targeted enhancement based on the brightness characteristics of different regions, avoiding the problem of over-enhancement or detail loss that may be caused by global enhancement methods.

深度学习去噪处理:利用预训练的去噪模型对增益Raw域图像进行去噪处理,有效消除了图像中的噪声,去噪处理不仅提高了图像的清晰度,还改善了图像的视觉效果和后续处理的准确性。Deep learning denoising: The pre-trained denoising model is used to denoise the gain Raw domain image, which effectively eliminates the noise in the image. The denoising process not only improves the clarity of the image, but also improves the visual effect of the image and the accuracy of subsequent processing.

良好的泛化性能:本发明的方法不依赖于特定场景的先验知识或人工约束条件,而是通过深度学习模型自动学习图像特征并进行增强处理,因此,该方法在不同场景和光照条件下均表现出良好的泛化性能。Good generalization performance: The method of the present invention does not rely on prior knowledge or artificial constraints of specific scenes, but automatically learns image features and performs enhancement processing through a deep learning model. Therefore, the method exhibits good generalization performance in different scenes and lighting conditions.

实施例二Embodiment 2

本发明还提供了一种低光环境下的图像增强系统,用于执行所述的一种低光环境下的图像增强方法,参考图2所示,所述增强系统包括:The present invention further provides an image enhancement system in a low-light environment, which is used to perform the image enhancement method in a low-light environment. Referring to FIG. 2 , the enhancement system includes:

亮度获取模块100,用于获取待增强图像的原始Raw域图像,并获取所述原始Raw域图像中每个像素的亮度值。The brightness acquisition module 100 is used to acquire an original Raw domain image of the image to be enhanced, and acquire the brightness value of each pixel in the original Raw domain image.

图像分割模块200,用于基于每个像素的亮度值,采用聚类算法对所述原始Raw域图像进行区域分割,生成多个图像区域。The image segmentation module 200 is used to perform region segmentation on the original Raw domain image based on the brightness value of each pixel by using a clustering algorithm to generate multiple image regions.

区域亮度计算模块300,用于根据所述图像区域中所有像素的亮度值计算得到图像区域的区域亮度,其中,所述区域亮度为所述图像区域的亮度均值。The regional brightness calculation module 300 is used to calculate the regional brightness of the image area according to the brightness values of all pixels in the image area, wherein the regional brightness is the average brightness of the image area.

亮度增益调整模块400,用于将每个所述图像区域的区域亮度输入预训练的亮度增益模型,输出每个所述图像区域的增益系数,并应用输出的增益系数对相应的图像区域进行亮度提升,得到增益Raw域图像。The brightness gain adjustment module 400 is used to input the regional brightness of each image area into a pre-trained brightness gain model, output a gain coefficient of each image area, and apply the output gain coefficient to enhance the brightness of the corresponding image area to obtain a gain Raw domain image.

去噪增强模块500,用于利用去噪模型对所述增益Raw域图像进行去噪处理,得到增强图像。The denoising and enhancement module 500 is used to perform denoising processing on the gain Raw domain image using a denoising model to obtain an enhanced image.

本申请是参照根据本申请实施例的方法、设备(系统)和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框,以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to the flowcharts and/or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the processes and/or boxes in the flowchart and/or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate a device for implementing the functions specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一种计算机可读存储介质中,存储介质包括只读存储器(Read-Only Memory,ROM)、随机存储器(Random Access Memory,RAM)、可编程只读存储器(Programmable Read-only Memory,PROM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、一次可编程只读存储器(One-time Programmable Read-Only Memory,OTPROM)、电子抹除式可复写只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(CompactDisc Read-Only Memory,CD-ROM)或其他光盘存储器、磁盘存储器、磁带存储器,或者能够用于携带或存储数据的计算机可读的任何其他介质。A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, the storage medium including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically-erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

还需要说明的是,术语“包括”“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者还是包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or includes elements that are inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.

Claims (8)

1.一种低光环境下的图像增强方法,其特征在于,所述增强方法包括以下步骤:1. A method for image enhancement in a low-light environment, characterized in that the enhancement method comprises the following steps: S1:获取待增强图像的原始Raw域图像,并获取所述原始Raw域图像中每个像素的亮度值;S1: obtaining an original Raw domain image of the image to be enhanced, and obtaining the brightness value of each pixel in the original Raw domain image; S2:基于每个像素的亮度值,采用聚类算法对所述原始Raw域图像进行区域分割,生成多个图像区域;S2: Based on the brightness value of each pixel, a clustering algorithm is used to perform region segmentation on the original Raw domain image to generate multiple image regions; S3:根据所述图像区域中所有像素的亮度值计算得到图像区域的区域亮度,其中,所述区域亮度为所述图像区域的亮度均值;S3: Calculating the regional brightness of the image area according to the brightness values of all pixels in the image area, wherein the regional brightness is the average brightness of the image area; S4:将每个所述图像区域的区域亮度输入预训练的亮度增益模型,输出每个所述图像区域的增益系数,并应用输出的增益系数对相应的图像区域进行亮度提升,得到增益Raw域图像;S4: inputting the regional brightness of each of the image regions into a pre-trained brightness gain model, outputting a gain coefficient of each of the image regions, and applying the output gain coefficient to enhance the brightness of the corresponding image region to obtain a gain Raw domain image; S5:利用去噪模型对所述增益Raw域图像进行去噪处理,得到增强图像;S5: performing denoising processing on the gain Raw domain image using a denoising model to obtain an enhanced image; 其中,所述亮度增益模型的训练包括:Wherein, the training of the brightness gain model includes: 收集相同场景下,且包含低光环境和正常光照环境下图像对的训练数据集;Collect training datasets containing image pairs in low-light and normal-light environments under the same scene; 对于训练数据集中的每张低光图像,按照步骤S1至S3的方法提取其图像区域的区域亮度;For each low-light image in the training data set, extract the regional brightness of its image area according to the method of steps S1 to S3; 对于每张低光图像对应的正常光照图像,同样提取其图像区域的区域亮度,并计算低光图像区域亮度到正常光照图像区域亮度的目标增益系数;For each normal light image corresponding to the low light image, the regional brightness of its image area is also extracted, and the target gain coefficient from the low light image regional brightness to the normal light image regional brightness is calculated; 使用提取的低光图像区域亮度和对应的目标增益系数作为训练数据和标签,构建并训练亮度增益模型,以使亮度增益模型学习区域亮度与目标增益系数之间的映射关系。The extracted low-light image area brightness and the corresponding target gain coefficient are used as training data and labels to construct and train a brightness gain model so that the brightness gain model learns the mapping relationship between the area brightness and the target gain coefficient. 2.根据权利要求1所述的一种低光环境下的图像增强方法,其特征在于,步骤S1包括以下步骤:2. The method for image enhancement in a low-light environment according to claim 1, wherein step S1 comprises the following steps: S101:获取待增强图像的原始Raw域图像并进行格式解析;S101: obtaining an original Raw domain image of an image to be enhanced and performing format analysis; S102:读取解析后的原始Raw域图像中每个像素的RGB值;S102: Reading the RGB value of each pixel in the parsed original Raw domain image; S103:对像素的RGB值进行加权求和,得到像素对应的亮度值,其中,亮度值Y的计算公式为:S103: Perform weighted summation on the RGB values of the pixel to obtain a brightness value corresponding to the pixel, wherein the calculation formula of the brightness value Y is: Y=ω1·R+ω2·G+ω3·BY=ω 1 ·R+ω 2 ·G+ω 3 ·B 其中,ω1、ω2和ω3分别为R值、G值和B值的权重,且分别取值为0.299、0.587和0.114。Among them, ω 1 , ω 2 and ω 3 are the weights of R value, G value and B value, and their values are 0.299, 0.587 and 0.114 respectively. 3.根据权利要求2所述的一种低光环境下的图像增强方法,其特征在于,步骤S2包括以下步骤:3. The method for image enhancement in a low-light environment according to claim 2, wherein step S2 comprises the following steps: S201:根据原始Raw域图像的亮度值范围,通过随机初始化选择初始的聚类中心;S201: selecting an initial cluster center by random initialization according to the brightness value range of the original Raw domain image; S202:遍历所述原始Raw域图像中的每个像素,根据每个像素的亮度值,将其分配给最近的聚类中心;S202: traverse each pixel in the original Raw domain image, and assign each pixel to the nearest cluster center according to its brightness value; S203:在将所有像素分配给聚类中心后,根据每个聚类中所有像素的亮度值,重新计算每个聚类的中心;S203: after all pixels are assigned to cluster centers, the center of each cluster is recalculated according to the brightness values of all pixels in each cluster; S204:重复上述步骤S202和S203进行迭代优化,直到聚类中心的变化小于预设阈值;S204: repeating the above steps S202 and S203 to perform iterative optimization until the change of the cluster center is less than a preset threshold; S205:根据最终的聚类中心及对应的像素集合,将原始Raw域图像分割成多个图像区域,每个图像区域由一组属于同一聚类的像素组成。S205: According to the final cluster center and the corresponding pixel set, the original Raw domain image is divided into multiple image regions, each image region is composed of a group of pixels belonging to the same cluster. 4.根据权利要求3所述的一种低光环境下的图像增强方法,其特征在于,所述图像区域包括图像上的连通区域和非连通区域。4. The image enhancement method in a low-light environment according to claim 3, characterized in that the image area includes a connected area and a non-connected area on the image. 5.根据权利要求4所述的一种低光环境下的图像增强方法,其特征在于,步骤S3包括以下步骤:5. The method for image enhancement in a low-light environment according to claim 4, wherein step S3 comprises the following steps: S301:读取所述图像区域中所有像素的亮度值;S301: Read the brightness values of all pixels in the image area; S302:基于所述图像区域中所有像素的亮度值,计算得到图像区域的亮度均值,并将亮度均值认定为区域亮度。S302: Based on the brightness values of all pixels in the image area, calculate the brightness mean of the image area, and identify the brightness mean as the area brightness. 6.根据权利要求5所述的一种低光环境下的图像增强方法,其特征在于,步骤S4包括以下步骤:6. The method for image enhancement in a low-light environment according to claim 5, wherein step S4 comprises the following steps: S401:将计算得到的每个图像区域的区域亮度输入所述亮度增益模型进行映射处理,得到对应的增益系数;S401: inputting the calculated regional brightness of each image region into the brightness gain model for mapping processing to obtain a corresponding gain coefficient; S402:遍历所有图像区域,并将图像区域的每个像素的亮度值乘以增益系数,以实现亮度提升;S402: traversing all image regions, and multiplying the brightness value of each pixel in the image region by a gain coefficient to achieve brightness enhancement; S403:在遍历所有图像区域后,将处理后的图像区域组合成增益Raw域图像。S403: After traversing all image regions, the processed image regions are combined into a gain Raw domain image. 7.根据权利要求6所述的一种低光环境下的图像增强方法,其特征在于,步骤S5具体为:7. The method for image enhancement in a low-light environment according to claim 6, wherein step S5 specifically comprises: 将得到的增益Raw域图像输入到预训练的去噪模型中,通过去噪模型对图像中的噪声进行分析和消除,从而输出一张亮度提升且噪声减少的增强图像。The obtained gain Raw domain image is input into the pre-trained denoising model, and the noise in the image is analyzed and eliminated by the denoising model, so as to output an enhanced image with improved brightness and reduced noise. 8.一种低光环境下的图像增强系统,用于执行如权利要求1至7任意一项所述的一种低光环境下的图像增强方法,其特征在于,所述增强系统包括:8. An image enhancement system in a low-light environment, used to execute the image enhancement method in a low-light environment according to any one of claims 1 to 7, characterized in that the enhancement system comprises: 亮度获取模块,用于获取待增强图像的原始Raw域图像,并获取所述原始Raw域图像中每个像素的亮度值;A brightness acquisition module, used to acquire an original Raw domain image of the image to be enhanced, and acquire the brightness value of each pixel in the original Raw domain image; 图像分割模块,用于基于每个像素的亮度值,采用聚类算法对所述原始Raw域图像进行区域分割,生成多个图像区域;An image segmentation module, used to perform region segmentation on the original Raw domain image based on the brightness value of each pixel by using a clustering algorithm to generate multiple image regions; 区域亮度计算模块,用于根据所述图像区域中所有像素的亮度值计算得到图像区域的区域亮度,其中,所述区域亮度为所述图像区域的亮度均值;A regional brightness calculation module, used to calculate the regional brightness of the image area according to the brightness values of all pixels in the image area, wherein the regional brightness is the brightness mean of the image area; 亮度增益调整模块,用于将每个所述图像区域的区域亮度输入预训练的亮度增益模型,输出每个所述图像区域的增益系数,并应用输出的增益系数对相应的图像区域进行亮度提升,得到增益Raw域图像;A brightness gain adjustment module, used for inputting the regional brightness of each of the image regions into a pre-trained brightness gain model, outputting a gain coefficient of each of the image regions, and applying the output gain coefficient to enhance the brightness of the corresponding image region to obtain a gain Raw domain image; 去噪增强模块,用于利用去噪模型对所述增益Raw域图像进行去噪处理,得到增强图像。The denoising and enhancement module is used to perform denoising processing on the gain Raw domain image by using a denoising model to obtain an enhanced image.
CN202411163857.5A 2024-08-23 2024-08-23 Image enhancement method and enhancement system in low-light environment Active CN118674655B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411163857.5A CN118674655B (en) 2024-08-23 2024-08-23 Image enhancement method and enhancement system in low-light environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411163857.5A CN118674655B (en) 2024-08-23 2024-08-23 Image enhancement method and enhancement system in low-light environment

Publications (2)

Publication Number Publication Date
CN118674655A CN118674655A (en) 2024-09-20
CN118674655B true CN118674655B (en) 2024-10-29

Family

ID=92719744

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411163857.5A Active CN118674655B (en) 2024-08-23 2024-08-23 Image enhancement method and enhancement system in low-light environment

Country Status (1)

Country Link
CN (1) CN118674655B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109064426A (en) * 2018-07-26 2018-12-21 电子科技大学 A kind of method and device for inhibiting dazzle in low-light (level) image and enhancing image
WO2021143284A1 (en) * 2020-01-15 2021-07-22 华为技术有限公司 Image processing method and apparatus, terminal and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20230068894A (en) * 2021-11-11 2023-05-18 삼성전자주식회사 Display apparatus and operating method for the same
CN115456905B (en) * 2022-09-26 2025-06-10 南京邮电大学 Single image defogging method based on bright-dark region segmentation
CN117333401A (en) * 2023-11-30 2024-01-02 光宇锦业(武汉)智能科技有限公司 Image illumination enhancement method, system, medium and device with uneven brightness distribution
CN118212150A (en) * 2024-02-27 2024-06-18 智洋创新科技股份有限公司 Image enhancement method, system and storage medium for power transmission channel

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109064426A (en) * 2018-07-26 2018-12-21 电子科技大学 A kind of method and device for inhibiting dazzle in low-light (level) image and enhancing image
WO2021143284A1 (en) * 2020-01-15 2021-07-22 华为技术有限公司 Image processing method and apparatus, terminal and storage medium

Also Published As

Publication number Publication date
CN118674655A (en) 2024-09-20

Similar Documents

Publication Publication Date Title
US11037278B2 (en) Systems and methods for transforming raw sensor data captured in low-light conditions to well-exposed images using neural network architectures
CN115442515B (en) Image processing methods and equipment
EP4109392A1 (en) Image processing method and image processing device
WO2021114184A1 (en) Neural network model training method and image processing method, and apparatuses therefor
CN114049283A (en) Self-adaptive gray gradient histogram equalization remote sensing image enhancement method
CN116569213A (en) Semantic refinement of image regions
CN113129236A (en) Single low-light image enhancement method and system based on Retinex and convolutional neural network
CN115205160A (en) Reference-free low-light image enhancement method based on local scene perception
CN114240767B (en) Image wide dynamic range processing method and device based on exposure fusion
CN115526811B (en) Adaptive vision SLAM method suitable for variable illumination environment
CN118302788A (en) High dynamic range view synthesis from noisy raw images
CN109389569B (en) Monitoring video real-time defogging method based on improved DehazeNet
CN115456905B (en) Single image defogging method based on bright-dark region segmentation
CN110717953A (en) Coloring method and system for black and white pictures based on CNN-LSTM combination model
CN116385298B (en) A reference-free enhancement method for images collected by UAV at night
CN109493296A (en) Image enchancing method, device, electronic equipment and computer-readable medium
CN113744167A (en) Image data conversion method and device
CN113096023A (en) Neural network training method, image processing method and device, and storage medium
CN118297837B (en) Infrared simulator virtual image enhancement system based on image processing
WO2022193132A1 (en) Image detection method and apparatus, and electronic device
CN116681606A (en) A method, system, device and medium for enhancing underwater uneven illumination images
CN113888405A (en) Denoising and demosaicing method based on clustering self-adaptive expansion convolutional neural network
CN113706400A (en) Image correction method, image correction device, microscope image correction method, and electronic apparatus
US12035033B2 (en) DNN assisted object detection and image optimization
CN118674655B (en) Image enhancement method and enhancement system in low-light environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant