Image processing method, computer program, storage medium and device
Patent Information
- Application Number
- CN202610461341.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-09
- Publication Date
- 2026-08-21
AI Technical Summary
[0002]相关技术中,传统色调映射的效果主要依赖于计算参数设置,容易导致映射结果过度增强或者出现光晕扩散和暗区细节消失,导致图像质量低下
[0042] This application decouples the structural information and brightness distribution of HDR images and optimizes them independently by local and global feature modules, which significantly improves the ability to suppress halos in highlight areas and restore textures in dark areas in backlit nighttime scenes, making the output SDR images more visually consistent and readable.
Smart Images

Figure CN122617698A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to image processing methods, computer programs, storage media and devices. Background Technology
[0002] In related technologies, the effect of traditional tone mapping mainly depends on the setting of calculation parameters, which can easily lead to over-enhancement of the mapping result or the appearance of halo diffusion and loss of details in dark areas, resulting in poor image quality. Summary of the Invention
[0003] The image processing method, computer program, storage medium, and device provided in the embodiments of this application at least partially solve the above-mentioned problems. A first aspect of this application provides an image processing method, the method comprising:
[0004] Acquire the high dynamic range image to be processed;
[0005] Based on the high dynamic range image, an edge base map and a base brightness map are obtained;
[0006] Local feature extraction is performed on the edge base map to obtain the edge contour map;
[0007] Global feature extraction is performed on the base brightness map to obtain a brightness feature map;
[0008] A standard dynamic range image is obtained based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map.
[0009] Optionally, obtaining the edge base map and the base brightness map based on the high dynamic range image includes:
[0010] The high dynamic range image is subjected to bilateral filtering to obtain a bilateral filtered image;
[0011] The edge baseline map is obtained based on the high dynamic range image and the bilateral filtered map;
[0012] The bilateral filtered image is downsampled at least once to obtain the base brightness image.
[0013] Optionally, the step of extracting local features from the edge base map to obtain an edge contour map includes:
[0014] The edge base map is input into a local feature extraction network to obtain deep semantic features;
[0015] The edge contour map is obtained based on the deep semantic features and the edge base map;
[0016] Optionally, the local feature extraction network is a local feature extraction network with a residual network structure.
[0017] Optionally, the global feature extraction employs a global feature extraction network composed of parallel multi-branch multi-size convolutional kernels.
[0018] Optionally, obtaining a standard dynamic range image based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map includes:
[0019] The high dynamic range image is subjected to bilateral filtering to obtain a bilateral filtered image;
[0020] The bilateral filtered image is downsampled and the base brightness image is subtracted to obtain the difference brightness image;
[0021] The brightness feature map is upsampled and Gaussian filtered, and then fused with the difference brightness map to obtain the upsampled brightness feature map.
[0022] The upsampled brightness feature map is upsampled and Gaussian filtered to obtain the texture color map;
[0023] A standard dynamic range image is obtained based on the texture color map and the edge contour map.
[0024] Optionally, the base brightness map includes a first base brightness map and a second base brightness map, and the upsampled brightness feature map includes a first upsampled brightness feature map and a second upsampled brightness feature map; obtaining the standard dynamic range image based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map includes:
[0025] The high dynamic range image is subjected to bilateral filtering to obtain a bilateral filtered image;
[0026] The bilateral filtered image is subjected to Gaussian filtering and downsampling to obtain the first basic brightness image;
[0027] The first base brightness map is subjected to Gaussian filtering and downsampling to obtain the second base brightness map;
[0028] The first base brightness map is downsampled and the second base brightness map is subtracted to obtain the first difference brightness map;
[0029] The brightness feature map is upsampled and Gaussian filtered, and then fused with the first difference brightness map to obtain the first upsampled brightness feature map;
[0030] The bilateral filtered image is downsampled and the first base brightness image is subtracted to obtain the second difference brightness image;
[0031] The first upsampled brightness feature map is upsampled and Gaussian filtered, and then fused with the second difference brightness map to obtain the second upsampled brightness feature map;
[0032] The second upsampled brightness feature map is upsampled and Gaussian filtered to obtain a texture color map;
[0033] A standard dynamic range image is obtained based on the texture color map and the edge contour map.
[0034] Optionally, after obtaining the standard dynamic range image based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map, the method includes:
[0035] The standard dynamic range image is converted into a YUV domain image to obtain a luminance map and / or a chrominance map;
[0036] The brightness map is adjusted to obtain a brightness correction map; and / or,
[0037] The chromaticity diagram is then subjected to color restoration to obtain a chromaticity correction diagram;
[0038] A low dynamic range image is obtained based on the luminance correction map and / or the chrominance correction map.
[0039] A computer program that can perform the image processing method as described in any of the preceding claims.
[0040] A storage medium storing a computer program as described above, or being connectable to a processor to run an image processing method as described in any of the preceding claims.
[0041] An apparatus, characterized in that the apparatus includes a storage medium as described above, or the apparatus is capable of running a computer program as described above, or the apparatus is capable of performing an image processing method as described in any one of the above.
[0042] This application decouples the structural information and brightness distribution of HDR images and optimizes them independently by local and global feature modules, which significantly improves the ability to suppress halos in highlight areas and restore textures in dark areas in backlit nighttime scenes, making the output SDR images more visually consistent and readable.
[0043] Other features and advantages of this application will be described in detail in the following detailed description section. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] To gain a more complete understanding of this application and its beneficial effects, the following description will be provided in conjunction with the accompanying drawings, wherein the same reference numerals in the following description denote the same parts.
[0046] Figure 1 This is a flowchart of an image processing method provided in an exemplary embodiment of this disclosure;
[0047] Figure 2 This is a flowchart (a) of an image processing method provided in an exemplary embodiment of this disclosure;
[0048] Figure 3 This is a flowchart (II) of an image processing method provided in an exemplary embodiment of this disclosure;
[0049] Figure 4 This is a flowchart (III) of an image processing method provided in an exemplary embodiment of this disclosure;
[0050] Figure 5 This is a flowchart (IV) of an image processing method provided in an exemplary embodiment of this disclosure. Detailed Implementation
[0051] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0052] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, features defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0053] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0054] This application provides an image processing method that can be used for color mapping of high dynamic range (HDR) images, or for image processing of contours and brightness of other images; no specific limitations are made here. In some embodiments or implementations of this application, the processing of high dynamic range images may be used as an example for illustration and explanation, but this does not limit the scope of protection of this application. Figure 1 , Figure 2 As shown, the image processing method may include the following steps:
[0055] Step 10: Obtain the high dynamic range image to be processed;
[0056] Specifically, the brightness of the RGB domain high dynamic range (HDR) image is first adjusted using the Gamma correction formula, which is as follows:
[0057]
[0058] In the formula, H is the input RGB domain HDR image, and G is the image after Gamma correction.
[0059] Step 20: Based on the high dynamic range image, obtain the edge base map and the base brightness map;
[0060] In specific implementations, the edge base map and base brightness map obtained from the high dynamic range image can be obtained in the following ways: the edge base map can be obtained by quickly calculating the brightness gradient using gradient operators, accurately locating edges using LoG / Canny operators, or adapting to the wide dynamic range characteristics of HDR through multi-scale fusion, achieving different extraction needs from coarse to fine, and from real-time to high quality; the base brightness map relies on channel fusion to directly calculate the brightness component, smoothing details with Gaussian, bilateral, and other low-pass filters, or compressing the dynamic range through tone mapping to preserve the overall brightness distribution. The extraction of both types of images needs to adapt to the characteristics of HDR images, such as a large dynamic range and wide brightness span. Edge extraction emphasizes a balance between noise resistance and accuracy to avoid noise interference; brightness extraction focuses on smoothing and structure preservation to prevent excessive loss of details. By comprehensively using gradient calculation, filtering, multi-scale analysis, and tone mapping, edge and brightness information can be efficiently separated while ensuring that the results conform to the characteristics of HDR images, providing stable basic data for subsequent image enhancement, segmentation, and fusion processing. This is a crucial preliminary step in the HDR image processing workflow. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0061] Step 30: Extract local features from the edge base map to obtain the edge contour map;
[0062] In specific implementations, various algorithms can be employed to extract local features from the edge base map and generate the edge contour map. For example, the Sobel operator can be used to detect edges by calculating the gradients of the image in the horizontal and vertical directions. Alternatively, the Canny operator can be used to provide clear and accurate edge detection results through Gaussian filtering, gradient calculation, non-maximum suppression, and double thresholding. The Laplacian and LoG operators, based on second derivatives and Gaussian filtering respectively, can effectively detect sharp edges. Zernike moments can also be used for shape description, but can also be used for local feature extraction, extracting image features by calculating moments of different orders. The Harris corner detection algorithm can also be used to detect corners and edges in the image by calculating gradient directions. Specifically, these algorithms each have their advantages and are suitable for different application scenarios. The choice of a suitable algorithm depends on specific requirements and image characteristics to ensure the quality and accuracy of the edge contour map. Combining these algorithms can improve the edge detection effect and meet the needs of various image processing tasks. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0063] Step 40: Perform global feature extraction on the basic brightness map to obtain a brightness feature map;
[0064] Specifically, various algorithms can be used to extract global features from a base brightness map and generate a brightness feature map. For example, histograms provide overall brightness distribution information by statistically analyzing the frequency of each brightness value in the image, making them suitable for image comparison and classification tasks. Mean and variance reflect the average brightness level and the fluctuation of brightness values, respectively, offering a simple and intuitive approach. Principal Component Analysis (PCA) extracts key brightness features by converting image brightness values into feature vectors and calculating principal components, making it suitable for complex feature extraction. Wavelet transform decomposes the image into sub-images of different scales, extracting global brightness features by analyzing the brightness features of these sub-images. Fourier transform converts the image from the spatial domain to the frequency domain, providing the distribution of brightness at different frequencies by analyzing frequency components. Global histogram equalization enhances image contrast by adjusting the brightness histogram, providing more detailed brightness distribution information. These algorithms each have their advantages and are suitable for different application scenarios. Histograms, mean, and variance are suitable for simple global feature extraction, while PCA and wavelet transform are more suitable for complex feature extraction. Fourier transform and global histogram equalization can provide more detailed brightness distribution information. Choosing appropriate algorithms can improve the quality and accuracy of brightness feature maps, meeting the needs of various image processing tasks. Combining these algorithms allows for better extraction and utilization of global brightness features, thus enhancing image processing performance. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0065] Step 50: Obtain a standard dynamic range image based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map.
[0066] Specifically, various algorithms and methods can be employed to generate standard dynamic range (SDR) images from high dynamic range (HDR) images, base luminance maps, edge contour maps, and luminance feature maps. Tone mapping is a commonly used technique that adjusts the brightness and contrast of an image to fit the dynamic range of a standard display. Edge-based tone mapping methods, combined with edge contour maps, can better preserve the edge information of an image, generating sharper and more natural SDR images. Luminance feature-based tone mapping methods, combined with luminance feature maps, can utilize the global luminance information of an image to generate SDR images that better conform to human visual perception. Histogram equalization-based tone mapping methods, combined with base luminance maps, can improve the contrast and luminance distribution of an image, making it more suitable for standard displays. Wavelet transform-based tone mapping methods utilize luminance information at different scales to preserve image detail and improve visual quality. Machine learning-based tone mapping methods adaptively adjust the brightness and contrast of HDR images through trained models, generating high-quality SDR images. Tone mapping techniques can preserve the visual effects of HDR images while adapting to the display range of SDR displays. Tone mapping methods that combine edge contour maps and brightness feature maps can better preserve image detail and global brightness distribution. Choosing appropriate algorithms can improve the quality and visual effect of SDR images, meeting the needs of various image processing tasks. By comprehensively utilizing these methods, high-quality SDR images can be generated from HDR images more effectively, enhancing image display. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0067] In the above embodiments, by decoupling the structural information and brightness distribution of the HDR image and optimizing them independently by local and global feature modules, the ability to suppress halos in the highlight areas and restore textures in the dark areas in backlit night scenes is significantly improved, making the output SDR image more visually consistent and readable.
[0068] In some embodiments, see Figures 3 to 5 Step 20: Based on the high dynamic range image, obtain the edge base map and the base brightness map, which may include:
[0069] Step 21: Perform bilateral filtering on the high dynamic range image to obtain a bilateral filtered image;
[0070] Specifically, various algorithms and methods can be employed when performing bilateral filtering on high dynamic range (HDR) images to obtain bilateral filtered images. Bilateral filtering is a nonlinear filtering method that combines weights in the spatial domain and the smoothing luminance domain to effectively remove noise while preserving edge information. Guided filtering guides the smoothing of the target image, better handling complex textures and details. Adaptive bilateral filtering adaptively adjusts filtering parameters based on local image features to improve filtering performance. Multi-scale bilateral filtering performs filtering at multiple scales, better handling different details and structures. Machine learning-based bilateral filtering adaptively adjusts filtering parameters through a trained model to optimize filtering performance. These methods each have their advantages and are suitable for different application scenarios. Bilateral filtering is suitable for basic noise removal and edge preservation, guided filtering and adaptive bilateral filtering are suitable for complex texture processing, and multi-scale bilateral filtering and machine learning-based bilateral filtering are suitable for further improving filtering performance. Choosing an appropriate algorithm can improve the smoothing effect of HDR images and meet various image processing needs. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0071] Step 22: Obtain the edge baseline map based on the high dynamic range image and the bilateral filter map;
[0072] Specifically, various algorithms and methods can be employed when obtaining the edge baseline map from a high dynamic range image and a bilaterally filtered image. A common approach is to use edge detection algorithms such as the Canny or Sobel operators. The Canny operator provides clear and accurate edge detection results through Gaussian filtering, gradient calculation, non-maximum suppression, and double thresholding. The Sobel operator effectively detects edges by calculating the gradients of the image in the horizontal and vertical directions. Another approach is to combine edge detection with a bilaterally filtered image, utilizing the smoothing effect of the bilateral filter to reduce noise and improve the accuracy of edge detection. Furthermore, machine learning-based methods can be used to train models to identify and extract edge information. Each of these methods has its advantages. The Canny and Sobel operators are suitable for basic edge detection, edge detection methods combined with bilaterally filtered images can reduce noise and improve edge quality, while machine learning-based methods can further optimize the edge detection effect. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0073] Step 23: Perform at least one downsampling process on the bilateral filtered image to obtain the base brightness image.
[0074] Specifically, when processing the bilaterally filtered image to obtain the basic brightness map, Gaussian filtering and downsampling methods can be used. First, Gaussian filtering is used to smooth the bilaterally filtered image, reducing noise and details while preserving the overall brightness information of the image. Gaussian filtering smooths the image in the spatial domain by applying a Gaussian kernel function, reducing high-frequency noise. Next, downsampling is performed to simplify the image data by reducing the image resolution, extracting key brightness information. Downsampling can reduce the width and height of the image through a downsampling factor, preserving the main brightness features. These steps can effectively extract the basic brightness information of the image, reduce redundant details, and improve the efficiency and accuracy of subsequent processing. By comprehensively using Gaussian filtering and smoothing, combined with downsampling methods, a high-quality basic brightness map can be generated, meeting the needs of image processing. The above is only an illustrative example and should not limit the scope of protection of this application.
[0075] In the above embodiments, bilateral filtering can be used, employing a spatial domain Gaussian kernel (radius 5 pixels) and a value domain Gaussian kernel (σ_r = 0.3 × (HDR maximum - minimum value)) working together to effectively preserve strong edges while smoothing sensor noise in non-edge areas. The edge base map can be obtained by subtracting the bilateral filtered map from the original HDR image, i.e., E_base = HDR − BilateralHDR. This difference map preserves high-frequency structural information, such as headlight edges, leaf outlines, and reflective road surface textures, providing high-fidelity structural input for subsequent local feature extraction. The base brightness map is obtained through two cascaded Gaussian filters and downsampling: after the first Gaussian filtering (kernel size 7 × 7, σ = 1.2) of the bilateral filtered map, it is downsampled at a 2:1 ratio to obtain the mid-frequency brightness component; after performing the same operation again, the low-frequency dominant base brightness map B_base is obtained, with its resolution reduced to the original. Figure 1 / 4 effectively removes local texture interference and retains only the global illumination trend, providing a stable base for subsequent brightness feature extraction.
[0076] In some embodiments, see Figures 3 to 5 Step 30: Extract local features from the edge base map to obtain an edge contour map, which may include:
[0077] Step 31: Input the edge base map into the local feature extraction network to obtain deep semantic features;
[0078] Specifically, various algorithms and methods can be employed when inputting the edge base map into a local feature extraction network to obtain deep semantic features. A common approach is to use a convolutional neural network (CNN) to extract local features from the image through multiple convolutional and pooling operations. Convolutional layers can capture local patterns and texture information in the image, while pooling layers can reduce feature dimensionality and retain key information. Furthermore, object detection networks such as Region Convolutional Networks (R-CNN) or Faster R-CNN can be used to extract deep semantic features from the image through region proposal and classification regression. These networks can identify and locate specific objects in the image and extract their deep features. Another approach is to use attention mechanisms, highlighting important regions in the image through self-attention or cross-modal attention modules, thereby enhancing the accuracy of feature extraction. These methods can effectively extract deep semantic information from the edge base map, improving the performance of image understanding and recognition. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0079] Step 32: Obtain the edge contour map based on the deep semantic features and the edge base map.
[0080] Specifically, various algorithms and methods can be employed to obtain edge contour maps based on deep semantic features and edge base maps. A common approach combines deep learning and edge detection techniques. First, a convolutional neural network (CNN) is used to extract deep semantic features, capturing key structural and textural information in the image. Then, these deep semantic features are combined with the edge base map, and a fusion network is used to further extract and enhance edge information. The fusion network can employ an attention mechanism to highlight important edge regions in the image, improving the accuracy of edge detection. Another approach uses image segmentation-based techniques, such as U-Net or Mask R-CNN. These networks can perform edge detection and semantic segmentation simultaneously, generating more accurate edge contour maps through multi-scale feature fusion and the utilization of contextual information. U-Net, through its encoder-decoder structure and skip connections, preserves multi-scale edge information. Mask R-CNN further refines the edge detection results through a region proposal network (RPN) and a mask branch. Additionally, optimization-based methods, such as energy minimization models, can be used. This method optimizes edge contour generation by defining an energy function and combining the edge base map and deep semantic features. The energy function may include data terms and regularization terms to ensure that the generated edge contours are both consistent with the image content and smooth and natural. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0081] In the above embodiment, the local feature extraction network can adopt a five-layer residual convolutional structure, with each layer containing two 3×3 convolutional layers and an identity mapping residual connection, and the activation function is LeakyReLU (α=0.1). After the input edge base map is convolved by the first layer, the number of channels is expanded to 64. The number of channels in each subsequent layer doubles to 128, 256, 512, and 512, respectively, and the number of output channels in the last layer is restored to 3, consistent with the number of input channels. The deep semantic features are fused with the original edge base map through an element-wise addition operation, i.e.: E_contour = E_base + F_deep, where F_deep is the semantic enhancement feature output by the network. This design enables the network to enhance weak contrast edges (such as blurred curbs and pedestrian outlines at night) and suppress false edges (such as jagged edges caused by sensor noise) through deep nonlinear mapping while preserving the original edge structure. In backlit video streams captured by vehicle-mounted cameras at night, this module can reliably identify the leg contours of pedestrians up to 30 meters away from the vehicle, with a low false detection rate, significantly outperforming the traditional Canny+ morphological post-processing solution.
[0082] In some embodiments, the local feature extraction network described above is a local feature extraction network with a residual network structure.
[0083] Specifically, the residual network structure adopts a "bottleneck" design, with each residual block containing three stages: 1×1 convolutional dimensionality reduction, a 3×3 convolutional backbone, and 1×1 convolutional dimensionality enhancement, with the number of channels increasing from 64 to 32 to 64, effectively reducing computational overhead. During training, L1+perceptual loss is used for joint optimization. The perceptual loss is based on the conv3_3 layer features of VGG16, forcing the output edge contour map to align with the ground truth labeled image in semantic space. This structure achieves an inference latency of less than 8ms / frame on embedded platforms, meeting the requirements of real-time in-vehicle image processing. The presence of residual connections makes gradient propagation more stable in deeper layers, avoiding gradient vanishing due to low light conditions at night, and ensuring consistent edge enhancement effects even under extreme low-light conditions.
[0084] In some embodiments, global feature extraction employs a global feature extraction network composed of parallel multi-branch multi-size convolutional kernels.
[0085] Specifically, the global feature extraction network consists of three parallel branches: the first branch uses a 7×7 convolutional kernel, the second branch uses a 5×5 convolutional kernel, and the third branch uses a 3×3 convolutional kernel. All three branches take a base brightness map B_base as input and output 64 channels each. After ReLU activation, the channels are concatenated and then compressed to 32 channels using a 1×1 convolution, ultimately outputting a brightness feature map L_feat. This design enables the network to simultaneously capture large-scale illumination gradients (such as the transition between sky and ground brightness) and local brightness fluctuations (such as the brightness decay at the edges of headlights), avoiding underfitting or overfitting of single-scale convolutions under complex nighttime lighting conditions. In actual testing, when the light source is located at the top of the image (such as elevated streetlights), the 7×7 branch effectively models the smooth decay curve from bright to dark areas, while the 3×3 branch accurately captures the sharp brightness jumps at the edges of headlights. The fused brightness feature map achieves an optimal balance between global consistency and local detail. The above is merely an illustrative example and should not limit the scope of this application.
[0086] In some embodiments, see Figures 3 to 5 Step 50: Obtaining a standard dynamic range image based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map may include:
[0087] Step 51: Perform bilateral filtering on the high dynamic range image to obtain a bilateral filtered image;
[0088] Specifically, various algorithms and methods can be employed when performing bilateral filtering on high dynamic range (HDR) images to obtain bilaterally filtered images. Bilateral filtering is an effective nonlinear filtering technique that combines weights in the spatial and smoothing luminance domains, effectively removing noise while preserving edge information. The specific steps are as follows: Bilateral Filtering: Applying a bilateral filter to the HDR image ensures smoothness of neighboring pixels through weights in the spatial and luminance domains, while preserving edge details. Parameter Selection: Choosing an appropriate filter radius and standard deviation to achieve the best smoothing effect. A larger spatial radius and smoothing luminance domain standard deviation can better handle complex structures. Multi-Scale Bilateral Filtering: Performing bilateral filtering at different scales better handles complex structures and details in the image, improving the overall smoothing effect. Adaptive Bilateral Filtering: Adaptively adjusting the filtering parameters based on local image features to better handle HDR images with complex brightness variations. Using these methods, high-quality bilaterally filtered images can be generated. Bilateral filtering effectively removes noise and preserves edge information; multi-scale and adaptive bilateral filtering further improve the filtering effect, reduce noise, and preserve details. Choosing appropriate parameters and methods can better meet the needs of HDR image processing, generating smooth and detailed bilateral filter maps. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0089] Step 52: Downsample the bilateral filter image and subtract the base brightness image to obtain the difference brightness image;
[0090] Specifically, various algorithms and methods can be used when downsampling the bilateral filtered image and subtracting the base brightness image to obtain the difference brightness image. The specific steps are as follows: Downsampling: Selecting a downsampling method: Common downsampling methods include direct sampling, bilinear interpolation, and nearest neighbor interpolation. Direct sampling is simple and fast, but may introduce jagged edges; bilinear interpolation and nearest neighbor interpolation can better preserve image details and smoothness. Determining the downsampling factor: Selecting an appropriate downsampling factor (such as 2, 4, etc.) reduces the image resolution, simplifies the image data, and extracts key brightness information. Subtracting the base brightness image: Image subtraction: Performing a pixel-by-pixel subtraction operation between the downsampling bilateral filtered image and the base brightness image. Specifically, for each pixel, the pixel value of the bilateral filtered image is calculated minus the pixel value of the base brightness image to obtain the difference brightness image. Ensuring size matching: Before performing the subtraction operation, ensure that the dimensions of the bilateral filtered image and the base brightness image are consistent. If they are inconsistent, the bilateral filtered image can be adjusted as necessary to make it the same size as the base brightness image. These methods can be used to generate high-quality difference brightness maps. Downsampling simplifies image data and extracts key brightness information, while subtraction highlights brightness differences in the image. Choosing appropriate downsampling methods and factors, and ensuring image size matching, can better meet the needs of image processing and generate smooth difference brightness maps with significant brightness differences. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0091] Step 53: Upsample and Gaussian filter the brightness feature map, and fuse the difference brightness map to obtain the upsampled brightness feature map;
[0092] Specifically, various algorithms and methods can be used when upsampling and Gaussian filtering the brightness feature map and fusing the difference brightness map to obtain the upsampled brightness feature map. The specific steps are as follows: Upsampling: Selecting an upsampling method: Commonly used upsampling methods include nearest neighbor interpolation, bilinear interpolation, and bicubic interpolation. Nearest neighbor interpolation is simple and fast, but may introduce jagged edges; bilinear interpolation and bicubic interpolation can better preserve image details and smoothness. Determining the upsampling factor: Selecting an appropriate upsampling factor (such as 2, 4, etc.) increases the image resolution to match the original image size. Gaussian filtering: Applying Gaussian filtering: Applying Gaussian filtering to the upsampled brightness feature map further smooths the image and reduces noise. Gaussian filtering, by applying a Gaussian kernel function, makes the image smoother in the spatial domain and reduces high-frequency noise. Selecting filtering parameters: Adjusting the size and standard deviation of the Gaussian filter according to specific needs to achieve the best smoothing effect. Fusing the difference brightness map: Image fusion: Fusing the Gaussian-filtered brightness feature map with the difference brightness map. A weighted fusion method can be used, assigning different weights according to importance to ensure that the fused image retains key brightness information. Ensuring size matching: Before fusion, ensure that the brightness feature map and the difference brightness map are the same size. If they are not, one of the images can be adjusted to match the other. Using these methods, high-quality upsampled brightness feature maps can be generated. Upsampling increases image resolution, Gaussian filtering further smooths the image and reduces noise, while fusion incorporates key information from the difference brightness map into the brightness feature map. Choosing appropriate upsampling methods and Gaussian filtering parameters, and ensuring image size matching, better meets the needs of image processing, generating smooth upsampled brightness feature maps that contain key brightness information. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0093] Step 54: Perform upsampling and Gaussian filtering on the upsampled brightness feature map to obtain the texture color map;
[0094] Specifically, similar to the above, when further processing the upsampled brightness feature map to obtain a texture color map, upsampling and Gaussian filtering methods can be used. The specific steps are as follows: Upsampling Processing: Selecting an upsampling method: Commonly used upsampling methods include nearest neighbor interpolation, bilinear interpolation, and bicubic interpolation. Nearest neighbor interpolation is simple and fast, but may introduce jagged edges; bilinear and bicubic interpolation can better preserve image details and smoothness. Determining the Upsampling Factor: Selecting an appropriate upsampling factor (such as 2, 4, etc.) increases the image resolution to match the original image size. This step ensures richer and clearer image details. Gaussian Filtering Processing: Applying Gaussian filtering: Applying Gaussian filtering to the upsampled brightness feature map further smooths the image and reduces noise. Gaussian filtering, by applying a Gaussian kernel function, makes the image smoother in the spatial domain and reduces high-frequency noise. Selecting Filtering Parameters: Adjusting the size and standard deviation of the Gaussian filter according to specific needs to achieve the best smoothing effect. Larger filter sizes and standard deviations can better smooth the image and reduce noise. Using these methods, high-quality texture color maps can be generated. Upsampling can increase image resolution and enrich details; Gaussian filtering can further smooth the image, reduce noise, and ensure image smoothness and clarity. Choosing appropriate upsampling methods and Gaussian filtering parameters can better meet the needs of image processing, generating smooth texture color maps containing rich texture information. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0095] Step 55: Obtain the standard dynamic range image based on the texture color map and edge contour map.
[0096] Specifically, various algorithms and methods can be used to generate standard dynamic range (SDR) images from texture color maps and edge contour maps. The specific steps are as follows: 1. Fusing texture color maps and edge contour maps: Selecting a fusion method: Common fusion methods include weighted fusion, multi-scale fusion, and deep learning-based fusion. Weighted fusion combines information from the two images by assigning different weights, multi-scale fusion fuses at different scales, and deep learning-based fusion automatically optimizes the fusion effect through model training. 2. Ensuring size matching: Before fusion, ensure that the texture color map and edge contour map are the same size. If they are not, one image can be adjusted to match the other. 3. Tone mapping: Applying a tone mapping algorithm: Tone mapping is a crucial step in converting high dynamic range images into standard dynamic range images. Common tone mapping algorithms include histogram-based mapping, local contrast-based mapping, and perceptual mapping. 4. Adjusting parameters: Adjusting the parameters of the tone mapping algorithm according to specific needs, such as histogram equalization parameters and contrast enhancement parameters, to achieve the best visual effect. Post-processing: Sharpening and noise reduction: After generating the SDR image, sharpening and noise reduction can be performed to further improve image quality. Sharpening enhances image details, while noise reduction reduces noise in the image. Color correction: Color correction is performed according to specific needs to ensure accurate and natural colors in the image. Using these methods, high-quality standard dynamic range images can be generated. Fusion of texture color maps and edge contour maps can preserve image details and structural information, tone mapping can convert high dynamic range images into images suitable for standard display, and post-processing steps can further improve image quality. Selecting appropriate fusion methods and tone mapping algorithms, and ensuring image size matching, can better meet the needs of image processing and generate clear, natural, and high-quality SDR images. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0097] In the above embodiment, firstly, the original HDR image is subjected to bilateral filtering again (with the same parameters) to obtain Bil_HDR; after downsampling it to the same resolution as B_base, an interpolation operation is performed: D_diff = Bil_HDR − B_base. This interpolation map retains the mid-frequency structure information, reflecting the deviation between local brightness and global trends. Subsequently, the brightness feature map L_feat (low resolution) is upsampled to the original image size through bilinear upsampling, and then smoothed by Gaussian filtering (σ=0.8) to obtain L_up. L_up and D_diff are then fused pixel-wise with weighted fusion: F_fuse = α·L_up + (1−α)·D_diff, where α=0.6, ensuring that the global illumination trend dominates and local details are not obscured. F_fuse is then upsampled a second time and Gaussian filtered to obtain the texture color map T_color, which carries the recovered texture and color information. Finally, T_color and edge contour map E_contour are concatenated through channels and fused by 1×1 convolution to output an SDR image. This step ensures that edge sharpness and texture details are enhanced simultaneously, avoiding the imbalance problem of "blurred bright areas and overly sharp dark areas".
[0098] In some embodiments, the base luminance map includes a first base luminance map and a second base luminance map, and the upsampled luminance feature map includes a first upsampled luminance feature map and a second upsampled luminance feature map; therefore, see [link to relevant documentation]. Figure 3 , Figure 4 Step 23: Perform at least one downsampling process on the bilateral filtered image to obtain the base brightness image, which may include:
[0099] Step 231: Perform Gaussian filtering and downsampling on the bilateral filtered image to obtain the first basic brightness image;
[0100] Specifically, various algorithms and methods can be used to obtain the first basic brightness map by performing Gaussian filtering and downsampling on the bilateral filtered image. The specific steps are as follows: Step 1: Gaussian Filtering: Selecting a Gaussian filter: Applying a Gaussian filter to smooth the bilateral filtered image reduces noise and details while preserving the overall brightness information of the image. The Gaussian filter, by applying a Gaussian kernel function, makes the image smoother in the spatial domain and reduces high-frequency noise. Step 2: Adjusting Filtering Parameters: Adjusting the size and standard deviation of the Gaussian filter according to specific needs to achieve the best smoothing effect. A larger filter size and standard deviation can smooth the image better and reduce noise. Step 3: Downsampling: Selecting a downsampling method: Commonly used downsampling methods include direct sampling, bilinear interpolation, and nearest neighbor interpolation. Direct sampling is simple and fast, but may introduce jagged edges; bilinear interpolation and nearest neighbor interpolation can better preserve image details and smoothness. Step 4: Determining the Downsampling Factor: Selecting an appropriate downsampling factor (such as 2, 4, etc.) reduces the image resolution, simplifies the image data, and extracts key brightness information. Using these methods, a high-quality first basic brightness map can be generated. Gaussian filtering can effectively reduce noise while preserving the overall brightness information of an image, while downsampling can simplify image data and extract key brightness features. Choosing an appropriate Gaussian filter size and downsampling factor ensures that the image is smooth and contains key brightness information, better meeting the needs of image processing. The above examples are illustrative and should not limit the scope of protection of this application.
[0101] Step 232: Perform Gaussian filtering and downsampling on the first basic brightness map to obtain the second basic brightness map.
[0102] Specifically, various algorithms and methods can be used to obtain a second basic brightness map by performing Gaussian filtering and downsampling on the first basic brightness map. The specific steps are as follows: Gaussian Filtering: Selecting a Gaussian Filter: Applying a Gaussian filter to smooth the first basic brightness map reduces noise and details while preserving the overall brightness information of the image. The Gaussian filter, by applying a Gaussian kernel function, makes the image smoother in the spatial domain and reduces high-frequency noise. Adjusting Filter Parameters: Adjusting the size and standard deviation of the Gaussian filter according to specific needs to achieve the best smoothing effect. A larger filter size and standard deviation can smooth the image better and reduce noise. Downsampling: Selecting a Downsampling Method: Commonly used downsampling methods include direct sampling, bilinear interpolation, and nearest neighbor interpolation. Direct sampling is simple and fast, but may introduce jagged edges; bilinear interpolation and nearest neighbor interpolation can better preserve image details and smoothness. Determining the Downsampling Factor: Selecting an appropriate downsampling factor (such as 2, 4, etc.) reduces the image resolution, simplifies the image data, and extracts key brightness information. Using these methods, a high-quality second basic brightness map can be generated. Gaussian filtering can further reduce noise while preserving the overall brightness information of the image, while downsampling can further simplify image data and extract key brightness features. Choosing an appropriate Gaussian filter size and downsampling factor ensures that the image is smooth and contains key brightness information, better meeting the needs of image processing. Through multiple Gaussian filtering and smoothing processes, noise can be gradually reduced, key brightness information of the image can be preserved, and a high-quality base brightness map can be generated. The above examples are illustrative and should not limit the scope of protection of this application.
[0103] In the above embodiments, this two-stage processing flow ensures that the base brightness map has a clear hierarchical structure: the first stage uses Gaussian filtering (σ=1.0) to smooth residual high-frequency noise in the bilaterally filtered map while preserving the main brightness trend; after downsampling, the resolution is reduced to the original... Figure 1 / 2, forming the mid-frequency luminance component B_mid. The second stage applies the same Gaussian filter (σ=1.2) and 2:1 downsampling again to obtain the final base luminance map B_base (1 / 4 resolution), which mainly carries the global illumination distribution and has completely stripped away local textures and edge structures. This layered downsampling strategy avoids edge blurring caused by a single large-kernel Gaussian filter, while reducing the computational load of subsequent global feature extraction. In automotive applications, this structure allows the system to operate stably on low-computing-power platforms (such as MCUs) and is robust to changes in input image resolution (supporting 1080p to 4K input). The above is merely an illustrative example and should not limit the scope of protection of this application.
[0104] Step 50: Obtaining a standard dynamic range image based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map may include:
[0105] Step 51: Perform bilateral filtering on the high dynamic range image to obtain a bilateral filtered image; for details, please refer to the descriptions of the above embodiments or implementation methods, which will not be repeated here.
[0106] Step 521: Downsample the first base brightness map and subtract the second base brightness map to obtain the first difference brightness map;
[0107] Specifically, when downsampling the first base brightness map and subtracting the second base brightness map to obtain the first difference brightness map, various algorithms and methods can be used. The specific steps are as follows: Downsampling: Selecting a downsampling method: Commonly used downsampling methods include direct sampling, bilinear interpolation, and nearest neighbor interpolation. Direct sampling is simple and fast, but may introduce jagged edges; bilinear interpolation and nearest neighbor interpolation can better preserve image details and smoothness. Determining the downsampling factor: Selecting an appropriate downsampling factor (such as 2, 4, etc.) reduces the image resolution, simplifies the image data, and extracts key brightness information. Subtracting the second base brightness map: Image subtraction: Performing a pixel-by-pixel subtraction operation between the downsampled first base brightness map and the second base brightness map. Specifically, for each pixel, calculating the pixel value of the first base brightness map minus the pixel value of the second base brightness map to obtain the first difference brightness map. Ensuring size matching: Before performing the subtraction operation, ensure that the sizes of the first base brightness map and the second base brightness map are consistent. If there is a discrepancy, the first base brightness map can be adjusted to match the size of the second base brightness map. Using these methods, a high-quality first difference brightness map can be generated. Downsampling simplifies image data and extracts key brightness information, while subtraction highlights brightness differences in the image. Choosing appropriate downsampling methods and factors, and ensuring image size matching, can better meet the needs of image processing and generate a smooth first difference brightness map with significant brightness differences. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0108] Step 531: Upsample and Gaussian filter the brightness feature map, and fuse it with the first difference brightness map to obtain the first upsampled brightness feature map;
[0109] Specifically, various algorithms and methods can be used when upsampling and Gaussian filtering the brightness feature map and fusing it with the first difference brightness map to obtain the first upsampled brightness feature map. The specific steps are as follows: Upsampling: Selecting an upsampling method: Commonly used upsampling methods include nearest neighbor interpolation, bilinear interpolation, and bicubic interpolation. Nearest neighbor interpolation is simple and fast, but may introduce jagged edges; bilinear interpolation and bicubic interpolation can better preserve image details and smoothness. Determining the upsampling factor: Selecting an appropriate upsampling factor (such as 2, 4, etc.) increases the image resolution to match the original image size. Gaussian filtering: Applying Gaussian filtering: Applying Gaussian filtering to the upsampled brightness feature map further smooths the image and reduces noise. Gaussian filtering, by applying a Gaussian kernel function, makes the image smoother in the spatial domain and reduces high-frequency noise. Selecting filtering parameters: Adjusting the size and standard deviation of the Gaussian filter according to specific needs to achieve the best smoothing effect. Fusing the first difference brightness map: Image fusion: Fusing the Gaussian-filtered brightness feature map with the first difference brightness map. A weighted fusion method can be used, assigning different weights according to importance to ensure that the fused image retains key brightness information. Ensuring size matching: Before fusion, ensure that the brightness feature map and the first difference brightness map are the same size. If they are not, one of the images can be adjusted to match the other. Using these methods, a high-quality first upsampled brightness feature map can be generated. Upsampling increases image resolution and enriches details; Gaussian filtering further smooths the image and reduces noise; the fusion operation incorporates key information from the first difference brightness map into the brightness feature map. Choosing appropriate upsampling methods and Gaussian filtering parameters, and ensuring image size matching, better meets the needs of image processing, generating a smooth first upsampled brightness feature map that contains key brightness information. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0110] Step 522: Downsample the bilateral filter image and subtract the first base brightness image to obtain the second difference brightness image; for details, please refer to step 521 or the description of the above embodiments or implementation methods, which will not be repeated here.
[0111] Step 532: Perform upsampling and Gaussian filtering on the first upsampled brightness feature map, and fuse it with the second difference brightness map to obtain the second upsampled brightness feature map; for details, please refer to step 531, or the description of the above embodiments or implementation methods, which will not be repeated here.
[0112] Step 541: Perform upsampling and Gaussian filtering on the second upsampled brightness feature map to obtain a texture color map. Specifically, various algorithms and methods can be used when performing upsampling and Gaussian filtering on the second upsampled brightness feature map to obtain the texture color map. The specific steps are as follows: Upsampling: Select an upsampling method: Commonly used upsampling methods include nearest neighbor interpolation, bilinear interpolation, and bicubic interpolation. Nearest neighbor interpolation is simple and fast, but may introduce jagged edges; bilinear interpolation and bicubic interpolation can better preserve image details and smoothness. Determine the upsampling factor: Select an appropriate upsampling factor (such as 2, 4, etc.) to increase the image resolution and match it with the original image size. Gaussian filtering: Apply Gaussian filtering: Perform Gaussian filtering on the upsampled second upsampled brightness feature map to further smooth the image and reduce noise. Gaussian filtering makes the image smoother in the spatial domain and reduces high-frequency noise by applying a Gaussian kernel function. Select filtering parameters: Adjust the size and standard deviation of the Gaussian filter according to specific needs to achieve the best smoothing effect. Larger filter sizes and standard deviations can better smooth images and reduce noise. These methods can generate high-quality texture color maps. Upsampling increases image resolution and enriches details; Gaussian filtering further smooths the image, reduces noise, and ensures smoothness and clarity. Choosing appropriate upsampling methods and Gaussian filtering parameters can better meet the needs of image processing, generating smooth texture color maps that contain rich texture information. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0113] Step 55: Obtain the standard dynamic range image based on the texture color map and edge contour map.
[0114] Specifically, please refer to the descriptions of the above embodiments or implementation methods, which will not be repeated here.
[0115] In the above embodiment, this implementation constructs a two-level difference fusion mechanism. The first base brightness map B_base1 is obtained by a bilaterally filtered map through a Gaussian downsampling process (resolution 1 / 2), and the second base brightness map B_base2 is obtained by further processing B_base1 (resolution 1 / 4). The first difference map D1 = B_base1 − B_base2 reflects the mid-frequency structure (such as headlight edge attenuation, building outlines) and is used to guide the local enhancement of the first upsampled brightness feature map L_up1. The second difference map D2 = Bil_HDR − B_base1 reflects the high-frequency structure (such as leaves, car window reflections) and is used to further refine the texture based on L_up1. L_up1 is fused with D2 after upsampling to generate L_up2, whose resolution is restored to the original image, carrying complete brightness structure information from global to local. This two-level difference structure enables the system to recover brightness details at different scales in stages, avoiding "halo overflow" or "detail breakage" at the boundary between strong light and dark areas in a single difference map. In real-vehicle testing, this solution successfully reproduced the gradient light spots of the taillights of the vehicle ahead and the subtle text of the road signs behind in a tunnel exit scenario with dense streetlights, without exhibiting the "halo trailing" phenomenon commonly seen in traditional methods. The above is merely an illustrative example and should not limit the scope of protection of this application.
[0116] Specifically, see Figures 1 to 5 The high dynamic range image G to be processed obtained in step 10 can be input into the first layer of the Gaussian pyramid for bilateral filtering, specifically:
[0117]
[0118]
[0119] In the formula, F represents the first-layer bilateral filter plot, ω represents the bilateral filter kernel, and σ represents the standard deviation of the Gaussian kernel. F is then subjected to Gaussian filtering, and then downsampled by half of its maximum value to obtain Fi. B In the case of F B Perform Gaussian filtering, then downsample by half the maximum value to obtain... Specifically:
[0120]
[0121]
[0122] In the formula, F B This is a Gaussian filtered image, where w is a two-dimensional Gaussian filter kernel. The base brightness image is obtained at the third layer of the Gaussian pyramid.
[0123] Next, to clearly restore the edge contour of the object, this embodiment of the invention uses the Gamma correction map G obtained in step 10 to subtract the obtained bilateral filter map F to obtain a shallow edge map, specifically:
[0124]
[0125] In the formula, This is a shallow edge map. The input uses a local feature module with a residual network structure, fusing shallow edge features with deep semantic features extracted by the network. This avoids the problems of broken edges and missed detections that are common in traditional edge detection in dark scenes, resulting in a clear and continuous edge contour map. The local feature module contains convolutional layers and residual connection structures, specifically:
[0126]
[0127] In the formula, K is the convolution kernel of size m×n, BN(·) represents batch normalization calculation, and ReLU(·) represents ReLU nonlinear activation calculation. These are the deep semantic features extracted by the convolutional layer. The edge contour map is calculated for the local feature module.
[0128] Next, to ensure minimal color texture deviation in HDR tone mapping and meet the human eye's preference for highly saturated colors, this invention implements a global feature module composed of parallel multi-branch multi-size convolutional kernels. This module undergoes convolution at different sizes to effectively obtain both coarse-scale and fine-grained textures, while preserving details and global brightness variations. The resulting fusion yields robust and complete brightness texture features, reducing interference from shadows and highlights. Specifically:
[0129]
[0130] In the formula, For brightness texture features, Concat represents the concatenation of multi-scale feature channels. This represents the convolution calculation using an n×n size convolution kernel. Input a 3-layer Gaussian pyramid, perform Gaussian filtering and bilinear interpolation upsampling layer by layer, add the calculation result of each layer to the calculation result of the corresponding layer of the Laplacian pyramid, and obtain the texture color map in the final layer.
[0131] In some embodiments, see Figure 5 Step 50: After obtaining the standard dynamic range image based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map, the method may further include:
[0132] Step 60: Convert the standard dynamic range image into a YUV domain image to obtain a luminance map and / or a chrominance map;
[0133] Specifically, various algorithms and methods can be used to convert a standard dynamic range image (SDR image) into a YUV domain image to obtain a luminance map and a chrominance map. The specific steps are as follows: 1. Color Space Conversion: RGB to YUV Conversion: Convert the SDR image from the RGB color space to the YUV color space. The YUV color space includes the luminance component Y and two chrominance components U and V. Conversion Formula: Commonly used RGB to YUV conversion formulas are as follows:
[0134]
[0135] In the formula, R, G, and B represent the two-dimensional matrix values of S in the three channels of the RGB domain image, respectively; Y is the luminance map obtained by S conversion; and U and V are the chrominance maps obtained by S conversion. 2. Extracting the luminance map and / or chrominance map: Luminance map: The luminance component Y is extracted from the YUV image, which is the luminance map. Chrominance map: The chrominance components U and V are extracted from the YUV image, which is the chrominance map. Using these methods, standard dynamic range images can be converted from the RGB color space to the YUV color space, and luminance and chrominance maps can be extracted from them. Color space conversion converts RGB images to YUV images using specific conversion formulas or matrix forms, extracting the luminance component Y as the luminance map and the chrominance components U and V as the chrominance map. This method can better separate the luminance and chrominance information of the image, facilitating subsequent image processing and analysis. Choosing appropriate conversion formulas and methods can ensure the accuracy and efficiency of the conversion, generating high-quality luminance and chrominance maps. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0136] Step 70: Adjust the brightness of the brightness diagram to obtain a brightness correction diagram; and / or restore the color of the chromaticity diagram to obtain a chromaticity correction diagram;
[0137] Specifically, various algorithms and methods can be used when adjusting the brightness of a luminance map to obtain a luminance-corrected map, and when performing color restoration on a chrominance map to obtain a chrominance-corrected map. The specific steps are as follows: For brightness adjustment, linear adjustment can be used: Step 1: Linear gain: Adjust brightness by multiplying by a gain factor. For example, multiplying the brightness value by a gain factor greater than 1 can increase brightness, while multiplying by a gain factor less than 1 can decrease brightness. Step 2: Linear offset: Adjust brightness by adding or subtracting an offset value. For example, increasing a positive value can increase overall brightness, while decreasing a positive value can decrease overall brightness. Alternatively, non-linear adjustment can be used: Step 1: Gamma correction: Adjust the non-linear characteristics of brightness through gamma correction. The gamma correction formula is Y′=Yγ, where γ is the gamma value, which can adjust the brightness contrast of the image. Step 2: Logarithmic transformation: Adjust the dynamic range of brightness through logarithmic transformation. For example, Y′=log(Y+1) can be used to compress high-brightness areas. For color restoration, linear adjustment can be used: Step 1: Linear gain: Adjust chrominance values by multiplying by a gain factor. For example, multiplying a chroma value by a gain factor greater than 1 can enhance color saturation, while multiplying by a gain factor less than 1 can reduce color saturation. The second step is linear offset: adjusting the chroma value by adding or subtracting an offset value. For example, increasing a positive value can increase color saturation, while decreasing a positive value can decrease it. Alternatively, non-linear adjustment can be used: the first step is color saturation adjustment: enhancing or weakening color by adjusting the saturation of the chroma value. For example, adjusting saturation by setting U′=U×saturation_factor and V′=V×saturation_factor. The second step is color balance: correcting color deviation by adjusting the balance of chroma values. For example, correcting color shift by adjusting the ratio of U and V values. Using these methods, brightness can be adjusted on the luminance map to generate a luminance correction map; simultaneously, color can be restored on the chroma map to generate a chroma correction map. Linear adjustment methods, including gain and offset, can simply and effectively adjust brightness and chroma values. Non-linear adjustment methods, including gamma correction, logarithmic transformation, and color saturation adjustment, can more finely control the dynamic range and saturation of brightness and chroma. Choosing appropriate adjustment methods and parameters can ensure accurate correction and restoration of image brightness and color, generating high-quality brightness and color correction maps. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0138] Step 80: Obtain a low dynamic range image based on the luminance correction map and / or the chrominance correction map.
[0139] Specifically, when obtaining a low dynamic range image based on a luminance correction map and / or a chrominance correction map, various algorithms and methods can be employed. The specific steps are as follows: The luminance correction map can be used directly: Step 1: Single-channel image: The luminance correction map is directly used as the luminance channel of the low dynamic range image. Step 2: Grayscale image: The luminance correction map is converted to a grayscale image, i.e., the low dynamic range image. Step 3: Color reconstruction: Reconstructing the RGB image: The luminance correction map is combined with the original chrominance map, and the RGB image is reconstructed using the inverse YUV to RGB conversion formula. Formula: The following formula is used to convert the YUV image back to an RGB image:
[0140] R = Y + 1.402(V−128)
[0141] G=Y−0.344(U−128)−0.714(V−128)
[0142] B = Y + 1.772(U−128)
[0143] The chromaticity correction image can be obtained by combining the luminance correction image and the chromaticity correction image: The first step is to reconstruct the RGB image: combine the luminance correction image and the chromaticity correction image, and reconstruct the RGB image using the inverse YUV to RGB conversion formula. Use the following formula to convert the YUV image back to an RGB image:
[0144] R = Y + 1.402(V−128)
[0145] G=Y−0.344(U−128)−0.714(V−128)
[0146] B = Y + 1.772(U−128)
[0147] The second step is color enhancement: After reconstructing the RGB image, color saturation and contrast can be further adjusted to enhance the image's visual effect. Using these methods, high-quality low dynamic range images can be generated. Directly using the luminance correction map can generate grayscale or single-channel images, while combining the luminance and chrominance correction maps can reconstruct RGB images. By using the inverse YUV to RGB conversion formula, the corrected luminance and chrominance information can be converted back to an RGB image, ensuring accurate restoration of the image's color and luminance information. Choosing appropriate reconstruction methods and parameters can ensure that the generated low dynamic range image has good visual effects and accurate color information. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0148] In the above embodiments, after the SDR image is converted from RGB to YUV, the Y channel carries luminance information, while the U and V channels carry chrominance information. The luminance adjustment module uses a non-linear mapping function: Y_corrected = Y * (1 + k·(Y − Y_mean) / Y_max), where k=0.3, and Y_mean is the global average luminance. This function moderately boosts the luminance in low-luminance regions (Y<0.3) and compresses it in high-luminance regions (Y>0.8) to avoid overexposure. The color restoration module applies adaptive gain to the U and V channels based on the human eye's high saturation perception model: U_corrected = U * (1 + 0.5·exp(−|U| / 0.2)), V_corrected = V * (1 + 0.4·exp(−|V| / 0.15)). This design enhances the saturation of common nighttime color blocks (such as red brake lights and yellow road signs) while suppressing background noise. Finally, after YUV merging, an LDR image is output via inverse conversion. In an in-vehicle HUD display system, this processing improves the accuracy of pedestrian recognition at night by 21%, makes color perception more in line with the driver's subjective preferences, and does not introduce color shift. The above is merely an illustrative example and should not limit the scope of protection of this application.
[0149] Specifically, the core problem of backlight imaging at night lies in the extremely uneven distribution of light. The large difference between brightness and darkness also leads to increased deviations in color reproduction. In this embodiment of the invention, the brightness map Y obtained in step 60 can be input into a brightness adjustment module based on a multi-scale and residual connection network to obtain an adjusted brightness map; and the chromaticity maps U and V can be input into a color reproduction module based on a residual connection network to obtain a reproduced chromaticity map. , To ensure that image brightness and color are processed without interference, the brightness and color information of the tone-mapped image is reconstructed. Then, the obtained brightness and chromaticity maps are merged along the channel dimension. Based on the basic principles of color space conversion and the ITU.BT-601 conversion standard, the YUV domain image is converted to an RGB domain image, resulting in the final tone-mapped RGB image, specifically:
[0150]
[0151] In the formula, , , These represent the two-dimensional matrix values of the three channels of the transformed RGB domain image. Finally, the loss function of this network consists of six parts: tone mapping quality index loss. Color shift loss Color difference loss Structural similarity loss Perceived loss and absolute average error loss The final objective function is:
[0152]
[0153] Through optimization Once convergence is achieved, the trained model is used to perform tone mapping on the nighttime backlit HDR image. This embodiment of the invention can achieve clear imaging of nighttime backlit scenes and suppress overexposure, increasing visibility around the light source. In terms of color reproduction, this embodiment reproduces colors more accurately in line with the human eye's perception of high saturation. This is because, during tone mapping, this embodiment processes the luminance and chrominance maps separately for each channel. This mitigates the chrominance shift and saturation reduction issues caused by directly processing the RGB image while adjusting scene brightness, thus improving the practicality of the tone-mapped image.
[0154] This application also provides a computer program, characterized in that the computer program can execute the image processing method described above.
[0155] In the above embodiments, the computer program is implemented using a C++ / CUDA hybrid architecture, with the core algorithm deployed on an embedded AI accelerator, and image preprocessing and post-processing completed by the processor core. The program supports multi-threaded pipelined processing: image input → bilateral filtering → feature extraction → fusion reconstruction → YUV adjustment → output, with end-to-end latency controlled within a certain time delay. When used in intelligent vehicles, the program can be modularly designed, supporting dynamic parameter configuration (such as filter kernel size, number of downsampling layers), and adapting to different vehicle camera modules (such as front-view, surround-view, and rear-view). The above are merely illustrative examples and should not limit the scope of protection of this application.
[0156] This application also provides a storage medium, characterized in that the storage medium stores a computer program as described above, or can be connected to a processor to run the image processing method as described above.
[0157] In the above embodiments, the storage medium is a non-volatile flash memory chip integrated into the vehicle domain controller, storing program code, pre-trained local and global feature extraction network weights (.bin format), filter parameter configuration tables, and YUV adjustment coefficient matrices. Encrypted signature verification is supported to prevent firmware tampering. Upon vehicle startup, the program is automatically loaded into the NPU cache, enabling the processing of the first frame image within 200ms after a cold start. The storage medium also reserves an extended partition for caching historical image processing parameters, supporting driving behavior analysis and adaptive algorithm optimization. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0158] This application also provides an apparatus, characterized in that the apparatus includes a storage medium as described above, or the apparatus is capable of running a computer program as described above, or the apparatus is capable of performing an image processing method as described above.
[0159] In the above embodiments, the device is a smart car or an in-vehicle image processing system for a smart car, including a CMOS image sensor, an ISP module, an NPU acceleration unit, an ARM processor, DDR memory, and storage media. The image sensor outputs 12-bit HDR raw data, which is initially denoised and white-balanced by the ISP before being input to the processing module of this method. The processing result is directly output to the vehicle's central control screen, HUD head-up display, automatic parking vision system, and ADAS perception module as a multi-task input. The system can communicate with the vehicle control unit via a CAN bus and supports automatic switching of processing modes (standard / nighttime backlight / strong light overexposure) according to the ambient light intensity, achieving full-scene adaptive optimization. The above are merely illustrative examples and should not limit the scope of protection of this application.
[0160] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0161] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. An image processing method, characterized in that, The method includes: Acquire the high dynamic range image to be processed; Based on the high dynamic range image, an edge base map and a base brightness map are obtained; Local feature extraction is performed on the edge base map to obtain the edge contour map; Global feature extraction is performed on the base brightness map to obtain a brightness feature map; A standard dynamic range image is obtained based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map.
2. The image processing method according to claim 1, characterized in that, The step of obtaining the edge baseline map and the baseline brightness map based on the high dynamic range image includes: The high dynamic range image is subjected to bilateral filtering to obtain a bilateral filtered image; The edge baseline map is obtained based on the high dynamic range image and the bilateral filtered map; The bilateral filtered image is downsampled at least once to obtain the base brightness image.
3. The image processing method according to claim 1 or 2, characterized in that, The step of extracting local features from the edge base map to obtain an edge contour map includes: The edge base map is input into a local feature extraction network to obtain deep semantic features; The edge contour map is obtained based on the deep semantic features and the edge base map.
4. The image processing method according to claim 3, characterized in that, The local feature extraction network is a local feature extraction network with a residual network structure.
5. The image processing method according to claim 1 or 2, characterized in that, The global feature extraction employs a global feature extraction network composed of parallel multi-branch multi-size convolutional kernels.
6. The image processing method according to any one of claims 1 to 5, characterized in that, The step of obtaining a standard dynamic range image based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map includes: The high dynamic range image is subjected to bilateral filtering to obtain a bilateral filtered image; The bilateral filtered image is downsampled and the base brightness image is subtracted to obtain the difference brightness image; The brightness feature map is upsampled and Gaussian filtered, and then fused with the difference brightness map to obtain the upsampled brightness feature map. The upsampled brightness feature map is upsampled and Gaussian filtered to obtain the texture color map; A standard dynamic range image is obtained based on the texture color map and the edge contour map.
7. The image processing method according to any one of claims 1 to 6, characterized in that, The base brightness map includes a first base brightness map and a second base brightness map, and the upsampled brightness feature map includes a first upsampled brightness feature map and a second upsampled brightness feature map; obtaining the standard dynamic range image based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map includes: The high dynamic range image is subjected to bilateral filtering to obtain a bilateral filtered image; The bilateral filtered image is subjected to Gaussian filtering and downsampling to obtain the first basic brightness image; The first base brightness map is subjected to Gaussian filtering and downsampling to obtain the second base brightness map; The first base brightness map is downsampled and the second base brightness map is subtracted to obtain the first difference brightness map; The brightness feature map is upsampled and Gaussian filtered, and then fused with the first difference brightness map to obtain the first upsampled brightness feature map; The bilateral filtered image is downsampled and the first base brightness image is subtracted to obtain the second difference brightness image; The first upsampled brightness feature map is upsampled and Gaussian filtered, and then fused with the second difference brightness map to obtain the second upsampled brightness feature map. The second upsampled brightness feature map is upsampled and Gaussian filtered to obtain a texture color map; A standard dynamic range image is obtained based on the texture color map and the edge contour map.
8. The image processing method according to any one of claims 1 to 7, characterized in that, After obtaining the standard dynamic range image based on the high dynamic range image, the base brightness map, the edge contour map, and the brightness feature map, the method includes: The standard dynamic range image is converted into a YUV domain image to obtain a luminance map and / or a chrominance map; The brightness map is adjusted to obtain a brightness correction map; and / or, The chromaticity diagram is then subjected to color restoration to obtain a chromaticity correction diagram; A low dynamic range image is obtained based on the luminance correction map and / or the chrominance correction map.
9. A computer program, characterized in that, The computer program can execute the image processing method as described in any one of claims 1 to 8.
10. A storage medium, characterized in that, The storage medium stores the computer program as described in claim 9, or can be connected to a processor to run the image processing method as described in any one of claims 1 to 8.
11. A device, characterized in that, The device includes the storage medium as described in claim 10, or the device can run the computer program as described in claim 9, or the device can perform the image processing method as described in any one of claims 1 to 8.