RAW Domain Low-Light Enhancement Method for RCCB Image Sensors
By distributing brightness contribution degree and dividing region in the RAW domain stage of the RCCB image sensor, dynamically adjusting the weight coefficient, and using a nonlinear gain function, the problem of insufficient brightness and loss of details at low illuminance is solved, and the enhancement of high-quality images is achieved.
Patent Information
- Application Number
- CN202510502687.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-04-22
AI Technical Summary
In the prior art, the RCCB image sensor has insufficient image brightness and lost details under low illumination conditions. The existing methods are prone to introduce noise and artifacts during the processing process, making it difficult to effectively improve image quality.
In the RAW image data stage, the weight coefficient is dynamically adjusted by assigning the weight coefficients based on the RCCB format by combining edge detection and texture complexity analysis, and brightness enhancement is performed using a nonlinear gain function.
Improve image brightness in low illumination conditions, retain details and reduce noise, and output high-quality images.
Smart Images

Figure CN120075627B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a RAW domain low-light enhancement method for an RCCB image sensor. Background Art
[0002] With the rapid development of digital imaging technology, as the core component of a digital camera, the performance of an image sensor directly affects the quality and shooting effect of an image. Among them, as a special color filter array (CFA) design, an RCCB (Red, Clear1, Clear2, Blue) image sensor can provide richer spectral information and higher sensitivity in low-light environments by introducing two transparent channels (Clear1 and Clear2). However, RAW images in RCCB format often face problems such as insufficient brightness and loss of details under low-light conditions, which pose higher requirements for subsequent image processing algorithms.
[0003] In the prior art, most of the low-light enhancement methods for RCCB image sensors focus on the later stage of image processing, such as improving the image quality by increasing the contrast and saturation of the image or applying complex denoising algorithms. Although these methods can improve the visual effect of the image to a certain extent, they often sacrifice the detail information of the image and are prone to introducing additional noise and artifacts during the processing.
[0004] Therefore, it is necessary to provide a RAW domain low-light enhancement method for an RCCB image sensor to solve the above technical problems. Summary of the Invention
[0005] To solve the above technical problems, the present invention provides a RAW domain low-light enhancement method for an RCCB image sensor, which makes full use of the characteristics of the RCCB format and performs targeted processing at the RAW image data stage, aiming to improve the brightness of the image, retain details and reduce noise, so as to output a high-quality image.
[0006] The present invention provides a RAW domain low-light enhancement method for an RCCB image sensor, and the method includes the following steps:
[0007] Allocate a first weight coefficient based on the brightness contribution degree of each channel of the RAW image in RCCB format, and generate an initial brightness value for each pixel point through weighted calculation;
[0008] Identify the image edges through an edge detection method, and divide the RAW image into an edge area, a texture area and a smooth area in combination with a texture complexity analysis method;
[0009] For each pixel, in combination with the region where it is located and the calculated initial brightness value, dynamically adjust the first weight coefficient to obtain a second weight coefficient;
[0010] Re - weight and calculate the brightness values of each pixel according to the second weight coefficient, and perform gain adjustment on the recalculated brightness values through a preset non - linear gain function, and output the enhanced RAW image based on the gain - adjusted brightness values.
[0011] Preferably, the steps of allocating the first weight coefficient to the brightness contribution degrees of each channel of the RAW image in the RCCB format and generating the initial brightness value of each pixel through weighted calculation are as follows:
[0012] Based on the photoelectric response characteristics of the RCCB image sensor, calculate the brightness contribution degree ratios of the four channels respectively;
[0013] Map the brightness contribution degree ratios of each channel to the first weight coefficient through normalization processing;
[0014] Perform weighted calculation of the initial brightness value, where the calculation formula of the initial brightness value is:
[0015]
[0016] Where, represents the initial brightness value, , , and are the original pixel values of the red channel, the first transparent channel, the second transparent channel, and the blue channel in the four channels respectively, , , and are the first weight coefficients corresponding to the red channel, the first transparent channel, the second transparent channel, and the blue channel respectively.
[0017] Preferably, the method of identifying the image edge by edge detection includes:
[0018] Process the RAW image using the Sobel operator to calculate the gradient magnitude and direction of each pixel;
[0019] Apply threshold processing to the gradient magnitude, and mark the pixels higher than the dynamic threshold as potential edge points, where the dynamic threshold is obtained through the mean and standard deviation of the gradient magnitude;
[0020] Apply the non - maximum suppression method to refine the edge, and determine whether it belongs to a part of the edge by comparing each pixel with its neighbors in the gradient direction, and determine the edge region and non - edge region.
[0021] Preferably, dividing the RAW image into edge areas, texture areas, and smooth areas in combination with a texture complexity analysis method comprises:
[0022] For non-edge areas, within a preset neighborhood, the gray-level co-occurrence matrix is extracted along the horizontal, vertical, left diagonal, and right diagonal directions. The weighted sum of the squared gray-level differences of adjacent pixels in each direction is calculated to obtain four contrast eigenvalues.
[0023] Normalize the contrast feature values in each direction, and take the average of the normalized results in four directions as the texture complexity of the current pixel;
[0024] The area types are divided according to a preset first threshold and a preset second threshold, wherein a pixel point with a texture complexity greater than the preset first threshold is identified as a texture area, a pixel point with a texture complexity less than the preset second threshold is identified as a smooth area, and the preset second threshold is less than the preset first threshold.
[0025] Preferably, for each pixel point, dynamically adjusting the preset first weight coefficient in combination with the area where the pixel point is located and the calculated initial brightness value to obtain the second weight coefficient includes:
[0026] For the edge area, the weight adjustment of the red channel and the blue channel is set to the first weight coefficient. times, and reduce the first weight coefficients of the two transparent channels respectively ,in A preset scaling factor associated with edge strength;
[0027] For the texture area, increase the first weight coefficients of the two transparent channels by , and reduce the first weight coefficients of the red channel and blue channel respectively , where C is the local contrast, T is the texture complexity of the current pixel, and are preset proportional coefficients, and are the increments of the first weight coefficients of the red channel and the blue channel respectively, is the calculated local contrast maximum;
[0028] For smooth areas, increase the first weight coefficients of the two transparent channels by , the first weight coefficients of the red channel and the blue channel are reduced
[0029] ,in is the initial brightness value of the current pixel, and is the preset brightness compensation coefficient, is the maximum brightness value among all pixel points.
[0030] Preferably, the method of re - weighting and calculating the brightness value of each pixel according to the second weight coefficient, and performing gain adjustment on the recalculated brightness value through a preset non - linear gain function, and outputting an enhanced RAW image based on the brightness value after gain adjustment includes:
[0031] Multiply the original pixel values of the red channel, the first transparent channel, the second transparent channel, and the blue channel by the corresponding second weight coefficients respectively, and sum them to obtain a new brightness value;
[0032] Use the sigmoid function to perform gain adjustment on the new brightness value;
[0033] Take the brightness value after gain adjustment as a reference, re - allocate the pixel values of each channel, and output the enhanced RAW image.
[0034] Compared with the related technology, a RAW - domain low - light enhancement method for an RCCB image sensor provided by the present invention has the following beneficial effects:
[0035] The present invention first allocates the first weight coefficient based on the brightness contribution degree of each channel of the RAW image in the RCCB format, and generates the initial brightness value of each pixel point through weighted calculation.
[0036] Then, through the edge detection method and the texture complexity analysis method, the RAW image is divided into an edge area, a texture area, and a smooth area.
[0037] Then, for each pixel point, combining the area where it is located and the calculated initial brightness value, dynamically adjust the preset first weight coefficient to obtain the second weight coefficient.
[0038] Finally, re - weight and calculate the brightness value of each pixel point according to the second weight coefficient, and perform gain adjustment on the recalculated brightness value through a preset non - linear gain function, and output the enhanced RAW image. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flowchart of a RAW - domain low - light enhancement method for an RCCB image sensor provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0040] The following further describes the present invention in detail with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only for explaining the present invention, rather than limiting the present invention. In addition, it should be noted that for the sake of description, only parts related to the present invention are shown in the drawings rather than all structures. In addition, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.
[0041] It should also be noted that, for ease of description, only the parts related to the present invention rather than all the content are shown in the 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 flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operations are completed, but there can also be additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0042] A RAW domain low-light enhancement method for an RCCB image sensor, referring to Figure 1 as shown, includes the following steps:
[0043] S1: Allocate the first weight coefficient based on the brightness contribution of each channel of the RAW image in RCCB format, and generate the initial brightness value of each pixel point through weighted calculation.
[0044] Specifically, step S1 specifically includes the following steps:
[0045] S11: Calculate the brightness contribution ratio of the four channels respectively based on the photoelectric response characteristics of the RCCB image sensor.
[0046] In this embodiment, first, analyze the photoelectric response characteristics of each channel according to the physical characteristics of the RCCB image sensor. Due to the spectral transmittance limitation of the filter, the quantum efficiency of the red channel (R) and the blue channel (B) is usually lower than that of the transparent channels (C1, C2). Since the transparent channels are not provided with filters and can capture optical signals in a wider spectral range, they have higher photosensitivity at low illuminance, but at the same time introduce a higher noise level.
[0047] To quantify the contribution of each channel to brightness, dynamic calculation needs to be combined with the following parameters:
[0048] Quantum efficiency: Obtain the quantum efficiency values of each channel in the visible light band through sensor calibration data. The quantum efficiency of the transparent channels is usually 30%-50% higher than that of the red and blue channels.
[0049] Noise characteristics: Analyze the readout noise and shot noise levels of each channel based on the dark current test data. The noise variance of the transparent channels is usually 1.5-2 times that of the red and blue channels.
[0050] Dynamic range: Determine its linear response interval by measuring the maximum saturated charge capacity of each channel.
[0051] Based on the above parameters, the calculation method of the brightness contribution ratio is as follows:
[0052] For the red and blue channels, calculate the basic contribution according to the product of their quantum efficiency and dynamic range;
[0053] For the transparent channel, introduce a noise suppression factor (reciprocal of the noise variance) in the calculation of the basic contribution to reduce the weight of high-noise regions;
[0054] Determine the brightness contribution ratio of each channel finally through experimental calibration.
[0055] S12: Map the brightness contribution ratio of each channel to the first weight coefficient through normalization.
[0056] In this embodiment, normalize the calculated brightness contribution ratio of each channel to ensure that the sum of the four-channel weight coefficients is 1. The specific operations include:
[0057] Dynamic range compensation: For high-dynamic scenes, if the pixel values of the red and blue channels are close to the saturation threshold, reduce their contribution weights proportionally to prevent highlight overflow.
[0058] Noise adaptive adjustment: In low-illumination regions (such as pixel values below 5% of the full well capacity), apply an attenuation coefficient to the weight of the transparent channel (such as the weight is reduced by 0.5% for each 1-unit increase in the noise variance) to suppress the noise amplification effect.
[0059] Normalization calculation: Divide the adjusted contribution values of each channel by the sum to obtain the normalized weight coefficient.
[0060] S13: Calculate the initial brightness value by weighted calculation, where the calculation formula of the initial brightness value is:
[0061]
[0062] Among them, represents the initial brightness value, , , and are the original pixel values of the red channel, the first transparent channel, the second transparent channel, and the blue channel in the four channels respectively, , , and are the first weight coefficients corresponding to the red channel, the first transparent channel, the second transparent channel, and the blue channel respectively.
[0063] In this embodiment, based on the normalized first weight coefficient, perform weighted fusion on the four-channel original data of each pixel. Specifically, when implementing:
[0064] Pixel value preprocessing: Perform black level correction and defective pixel repair on the original RAW data to eliminate the influence of the inherent noise of the sensor.
[0065] Channel alignment processing: Since the pixel density of the transparent channel in the RCCB array is twice that of the red and blue channels, bilinear interpolation downsampling needs to be performed on the transparent channel data to align it with the pixel grid of the red and blue channels.
[0066] Weighted calculation: For each pixel point, multiply the pixel values of its corresponding red channel (R), downsampled transparent channels (C1, C2), and blue channel (B) by the obtained first weight coefficient, and then add the products of the four to obtain the initial luminance value.
[0067] In addition, the calculation result needs to be limited within the bit width range of the original sensor data to avoid calculation overflow.
[0068] S2: Identify the image edges through the edge detection method, and divide the RAW image into an edge region, a texture region, and a smooth region in combination with the texture complexity analysis method.
[0069] Specifically, the identification of image edges through the edge detection method includes:
[0070] First, use the Sobel operator to process the RAW image and calculate the gradient magnitude and direction of each pixel point.
[0071] In this embodiment, the image is convolved with the Sobel operator kernels in the horizontal and vertical directions respectively to calculate the gradient components of each pixel point in the horizontal and vertical directions. The operator kernel in the horizontal direction highlights the left and right edges, and the operator kernel in the vertical direction strengthens the upper and lower edges. Combine the gradient components in the two directions, calculate the gradient magnitude of each pixel point, and determine the main direction of the gradient through the arctangent function, quantized to four main directions of 0°, 45°, 90°, and 135°.
[0072] Second, apply threshold processing to the gradient magnitude, and mark the pixel points higher than the dynamic threshold as potential edge points, where the dynamic threshold is obtained through the mean and standard deviation of the gradient magnitude.
[0073] In this embodiment, based on the statistical characteristics of the gradient magnitude of the entire image, calculate its mean and standard deviation, and dynamically set the edge detection threshold. The specific threshold consists of the mean plus twice the standard deviation. This method can effectively distinguish real edges from noise and retain more than 95% of the effective edge points. The pixels with gradient magnitude exceeding the threshold are marked as candidate edge points.
[0074] Finally, the non-maximum suppression method is applied to refine the edges. By comparing each pixel with its neighbors in the gradient direction, it is determined whether it belongs to a part of the edge, and the edge region and non-edge region are determined.
[0075] In this embodiment, to eliminate redundant responses in edge detection, along the main gradient direction of each candidate edge point, its gradient magnitude is compared with that of adjacent pixels. Only the pixel points with the maximum local gradient magnitude are retained, and the non-maximum points are suppressed, thereby obtaining an edge line with a single-pixel width. Subsequently, the morphological closing operation is used to fill the edge break regions, and the line detection algorithm is used to connect the longer broken edges to ensure edge continuity.
[0076] Finally, the finally retained edge pixels and their neighborhoods within the range of 3×3 pixels around them are uniformly classified as the edge region, and the rest are marked as the non-edge region, providing a basis for subsequent texture analysis.
[0077] Specifically, dividing the RAW image into an edge region, a texture region, and a smooth region in combination with the texture complexity analysis method includes:
[0078] First, for the non-edge region, within the preset neighborhood range, the gray-level co-occurrence matrix is extracted along four directions: horizontal, vertical, left diagonal, and right diagonal. The weighted sum of the squared gray-level differences of adjacent pixels in each direction is calculated to obtain four contrast feature values.
[0079] In this embodiment, within the non-edge region, with each pixel as the center, the pixel data of a 5×5 neighborhood window is extracted. Along the four directions of horizontal, vertical, left diagonal, and right diagonal, the co-occurrence frequency of pixel gray-level values in the neighborhood is statistically analyzed to generate gray-level co-occurrence matrices in four directions. To reduce the computational complexity, the 12-bit raw data is linearly compressed to 16 levels of gray.
[0080] Secondly, the contrast feature values in each direction are normalized, and the average value of the normalized results in the four directions is taken as the texture complexity of the current pixel.
[0081] In this embodiment, for the gray-level co-occurrence matrix in each direction, the contrast feature value is calculated. The contrast is quantified by the weighted sum of the squared gray-level differences of pixels, reflecting the clarity of local texture. After the contrast values in the four directions are respectively normalized to the interval from 0 to 1, their average value is taken as the texture complexity index of the current pixel. The higher this index value, the richer the texture details.
[0082] Finally, the region types are divided according to a preset first threshold and a preset second threshold, where the pixel points with a texture complexity greater than the preset first threshold are determined as the texture region, and the pixel points with a texture complexity less than the preset second threshold are determined as the smooth region, and the preset second threshold is less than the preset first threshold.
[0083] In this embodiment, a preset first threshold and a preset second threshold (for example, the preset first threshold is 0.7, and the preset second threshold is 0.3) are set in advance to classify the texture complexity:
[0084] Textured areas: areas with a complexity higher than 0.7, such as leaves or fabrics with rich details;
[0085] Smooth areas: areas with complexity lower than 0.3, such as uniform areas like the sky or solid color background;
[0086] Intermediate region: The complexity is between 0.3 and 0.7, which is classified as a smooth region to prioritize noise suppression.
[0087] If a pixel is marked as both an edge and a texture region, the edge region is used as the final classification to ensure edge integrity.
[0088] S3: For each pixel point, dynamically adjust the first weight coefficient in combination with the area where the pixel point is located and the calculated initial brightness value to obtain a second weight coefficient.
[0089] Specifically, step S3 includes the following steps:
[0090] For the edge area, the weight adjustment of the red channel and the blue channel is set to the first weight coefficient. times, and reduce the first weight coefficients of the two transparent channels respectively ,in A preset scaling factor associated with edge strength.
[0091] In this embodiment, in step S2, the gradient magnitude of each pixel has been calculated using the Sobel operator, and this value reflects the strength of the edge.
[0092] Calculate the mean and standard deviation of the gradient amplitude of the entire image, and use the mean plus twice the standard deviation as the threshold to distinguish strong edges from weak edges.
[0093] Determine the scaling factor related to edge strength , specifically including:
[0094] Set a minimum value and maximum value , these two values can be adjusted according to actual application requirements. For example, It can be set to 0.1, which means that a certain enhancement effect should be retained even at weak edges; Can be set to 0.5, which indicates maximum enhancement effect at strong edges.
[0095] For each pixel, it is proportionally mapped to and Between. If the edge strength is closer to the maximum value in the whole image, then It is closer to ; if the edge strength is closer to the minimum value, then It is closer to .
[0096] Use To calculate the weight reduction of the transparency channel. Specifically, the reduction of the transparency channel is the average of the first weight coefficients of the red channel and the blue channel multiplied by .
[0097] Adjust the weights of each channel: Increase the weights of the red channel and the blue channel by a certain proportion (determined by ), respectively. At the same time, reduce the weights of the two transparency channels by the corresponding reduction amounts.
[0098] For the texture area, increase the first weight coefficients of the two transparency channels by , and reduce the first weight coefficients of the red channel and the blue channel by , where C is the local contrast, T is the texture complexity of the current pixel point, And Are preset proportionality coefficients, And Are the increments of the first weight coefficients of the red channel and the blue channel, respectively, Is the maximum value of the calculated local contrast.
[0099] In this embodiment, calculate the local contrast and the texture complexity:
[0100] The local contrast is calculated through the gray-level co-occurrence matrix, reflecting the degree of light and dark changes in the current area. The average value of the contrast eigenvalues in four directions is taken to represent the local contrast.
[0101] The texture complexity is a normalized index, ranging from 0 to 1, and the larger the value, the more complex the texture.
[0102] Determine the proportionality coefficients And : Initialize the two proportionality coefficients And . For example, , used to control the enhancement of the transparency channel; , used to control the weakening of the red and blue channels.
[0103] Adjust the weight increase of the transparency channel: Calculate the weight increase of the transparency channel according to the magnitude of the local contrast. When the local contrast is low, increase the weight of the transparency channel more; when the local contrast is high, increase it less.
[0104] Adjust the weight reduction of the red and blue channels: Calculate the weight reduction of the red and blue channels according to the texture complexity. The more complex the texture, the more the weight is reduced.
[0105] Adjust the weights of each channel: Increase the weights of the two transparent channels by the corresponding increase amounts, and reduce the weights of the red and blue channels by the corresponding reduction amounts.
[0106] For smooth regions, increase the first weight coefficients of the two transparent channels by respectively, and reduce the first weight coefficients of the red and blue channels by respectively, where is the initial brightness value of the current pixel, and are preset brightness compensation coefficients, is the maximum brightness value among all pixels.
[0107] In this embodiment, determine the brightness compensation coefficients and :
[0108] Initialize two proportionality coefficients and . For example, , which is used to control the enhancement of the transparent channels; , which is used to control the weakening of the red and blue channels.
[0109] Calculate the weight increase of the transparent channels : Calculate the weight increase of the transparent channels according to the brightness value of the current pixel. The lower the brightness, the more the weight is increased; the higher the brightness, the less the weight is increased.
[0110] Calculate the weight reduction of the red and blue channels: Calculate the weight reduction of the red and blue channels according to the brightness value of the current pixel, that is . The lower the brightness, the less the weight is reduced; the higher the brightness, the more the weight is reduced.
[0111] Adjust the weights of each channel: Increase the weights of the two transparent channels by the corresponding increase amounts, and reduce the weights of the red and blue channels by the corresponding reduction amounts.
[0112] S4: Re-weight and calculate the brightness values of each pixel according to the second weight coefficient, and perform gain adjustment on the recalculated brightness values through a preset non-linear gain function, and output the enhanced RAW image based on the brightness values after gain adjustment.
[0113] Specifically, step S4 specifically includes the following steps:
[0114] S41: Multiply the original pixel values of the red channel, the first transparent channel, the second transparent channel, and the blue channel by their corresponding second weight coefficients respectively, and sum them up to obtain a new luminance value.
[0115] In this embodiment, for each pixel, the original pixel values of its red channel, the first transparent channel, the second transparent channel, and the blue channel are extracted respectively. These values are usually RAW data stored in 12-bit or higher bitwidth.
[0116] Multiply the original pixel value of each channel by its corresponding second weight coefficient. For example, for the red channel, multiply its original pixel value by the second weight coefficient of the red channel; for the two transparent channels, multiply by their respective second weight coefficients; for the blue channel, also multiply by the second weight coefficient of the blue channel.
[0117] Add the weighted results of the four channels to obtain the new luminance value of this pixel. This new luminance value is the result of comprehensively considering the contribution degrees of each channel and the regional characteristics.
[0118] S42: Use the sigmoid function to perform gain adjustment on the new luminance value.
[0119] In this embodiment, in order to further improve the visual effect of the image, especially the detail performance in low-illumination areas, it is necessary to perform non-linear gain adjustment on the new luminance value. Here, the sigmoid function is used to achieve the gain adjustment. Its characteristic is that it can provide a higher gain when the input value is low, and gradually saturate when the input value is high, so as to achieve the effects of dynamic range compression and contrast enhancement. The specific implementation process is as follows:
[0120] First, set the form of the sigmoid function as , where: is the input new luminance value; is the gain control parameter, which is used to adjust the steepness of the curve; is the offset parameter, which is used to adjust the center position of the curve.
[0121] According to the results of experimental calibration, select appropriate and values.
[0122] Substitute the new luminance value of each pixel into the sigmoid function to calculate the luminance value after its gain adjustment. Since the output range of the sigmoid function is from 0 to 1, it is necessary to map it back to the original data bitwidth range.
[0123] During the mapping process, a scaling factor A can be introduced so that the final output value satisfies . The scaling factor A can be determined by experimental calibration to ensure a reasonable overall luminance distribution of the image.
[0124] S43: Using the brightness value after gain adjustment as a reference, re - allocate the pixel values of each channel and output the enhanced RAW image.
[0125] In this embodiment, after completing the gain adjustment of the brightness value, it is necessary to use the adjusted brightness value as a reference, re - allocate the pixel values of each channel, and generate an enhanced RAW image. The specific implementation process is as follows:
[0126] For each pixel point, first calculate the difference between its brightness value after gain adjustment and the original brightness value. This difference reflects the impact of gain adjustment on brightness.
[0127] Allocate this difference proportionally to the four channels. The specific allocation ratio can be adjusted according to the second weight coefficient of each channel. For example, if a channel has a larger weight, more difference will be allocated to that channel.
[0128] Update the pixel value of each channel to reflect the brightness change after gain adjustment. It should be noted that during the update process, ensure that the pixel values of each channel remain within the range of the original data bit - width.
[0129] Finally, merge the updated four - channel data of all pixel points to generate an enhanced RAW image. The image at this time has higher detail clarity in low - illumination areas and retains good color fidelity in high - light areas.
[0130] This application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowcharts and / or block diagrams can be implemented by computer program instructions, and the combination of processes and / or blocks in the flowcharts and / or block diagrams can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general - purpose computer, a special - purpose computer, an embedded processor, or other programmable data - processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data - processing devices generate a device for realizing the functions specified in one Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0131] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium includes 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), compact disc read-only memory (CD-ROM) or other optical disc memories, magnetic disc memories, tape memories, or any other medium that can be used to carry or store data and is computer-readable.
[0132] It should also be noted that the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent in such process, method, commodity or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, commodity or device including the element.
Claims
1. A RAW domain low-light enhancement method for an RCCB image sensor, characterized in that, The method comprises the following steps: A first weight coefficient is assigned based on the brightness contribution of each channel of the RAW image in RCCB format, and an initial brightness value of each pixel is generated through weighted calculation; Identify image edges using an edge detection method, and divide the RAW image into edge areas, texture areas, and smooth areas in combination with a texture complexity analysis method; For each pixel, dynamically adjusting the first weight coefficient based on the region where the pixel is located and the calculated initial brightness value to obtain a second weight coefficient; The dynamic adjustment of the first weight coefficient specifically includes the following steps: For the edge region, set the weight adjustment amounts of the red channel and the blue channel to times the first weight coefficient, and reduce the first weight coefficients of the two transparent channels by , where is a preset proportionality coefficient associated with the edge intensity; For the texture region, increase the first weight coefficients of the two transparency channels by , and decrease the first weight coefficients of the red channel and the blue channel by , where C is the local contrast, T is the texture complexity of the current pixel, and are preset proportionality coefficients respectively, and are the increments of the first weight coefficients of the red channel and the blue channel respectively, is the calculated maximum value of the local contrast; For the smooth area, increase the first weight coefficients of the two transparent channels respectively , and decrease the first weight coefficients of the red channel and the blue channel respectively , where is the initial brightness value of the current pixel point, and are preset brightness compensation coefficients, is the maximum brightness value among all pixel points; The brightness value of each pixel point is re-weighted and calculated according to the second weight coefficient, and the re-calculated brightness value is gain-adjusted by a preset nonlinear gain function, and an enhanced RAW image is output based on the brightness value after gain adjustment.
2. The RAW domain low light enhancement method for an RCCB image sensor according to claim 1, characterized in that The method of allocating a first weight coefficient to the brightness contribution of each channel of the RAW image in RCCB format and generating an initial brightness value of each pixel through weighted calculation specifically includes the following steps: Based on the photoelectric response characteristics of the RCCB image sensor, the brightness contribution ratios of the four channels are calculated respectively; Mapping the brightness contribution ratio of each channel to a first weight coefficient through normalization processing; The initial brightness value is calculated by weighted calculation, wherein the calculation formula of the initial brightness value is: Among them, represents the initial brightness value, , , and are respectively the original pixel values of the red channel, the first transparent channel, the second transparent channel, and the blue channel in the four channels, , , and are respectively the first weight coefficients corresponding to the red channel, the first transparent channel, the second transparent channel, and the blue channel.
3. A RAW domain low-light enhancement method for an RCCB image sensor according to claim 2, characterized in that, The identifying of image edges by an edge detection method comprises: Process the RAW image using the Sobel operator to calculate the gradient magnitude and direction of each pixel; Applying thresholding to the gradient magnitude to mark pixels above a dynamic threshold as potential edge points, wherein the dynamic threshold is obtained by the mean and standard deviation of the gradient magnitude; The non-maximum suppression method is applied to refine the edge, and each pixel is compared with its neighbors in the gradient direction to determine whether it is part of the edge, and the edge area and non-edge area are determined.
4. A RAW domain low-light enhancement method for an RCCB image sensor according to claim 3, characterized in that, The method of combining the texture complexity analysis to divide the RAW image into an edge area, a texture area, and a smooth area includes: For non-edge areas, within a preset neighborhood, the gray-level co-occurrence matrix is extracted along the horizontal, vertical, left diagonal, and right diagonal directions. The weighted sum of the squared gray-level differences of adjacent pixels in each direction is calculated to obtain four contrast eigenvalues. Normalize the contrast feature values in each direction, and take the average of the normalized results in four directions as the texture complexity of the current pixel; The area types are divided according to a preset first threshold and a preset second threshold, wherein a pixel point with a texture complexity greater than the preset first threshold is identified as a texture area, a pixel point with a texture complexity less than the preset second threshold is identified as a smooth area, and the preset second threshold is less than the preset first threshold.
5. A RAW domain low-light enhancement method for an RCCB image sensor according to claim 4, characterized in that, The step of re-weighting and calculating the brightness value of each pixel according to the second weight coefficient, performing gain adjustment on the re-calculated brightness value using a preset nonlinear gain function, and outputting an enhanced RAW image based on the brightness value after the gain adjustment includes: Multiply the original pixel values of the red channel, the first transparent channel, the second transparent channel, and the blue channel by the corresponding second weight coefficients respectively, and sum them to obtain a new brightness value; Use the sigmoid function to perform gain adjustment on the new brightness value; Take the brightness value after gain adjustment as the reference, reallocate the pixel values of each channel, and output the enhanced RAW image.
Citation Information
Patent Citations
Image processing method and device, equipment and storage medium
CN113902644A
Method for fusing low-illumination camera image and infrared image
CN118195921A