Image strong light inhibition method and system
By performing single-frame image decomposition, subject recognition and lighting area segmentation on the vehicle camera video, combined with image fusion technology, the problem of poor processing effect of gradient grayscale mirror in the strong light area is solved, and the lighting and brightness consistency of the video is significantly improved. A more natural visual effect is achieved.
Patent Information
- Application Number
- CN202411118367.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-08-15
AI Technical Summary
In the prior art, the gradient grayscale mirror is used for strong light suppression and has poor processing effect in the strong light area, which affects the clarity of the video.
By obtaining the input video, decompose it into a single frame image and performing subject recognition and grouping marking, adjusting saturation, contrast and brightness according to the preset threshold, calculating the brightness histogram to segment the lighting area, selecting the reference image and fusion, converting high brightness and The brightness value of the overexposure area is finally spliced into a suppressed video.
Significantly improves the lighting, saturation and brightness of the video, improves the visual effect, makes the image more natural and comfortable, and retains important details and dynamic changes.
Smart Images

Figure CN119136064A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual imaging technology, and in particular to a method and system for suppressing image glare. Background Art
[0002] Traditional vehicle-mounted cameras often have difficulty capturing clear images at night or in dim environments due to insufficient light. Especially when facing strong light sources, images are more likely to be overexposed or have uneven brightness, which seriously affects the driver's judgment. Therefore, it is particularly important to develop a vehicle-mounted night vision camera technology that can automatically adapt to complex lighting conditions at night, effectively suppress overexposure, and improve image contrast and brightness.
[0003] At present, the Chinese invention patent application number CN201510657615.6 discloses a method for suppressing strong light based on a gradient grayscale mirror. The transmittance V(d) of the gradient grayscale mirror is The gradient filter is directly proportional to the light intensity of the image; H represents the height of the gradient grayscale mirror, d represents the height from the lower edge of the gradient grayscale mirror, and V(d) represents the light transmittance at a vertical distance d from the lower edge of the gradient grayscale mirror. The method of using the gradient filter to suppress strong light is to set the gradient grayscale mirror on a filter switching device. When the moving headlights of a car are detected in the monitoring picture, the gradient grayscale mirror of the filter switching device is switched to the optical path where the lens and the sensor are located. Although this invention can effectively suppress the glare, ghosting and image overexposure problems in the monitoring picture, and will not reduce the overall exposure of the monitoring picture, and will not affect the license plate capture, the processing effect of the gradient grayscale mirror on the strong light area is poor, which affects the clarity of the final video. Summary of the invention
[0004] The technical problem solved by the present invention is: in the related technology, although the problems of glare, ghosting and image overexposure in the monitoring screen can be effectively suppressed, and the overall exposure of the monitoring screen will not be reduced, and the license plate capture will not be affected, the processing effect of the strong light area through the gradient grayscale filter is poor, which affects the clarity of the final video.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: In a first aspect, a method for suppressing image glare includes the following steps: Step S1, obtaining an input video, and decomposing the input video into single-frame images, performing subject recognition on the single-frame images, grouping and marking them according to the subjects, and outputting them as image groups.
[0006] Step S2, according to the preset saturation threshold and saturation gradient value, contrast threshold and contrast gradient value, and brightness threshold and brightness gradient value, the saturation, contrast and brightness of the single-frame image in each image group are gradient-adjusted to obtain a single-frame image group, edge detection is performed on the main part of the single-frame image under each gradient in the single-frame image group, and the edge lines are obtained and stored.
[0007] Step S3, calculate the brightness histogram of each single-frame image, divide each single-frame image into a normal lighting area, a high brightness area and an overexposed area according to a preset standard brightness threshold and a brightness histogram, and store them, select a reference image, record the image parameters of the reference image, and apply the image parameters to all single-frame images in the image group.
[0008] Step S4, performing image fusion on the reference image and other single-frame images in the image group except the reference image.
[0009] Step S5, respectively calculating the channel histograms of the corresponding reference area, high brightness area and overexposed area on the single frame image in the image group and calculating the cumulative distribution function, and converting each brightness value of the high brightness area and the overexposed area into the brightness value of the corresponding reference area.
[0010] Step S6, stitching the converted reference area, high brightness area and over-exposed area to obtain a suppressed single-frame image, and re-stitching the suppressed single-frame image into a processed video and outputting it.
[0011] Preferably, the step S1 includes the following sub-steps: Step S101, obtain input video, set the export format to all frames, decompose it into single frame images and add corresponding timestamps.
[0012] Step S102, converting a single frame image into a grayscale image and storing it separately, using a pre-trained convolutional neural network to extract high-level image feature vectors in the grayscale image, calculating the Euclidean distance between the image feature vectors, merging the images with the smallest Euclidean distance into an image group, and outputting the image group.
[0013] Preferably, step S2 includes the following sub-steps: Step S201, input the preset saturation threshold and saturation gradient value, contrast threshold and contrast gradient value, and brightness threshold and brightness gradient value, adjust the single-frame image in each image group, and obtain single-frame image groups with different saturation, contrast and brightness.
[0014] Step S202, perform Gaussian blur on the grayscale image, use the Sobel operator to calculate the gradients in the horizontal and vertical directions, calculate the gradient amplitude and direction by combining the gradients in the horizontal and vertical directions, and mark the pixels whose gradient amplitude is greater than a preset edge threshold as edge pixels.
[0015] Step S203: Merge edge pixels and output them as edge lines, save them as an array and store them.
[0016] Preferably, step S3 includes the following sub-steps: Step S301 , calculating the brightness histogram of each single frame image, dividing each single frame image into a normal illumination area, a high brightness area and an overexposure area according to a preset standard brightness threshold and storing them.
[0017] Step S302, calculating the number of breakpoints of each edge line, and selecting the edge line with the least number of breakpoints as a clear edge line.
[0018] Step S303, calculate the area overlap between the image within the clear edge line and the normal lighting area, select the single-frame image with the largest area overlap and mark it as the reference image, record the saturation, contrast and brightness of the reference image, and apply it to all single-frame images in the image group corresponding to the reference image.
[0019] Preferably, step S4 includes the following sub-steps: Step S401 , marking a normal illumination area of a reference image as a reference area, calculating pixel gradient information of the reference area and a background area other than the reference area near a boundary of the reference area, and outputting and storing the information as standard gradient information.
[0020] Step S402, respectively calculating the gradient information and coordinates between adjacent pixel points of other single-frame images in the image group except the reference image, and merging and outputting them as the gradient information to be fused.
[0021] Step S403, inputting the standard gradient information into the gradient information to be fused, searching for coordinates corresponding to the gradient information to be fused that matches the standard gradient information, and fusion of the reference image onto other single-frame images in the image group except the reference image.
[0022] Preferably, step S5 includes the following sub-steps: Step S501 , respectively calculating the histograms of the reference area, the high brightness area and the overexposure area of the single frame image, and outputting them as a reference channel histogram, a high brightness channel histogram and an overexposure channel histogram.
[0023] Step S502, calculating the cumulative distribution function according to the reference channel histogram, the high brightness channel histogram and the overexposure channel histogram, and outputting the reference cumulative distribution function, the high brightness cumulative distribution function and the overexposure cumulative distribution function.
[0024] Step S503 , mapping the high brightness cumulative distribution function and the overexposure cumulative distribution function to the reference cumulative distribution function, and outputting the mapping relationship.
[0025] Step S504 : converting each brightness value of the high brightness area and the overexposed area into a brightness value of a corresponding reference area according to the mapping relationship.
[0026] Preferably, step S6 includes the following sub-steps: Step S601, stitching the adjusted reference area, high brightness area and over-exposed area to generate a suppressed single frame image.
[0027] Step S602 , stitching the adjusted single-frame images into a new video according to the timestamps of the adjusted single-frame images, and outputting the new video as a processed video.
[0028] In a second aspect, an image strong light suppression system includes a preliminary processing module, a strong light suppression module and a video output module: The preliminary processing module is used to decompose the input video into single-frame images, perform subject recognition on each frame of the image, and group and mark the images according to the recognition results, and output them as image groups.
[0029] The strong light suppression module is used to perform gradient adjustment on the saturation, contrast and brightness of the single-frame images in each image group according to preset parameter thresholds and parameter gradient values, obtain a single-frame image group, perform edge detection on the main part of the single-frame images under each gradient in the single-frame image group, obtain edge lines and store them, calculate the brightness histogram of the single-frame images, divide the single-frame images into normal illumination areas, high-brightness areas and overexposed areas and store them, select a reference image according to the edge lines, apply the image parameters of the reference image to all single-frame images in the image group, perform image fusion on the reference image and other single-frame images, respectively calculate the channel histograms of the reference area, high-brightness area and overexposed area corresponding to the single-frame image and calculate the cumulative distribution function, and convert each brightness value of the high-brightness area and the overexposed area into the brightness value of the corresponding reference area.
[0030] The video output module is used to splice the converted reference area, high brightness area and overexposed area to obtain a suppressed single frame image, and re-splice the suppressed single frame image in sequence to output as a processed video.
[0031] According to a third aspect, an electronic device includes a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in any of the above methods are performed.
[0032] In a fourth aspect, a storage medium stores a computer program thereon, wherein when the computer program is executed by a processor, the steps in any of the methods described above are executed.
[0033] Beneficial effects of the present invention: The method identifies and groups key objects in the video, fine-tunes saturation, contrast and brightness, segments and standardizes the illuminated areas, fuses reference images to balance the illumination and color differences, converts and suppresses the brightness values of high-brightness and overexposed areas, and finally splices them back to the original image. The processed video has significant improvements in illumination, saturation, contrast and brightness, and the overall visual effect is more natural and comfortable, retaining important details and dynamic changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A flowchart of a method for suppressing image glare provided by an embodiment of the present invention; Figure 2 A schematic diagram of the basic flow of an image highlight suppression system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0036] Embodiment 1, refer to Figure 1 , provides an image strong light suppression method, comprising the following steps: Step S1, obtain an input video, decompose the input video into single-frame images, identify the subject of the single-frame images, group and mark them according to the subject, and output them as image groups.
[0037] Step S2, according to the preset saturation threshold and saturation gradient value, contrast threshold and contrast gradient value, and brightness threshold and brightness gradient value, the saturation, contrast and brightness of the single-frame image in each image group are gradient-adjusted to obtain a single-frame image group, edge detection is performed on the main part of the single-frame image under each gradient in the single-frame image group, and the edge lines are obtained and stored.
[0038] Step S3, calculate the brightness histogram of each single-frame image, divide each single-frame image into a normal lighting area, a high brightness area and an overexposed area according to a preset standard brightness threshold and brightness histogram, and store them, select a reference image, record the image parameters of the reference image, and apply the image parameters to all single-frame images in the image group.
[0039] Step S4, performing image fusion on the reference image and other single-frame images in the image group except the reference image.
[0040] Step S5, respectively calculating the channel histograms of the corresponding reference area, high brightness area and overexposed area on the single frame image in the image group and calculating the cumulative distribution function, and converting each brightness value of the high brightness area and the overexposed area into the brightness value of the corresponding reference area.
[0041] Step S6, stitching the converted reference area, high brightness area and over-exposed area to obtain a suppressed single-frame image, and re-stitching the suppressed single-frame image into a processed video and outputting it.
[0042] Step S1 includes the following sub-steps: Step S101, obtain input video, set the export format to all frames, decompose it into single frame images and add corresponding timestamps.
[0043] Step S102, converting a single frame image into a grayscale image and storing it separately, using a pre-trained convolutional neural network to extract high-level image feature vectors in the grayscale image, calculating the Euclidean distance between the image feature vectors, merging the images with the smallest Euclidean distance into an image group, and outputting the image group.
[0044] Perform color standardization and convert the color single-frame image into a grayscale image to simplify the image information and reduce the impact of color differences on feature extraction. Select a pre-trained convolutional neural network model that has been trained on a large data set and can extract high-level features of the image. Use the deep learning framework to load and instantiate the model. Set parameters during instantiation to exclude the fully connected layer at the top of the model. Input the grayscale image into the model, obtain the high-level image feature vector through forward propagation, repeat the above feature extraction process to obtain the image feature vector of each single-frame image, use the Euclidean distance formula to calculate the distance between each pair of image feature vectors, sort the single-frame images according to the calculated Euclidean distance, and merge the images whose Euclidean distance is less than the preset Euclidean distance threshold into one image group according to the preset Euclidean distance threshold, and output all image groups.
[0045] Decomposing a video into frames allows for more sophisticated analysis. The dynamic information of a video is presented through the continuous playback of a series of static images. Processing a single frame allows each moment in the video to be analyzed and processed independently. A timestamp is added to each frame, which preserves the original temporal order of the frames in the video. A pre-trained convolutional neural network is used to extract high-level image features from grayscale images. Image features capture abstract information such as texture, shape, and edges in a single frame. The Euclidean distance between feature vectors is extracted by calculation to evaluate the similarity between single frames. The smaller the Euclidean distance, the closer the distance between the two images in the feature space and the more similar they are in content structure. Based on the results of the Euclidean distance calculation and comparison, single frames with similar features are merged into one group, which helps to identify repeated scenes and similar objects in the video.
[0046] Step S2 includes the following sub-steps: Step S201, input the preset saturation threshold and saturation gradient value, contrast threshold and contrast gradient value, and brightness threshold and brightness gradient value, adjust the single-frame image in each image group, and obtain single-frame image groups with different saturation, contrast and brightness.
[0047] Step S202, perform Gaussian blur on the grayscale image, use the Sobel operator to calculate the gradients in the horizontal and vertical directions, calculate the gradient amplitude and direction by combining the gradients in the horizontal and vertical directions, and mark the pixels whose gradient amplitude is greater than a preset edge threshold as edge pixels.
[0048] Step S203: Merge edge pixels and output them as edge lines, save them as an array and store them.
[0049] Input the preset saturation threshold and saturation gradient value, contrast threshold and contrast gradient value, brightness threshold and brightness gradient value to define the range and step size of image adjustment. For each single-frame image in each image group, adjust the saturation, contrast and brightness according to the input threshold and gradient value to generate a series of single-frame image groups with different saturation, contrast and brightness for subsequent analysis and processing. Gaussian blur processing is performed on the grayscale image to reduce noise and smooth the single-frame image. The Sobel operator is used to calculate the gradient of the image in the horizontal and vertical directions. The Sobel operator is a discrete differential operator used for edge detection. It works by calculating the approximate gradient of the grayscale of the brightness function of the single-frame image. Combining the horizontal and vertical gradients, the gradient amplitude and direction of each pixel can be calculated. The gradient amplitude represents the strength of the edge, and the gradient direction represents the direction of the edge. Pixels with gradient amplitudes greater than the preset edge threshold are marked as edge pixels. Adjacent edge pixels are connected by edge tracing to form complete edge lines, and the edge lines are stored in the storage medium in the form of an array.
[0050] By adjusting the saturation, contrast and brightness of the image, a series of single-frame images with different visual characteristics are generated, which is helpful for a more comprehensive analysis of the single-frame image features in subsequent processing. Due to different scenes or lighting conditions, the optimal visual parameters of a single-frame image may be different. By adjusting the preset threshold and gradient values, the single-frame image is more adapted to the current processing needs. Edge detection and feature extraction provide a variety of input images for subsequent image processing steps, which helps to improve the accuracy and robustness of these steps. By calculating the gradient of a single-frame image and marking the edge pixels, the edge part in the single-frame image becomes clearer and more prominent, which is crucial for subsequent image analysis. Gaussian blur processing reduces the The reduction of noise in a single-frame image makes edge detection more accurate. Noise usually causes false edges in edge detection, and Gaussian blur helps smooth these noise points. The calculation of the gradient direction not only provides edge intensity information, but also provides edge direction information, which is very useful for understanding the shape and arrangement of objects in a single-frame image. By merging adjacent edge pixels to form lines, the continuity of the edges is enhanced, making the edges more consistent with the object boundaries in human visual perception, which is helpful for subsequent image understanding and interpretation. Storing edge lines in the form of an array makes the edge information more structured and easier to process, which helps subsequent image analysis algorithms to access and utilize the edge information more efficiently.
[0051] Step S3 includes the following sub-steps: Step S301 , calculating the brightness histogram of each single frame image, dividing each single frame image into a normal illumination area, a high brightness area and an overexposure area according to a preset standard brightness threshold and storing them.
[0052] Step S302, calculating the number of breakpoints of each edge line, and selecting the edge line with the least number of breakpoints as a clear edge line.
[0053] Step S303, calculate the area overlap between the image within the clear edge line and the normal illumination area, select the single-frame image with the largest area overlap and mark it as the reference image, record the saturation, contrast and brightness of the reference image, and apply it to all single-frame images in the image group corresponding to the reference image. The brightness histogram is a statistical chart of the distribution of brightness values in a single-frame image. Each pixel in the single-frame image is traversed, the brightness value is counted and a histogram is constructed to represent the frequency distribution of different brightness values. According to the image content and processing requirements, two brightness thresholds T1 and T2 are preset. T1 is used to distinguish between the normal illumination area and the high brightness area, and T2 is used to distinguish between the high brightness area and the overexposed area. According to the preset brightness threshold, each pixel in the single-frame image is assigned to the normal illumination area, the high brightness area and the overexposed area. Pixels with brightness values less than T1 are classified as normal illumination areas, pixels with brightness values between T1 and T2 are classified as high brightness areas, and pixels with brightness values greater than T2 are classified as overexposed areas. The segmented image area is stored as an image mask, and the breakpoints of the edge lines are Refers to the discontinuous points in the lines. Each edge line is traversed and the number of its breakpoints is calculated. Among all the edge lines, the line with the least number of breakpoints is selected as the clear edge line. For each single-frame image, the area overlap between its normal illumination area and the area covered by the clear edge line is calculated. The two areas are compared at the pixel level, and the proportion of their intersection area to their respective total areas is calculated. Among all the single-frame images, the single-frame image with the largest area overlap is selected as the reference image. The saturation, contrast and brightness values of the reference image are recorded, and these attribute values are applied to all the single-frame images in the image group corresponding to the reference image. By adjusting the visual attributes of other images to make them visually consistent with the reference image, the consistency and quality of the entire image sequence are improved.
[0054] By calculating the brightness histogram and segmenting it according to the preset brightness threshold, the single-frame image is clearly divided into normal illumination area, high brightness area and overexposure area, which is helpful to adopt different processing strategies for different areas in subsequent processing, identify areas with different lighting conditions in single-frame images, and provide a basis for subsequent brightness adjustment. By calculating the number of breakpoints of edge lines, evaluating the clarity of edge lines, and selecting edge lines with the least number of breakpoints as clear edge lines, the interference of image noise on edge detection results is reduced, and the accuracy of edge detection is improved. By calculating the area overlap between clear edge lines and normal illumination areas, and selecting a single-frame image with the largest overlap as a reference image, it can be ensured that the selected reference image is representative in terms of lighting conditions and edge clarity. The saturation, contrast and brightness values of the reference image are applied to all single-frame images in the corresponding image group, which can achieve consistency in visual attributes of the image sequence, which helps to improve the perception and quality of the entire image sequence. By selecting the reference image and applying its attributes to the entire image group, the complex process of adjusting each single-frame image individually is avoided, thereby improving processing efficiency.
[0055] Step S4 includes the following sub-steps: Step S401 , marking a normal illumination area of a reference image as a reference area, calculating pixel gradient information of the reference area and a background area other than the reference area near a boundary of the reference area, and outputting and storing the information as standard gradient information.
[0056] Step S402, respectively calculating the gradient information and coordinates between adjacent pixel points of other single-frame images in the image group except the reference image, and merging and outputting them as the gradient information to be fused.
[0057] Step S403, inputting the standard gradient information into the gradient information to be fused, searching for coordinates corresponding to the gradient information to be fused that matches the standard gradient information, and fusion of the reference image onto other single-frame images in the image group except the reference image.
[0058] The normally illuminated area is clearly marked as the reference area in the reference image, and the pixel gradient information between the reference area and the background area is calculated based on the pixels within the predefined boundary width. The pixel gradient reflects the brightness or color change rate of the image at that point. The calculated gradient information is output as the standard gradient information and stored for subsequent use. For each frame of the non-reference image in the image group, the gradient information between its adjacent pixels, that is, the brightness change rate, and the coordinates of these pixels are calculated respectively. All the calculated gradient information and the corresponding coordinates are merged to form the gradient information to be fused, which is used for the subsequent matching process with the standard gradient information. The standard gradient information calculated and stored in step S401 is used as input, and the gradient information matching the standard gradient information is searched in the gradient information to be fused generated in step S402. The matching is based on the gradient value, direction and the spatial relationship between them, and the matching gradient information is found. The coordinates of these gradient information on the image to be fused are determined, and according to these coordinates, the reference image is fused to the corresponding single frame image by interpolation of pixel values.
[0059] By taking the normal lighting area of the reference image as the standard and ensuring that the other single-frame images in the image group are consistent with it in lighting conditions, it helps to reduce the image quality differences caused by different lighting conditions and improve the visual consistency of the entire image sequence. The matching and fusion process of gradient information helps to maintain the continuity of the image edges. During the fusion process, the clear edge features in the reference image are copied to other single-frame images, thereby reducing edge blur or breakage.
[0060] Step S5 includes the following sub-steps: Step S501 , respectively calculating the histograms of the reference area, the high brightness area and the overexposure area of the single frame image, and outputting them as a reference channel histogram, a high brightness channel histogram and an overexposure channel histogram.
[0061] Step S502, calculating the cumulative distribution function according to the reference channel histogram, the high brightness channel histogram and the overexposure channel histogram, and outputting the reference cumulative distribution function, the high brightness cumulative distribution function and the overexposure cumulative distribution function.
[0062] Step S503 , mapping the high brightness cumulative distribution function and the overexposure cumulative distribution function to the reference cumulative distribution function, and outputting the mapping relationship.
[0063] Step S504 : converting each brightness value of the high brightness area and the overexposed area into a brightness value of a corresponding reference area according to the mapping relationship.
[0064] A single-frame image is converted from an RGB color space to a YCrCb color space, where the YCrCb color space includes a Y channel, a Cr channel, and a Cb channel. Histograms of a reference area, a high-brightness area, and an overexposed area of the single-frame image in the Y channel, the Cr channel, and the Cb channel are calculated respectively, and the outputs are a reference channel histogram, a high-brightness channel histogram, and an overexposed channel histogram. Each channel histogram includes histograms of the Y channel, the Cr channel, and the Cb channel. The cumulative distribution functions of the Y channel, the Cr channel, and the Cb channel of the reference area, the high-brightness area, and the overexposed area are calculated, and the outputs are a reference cumulative distribution function, a high-brightness cumulative distribution function, and an overexposed cumulative distribution function. The high-brightness cumulative distribution function and the overexposed cumulative distribution function are mapped to the reference cumulative distribution function, and the output is a mapping relationship. According to the mapping relationship and the corresponding reference channel histogram, the high-brightness channel histogram, and the overexposed channel histogram, each brightness value of the high-brightness area and the overexposed area is converted to a brightness value of the corresponding reference area, and the brightness value is stored in the Y channel.
[0065] By calculating and mapping the cumulative distribution functions of different brightness areas, the brightness values of high-brightness areas and over-exposed areas can be adjusted to make them closer to the brightness distribution of the reference area, which helps to eliminate overexposure in the image and reduce the brightness differences in highlight areas, making the brightness distribution of the entire image more balanced. In overexposed areas, due to excessive brightness, image details are often lost. By adjusting the brightness values of these areas, it helps to restore some of the lost details and make the image information richer and more complete. The visual effect of a single-frame image after brightness adjustment will be significantly improved. The overexposed and high-brightness areas are no longer dazzling, the overall contrast of the image is more natural, and the colors are more saturated, thereby improving the image's viewing and readability. Through a series of automated calculation and adjustment processes, rapid optimization of image brightness distribution is achieved, reducing the need for manual intervention and improving the efficiency and consistency of image processing.
[0066] Step S6 includes the following sub-steps: Step S601, stitching the adjusted reference area, high brightness area and over-exposed area to generate a suppressed single frame image.
[0067] Step S602 , stitching the adjusted single-frame images into a new video according to the timestamps of the adjusted single-frame images, and outputting the new video as a processed video.
[0068] Use image processing software to fuse the adjusted reference area, high-brightness area, and overexposed area using multi-bands, and precisely stitch them according to their positions in the original image to avoid obvious seams or color differences, generate suppressed single-frame images, sort them according to the timestamp of each suppressed single-frame image to ensure the correct time sequence in the video, and output the processed video.
[0069] By accurately stitching the adjusted reference area, high-brightness area and over-exposed area, single-frame images with higher visual quality are generated. These single-frame images are optimized in terms of brightness, contrast and detail retention, making the entire image clearer, more natural and more colorful. In response to the overexposure and highlight problems in the original video, specific adjustment algorithms and techniques are used to effectively reduce the brightness of these areas and restore some details lost due to overexposure, so that the high-brightness areas and over-exposed areas in the single-frame image are no longer dazzling and the overall visual effect is more comfortable. In the process of recombining the adjusted single-frame images into a video, the correct time sequence between frames is guaranteed to avoid jitter or jumping during video playback.
[0070] Through subject recognition technology, the key objects in the video are separated from the background and grouped, which helps to optimize the subject more accurately in the subsequent steps, while reducing over-processing of non-key areas. Fine-tuning the single-frame image through preset thresholds and gradient values can significantly improve the visual effect of the single-frame image and make the single-frame image clearer. The application of edge detection further enhances the details of the single-frame image and makes the edge of the subject sharper. By calculating the brightness histogram and dividing the single-frame image into normal lighting, high brightness and overexposed areas, it can more accurately identify and handle lighting problems. Selecting a reference image and applying its parameters to the entire image grouping helps to maintain the image The consistency of lighting conditions within the group can reduce visual discomfort caused by lighting changes. Fusion of the reference image with other single-frame images can further balance the lighting and color differences between single-frame images, making the video transition more natural and smooth. By calculating the channel histogram and cumulative distribution function, the brightness values of the high-brightness area and the overexposed area are converted to the brightness values of the corresponding reference area, which effectively suppresses the problems of overexposure and excessive brightness while maintaining the details and layering of the image. The converted area is spliced back to the original image to obtain the suppressed single-frame image, which is re-spliced into a video. The output video will be significantly improved in terms of lighting, saturation, contrast and brightness.
[0071] Example 2, refer to Figure 2 , provides an image strong light suppression system, including a preliminary processing module, a strong light suppression module and a video output module: The preliminary processing module is used to decompose the input video into single-frame images, perform subject recognition on each frame, and group and mark the images according to the recognition results, and output them as image groups.
[0072] The input video is decomposed into single-frame images, the subject in each frame is identified, and the images are grouped and labeled according to the identification results. The output result is the grouped and labeled image groups.
[0073] The strong light suppression module is used to perform gradient adjustment on the saturation, contrast and brightness of the single-frame images in each image group according to preset parameter thresholds and parameter gradient values, obtain a single-frame image group, perform edge detection on the main part of the single-frame images under each gradient in the single-frame image group, obtain edge lines and store them, calculate the brightness histogram of the single-frame image, divide the single-frame image into a normal illumination area, a high-brightness area and an overexposed area and store them, select a reference image according to the edge lines, apply the image parameters of the reference image to all single-frame images in the image group, perform image fusion on the reference image and other single-frame images, calculate the channel histograms of the reference area, high-brightness area and overexposed area corresponding to the single-frame image respectively and calculate the cumulative distribution function, and convert each brightness value of the high-brightness area and the overexposed area into the brightness value of the corresponding reference area.
[0074] According to the preset parameter threshold and gradient value, the single-frame images in each image group are adjusted to optimize the image quality, obtain and store the edge lines of the main part of the single-frame image, enhance the image details, select the reference image, apply its parameters to all the single-frame images in the image group, and perform image fusion to balance the lighting and color differences between images, calculate the histogram and cumulative distribution function of the corresponding area of the single-frame image, and convert the brightness values of the high-brightness and overexposed areas into the brightness values of the corresponding reference areas.
[0075] The video output module is used to stitch the converted reference area, high brightness area and over-exposed area to obtain a suppressed single-frame image, and to re-stitch the suppressed single-frame image in sequence to output it as a processed video.
[0076] The converted reference area, high brightness area and over-exposed area are stitched together to obtain a suppressed single-frame image, and these suppressed single-frame images are stitched together again into a video in the order of timestamps to output the processed video.
[0077] Through this image glare suppression system, the input video undergoes a series of complex image processing steps, which significantly improves the video quality. The lighting, saturation, contrast and brightness are significantly optimized, overexposure and high brightness problems are effectively suppressed, and the output video visual effect is more natural. At the same time, important image details and dynamic changes are retained, enhancing the audience's viewing experience.
[0078] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Among them, the storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0079] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for suppressing image glare, It is characterized in that The steps include: Step S1, obtaining an input video, decomposing the input video into single-frame images, performing subject recognition on the single-frame images, grouping and marking them according to the subjects, and outputting them as image groups; Step S2, according to the preset saturation threshold and saturation gradient value, contrast threshold and contrast gradient value, and brightness threshold and brightness gradient value, the saturation, contrast and brightness of the single-frame image in each image group are gradient-adjusted to obtain a single-frame image group, and edge detection is performed on the main part of the single-frame image under each gradient in the single-frame image group to obtain and store edge lines; Step S3, calculating the brightness histogram of each single-frame image, dividing each single-frame image into a normal illumination area, a high brightness area, and an overexposed area according to a preset standard brightness threshold and the brightness histogram, and storing them, selecting a reference image, recording the image parameters of the reference image, and applying the image parameters to all single-frame images in the image group; Step S4, performing image fusion on the reference image and other single-frame images in the image group except the reference image; Step S5, respectively calculating the channel histograms of the corresponding reference area, high brightness area and overexposed area on the single frame image in the image group and calculating the cumulative distribution function, and converting each brightness value of the high brightness area and the overexposed area into the brightness value of the corresponding reference area; Step S6, stitching the converted reference area, high brightness area and over-exposed area to obtain a suppressed single-frame image, and re-stitching the suppressed single-frame image into a processed video and outputting it.
2. The method for suppressing image glare according to claim 1, It is characterized in that The step S1 includes the following sub-steps: Step S101, obtaining an input video, setting the export format to all frames, decomposing it into single-frame images and adding corresponding timestamps; Step S102, converting a single frame image into a grayscale image and storing it separately, using a pre-trained convolutional neural network to extract high-level image feature vectors in the grayscale image, calculating the Euclidean distance between the image feature vectors, merging the images with the smallest Euclidean distance into an image group, and outputting the image group.
3. The method for suppressing image glare as claimed in claim 2, It is characterized in that The step S2 includes the following sub-steps: Step S201, inputting a preset saturation threshold and saturation gradient value, a contrast threshold and contrast gradient value, and a brightness threshold and brightness gradient value, adjusting a single-frame image in each image group, and obtaining a single-frame image group with different saturation, contrast, and brightness; Step S202, performing Gaussian blur on the grayscale image, using the Sobel operator to calculate the gradients in the horizontal and vertical directions, combining the gradients in the horizontal and vertical directions to calculate the gradient amplitude and direction, and marking pixels with a gradient amplitude greater than a preset edge threshold as edge pixels; Step S203: Merge edge pixels and output them as edge lines, save them as an array and store them.
4. The method for suppressing image glare as claimed in claim 3, It is characterized in that The step S3 includes the following sub-steps: Step S301, calculating the brightness histogram of each single frame image, dividing each single frame image into a normal illumination area, a high brightness area and an overexposed area according to a preset standard brightness threshold and storing them; Step S302, calculating the number of breakpoints of each edge line, and selecting the edge line with the least number of breakpoints as a clear edge line; Step S303, calculate the area overlap between the image within the clear edge line and the normal lighting area, select the single-frame image with the largest area overlap and mark it as the reference image, record the saturation, contrast and brightness of the reference image, and apply it to all single-frame images in the image group corresponding to the reference image.
5. The method for suppressing image glare according to claim 4, It is characterized in that The step S4 includes the following sub-steps: Step S401, marking the normal illumination area of the reference image as the reference area, calculating pixel gradient information of the reference area and the background area other than the reference area near the reference area boundary, and outputting and storing it as standard gradient information; Step S402, respectively calculating the gradient information and coordinates between adjacent pixel points of other single-frame images in the image group except the reference image, and merging and outputting them as the gradient information to be fused; Step S403, inputting the standard gradient information into the gradient information to be fused, searching for coordinates corresponding to the gradient information to be fused that matches the standard gradient information, and fusion of the reference image onto other single-frame images in the image group except the reference image.
6. A method for suppressing image glare as claimed in claim 5, It is characterized in that The step S5 includes the following sub-steps: Step S501, respectively calculating the histograms of the reference area, the high brightness area and the overexposed area of the single frame image, and outputting them as a reference channel histogram, a high brightness channel histogram and an overexposed channel histogram; Step S502, calculating the cumulative distribution function according to the reference channel histogram, the high brightness channel histogram and the overexposure channel histogram, and outputting the reference cumulative distribution function, the high brightness cumulative distribution function and the overexposure cumulative distribution function; Step S503, mapping the high brightness cumulative distribution function and the overexposure cumulative distribution function to the reference cumulative distribution function, and outputting the mapping relationship; Step S504: convert each brightness value of the high brightness area and the overexposed area into a brightness value of the corresponding reference area according to the mapping relationship.
7. The method for suppressing image glare according to claim 6, It is characterized in that The step S6 includes the following sub-steps: Step S601, stitching the adjusted reference area, high brightness area and overexposed area to generate a suppressed single frame image; Step S602 , stitching the adjusted single-frame images into a new video according to the timestamps of the adjusted single-frame images, and outputting the new video as a processed video.
8. An image glare suppression system, It is characterized in that Including preliminary processing module, strong light suppression module and video output module: The preliminary processing module is used to decompose the input video into single-frame images, perform subject recognition on each frame image, and group and mark the images according to the recognition results, and output them as image groups; The strong light suppression module is used to perform gradient adjustment on the saturation, contrast and brightness of the single-frame images in each image group according to the preset parameter threshold and parameter gradient value, obtain the single-frame image group, perform edge detection on the main part of the single-frame image under each gradient in the single-frame image group, obtain the edge lines and store them, calculate the brightness histogram of the single-frame image, divide the single-frame image into a normal illumination area, a high brightness area and an overexposed area and store them, select a reference image according to the edge lines, apply the image parameters of the reference image to all the single-frame images in the image group, perform image fusion on the reference image and other single-frame images, respectively calculate the channel histograms of the reference area, the high brightness area and the overexposed area corresponding to the single-frame image and calculate the cumulative distribution function, and convert each brightness value of the high brightness area and the overexposed area into the brightness value of the corresponding reference area; The video output module is used to splice the converted reference area, high brightness area and overexposed area to obtain a suppressed single frame image, and re-splice the suppressed single frame image in sequence to output as a processed video.
9. An electronic device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 7 are executed.
10. A storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Image definition improving method and device based on AI large model and medium
CN118279184A
Dual surveillance camera system
US20070013779A1
Cited By
Video image rapid adjustment method based on deep learning neural network
CN119338701A
Target tracking method, device, equipment, medium and product
CN119941797A
Target Tracking Method, Device, Equipment, Medium and Product
CN119941797B
Intelligent attendance card punching method and system based on face recognition
CN120997894A
