Image enhancement method for short video dark light scene
Patent Information
- Application Number
- CN202611076407.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-10-09
AI Technical Summary
而当暗光视频中存在行人移动、镜头晃动、灯光闪烁或压缩噪声时,单帧中的异常灰度峰值容易被识别为需要强化的暗部信息,后续拉伸可能同步放大噪点、边缘振铃和局部颗粒感
[0014]与现有技术相比,本发明的优点和积极效果在于:
Smart Images

Figure CN122887740A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image enhancement technology, and in particular to an image enhancement method for low-light scenes in short videos. Background Technology
[0002] Image enhancement technology addresses issues such as insufficient brightness, weak contrast, lack of detail, color distortion, and excessive noise in original images caused by insufficient lighting, limitations in imaging equipment performance, interference from the shooting environment, transmission noise, or unstable exposure conditions. By adjusting pixel brightness distribution, expanding the effective grayscale range, suppressing random noise, restoring texture edges, correcting color deviations, and enhancing local structures, the processed image has clearer visual layers and more complete scene information.
[0003] Existing technologies often start from the pixel distribution of a single image or frame, directly adjusting the overall grayscale range, local brightness, or contrast. In practice, pixels that are spatially close but have different temporal states are often treated as the same type of object, and fluctuations of the same pixel in consecutive frames are often ignored. This results in the enhancement intensity being mainly dominated by the brightness distribution of the current frame. When there are pedestrian movements, camera shake, light flickering, or compressed noise in low-light videos, abnormal grayscale peaks in a single frame are easily identified as dark information that needs to be enhanced. Subsequent stretching may simultaneously amplify noise, edge ringing, and local graininess. Furthermore, when using a uniform contrast limit, areas with stable textures and areas with dynamic changes are subject to the same constraint. Static backgrounds may experience excessive brightness enhancement, while rapidly changing areas may retain shadows due to overly strong constraints. Therefore, improvements are needed. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing an image enhancement method for low-light scenes in short videos.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: an image enhancement method for low-light scenes in short videos, comprising the following steps: Acquire multiple consecutive video images, extract the luminance channel components and stack them according to the time axis coordinate sequence to construct a three-dimensional spatiotemporal grid, and divide the three-dimensional spatiotemporal grid into multiple three-dimensional spatiotemporal blocks with overlapping regions according to a preset step size; Extract the brightness grayscale values of the associated pixels within each of the three-dimensional spatiotemporal blocks to generate a three-dimensional brightness pixel set, and count the frequency values of the three-dimensional brightness pixel set to construct a one-dimensional original histogram sequence; Calculate the Shannon entropy values corresponding to the probability distributions of each item in the one-dimensional original histogram sequence. Based on the comparison results between the Shannon entropy values and the preset entropy limit boundary conditions, selectively use the preset one-dimensional Gaussian kernel parameters to perform operations on the one-dimensional original histogram sequence to generate a smooth distribution histogram sequence. Calculate the time axis discrete variance of the three-dimensional brightness pixel set to generate a spatiotemporal temporal variance distribution; The variance values of each item in the spatiotemporal variance distribution are compared with the preset variance threshold values, and the corresponding weight parameters are assigned by decreasing or increasing the weight parameters according to the comparison results. The corresponding weight parameters are calculated by operating on the preset basic contrast limit value to obtain a dynamic adaptive limit value; excess frequency values exceeding the dynamic adaptive limit value are truncated within the smooth distribution histogram sequence and equally distributed and accumulated to obtain a restricted histogram sequence.
[0006] Preferably, the method further includes: A spatiotemporal cumulative distribution function is constructed by accumulating and summing the frequency values of each discrete node in the restricted histogram sequence; based on the three-dimensional brightness pixel set, an operation is performed within the interval between the center point of the adjacent three-dimensional spatiotemporal block and the corresponding spatiotemporal cumulative distribution function to generate a pixel brightness mapping matrix; The pixel brightness mapping matrix is merged with the original color channel components of multiple consecutive video frames. The original color channel components are then compensated for color saturation based on the ratio of the change in pixel brightness grayscale values between the pixel brightness mapping matrix and the original pixel brightness grayscale values. This compensates for the original pixel brightness grayscale values and outputs a short video enhanced image sequence.
[0007] Preferably, the step of obtaining the three-dimensional brightness pixel set is as follows: The system acquires multiple frames of video images arranged sequentially according to the shooting time in a low-light scene of a short video. It reads the horizontal pixel position, vertical pixel position, frame number and corresponding pixel value of the video image frame by frame. It separates the luminance channel component reflecting the brightness of the pixel from the original color channel components of each frame video image. The luminance channel components of each frame are stacked layer by layer along the time axis coordinate in ascending order of frame number so that the luminance channel components with the same horizontal and vertical coordinate positions correspond to the continuous time axis coordinates, forming a three-dimensional spatiotemporal grid composed of the intersection of horizontal, vertical and time axis coordinates. The system moves along the horizontal, vertical and time axis coordinate directions of the three-dimensional spatiotemporal grid according to the preset step size to divide the boundary, and controls the spatial and temporal overlap range between adjacent dividing boundaries to generate multiple three-dimensional spatiotemporal blocks. According to the starting and ending positions of the horizontal coordinate, the starting and ending positions of the vertical coordinate, the starting and ending positions of the time axis coordinate, and the ending positions of the time axis coordinate corresponding to each three-dimensional spatiotemporal block, the brightness channel components falling within the coordinate boundaries are retrieved point by point. The horizontal coordinate, vertical coordinate, time axis coordinate, and pixel brightness grayscale value corresponding to each brightness channel component are recorded. The pixel brightness grayscale values within the spatial or temporal overlap range are retained in their respective three-dimensional spatiotemporal blocks. The associated pixel brightness grayscale values are organized according to the three-dimensional spatiotemporal block number. Pixel brightness grayscale values whose coordinates exceed the boundary of the corresponding three-dimensional spatiotemporal block are deleted to generate a three-dimensional brightness pixel set.
[0008] Preferably, the steps for obtaining the one-dimensional original histogram sequence are as follows: Based on the three-dimensional brightness pixel set, the pixel brightness grayscale value inside each three-dimensional spatiotemporal block is read item by item. Continuous hierarchical intervals are set according to the ascending order of pixel brightness grayscale values. Each pixel brightness grayscale value is assigned to the hierarchical interval corresponding to the numerical boundary. The occurrence frequency of pixel brightness grayscale values in each hierarchical interval is accumulated. Pixel brightness grayscale values falling into the boundary position of the hierarchical interval are individually classified according to the preset boundary assignment rules. The frequency values corresponding to each hierarchical interval are recorded according to the hierarchical interval arrangement order. The hierarchical interval identifiers and frequency values are arranged sequentially to construct a one-dimensional original histogram sequence.
[0009] Preferably, the step of obtaining the smooth distribution histogram sequence is as follows: Based on the one-dimensional original histogram sequence, read the frequency values corresponding to each level interval, accumulate the total frequency values of all level intervals, divide the frequency value of each level interval by the total frequency values to obtain the probability distribution value corresponding to each level interval, calculate the contribution of the probability distribution value to the uncertainty of the one-dimensional original histogram sequence item by item, accumulate the contribution of all level intervals, and generate the Shannon entropy value. The Shannon entropy value is compared with a preset entropy limit boundary condition. When the Shannon entropy value is less than the preset entropy limit boundary condition, the difference between the preset entropy limit boundary condition and the Shannon entropy value is calculated. Based on the difference, the standard deviation of the one-dimensional Gaussian kernel parameter is increased proportionally, and the corresponding preset one-dimensional Gaussian kernel parameter is extracted. According to the hierarchical interval arrangement order of the one-dimensional original histogram sequence, the one-dimensional Gaussian kernel parameter is sequentially mapped to the current hierarchical interval and the adjacent hierarchical interval. The product of the frequency value of each hierarchical interval and the corresponding one-dimensional Gaussian kernel parameter is calculated respectively. All product results within the coverage of the current hierarchical interval are accumulated. The accumulated results are used to replace the original frequency value of the current hierarchical interval, and the continuous processing of all hierarchical intervals of the one-dimensional original histogram sequence is completed to generate a smooth distribution histogram sequence. When the Shannon entropy value is greater than or equal to the preset entropy limit boundary condition, the frequency value, hierarchical interval identifier and arrangement order of each hierarchical interval in the one-dimensional original histogram sequence remain unchanged, and the one-dimensional original histogram sequence is determined as a smooth distribution histogram sequence.
[0010] Preferably, the step of obtaining the spatiotemporal temporal variance distribution is as follows: Simultaneously, the three-dimensional brightness pixel set is retrieved, and the spatial position of each pixel in the continuous frame is locked according to the horizontal and vertical coordinates. The brightness gray values of all pixels corresponding to the same spatial position are extracted along the time axis coordinate direction. The number of brightness gray values of all pixels is counted, and the average value of all brightness gray values is calculated. The difference between each pixel brightness gray value and the average value is calculated item by item, and the difference is squared respectively. All squared results are accumulated, and the accumulated results are normalized according to the number of pixel brightness gray values to obtain the discrete variance value of each pixel brightness gray value. All discrete variance values are arranged according to the horizontal and vertical coordinates and the three-dimensional spatiotemporal block number to generate a spatiotemporal time variance distribution.
[0011] Preferably, the step of obtaining the dynamic adaptive limit value is as follows: Based on the spatiotemporal variance distribution, according to the arrangement order of the three-dimensional spatiotemporal block number, x-coordinate, and y-coordinate, the variance values corresponding to the pixel brightness grayscale values of each point are read item by item. Each variance value is compared with a preset variance threshold value. When the variance value is greater than the preset variance threshold value, the difference between the variance value and the preset variance threshold value is calculated. According to the increasing direction of the difference, a weighting parameter with a value less than one is determined. When the variance value is less than or equal to the preset variance threshold value, the difference between the preset variance threshold value and the variance value is calculated. According to the increasing direction of the difference, a weighting parameter with a value greater than one is determined. The three-dimensional spatiotemporal block number, x-coordinate, and y-coordinate corresponding to each weighting parameter or weighting parameter are retained to obtain the corresponding weighting parameter. According to the three-dimensional spatiotemporal block number, x-coordinate, and y-coordinate carried by the corresponding weight parameters, the preset basic contrast limit boundary value corresponding to the same position is retrieved. The increase weight parameter with a value greater than one is multiplied by the preset basic contrast limit boundary value, so that the limit boundary value at the corresponding position increases proportionally to the increase weight parameter value. The decrease weight parameter with a value less than one is multiplied by the preset basic contrast limit boundary value, so that the limit boundary value at the corresponding position decreases proportionally to the decrease weight parameter value. The limit boundary values at each position within each three-dimensional spatiotemporal block after the multiplication operation are recorded respectively, generating a dynamic adaptive limit value.
[0012] Preferably, the step of obtaining the restricted histogram sequence is as follows: Retrieve the corresponding smooth distribution histogram sequence according to the three-dimensional spatiotemporal block number. Read the frequency values item by item according to the hierarchical interval arrangement order. Compare the frequency value of each hierarchical interval with the corresponding dynamic adaptive limit. When the frequency value is greater than the dynamic adaptive limit, truncate the frequency value to the dynamic adaptive limit. Record the excess frequency value obtained by subtracting the dynamic adaptive limit from the frequency value before truncation. When the frequency value is less than or equal to the dynamic adaptive limit, retain the original frequency value. Accumulate the excess frequency values corresponding to all hierarchical intervals. Calculate the average distribution frequency value according to the number of hierarchical intervals in the smooth distribution histogram sequence. Add the average distribution frequency value to the retained frequency value or truncated frequency value of each hierarchical interval. Rearrange the accumulated frequency values according to the original hierarchical interval arrangement order to obtain the restricted histogram sequence.
[0013] Preferably, the step of obtaining the short video enhancement sequence is as follows: According to the restricted histogram sequence, the frequency values of each discrete node are read one by one according to the hierarchical intervals corresponding to the pixel brightness grayscale values. The frequency value of the first discrete node is registered as the first cumulative frequency value. Starting from the second discrete node, the cumulative frequency value corresponding to the previous discrete node is retrieved in sequence. The cumulative frequency value corresponding to the previous discrete node is added to the frequency value of the current discrete node to obtain the cumulative frequency value corresponding to the current discrete node. The accumulation operation is continuously performed until all discrete nodes are processed. The sum of the frequency values of all discrete nodes is calculated. Each cumulative frequency value is converted into a cumulative ratio according to the sum of the frequency values of all discrete nodes. A correspondence is established according to the three-dimensional spatiotemporal block number, hierarchical interval, and cumulative ratio to construct a spatiotemporal cumulative distribution function. The abscissa, ordinate, time axis coordinate, and pixel brightness grayscale value of each pixel in the three-dimensional brightness pixel set are retrieved. The overlapping position of the three-dimensional spatiotemporal block where each pixel is located is determined according to the abscissa, ordinate, and time axis coordinates. The center point of the adjacent three-dimensional spatiotemporal block surrounding each pixel is retrieved. The spatiotemporal cumulative distribution function corresponding to the center point of each adjacent three-dimensional spatiotemporal block is read. The cumulative proportion interval in each spatiotemporal cumulative distribution function is located according to the pixel brightness grayscale value. The relative distance ratio from each pixel to the center point of each adjacent three-dimensional spatiotemporal block in the abscissa direction, ordinate direction, and time axis direction is calculated respectively. The interpolation ratio corresponding to the center point of each adjacent three-dimensional spatiotemporal block is determined according to the relative distance ratio in the three coordinate directions. The brightness mapping results corresponding to each cumulative proportion interval are weighted and accumulated according to the interpolation ratio. The weighted accumulation result is recorded according to the abscissa, ordinate, and time axis coordinates of each pixel to generate a pixel brightness mapping matrix. The original color channel components are retrieved frame by frame according to the frame number of a series of consecutive video images. The horizontal, vertical, and time axis coordinates corresponding to each original color channel component are read. The brightness mapping result in the pixel brightness mapping matrix is retrieved according to the same horizontal, vertical, and time axis coordinates. The brightness mapping result is written to the corresponding spatial position to replace the original pixel brightness grayscale value at the same spatial position in the series of consecutive video images. The ratio coefficient between the brightness mapping result and the original pixel brightness grayscale value at the corresponding position is calculated. The color components other than the original pixel brightness grayscale value in the original color channel components are retained. The color components are multiplied by the ratio coefficient to perform adaptive saturation compensation to generate compensated color components. The replaced pixel brightness grayscale value and the compensated color components are recombined according to the spatial position. The continuous arrangement relationship is restored according to the frame number to output the short video enhanced picture sequence.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: This invention stacks the luminance channels of multiple consecutive video frames along the time axis into a three-dimensional spatiotemporal grid with unified spatial location and temporal order. It then divides the grid into three-dimensional spatiotemporal blocks with spatial and temporal overlap according to a preset step size. This allows for the synchronous aggregation of luminance changes from adjacent pixels and pixels from consecutive frames within the same local area, avoiding over-response to instantaneous noise or local anomalies when enhancement is based solely on the grayscale distribution of a single frame. The frequency of luminance grayscale values of associated pixels in each three-dimensional spatiotemporal block is statistically analyzed to form a one-dimensional original histogram sequence. The Shannon entropy value corresponding to the probability distribution is then used to determine whether smoothing processing is performed. This ensures that areas with concentrated grayscale levels and significant distribution fluctuations receive frequency transition correction, while areas with richer grayscale levels retain their original distribution characteristics, balancing dark noise suppression and texture detail preservation. Further utilizing the discrete variance along the temporal axis to characterize the brightness fluctuations of the same spatial location in consecutive frames, and configuring weighting parameters to decrease or increase based on the relationship between the variance values and the variance threshold, transforms the fixed basic contrast limit into a dynamically adaptive limit that adjusts with spatiotemporal changes. This prevents static dark areas from being overstretched and allows moving or flickering areas to receive enhancement intensity matching the degree of change. Truncating and equally distributing out-of-limit frequencies suppresses a few grayscale levels from occupying excessive mapping resources while maintaining overall frequency conservation. Constructing a spatiotemporal cumulative distribution function based on a constrained histogram sequence and performing 3D interpolation mapping between the center points of adjacent 3D spatiotemporal blocks weakens brightness abrupt changes at block boundaries, making the transitions in both spatial and temporal directions more continuous. Aligning and merging the pixel brightness mapping matrix with the original color channel components, and implementing color saturation compensation based on the brightness change ratio, brightens dark areas, expands contrast, and reduces the risk of color cast, fading, and saturation imbalance, thereby improving the detail visibility of low-light scenes in short videos. Attached Figure Description
[0015] Figure 1 A schematic diagram of a smoothly distributed histogram sequence; Figure 2 This is a schematic diagram of the spatiotemporal variance distribution. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0017] Please see Figure 1-2 This invention provides a technical solution: an image enhancement method for low-light scenes in short videos, comprising the following steps: Acquire multiple consecutive video images, extract the luminance channel components and stack them according to the time axis coordinate sequence to construct a three-dimensional spatiotemporal grid, divide the three-dimensional spatiotemporal grid into multiple three-dimensional spatiotemporal blocks with overlapping regions according to a preset step size, extract the luminance grayscale values of the associated pixels in each three-dimensional spatiotemporal block to generate a three-dimensional luminance pixel set, and count the frequency values of the three-dimensional luminance pixel set to construct a one-dimensional original histogram sequence; Calculate the Shannon entropy values corresponding to the probability distributions of each term in the one-dimensional original histogram sequence. Based on the comparison results between the Shannon entropy values and the preset entropy limit boundary conditions, selectively use the preset one-dimensional Gaussian kernel parameters to perform operations on the one-dimensional original histogram sequence to generate a smooth distribution histogram sequence; calculate the time axis discrete variance values of the three-dimensional brightness pixel set to generate a spatiotemporal time variance distribution. The variance values of each item in the spatiotemporal variance distribution are compared with the preset variance threshold values. Based on the comparison results, the corresponding weight parameters are assigned by either decreasing or increasing the weight parameters. The corresponding weight parameters are then calculated by operating on the preset basic contrast limit value to obtain the dynamic adaptive limit value. Excess frequency values exceeding the dynamic adaptive limit value are truncated within the smooth distribution histogram sequence and equally distributed and accumulated to obtain the restricted histogram sequence. A spatiotemporal cumulative distribution function is constructed by accumulating and summing the frequency values of each discrete node in the constrained histogram sequence. Based on the three-dimensional brightness pixel set, the operation is performed within the interval between the center point of adjacent three-dimensional spatiotemporal blocks and the corresponding spatiotemporal cumulative distribution function to generate a pixel brightness mapping matrix. The pixel brightness mapping matrix is merged with the original color channel components of multiple consecutive video images. The original color channel components are compensated for color saturation according to the change ratio of the pixel brightness mapping matrix and the original pixel brightness grayscale values, replacing the original pixel brightness grayscale values, and outputting a short video enhanced image sequence.
[0018] The steps to obtain the three-dimensional brightness pixel set are as follows: The system acquires multiple frames of video images arranged continuously according to the shooting time in a low-light scene of a short video. It reads the horizontal and vertical pixel positions, frame number and corresponding pixel value of the video image frame by frame. It separates the luminance channel component reflecting the brightness of the pixels from the original color channel components of each frame video image. The luminance channel components of each frame are stacked layer by layer along the time axis coordinate in ascending order of frame number so that the luminance channel components with the same horizontal and vertical coordinate positions correspond to the continuous time axis coordinates, forming a three-dimensional spatiotemporal grid composed of the intersection of horizontal, vertical and time axis coordinates. The system moves along the horizontal, vertical and time axis coordinates of the three-dimensional spatiotemporal grid according to the preset step size to divide the boundary, and controls the spatial and temporal overlap range between adjacent dividing boundaries to generate multiple three-dimensional spatiotemporal blocks. Based on the starting and ending positions of the horizontal coordinate, the starting and ending positions of the vertical coordinate, the starting and ending positions of the time axis coordinate, and the ending positions of the time axis coordinate corresponding to each 3D spatiotemporal block, the luminance channel components falling within the coordinate boundaries are retrieved point by point. The horizontal coordinate, vertical coordinate, time axis coordinate, and pixel luminance grayscale value corresponding to each luminance channel component are recorded. The pixel luminance grayscale values within the spatial or temporal overlap range are retained in their respective 3D spatiotemporal blocks. The associated pixel luminance grayscale values are organized according to the 3D spatiotemporal block number. Pixel luminance grayscale values whose coordinates exceed the boundary of the corresponding 3D spatiotemporal block are deleted, generating a 3D luminance pixel set.
[0019] Specifically, acquiring multiple consecutive video frames involves decoding and reading consecutive image data (e.g., 16 or 32 frames) from the short video file to be processed at a rate of 24 or 30 frames per second. The RGB color space data of each frame is read frame by frame and converted to the YCbCr color space. The Y channel, representing the brightness of pixels, is then separated as the luminance channel component. The calculation of the Y channel follows the ITU-R BT.601 standard, i.e., it is obtained by weighted averaging of the R, G, and B components. Simultaneously, the horizontal and vertical pixel positions of each pixel, as well as the frame number of the frame it belongs to, are recorded. The luminance channel component data of each frame are virtually stacked along the time axis in ascending order of frame number, so that pixels with the same spatial position in the video sequence (same horizontal and vertical coordinates) form a continuous sequence of luminance values in the time dimension. This constructs a three-dimensional spatiotemporal grid composed of horizontal coordinate X, vertical coordinate Y, and time axis T. Then, along the horizontal, vertical, and time axis directions of this three-dimensional spatiotemporal grid, a sliding window method is used for division. The window size is preset to, for example, 32×32 pixels in the spatial dimension and 8 frames in the time dimension. The sliding step is set to half the window size, that is, a spatial step of 16 pixels and a time step of 4 frames. This setting ensures that adjacent division boundaries retain a 16-pixel overlap range in space and a 4-frame overlap range in time. By moving the window on the entire three-dimensional spatiotemporal grid, a series of multiple three-dimensional spatiotemporal blocks with spatial and temporal overlap are generated.
[0020] Based on the defined start and end positions of the horizontal coordinate, vertical coordinate, and time axis coordinates for each 3D spatiotemporal block, data is extracted from the previously constructed 3D spatiotemporal mesh. Specifically, for a 3D spatiotemporal block numbered k, its boundary is defined as... , , Then, by using a triple loop, all integer coordinates within that coordinate range can be traversed. Retrieve and read the grayscale value of the brightness channel component at the corresponding coordinate position in the three-dimensional spatiotemporal grid, and then combine the grayscale value with its coordinates. Record them together. Because there are overlapping regions between adjacent 3D spatiotemporal blocks, a pixel located within the overlapping region (e.g., a pixel with coordinates of...) Pixels that simultaneously satisfy the boundary conditions of both block A and block B will have their brightness and grayscale values recorded and stored in the respective data sets of block A and block B. This operation ensures data continuity during subsequent interpolation processing. After retrieving and recording all pixel brightness and grayscale values within a 3D spatiotemporal block, these values are organized into a list or array and associated with the unique number of the 3D spatiotemporal block, for example, using a hash table or dictionary structure, where the key is the 3D spatiotemporal block number and the value is a list containing all pixel brightness and grayscale values within that block. During this process, filtering is performed based on the coordinate boundaries of each 3D spatiotemporal block. Pixel brightness and grayscale values whose coordinates exceed the boundary of the currently processed 3D spatiotemporal block will be discarded and not included in the data set of the current block. After traversing and processing all 3D spatiotemporal blocks, a 3D brightness pixel set containing all associated pixel brightness and grayscale values within each block is finally generated, indexed by the 3D spatiotemporal block number.
[0021] The steps to obtain the one-dimensional original histogram sequence are as follows: Based on the three-dimensional brightness pixel set, the pixel brightness grayscale value inside each three-dimensional spatiotemporal block is read item by item. Continuous hierarchical intervals are set according to the ascending order of pixel brightness grayscale values. Each pixel brightness grayscale value is assigned to the hierarchical interval corresponding to the numerical boundary. The occurrence frequency of pixel brightness grayscale values in each hierarchical interval is accumulated. Pixel brightness grayscale values falling into the boundary position of the hierarchical interval are classified separately according to the preset boundary assignment rules. The frequency values corresponding to each hierarchical interval are recorded according to the arrangement order of the hierarchical intervals. The hierarchical interval identifiers and frequency values are arranged in sequence to construct a one-dimensional original histogram sequence.
[0022] Specifically, based on the three-dimensional brightness pixel set generated in the previous step, a histogram construction operation is performed separately for each three-dimensional spatiotemporal block. Specifically, all the brightness grayscale values of the pixels contained in a certain three-dimensional spatiotemporal block are read item by item. Considering that the brightness grayscale value range of a typical 8-bit image is 0 to 255, 256 consecutive hierarchical intervals are pre-set, namely intervals [0], [1], ...,
[255] . Each interval corresponds to a brightness grayscale level. Then, each pixel brightness grayscale value in the three-dimensional spatiotemporal block is traversed and assigned to the corresponding hierarchical interval. For example, a pixel with a grayscale value of 128 will be assigned to the 128th hierarchical interval, and the count value of the interval will be incremented by 1. In order to handle the pixel values that fall exactly at the boundary of the hierarchical interval, the left-closed and right-open assignment rule is adopted, that is, a grayscale value V is assigned to the interval [V] to ensure that each pixel value is uniquely classified. A length of 256 is initialized for each three-dimensional spatiotemporal block, and all elements An integer array with an initial value of 0 is used to accumulate the occurrence frequency of pixel brightness grayscale values in each level interval. After traversing all pixels in the current 3D spatiotemporal block, this array constitutes the original histogram of the block. According to the order of level intervals from 0 to 255, the identifier of each level interval (i.e., grayscale value 0 to 255) and its corresponding frequency value are recorded in sequence. This process is repeated for all 3D spatiotemporal blocks, and finally a set of original histograms of all 3D spatiotemporal blocks is obtained, i.e., a one-dimensional original histogram sequence.
[0023] The steps to obtain a smooth distribution histogram sequence are as follows: Based on the one-dimensional original histogram sequence, read the frequency values corresponding to each level interval, accumulate the total frequency values of all level intervals, divide the frequency value of each level interval by the total frequency values to obtain the probability distribution value corresponding to each level interval, calculate the contribution of the probability distribution value to the uncertainty of the one-dimensional original histogram sequence item by item, accumulate the contribution of all level intervals, and generate the Shannon entropy value. The Shannon entropy value is compared with a preset entropy limit boundary condition. When the Shannon entropy value is less than the preset entropy limit boundary condition, the difference between the preset entropy limit boundary condition and the Shannon entropy value is calculated. Based on the difference, the standard deviation of the one-dimensional Gaussian kernel parameter is increased proportionally, and the corresponding preset one-dimensional Gaussian kernel parameter is extracted. According to the hierarchical interval arrangement order of the one-dimensional original histogram sequence, the one-dimensional Gaussian kernel parameter is sequentially mapped to the current hierarchical interval and the adjacent hierarchical interval. The product of the frequency value of each hierarchical interval and the corresponding one-dimensional Gaussian kernel parameter is calculated respectively. All product results within the coverage of the current hierarchical interval are accumulated, and the accumulated results are used to replace the original frequency value of the current hierarchical interval. The continuous processing of all hierarchical intervals of the one-dimensional original histogram sequence is completed, and a smooth distribution histogram sequence is generated. When the Shannon entropy value is greater than or equal to the preset entropy limit boundary condition, the frequency value, hierarchical interval identifier and arrangement order of each hierarchical interval in the one-dimensional original histogram sequence remain unchanged, and the one-dimensional original histogram sequence is determined as a smooth distribution histogram sequence.
[0024] Specifically, based on the one-dimensional original histogram sequence, the Shannon entropy corresponding to the histogram within each three-dimensional spatiotemporal block is calculated. First, the original histogram corresponding to one three-dimensional spatiotemporal block is read. This histogram records the frequency values of 256 hierarchical intervals from 0 to 255. All 256 frequency values are summed to obtain the total number of pixels within that three-dimensional spatiotemporal block, denoted as . For each class interval (From 0 to 255), determine its frequency value. Divide by the total number of pixels Calculate the probability distribution value of the occurrence of this gray level. Then, according to the definition of Shannon entropy, the contribution of each level interval to the uncertainty of the histogram is calculated item by item. When it is not 0, its contribution is If the probability If the value is 0, its contribution is defined as 0 to avoid the domain problem of logarithmic operations. The contributions corresponding to all 256 hierarchical intervals are accumulated and summed to obtain the final Shannon entropy value of the original histogram. The calculation formula is expressed as: ,in, This represents the Shannon entropy value of the three-dimensional spacetime block. For the first The probability distribution values of each hierarchical interval are calculated, and the above calculation process is repeated for each original histogram in the one-dimensional original histogram sequence to generate a corresponding Shannon entropy value for each three-dimensional spatiotemporal block.
[0025] The Shannon entropy value of each 3D spatiotemporal block calculated in the previous step is compared one by one with a preset entropy limit boundary condition. The method for setting the entropy limit boundary condition is as follows: First, collect the Shannon entropy values of all 3D spatiotemporal blocks in the dataset to form an entropy value set, and calculate the average value of the set. and standard deviation Entropy limit Then set it to an empirical value related to the statistic, for example... This setup aims to identify image patches with significantly lower information content and monotonous content, when the Shannon entropy value of a certain 3D spatiotemporal patch is less than... When it is determined that the histogram of the block needs to be smoothed, the entropy difference is calculated. Based on this difference, the parameters of the one-dimensional Gaussian kernel are adjusted; specifically, the standard deviation of the Gaussian kernel... Set as ,in It is a base standard deviation, for example, set to 0.8. This is a scaling factor, for example, set to 0.1. This proportionally increasing relationship results in a stronger smoothing effect for histograms with lower entropy values. Then, this Gaussian kernel is used to perform a one-dimensional convolution operation with the original one-dimensional histogram sequence of that block. That is, for each hierarchical interval of the histogram, its new frequency value is replaced by a weighted average of its original value and the frequency values of adjacent intervals. The weights are determined by the value of the Gaussian kernel in that interval and its neighboring positions. After continuous processing of all hierarchical intervals, a smooth distribution histogram sequence is generated. Conversely, when the Shannon entropy value is greater than or equal to... If the histogram contains sufficiently rich information, it is considered that there is no need for smoothing. Its original frequency values, hierarchical interval labels and arrangement order are kept unchanged, and this one-dimensional original histogram sequence is directly determined as the smooth distribution histogram sequence of the block.
[0026] The steps to obtain the spatiotemporal temporal variance distribution are as follows: Simultaneously, the three-dimensional brightness pixel set is retrieved, and the spatial position of each pixel in the continuous frame is locked according to the horizontal and vertical coordinates. The brightness grayscale values of all pixels corresponding to the same spatial position are extracted along the time axis coordinate direction. The number of brightness grayscale values of all pixels is counted, and the average value of all brightness grayscale values of all pixels is calculated. The difference between each pixel brightness grayscale value and the average value is calculated item by item, and the difference is squared. All squared results are accumulated, and the accumulated results are normalized according to the number of pixel brightness grayscale values to obtain the discrete variance value of each pixel brightness grayscale value. All discrete variance values are arranged according to the horizontal and vertical coordinates and the three-dimensional spatiotemporal block number to generate a spatiotemporal time variance distribution.
[0027] Specifically, the three-dimensional brightness pixel set is retrieved simultaneously, and temporal variance calculation is performed on the data within each three-dimensional spatiotemporal block. The specific operation is as follows: within a three-dimensional spatiotemporal block, each spatial pixel position is traversed according to its covered horizontal and vertical coordinates. For fixed Along the time axis coordinate direction, extract the continuous frames covered by the current 3D spatiotemporal block for that spatial location (e.g., time axis coordinate from...). arrive The total grayscale values of all pixels in the dataset are used to form a time-series list of brightness values. Count the number of pixel brightness grayscale values in this list, and denote it as . Then, the average of these brightness values is calculated. Then calculate each brightness value in the list item by item. Compared with the average The difference between the values is calculated, and each difference is squared to obtain a series of squared differences. All these squared differences are then summed. To obtain a normalized discrete variance value, this cumulative sum of squares is divided by the number of brightness values. (or unbiased estimation) ), thus calculating in At this spatial location, the degree of fluctuation of the brightness value over the time dimension, i.e., the discrete variance value, applies to all spatial locations within the current three-dimensional spatiotemporal block. Repeat this process, and associate and store each calculated discrete variance value with its x-coordinate, y-coordinate and the corresponding 3D spatiotemporal block number, ultimately generating a spatiotemporal variance distribution covering all 3D spatiotemporal blocks.
[0028] The steps for obtaining the dynamic adaptive limit are as follows: Based on the spatiotemporal variance distribution, according to the arrangement order of the three-dimensional spatiotemporal block number, x-coordinate, and y-coordinate, the variance values corresponding to the pixel brightness grayscale values of each point are read item by item. Each variance value is compared with the preset variance threshold value. When the variance value is greater than the preset variance threshold value, the difference between the variance value and the preset variance threshold value is calculated. According to the increasing direction of the difference, a weighting parameter with a value less than one is determined. When the variance value is less than or equal to the preset variance threshold value, the difference between the preset variance threshold value and the variance value is calculated. According to the increasing direction of the difference, a weighting parameter with a value greater than one is determined. The three-dimensional spatiotemporal block number, x-coordinate, and y-coordinate corresponding to each weighting parameter or weighting parameter are retained to obtain the corresponding weighting parameter. Based on the 3D spatiotemporal block number, x-coordinate, and y-coordinate carried by the corresponding weight parameters, the preset basic contrast limit boundary value corresponding to the same position is retrieved. The increase weight parameter with a value greater than one is multiplied by the preset basic contrast limit boundary value, so that the limit boundary value at the corresponding position increases proportionally to the increase weight parameter value. The decrease weight parameter with a value less than one is multiplied by the preset basic contrast limit boundary value, so that the limit boundary value at the corresponding position decreases proportionally to the decrease weight parameter value. The limit boundary values at each position within each 3D spatiotemporal block after the multiplication operation are recorded respectively, generating a dynamic adaptive limit value.
[0029] Specifically, based on the spatiotemporal variance distribution generated in the previous step, each spatial location is read item by item according to the index order of the three-dimensional spatiotemporal block number, x-coordinate, and y-coordinate. Corresponding brightness time variance value And compare this variance value with a preset variance threshold. The limit was compared. The setting is based on empirical values derived from statistical analysis of a large number of low-light video samples, aiming to distinguish between static / low-noise regions and dynamic / high-noise regions. For example, for an 8-bit grayscale image, the variance value is typically between 0 and several thousand, and a value such as... can be set. The limit value, when the variance value Greater than When this occurs, it indicates that the pixel has undergone significant changes over time (such as motion or noise), and the difference exceeding the limit is calculated. Based on this difference, a weight reduction parameter with a value less than 1 is determined. Its calculation method is as follows ,in It is a reduction factor, such as 0.01, and the weight is at least 0.5 to prevent over-suppression. When the variance value... Less than or equal to When this occurs, it indicates that the pixel is in a relatively static region, and the difference between its value and the limit is calculated. Based on this difference, a weighting parameter with a value greater than 1 is determined. The calculation method is as follows ,in It is an increase coefficient, such as 0.02, and the weight does not exceed 1.5 to prevent over-enhancement. After processing each pixel, the calculated weight reduction or weight increase parameters, along with their corresponding 3D spatiotemporal block number, x-coordinate and y-coordinate information, are retained to form the corresponding weight parameter set.
[0030] Based on the 3D spatiotemporal block number, x-coordinate, and y-coordinate information carried in the corresponding weight parameter set, the preset basic contrast limit value corresponding to each pixel position is retrieved and processed. It is uniformly set for each 3D spatiotemporal block, and its purpose is to initially limit the degree of contrast amplification during the histogram equalization process. Its value is calculated in the following way: First, determine the total number of pixels in the 3D spatiotemporal block. (For example, a 32×32×8 block with a total of 8192 pixels), then set a contrast limit factor. This factor is an empirical value, typically ranging from 2 to 10. For example, taking... The basic contrast limit value is then calculated as follows: ,in This is the number of hierarchical intervals in the histogram (usually 256). Based on this example, For each pixel position within the three-dimensional spatiotemporal block Extract its corresponding weight parameters and the basic contrast limit value of this block Perform multiplication if If the weighting parameter is greater than 1, the product will cause the limit value at the corresponding position to increase proportionally; conversely, if... A weighting parameter less than 1 will decrease the weighting parameter in the product, resulting in a local constraint value for each pixel location. To obtain a single constraint value that applies to the entire 3D spatiotemporal block, the local constraint values for all pixel locations within that block are... To average, that is, to calculate ,in and It is the spatial dimension of the block, and the average value is the final dynamic adaptive limit of the three-dimensional spatiotemporal block.
[0031] The steps to obtain the restricted histogram sequence are as follows: Retrieve the corresponding smooth distribution histogram sequence according to the three-dimensional spatiotemporal block number. Read the frequency values item by item according to the hierarchical interval arrangement order. Compare the frequency value of each hierarchical interval with the corresponding dynamic adaptive limit. When the frequency value is greater than the dynamic adaptive limit, truncate the frequency value to the dynamic adaptive limit. Record the excess frequency value obtained by subtracting the dynamic adaptive limit from the frequency value before truncation. When the frequency value is less than or equal to the dynamic adaptive limit, retain the original frequency value. Accumulate the excess frequency values corresponding to all hierarchical intervals. Calculate the average distribution frequency value according to the number of hierarchical intervals in the smooth distribution histogram sequence. Add the average distribution frequency value to the retained frequency value or truncated frequency value of each hierarchical interval. Rearrange the accumulated frequency values according to the original hierarchical interval arrangement order to obtain the restricted histogram sequence.
[0032] Specifically, based on the numbering of the three-dimensional spatiotemporal blocks, the corresponding smooth distribution histogram sequence and the dynamically adaptive constraint limit calculated in the previous step are retrieved. Then, the histogram is truncated and redistributed, starting by initializing a variable that accumulates the excess frequency values. If the value is 0, then according to the hierarchical intervals of the histogram (e.g., 0 to 255), read the frequency value of each interval one by one. ,Will With dynamic adaptive limit Compare, if This means that the frequency of that interval is too high and needs to be truncated. In this case, the frequency value of that interval is forcibly set to [value missing]. Simultaneously calculate and record the values of the truncated excess frequencies. And accumulate this difference to In, that is ,if If the frequency value of that interval remains unchanged, after traversing all 256 hierarchical intervals, the variable... The system stores the total frequency count truncated from all high-frequency intervals. To maintain the total number of pixels, this excess frequency count needs to be redistributed across all hierarchical intervals, calculating the average frequency count distributed to each hierarchical interval. Where 256 is the total number of hierarchical intervals, we iterate through all hierarchical intervals again and assign this evenly distributed frequency value. The values are added equally to the frequency values after processing (truncated or retained) in each interval to form a new frequency value. All new frequency values By rearranging the original hierarchical intervals, the restricted histogram sequence of the three-dimensional spatiotemporal block is obtained.
[0033] The steps for obtaining the enhanced video sequence in a short video are as follows: Based on the constrained histogram sequence, according to the hierarchical intervals corresponding to pixel brightness grayscale values, the frequency values of each discrete node are read item by item. The frequency value of the first discrete node is registered as the first cumulative frequency value. Starting from the second discrete node, the cumulative frequency value corresponding to the previous discrete node is retrieved in sequence. The cumulative frequency value corresponding to the previous discrete node is added to the frequency value of the current discrete node to obtain the cumulative frequency value corresponding to the current discrete node. The accumulation operation is continuously performed until all discrete nodes are processed. The sum of the frequency values of all discrete nodes is calculated. Each cumulative frequency value is converted into a cumulative ratio according to the sum of the frequency values of all discrete nodes. A correspondence is established according to the three-dimensional spatiotemporal block number, hierarchical interval, and cumulative ratio to construct a spatiotemporal cumulative distribution function. Retrieve the x-coordinate, y-coordinate, time axis coordinate, and pixel brightness grayscale value of each pixel in the 3D brightness pixel set. Determine the overlapping position of the 3D spatiotemporal block where each pixel is located according to the x-coordinate, y-coordinate, and time axis coordinates. Search for the center point of the adjacent 3D spatiotemporal block surrounding each pixel. Read the spatiotemporal cumulative distribution function corresponding to the center point of each adjacent 3D spatiotemporal block. Locate the cumulative proportion interval in each spatiotemporal cumulative distribution function according to the pixel brightness grayscale value. Calculate the relative distance ratio from each pixel to the center point of each adjacent 3D spatiotemporal block in the x-coordinate direction, y-coordinate direction, and time axis direction. Determine the interpolation ratio corresponding to the center point of each adjacent 3D spatiotemporal block according to the relative distance ratio in the three coordinate directions. Weight the brightness mapping results corresponding to each cumulative proportion interval according to the interpolation ratio. Record the weighted accumulation result according to the x-coordinate, y-coordinate, and time axis coordinates of each pixel to generate a pixel brightness mapping matrix. The original color channel components are retrieved frame by frame according to the frame number of a series of consecutive video images. The horizontal, vertical, and time axis coordinates corresponding to each original color channel component are read. The brightness mapping result in the pixel brightness mapping matrix is retrieved according to the same horizontal, vertical, and time axis coordinates. The brightness mapping result is written to the corresponding spatial position and replaces the original pixel brightness grayscale value at the same spatial position in the series of consecutive video images. The ratio coefficient between the brightness mapping result and the original pixel brightness grayscale value at the corresponding position is calculated. The color components other than the original pixel brightness grayscale value in the original color channel components are retained. The color components are multiplied by the ratio coefficient for adaptive saturation compensation to generate compensated color components. The replaced pixel brightness grayscale value and compensated color components are recombined according to the spatial position. The continuous arrangement relationship is restored according to the frame number, and the short video enhanced picture sequence is output.
[0034] Specifically, based on the restricted histogram sequence, a brightness mapping function, i.e., a spatiotemporal cumulative distribution function, is constructed for each 3D spatiotemporal block. The specific process is as follows: For the restricted histogram of a 3D spatiotemporal block, the frequency values of each discrete node are read item by item according to the order of the hierarchical intervals (0 to 255) corresponding to the pixel brightness grayscale values. Initialize a cumulative distribution function array CDF, also of size 256, and set the frequency value of the first discrete node (level 0) to... It is directly registered as the first cumulative frequency value, i.e. Starting from the second discrete node (level 1), iterative accumulation is performed on the current discrete node. The corresponding cumulative frequency value is obtained by retrieving the previous node. Cumulative frequency value And add the frequency value of the current node itself. To obtain, that is This cumulative summation operation continues until the last discrete node (level 255) has been processed. The value is the total number of pixels within the three-dimensional spatiotemporal block. Then, to normalize the cumulative distribution function, the cumulative frequency value in the CDF array is... Divide all by the total number of pixels This transforms the numerical range from absolute count values to cumulative proportions in the [0, 1] interval. A one-to-one correspondence is established between the number of each three-dimensional spatiotemporal block, each hierarchical interval (0-255) within it, and the normalized cumulative proportion corresponding to that hierarchical interval, and stored. This constructs a set composed of the cumulative distribution functions of all three-dimensional spatiotemporal blocks, namely the spatiotemporal cumulative distribution function.
[0035] Retrieve the complete coordinate information (horizontal coordinate, vertical coordinate, and time axis coordinate) of each pixel recorded in the three-dimensional brightness pixel set, along with its original pixel brightness grayscale value. Calculate a new brightness value for each pixel. Specifically, for a pixel located at... Coordinates, original brightness For a given pixel, firstly, based on its coordinates and the division method of the 3D spatiotemporal blocks, determine the center points of the eight nearest 3D spatiotemporal blocks surrounding the pixel. Then, read the spatiotemporal cumulative distribution function (CDF) corresponding to each of these eight adjacent 3D spatiotemporal blocks. For each CDF, use the pixel's original luminance value. As an index, a query or interpolation yields a corresponding cumulative ratio value. This ratio value, multiplied by the maximum brightness level (e.g., 255), becomes a candidate output brightness value. (in (ranging from 1 to 8), then calculate the pixel. The relative distance ratios to the center points of these eight 3D spatiotemporal blocks in the three directions of the horizontal axis, vertical axis, and time axis are calculated. For example, in the x-direction, the distance ratio between the pixel's x-coordinate and the x-coordinates of the two block centers surrounding it is calculated. The relative distance ratios in these three directions together determine the candidate brightness value in the 3D linear interpolation (i.e., trilinear interpolation). The weights, and the final output brightness value It is the weighted sum of these 8 candidate brightness values based on interpolation weights. For example, if the relative positions of the pixels in the three dimensions are... Then its final brightness can be expressed as a weighted sum of the values of the 8 vertices, with the weights as follows: This process is repeated for each pixel in the video sequence, and the calculated weighted summation result is recorded according to its original horizontal, vertical and time axis coordinates to generate a three-dimensional pixel brightness mapping matrix with the same size as the original video sequence.
[0036] Based on the original frame numbers of multiple consecutive video images, the original color channel components are retrieved frame by frame, namely the chrominance components Cb and Cr separated during the initial conversion from RGB to YCbCr space. Simultaneously, the position of each pixel is read. The corresponding original brightness Y value, then according to the same coordinates The enhanced new brightness value Y' is retrieved from the pixel brightness mapping matrix generated in the previous step, and this new brightness value Y' is written into the corresponding spatial position to replace the original brightness value Y at that position. In order to correct the problem of decreased color saturation that may be caused by the increase in brightness, the ratio coefficient between the old and new brightness values is calculated. The calculation method is as follows ,in This is a very small positive constant (e.g., 1e-6) to avoid division by zero errors when the original luminance Y is 0. The original chromaticity components Cb and Cr are then multiplied by this scaling factor. The new chromaticity components after adaptive saturation compensation are obtained. and The calculation results are truncated to ensure that the values are within the valid chromaticity range (e.g., for 8-bit video, the range is typically 16 to 240). After processing a single pixel, the enhanced luminance component Y' and the compensated chromaticity components Cb' and Cr' are recombined into a complete YCbCr pixel at their corresponding spatial positions. This process is repeated for all pixels in a frame. The processed YCbCr image frame is then converted back to the RGB color space. All processed RGB image frames are restored to their original consecutive arrangement according to their original frame numbers, and the final short video enhancement sequence is output.
[0037] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for image enhancement in low-light scenes of short videos, characterized in that, Includes the following steps: Acquire multiple consecutive video images, extract the luminance channel components and stack them according to the time axis coordinate sequence to construct a three-dimensional spatiotemporal grid, and divide the three-dimensional spatiotemporal grid into multiple three-dimensional spatiotemporal blocks with overlapping regions according to a preset step size; Extract the brightness grayscale values of the associated pixels within each of the three-dimensional spatiotemporal blocks to generate a three-dimensional brightness pixel set, and count the frequency values of the three-dimensional brightness pixel set to construct a one-dimensional original histogram sequence; Calculate the Shannon entropy values corresponding to the probability distributions of each item in the one-dimensional original histogram sequence. Based on the comparison results between the Shannon entropy values and the preset entropy limit boundary conditions, selectively use the preset one-dimensional Gaussian kernel parameters to perform operations on the one-dimensional original histogram sequence to generate a smooth distribution histogram sequence. Calculate the time axis discrete variance of the three-dimensional brightness pixel set to generate a spatiotemporal temporal variance distribution; The variance values of each item in the spatiotemporal variance distribution are compared with the preset variance threshold values, and the corresponding weight parameters are assigned by decreasing or increasing the weight parameters according to the comparison results. The corresponding weight parameters are calculated by operating on the preset basic contrast limit value to obtain a dynamic adaptive limit value; excess frequency values exceeding the dynamic adaptive limit value are truncated within the smooth distribution histogram sequence and equally distributed and accumulated to obtain a restricted histogram sequence.
2. The image enhancement method for low-light scenes in short videos according to claim 1, characterized in that, The method further includes: A spatiotemporal cumulative distribution function is constructed by accumulating and summing the frequency values of each discrete node in the restricted histogram sequence; based on the three-dimensional brightness pixel set, an operation is performed within the interval between the center point of the adjacent three-dimensional spatiotemporal block and the corresponding spatiotemporal cumulative distribution function to generate a pixel brightness mapping matrix; The pixel brightness mapping matrix is merged with the original color channel components of multiple consecutive video frames. The original color channel components are then compensated for color saturation based on the ratio of the change in pixel brightness grayscale values between the pixel brightness mapping matrix and the original pixel brightness grayscale values. This compensates for the original pixel brightness grayscale values and outputs a short video enhanced image sequence.
3. The image enhancement method for low-light scenes in short videos according to claim 1, characterized in that, The steps for obtaining the three-dimensional brightness pixel set are as follows: The system acquires multiple frames of video images arranged sequentially according to the shooting time in a low-light scene of a short video. It reads the horizontal pixel position, vertical pixel position, frame number and corresponding pixel value of the video image frame by frame. It separates the luminance channel component reflecting the brightness of the pixel from the original color channel components of each frame video image. The luminance channel components of each frame are stacked layer by layer along the time axis coordinate in ascending order of frame number so that the luminance channel components with the same horizontal and vertical coordinate positions correspond to the continuous time axis coordinates, forming a three-dimensional spatiotemporal grid composed of the intersection of horizontal, vertical and time axis coordinates. The system moves along the horizontal, vertical and time axis coordinate directions of the three-dimensional spatiotemporal grid according to the preset step size to divide the boundary, and controls the spatial and temporal overlap range between adjacent dividing boundaries to generate multiple three-dimensional spatiotemporal blocks. According to the starting and ending positions of the horizontal coordinate, the starting and ending positions of the vertical coordinate, the starting and ending positions of the time axis coordinate, and the ending positions of the time axis coordinate corresponding to each three-dimensional spatiotemporal block, the brightness channel components falling within the coordinate boundaries are retrieved point by point. The horizontal coordinate, vertical coordinate, time axis coordinate, and pixel brightness grayscale value corresponding to each brightness channel component are recorded. The pixel brightness grayscale values within the spatial or temporal overlap range are retained in their respective three-dimensional spatiotemporal blocks. The associated pixel brightness grayscale values are organized according to the three-dimensional spatiotemporal block number. Pixel brightness grayscale values whose coordinates exceed the boundary of the corresponding three-dimensional spatiotemporal block are deleted to generate a three-dimensional brightness pixel set.
4. The image enhancement method for low-light scenes in short videos according to claim 1, characterized in that, The steps for obtaining the one-dimensional original histogram sequence are as follows: Based on the three-dimensional brightness pixel set, the pixel brightness grayscale value inside each three-dimensional spatiotemporal block is read item by item. Continuous hierarchical intervals are set according to the ascending order of pixel brightness grayscale values. Each pixel brightness grayscale value is assigned to the hierarchical interval corresponding to the numerical boundary. The occurrence frequency of pixel brightness grayscale values in each hierarchical interval is accumulated. Pixel brightness grayscale values falling into the boundary position of the hierarchical interval are individually classified according to the preset boundary assignment rules. The frequency values corresponding to each hierarchical interval are recorded according to the hierarchical interval arrangement order. The hierarchical interval identifiers and frequency values are arranged sequentially to construct a one-dimensional original histogram sequence.
5. The image enhancement method for low-light scenes in short videos according to claim 1, characterized in that, The steps for obtaining the smooth distribution histogram sequence are as follows: Based on the one-dimensional original histogram sequence, read the frequency values corresponding to each level interval, accumulate the total frequency values of all level intervals, divide the frequency value of each level interval by the total frequency values to obtain the probability distribution value corresponding to each level interval, calculate the contribution of the probability distribution value to the uncertainty of the one-dimensional original histogram sequence item by item, accumulate the contribution of all level intervals, and generate the Shannon entropy value. The Shannon entropy value is compared with a preset entropy limit boundary condition. When the Shannon entropy value is less than the preset entropy limit boundary condition, the difference between the preset entropy limit boundary condition and the Shannon entropy value is calculated. Based on the difference, the standard deviation of the one-dimensional Gaussian kernel parameter is increased proportionally, and the corresponding preset one-dimensional Gaussian kernel parameter is extracted. According to the hierarchical interval arrangement order of the one-dimensional original histogram sequence, the one-dimensional Gaussian kernel parameter is sequentially mapped to the current hierarchical interval and the adjacent hierarchical interval. The product of the frequency value of each hierarchical interval and the corresponding one-dimensional Gaussian kernel parameter is calculated respectively. All product results within the coverage of the current hierarchical interval are accumulated. The accumulated results are used to replace the original frequency value of the current hierarchical interval, and the continuous processing of all hierarchical intervals of the one-dimensional original histogram sequence is completed to generate a smooth distribution histogram sequence. When the Shannon entropy value is greater than or equal to the preset entropy limit boundary condition, the frequency value, hierarchical interval identifier and arrangement order of each hierarchical interval in the one-dimensional original histogram sequence remain unchanged, and the one-dimensional original histogram sequence is determined as a smooth distribution histogram sequence.
6. The image enhancement method for low-light scenes in short videos according to claim 1, characterized in that, The steps for obtaining the spatiotemporal temporal variance distribution are as follows: Simultaneously, the three-dimensional brightness pixel set is retrieved, and the spatial position of each pixel in the continuous frame is locked according to the horizontal and vertical coordinates. The brightness gray values of all pixels corresponding to the same spatial position are extracted along the time axis coordinate direction. The number of brightness gray values of all pixels is counted, and the average value of all brightness gray values is calculated. The difference between each pixel brightness gray value and the average value is calculated item by item, and the difference is squared respectively. All squared results are accumulated, and the accumulated results are normalized according to the number of pixel brightness gray values to obtain the discrete variance value of each pixel brightness gray value. All discrete variance values are arranged according to the horizontal and vertical coordinates and the three-dimensional spatiotemporal block number to generate a spatiotemporal time variance distribution.
7. The image enhancement method for low-light scenes in short videos according to claim 1, characterized in that, The steps for obtaining the dynamic adaptive limit value are as follows: Based on the spatiotemporal variance distribution, according to the arrangement order of the three-dimensional spatiotemporal block number, x-coordinate, and y-coordinate, the variance values corresponding to the pixel brightness grayscale values of each point are read item by item. Each variance value is compared with a preset variance threshold value. When the variance value is greater than the preset variance threshold value, the difference between the variance value and the preset variance threshold value is calculated. According to the increasing direction of the difference, a weighting parameter with a value less than one is determined. When the variance value is less than or equal to the preset variance threshold value, the difference between the preset variance threshold value and the variance value is calculated. According to the increasing direction of the difference, a weighting parameter with a value greater than one is determined. The three-dimensional spatiotemporal block number, x-coordinate, and y-coordinate corresponding to each weighting parameter or weighting parameter are retained to obtain the corresponding weighting parameter. According to the three-dimensional spatiotemporal block number, x-coordinate, and y-coordinate carried by the corresponding weight parameters, the preset basic contrast limit boundary value corresponding to the same position is retrieved. The increase weight parameter with a value greater than one is multiplied by the preset basic contrast limit boundary value, so that the limit boundary value at the corresponding position increases proportionally to the increase weight parameter value. The decrease weight parameter with a value less than one is multiplied by the preset basic contrast limit boundary value, so that the limit boundary value at the corresponding position decreases proportionally to the decrease weight parameter value. The limit boundary values at each position within each three-dimensional spatiotemporal block after the multiplication operation are recorded respectively, generating a dynamic adaptive limit value.
8. The image enhancement method for low-light scenes in short videos according to claim 1, characterized in that, The steps for obtaining the restricted histogram sequence are as follows: Retrieve the corresponding smooth distribution histogram sequence according to the three-dimensional spatiotemporal block number. Read the frequency values item by item according to the hierarchical interval arrangement order. Compare the frequency value of each hierarchical interval with the corresponding dynamic adaptive limit. When the frequency value is greater than the dynamic adaptive limit, truncate the frequency value to the dynamic adaptive limit. Record the excess frequency value obtained by subtracting the dynamic adaptive limit from the frequency value before truncation. When the frequency value is less than or equal to the dynamic adaptive limit, retain the original frequency value. Accumulate the excess frequency values corresponding to all hierarchical intervals. Calculate the average distribution frequency value according to the number of hierarchical intervals in the smooth distribution histogram sequence. Add the average distribution frequency value to the retained frequency value or truncated frequency value of each hierarchical interval. Rearrange the accumulated frequency values according to the original hierarchical interval arrangement order to obtain the restricted histogram sequence.
9. The image enhancement method for low-light scenes in short videos according to claim 2, characterized in that, The steps for obtaining the enhanced short video sequence are as follows: According to the restricted histogram sequence, the frequency values of each discrete node are read one by one according to the hierarchical intervals corresponding to the pixel brightness grayscale values. The frequency value of the first discrete node is registered as the first cumulative frequency value. Starting from the second discrete node, the cumulative frequency value corresponding to the previous discrete node is retrieved in sequence. The cumulative frequency value corresponding to the previous discrete node is added to the frequency value of the current discrete node to obtain the cumulative frequency value corresponding to the current discrete node. The accumulation operation is continuously performed until all discrete nodes are processed. The sum of the frequency values of all discrete nodes is calculated. Each cumulative frequency value is converted into a cumulative ratio according to the sum of the frequency values of all discrete nodes. A correspondence is established according to the three-dimensional spatiotemporal block number, hierarchical interval, and cumulative ratio to construct a spatiotemporal cumulative distribution function. The abscissa, ordinate, time axis coordinate, and pixel brightness grayscale value of each pixel in the three-dimensional brightness pixel set are retrieved. The overlapping position of the three-dimensional spatiotemporal block where each pixel is located is determined according to the abscissa, ordinate, and time axis coordinates. The center point of the adjacent three-dimensional spatiotemporal block surrounding each pixel is retrieved. The spatiotemporal cumulative distribution function corresponding to the center point of each adjacent three-dimensional spatiotemporal block is read. The cumulative proportion interval in each spatiotemporal cumulative distribution function is located according to the pixel brightness grayscale value. The relative distance ratio from each pixel to the center point of each adjacent three-dimensional spatiotemporal block in the abscissa direction, ordinate direction, and time axis direction is calculated respectively. The interpolation ratio corresponding to the center point of each adjacent three-dimensional spatiotemporal block is determined according to the relative distance ratio in the three coordinate directions. The brightness mapping results corresponding to each cumulative proportion interval are weighted and accumulated according to the interpolation ratio. The weighted accumulation result is recorded according to the abscissa, ordinate, and time axis coordinates of each pixel to generate a pixel brightness mapping matrix. The original color channel components are retrieved frame by frame according to the frame number of a series of consecutive video images. The horizontal, vertical, and time axis coordinates corresponding to each original color channel component are read. The brightness mapping result in the pixel brightness mapping matrix is retrieved according to the same horizontal, vertical, and time axis coordinates. The brightness mapping result is written to the corresponding spatial position to replace the original pixel brightness grayscale value at the same spatial position in the series of consecutive video images. The ratio coefficient between the brightness mapping result and the original pixel brightness grayscale value at the corresponding position is calculated. The color components other than the original pixel brightness grayscale value in the original color channel components are retained. The color components are multiplied by the ratio coefficient to perform adaptive saturation compensation to generate compensated color components. The replaced pixel brightness grayscale value and the compensated color components are recombined according to the spatial position. The continuous arrangement relationship is restored according to the frame number to output the short video enhanced picture sequence.