Vehicle-mounted video device black light control method, device and terminal equipment

By acquiring continuous video images from vehicle-mounted cameras, extracting target image features and constructing a temporal feature sequence, calculating illumination quality scores, and generating black light function control commands, the problem of frequent start-stop of vehicle-mounted video equipment when illumination changes is solved, improving system efficiency and image clarity.

CN122457902APending Publication Date: 2026-07-24SHENZHEN STREAMING VIDEO TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN STREAMING VIDEO TECH
Filing Date
2026-03-16
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing vehicle-mounted video equipment frequently activates and deactivates its black light function when lighting conditions change, leading to increased consumption of system computing resources and image processing delays, making it difficult to achieve precise control.

Method used

By acquiring continuous video images from vehicle-mounted cameras, target image features are extracted, a temporal feature sequence is constructed, a lighting quality score is calculated, control commands for the black light function are generated, and frequent switching caused by brief fluctuations in lighting is suppressed.

Benefits of technology

It achieves precise control over the black light function, improves system operating efficiency, reduces processor usage and device power consumption, and ensures clear image output under different lighting conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122457902A_ABST
    Figure CN122457902A_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of intelligent terminals, and provides a vehicle-mounted video device black light control method, device and terminal equipment. The method comprises the following steps: acquiring continuous video images collected by a vehicle-mounted camera; extracting target image features from the video images; constructing a time sequence feature sequence based on the target image features of continuous multiple video images; calculating an illumination quality score of a current frame video image based on the time sequence feature sequence; and generating a control instruction of a black light function of a vehicle-mounted video device according to the illumination quality score. The application can accurately control the start and stop of the black light function, suppress frequent switching caused by short-term illumination fluctuations, and improve the accuracy of black light function control and system operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart terminal technology, and in particular to a black light control method, apparatus and terminal device for vehicle-mounted video equipment. Background Technology

[0002] In-vehicle video devices, such as electronic rearview mirrors and dashcams, need to output clear video footage under various lighting conditions. To improve image quality in low-light environments, these devices are often equipped with black light functionality, using techniques such as image enhancement, noise reduction, and dynamic range extension to improve image performance in low-light scenes.

[0003] However, activating the blacklight function significantly increases system computing resource consumption, leading to increased processor utilization, increased device power consumption, and prolonged image processing latency. To balance image quality and system operating efficiency, precise control over the activation and deactivation of the blacklight function is necessary.

[0004] Therefore, how to accurately control the start and stop of the black light function, suppress frequent switching caused by short-term fluctuations in illumination, and improve the accuracy of black light function control and system operating efficiency are issues that need to be considered. Summary of the Invention

[0005] This application provides a method, apparatus, and terminal device for controlling black light in vehicle-mounted video equipment, which can accurately control the start and stop of the black light function, suppress frequent switching caused by short-term fluctuations in illumination, and improve the accuracy of black light function control and system operating efficiency.

[0006] In a first aspect, embodiments of this application provide a method for controlling black light in a vehicle-mounted video device, including: Acquire continuous video images captured by the vehicle-mounted camera; Extract target image features from the video images; Based on the target image features of consecutive multi-frame video images, a temporal feature sequence is constructed; Based on the temporal feature sequence, calculate the illumination quality score of the current frame video image; Based on the illumination quality score, control instructions for the black light function of the vehicle-mounted video equipment are generated.

[0007] In one possible implementation of the first aspect, the target image features include a weighted average brightness; the extraction of target image features from the video image includes: The video image is divided into multiple grid regions; Calculate the average brightness value for each of the grid regions; The weighted average brightness of the video image is determined based on the region weight corresponding to each grid region and the average brightness value.

[0008] In one possible implementation of the first aspect, the target image features include a brightness dynamic range; the extraction of target image features from the video image includes: Obtain the brightness histogram of the video image; Based on the brightness histogram, determine the first specified percentile value and the second specified percentile value; The dynamic range of brightness of the video image is determined based on the difference between the first specified percentile value and the second specified percentile value.

[0009] In one possible implementation of the first aspect, the target image features include the image gradient mean; the extraction of target image features from the video image includes: The gradient magnitude of each pixel in the video image is calculated using a preset gradient operator. The average gradient magnitude of all pixels in the video image is obtained by averaging the gradient magnitudes of the video image.

[0010] In one possible implementation of the first aspect, before constructing the temporal feature sequence based on the target image features from consecutive multi-frame video images, the method further includes: Estimate the global motion vector between the current frame and the previous frame of video image; Based on the global motion vector, a compensation region corresponding to each grid region of the current frame video image is determined in the previous frame video image; Calculate the brightness difference between each region of the current frame video image and its corresponding compensation region; Based on the brightness difference, the target image features are redefined; The construction of a temporal feature sequence based on the target image features from multiple consecutive video frames includes: Based on the redefined target image features, a temporal feature sequence is constructed.

[0011] In one possible implementation of the first aspect, the target image features include weighted average brightness, brightness dynamic range, and image gradient mean; calculating the illumination quality score of the current frame video image based on the temporal feature sequence includes: According to preset weights, the average value of the weighted average brightness, the average value of the brightness dynamic range, and the average value of the image gradient within the time window are weighted and summed to obtain the illumination quality score of the current frame video image; wherein, the time window corresponds to the time range of multiple consecutive video images in the time-series feature sequence, and the preset weights are used to balance the contribution of the weighted average brightness, brightness dynamic range, and image gradient mean to the illumination quality evaluation.

[0012] In one possible implementation of the first aspect, generating control instructions for the black light function of the in-vehicle video device based on the illumination quality score includes: Based on the illumination quality score, the illumination status determination result of the current frame video image is determined; A sliding window voting mechanism was used to statistically analyze the illumination state determination results of multiple consecutive video frames to obtain statistical results. Based on the statistical results and preset control rules, control instructions for the black light function of the vehicle-mounted video equipment are generated.

[0013] In one possible implementation of the first aspect, generating control instructions for the black light function of the in-vehicle video device based on the statistical results and preset control rules includes: Based on the time-series characteristic sequence, calculate the light change trend index, the light change rate index, and the light stability index. Based on the light change trend index value, the light change rate index value, the light stability index value, and the statistical results, it is determined whether the preset state transition conditions in the state machine are met; wherein, the state machine includes at least a closed state, an open state, and a pending state; the preset state transition conditions are adaptively adjusted according to the light change rate index value; If the preset state transition conditions are met, a control command for the black light function of the vehicle-mounted video device is generated.

[0014] Secondly, embodiments of this application provide a black light control device for in-vehicle video equipment, comprising: The image acquisition unit is used to acquire continuous video images captured by the vehicle-mounted camera; The feature extraction unit is used to extract target image features from the video image; A sequence construction unit is used to construct a temporal feature sequence based on the target image features of multiple consecutive video frames; A quality scoring unit is used to calculate the illumination quality score of the current frame video image based on the temporal feature sequence. The black light control unit is used to generate control commands for the black light function of the vehicle-mounted video equipment based on the light quality score.

[0015] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the vehicle-mounted video device black light control method as described in the first aspect above.

[0016] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the vehicle-mounted video device black light control method as described in the first aspect above.

[0017] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the vehicle-mounted video device black light control method as described in the first aspect above.

[0018] In this embodiment, by acquiring continuous video images captured by an in-vehicle camera, the limitations of relying on a single frame image are overcome. Target image features are extracted from the video images, effectively capturing key information reflecting lighting conditions and providing a reliable basis for judging lighting changes. Then, a temporal feature sequence is constructed based on the target image features of multiple consecutive video frames. This fully integrates time-dimensional information, effectively filtering out instantaneous interference caused by brief fluctuations in lighting, and avoiding accidental triggering of the black light function's start / stop due to abnormal signals at a single moment, thereby suppressing frequent switching. Furthermore, the lighting quality score of the current frame video image is calculated based on the temporal feature sequence, accurately quantifying the current lighting level, and generating appropriate black light function control commands to achieve precise control of the black light function's start / stop. This solution effectively suppresses frequent switching caused by brief fluctuations in lighting, improving the accuracy of black light function control while avoiding unnecessary start / stop operations due to improper control, reducing processor occupancy and device power consumption, and reducing image processing latency, thereby improving system operating efficiency. This ensures that the in-vehicle video equipment outputs clear images and maintains stable and efficient operation under various lighting scenarios. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the implementation of the black light control method for vehicle-mounted video equipment provided in this application embodiment; Figure 2.1 This is a flowchart illustrating a specific implementation of step S102 in the black light control method for vehicle-mounted video equipment provided in this application embodiment; Figure 2.2 This is another specific implementation flowchart of step S102 in the black light control method for vehicle-mounted video equipment provided in the embodiments of this application; Figure 2.3This is another specific implementation flowchart of step S102 in the black light control method for vehicle-mounted video equipment provided in the embodiments of this application; Figure 3 This is a flowchart illustrating a specific implementation of motion compensation in the black light control method for vehicle-mounted video equipment provided in this application embodiment; Figure 4 This is a flowchart illustrating a specific implementation of step S104 in the black light control method for vehicle-mounted video equipment provided in this application embodiment; Figure 5 This is a flowchart illustrating a specific implementation of the black light control method for vehicle-mounted video equipment provided in this application, which generates adaptive control commands. Figure 6 This is a structural block diagram of the vehicle-mounted video equipment black light control device provided in the embodiments of this application; Figure 7 This is a schematic diagram of the terminal device provided in the embodiments of this application. Detailed Implementation

[0021] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0022] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0023] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0024] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0025] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0026] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0027] Currently, the activation and deactivation of the black light function can be achieved by using a sensor to detect the ambient light intensity. However, its sensitivity is easily affected by device wear and external obstructions, and the detected ambient light may deviate from the actual lighting conditions of the scene captured by the camera. Alternatively, it can be determined by analyzing the brightness characteristics of a single frame image, but this is easily interfered with by large areas of bright and dark objects in the image, making it difficult to accurately distinguish between the brightness of the scene content itself and insufficient ambient light. In scenes with rapidly changing lighting, it can also easily cause the black light function to switch frequently, affecting the user experience and increasing the system load.

[0028] In view of this, this application provides a black light control method for vehicle-mounted video equipment. This method can accurately identify the real light change pattern, distinguish the influence of changes in the lighting environment itself and changes in scene content, and then generate appropriate black light function control commands to achieve precise control of the start and stop of the black light function. While improving the accuracy of black light function control, it effectively suppresses frequent switching caused by short-term fluctuations in light and improves system operating efficiency.

[0029] By way of example and not limitation, the vehicle-mounted video equipment black light control method provided in this application is applicable to various types of terminal devices that need to perform vehicle-mounted video equipment black light control. Specific terminal devices may include mobile phones, tablets, wearable devices, laptops, ultra-mobile personal computers (UMPCs), desktop computers, and servers, etc. This application does not impose any restrictions on the specific type of terminal device.

[0030] Figure 1 The implementation flow of the black light control method for in-vehicle video equipment provided in this application embodiment is illustrated. The method flow includes steps S101 to S104. The specific implementation principle of each step is as follows: Step S101: Acquire continuous video images captured by the vehicle-mounted camera.

[0031] A vehicle-mounted camera is an image acquisition device installed on a vehicle to capture images of the external scene in real time while the vehicle is in motion. Its acquisition range can cover areas in front of, to the sides of, and behind the vehicle. The acquired image data format is adapted to the image processing requirements of the vehicle system. The acquired video images are a continuous frame sequence, ensuring the complete recording of the dynamic changes in scene lighting. Continuous video images refer to a series of sequentially linked image frames continuously acquired and output by the vehicle-mounted camera at a fixed frame rate. This serves as the foundational data for all subsequent processing steps, distinguishing it from single-frame images or intermittent image data, and providing information on lighting changes over time.

[0032] For example, the camera of the vehicle dashcam continuously captures the scene in front of the vehicle, generating 30 frames of images per second to form continuous video images, and fully records the image data corresponding to the changes in lighting throughout the entire process of the vehicle driving from a sunny road into a shady area and then out of the shady area.

[0033] In this embodiment of the application, by acquiring continuous and complete scene image data, data support is provided for subsequent extraction of target image features and construction of temporal feature sequences. This avoids incomplete judgment of illumination change trends due to single frame images or intermittent image data, and ensures that subsequent processing steps have a reliable data source.

[0034] Step S102: Extract target image features from the video image.

[0035] Target image features are key image features that can characterize the lighting state of a scene. They are not randomly extracted image features. Target image features have the characteristics of strong correlation with lighting changes and minimal interference from scene content.

[0036] In one possible implementation, the target image features include, but are not limited to, weighted average brightness, brightness dynamic range, and image gradient mean.

[0037] As one possible implementation of this application, the target image features include a weighted average brightness, which is used to reflect the overall brightness of the image; Figure 2.1 A specific implementation flow of step S102 in the black light control method for vehicle-mounted video equipment provided in this application embodiment is shown below: A1: Divide the video image into multiple grid regions.

[0038] A grid region refers to a regular rectangular area formed by dividing a single frame of video image according to a preset specification. After division, each grid region has no overlap or omissions, completely covering the entire video image. Each grid region contains a continuous block of pixels in the video image, which is used as the basic spatial unit for subsequent brightness statistics.

[0039] In this embodiment, the segmentation specification is set based on the computing power and illumination judgment accuracy requirements of the vehicle-mounted video equipment. For example, an 8×6 segmentation ratio is used to divide the video image into 8 rows and 6 columns, forming 48 grid regions. This number can ensure the precision of the region division, so that the brightness information of each grid region can accurately reflect the local illumination state, and avoid the surge in computational load due to too many regions.

[0040] A2: Calculate the average brightness value for each of the grid regions.

[0041] The average brightness value of a grid region refers to the arithmetic mean of the brightness values ​​of all pixels within a single grid region, used to characterize the local brightness level of that region. The pixel brightness value ranges from 0 to 255, where 0 represents pure black and 255 represents pure white, with the value directly correlated to the pixel's brightness. During video image segmentation, the image is divided into M horizontal regions and N vertical regions, resulting in a total of M×N grid regions. The average brightness value of a single grid region is determined by the total number of pixels within the region and the sum of their corresponding brightness values. The average brightness value of the grid region eliminates the interference of abnormal brightness in individual pixels on local brightness assessment, more accurately reflecting the overall brightness state of the grid region.

[0042] A3: Determine the weighted average brightness of the video image based on the region weight corresponding to each grid region and the average brightness value.

[0043] Regional weight refers to the weight coefficient assigned to each grid region, which is used to quantify the contribution of different grid regions to the overall illumination judgment.

[0044] In one possible implementation, the weighted average brightness of the video image is determined according to the following formula (1): (1) in, L weighted This represents the weighted average brightness. w i Indicates the first i The region weight of each grid region L i Indicates the first i The average brightness value of each grid region ranges from [0, 255], and M×N represents the total number of grid regions in the image segmentation.

[0045] In one possible implementation, the region weight is not a fixed value and needs to be dynamically calculated based on the location characteristics and brightness distribution stability of the grid region. It is composed of the product of the location weight and the content stability weight, i.e., Highlighting the effective lighting area and suppressing the interference area, where wpos,i w represents the position weight of the i-th grid region. stable,i This represents the content stability weights of the i grid regions.

[0046] In one possible implementation, w is determined according to the following calculation formula (2). pos,i : (2) Among them, (x i ,y i (x) represents the center coordinates of the i-th grid region. The coordinates need to be normalized to the interval between 0 and 1 (the top left corner of the image is (0,0), the bottom right corner is (1,1), and (x) represents the center coordinates of the i-th grid region. c ,y h ) represents the coordinates of the weight center, (σ) x ,σ y ) represents the standard deviation of the Gaussian distribution.

[0047] For example, x c =0.5 (corresponding to the horizontal center of the image), y h =0.4 (corresponding to the horizon position in conventional vehicle camera imaging), standard deviation σ of Gaussian distribution x =0.3、σ y =0.2. In this embodiment, the position weights are calculated based on a two-dimensional Gaussian distribution. The central area of ​​the image and the area near the horizon better reflect the real-world lighting conditions, and therefore are given higher weights. The position weights of the grid areas in the center of the image and near the horizon are close to 1, while the position weights of the edge areas gradually decrease.

[0048] In one possible implementation, it is determined according to the following calculation formula (3). w stable,i : (3) Where, k σ This is an adjustment coefficient, typically set to 0.001, used to adjust the influence of brightness variance on the weighting. This represents the luminance variance of the i-th grid region. , indicating that P i I represents the total number of pixels in grid region i. p This represents the brightness value of pixel p, and the summation range is the set R of all pixels belonging to grid region i. i The pixel p.

[0049] Content stability weight w stable,i The purpose of calculating the brightness variance of the grid area is to reduce the interference from objects with abnormal brightness, such as oncoming headlights and roadside reflective signs, so that areas with uniform brightness distribution can be given higher weight.

[0050] For example, in a scenario of vehicles driving at night, after a single frame image is segmented into 48 grid regions, the grid regions in the center of the image and near the horizon have higher position weights. If there is no interference from headlights or reflections in these regions, the brightness distribution is uniform, and the content stability weight is also at a high level. The overall weight is significantly higher than that of the edge regions of the image. On the right side of the image, there are grid regions with reflections from oncoming headlights, resulting in a larger brightness variance. The content stability weight decreases, and the overall weight decreases accordingly.

[0051] In this embodiment, by dynamically fusing position weights and content stability weights, the brightness information of each grid region is differentiated, the contribution of effective lighting areas is enhanced, local abnormal interference is suppressed, and finally a weighted average brightness that can accurately characterize the overall lighting conditions is obtained, providing high-quality feature data for subsequent construction of time-series feature sequences and analysis of lighting change trends.

[0052] As one possible implementation of this application, the target image feature includes a brightness dynamic range, which is used to reflect the degree of difference between bright and dark areas in the image; Figure 2.2 A specific implementation flow of step S102 in the black light control method for vehicle-mounted video equipment provided in this application embodiment is shown below: B1: Obtain the brightness histogram of the video image.

[0053] A luminance histogram is a distribution curve showing the number of pixels corresponding to each luminance value in a single frame of a video image. The horizontal axis of the luminance histogram represents the pixel luminance value, ranging from 0 to 255, while the vertical axis represents the cumulative number of pixels corresponding to that luminance value. The luminance histogram visually presents the distribution pattern of luminance in an image, reflecting the proportion of bright and dark pixels. One possible implementation involves traversing all pixels in a single frame of the video image, counting the number of pixels corresponding to each luminance value, generating a complete luminance distribution statistical result, and then forming the luminance histogram based on this result.

[0054] B2: Determine the first specified percentile value and the second specified percentile value based on the brightness histogram.

[0055] Specifying percentile values ​​is a quantile index based on brightness histogram statistics. It is used to filter representative brightness ranges in an image and eliminate interference from local extreme brightness values ​​(such as point light sources or deep black areas).

[0056] In one possible implementation, the first specified percentile value is the 95th percentile of the luminance histogram, and the second specified percentile value is the 5th percentile of the luminance histogram.

[0057] The 95th percentile refers to the brightness value that, when the brightness histogram is sorted from smallest to largest, represents the 95th percentile of the total number of pixels. This means that 95% of the pixels in the image have a brightness value below this value, and only 5% have a brightness value above it. Similarly, the 5th percentile refers to the brightness value that, when the cumulative number of pixels reaches 5% of the total number of pixels, represents the 5th percentile of the total number of pixels. This means that only 5% of the pixels in the image have a brightness value below this value, and 95% have a brightness value above it. By selecting these two percentile values, the brightest and darkest 5% of pixels can be removed, focusing on the brightness distribution of the main image area. Percentile filtering eliminates interference from extremely bright and dark pixels, locking in a brightness range that reflects the lighting conditions of the main image subject, providing a reliable quantitative indicator for subsequent calculations of the accurate dynamic range of brightness.

[0058] B3: Determine the dynamic range of brightness of the video image based on the difference between the first specified percentile value and the second specified percentile value.

[0059] In one possible implementation, the luminance dynamic range (DR) of the video image is determined according to the following formula (4): (4) Among them, P 95 P5 represents the 95th percentile of the brightness histogram, and P5 represents the 5th percentile. The difference directly quantifies the contrast between light and dark areas of the main image region. The larger the difference, the more obvious the distinction between light and dark areas of the main image region, and the more sufficient the lighting conditions. The smaller the difference, the weaker the contrast between light and dark areas of the main image region, the worse the lighting conditions, and the closer it is to a low-light environment.

[0060] In this embodiment, the dynamic range of brightness that can accurately characterize the illumination contrast of the main image subject is obtained by calculating the difference between two specified percentile values, effectively avoiding extreme pixel interference and ensuring that the feature parameters are strongly correlated with the actual illumination conditions.

[0061] As one possible implementation of this application, the target image features include the image gradient mean, which reflects the clarity of detail information in the image; Figure 2.3 A specific implementation flow of step S102 of the vehicle-mounted video equipment black light control method provided in this application embodiment is shown below: C1: Calculate the gradient magnitude of each pixel in the video image using a preset gradient operator.

[0062] Preset gradient operators refer to pre-configured filtering operators used to calculate pixel gradients.

[0063] In one possible implementation, the preset gradient operator is the Sobel operator, which detects the boundaries of brightness changes between pixels by performing local difference operations on the image, and then quantizes the gradient information.

[0064] The Sobel operator includes a horizontal Sobel operator and a vertical Sobel operator, used to calculate the gradient values ​​of a pixel in the horizontal and vertical directions, respectively. The horizontal gradient value reflects the degree of brightness change between the left and right sides of the pixel, while the vertical gradient value reflects the degree of brightness change between the top and bottom sides of the pixel. Let the brightness value of pixel (x,y) be I(x,y), and the horizontal gradient value be... The calculation is performed using a 3×3 convolution kernel, as shown in formula (5): (5) Vertical gradient value The calculation is performed using the corresponding 3×3 convolution kernel, as shown in the following formula (6): (6) The gradient magnitude of each pixel is determined according to the following formula (7). : (7) Where I(x,y) represents the pixel brightness value at position (x,y). In this embodiment, the larger the gradient magnitude, the more drastic the change in brightness at the location of the pixel, and the clearer the corresponding image details; the smaller the gradient magnitude, the more gradual the change in brightness at the location of the pixel, and the more blurred the corresponding image details or the smoother the area.

[0065] By calculating the gradient magnitude of each pixel using the Sobel operator, image detail information is transformed into quantized gradient data, accurately capturing the differences in brightness between pixels, providing basic data for the subsequent calculation of the average gradient of the image, and achieving preliminary quantification of the richness of image detail.

[0066] C2: Average the gradient magnitude of all pixels in the video image to obtain the average gradient of the video image.

[0067] The image gradient mean is the arithmetic mean of the gradient magnitudes of all pixels in a single frame of video image. It is used to comprehensively characterize the detail richness of the entire image and is a global fusion of the gradient magnitudes of individual pixels.

[0068] In one possible implementation, the mean gradient of the video image is determined according to the following formula (8): (8) Where W and H are the width and height of the video image, respectively (in pixels).

[0069] The magnitude of the average gradient of an image is directly related to the overall clarity of details in a video image and lighting conditions. When the lighting is sufficient, the image details are rich and the edges are clear, the gradient amplitude of each pixel is generally high, and the average gradient of the image is large. When the lighting is low, the image details are blurred and the edges are weakened, the gradient amplitude of each pixel is generally low, the average gradient of the image is small, and it is less affected by noise interference, and can stably reflect the detail state corresponding to the lighting.

[0070] In this embodiment, the gradient magnitude of each pixel is calculated by the Sobel operator to accurately capture the differences in brightness between pixels, converting image detail information into quantized data. Then, by averaging the gradient magnitudes of all pixels, the global fusion of gradient information of a single pixel is achieved, resulting in an average image gradient that can comprehensively characterize the richness of detail in the entire image. This avoids the random interference of gradient magnitudes of a single pixel, ensures the stability and reliability of feature parameters, and realizes global quantization and stable characterization of detail features.

[0071] Step S103: Construct a temporal feature sequence based on the target image features of multiple consecutive video frames.

[0072] A series of consecutive video frames is a sequence of frames captured by an in-vehicle camera. In one possible implementation, these consecutive video frames are video frames within a preset time window. The length of the time window is set according to the frame rate of the in-vehicle video device and the actual timescale of lighting changes; for example, it corresponds to 30 to 60 frames, which is equivalent to 1 to 2 seconds of video frames. The preset time window ensures that it covers the basic cycle of lighting changes while avoiding excessively long windows that could increase processing latency. The temporal feature sequence is a set of features formed by arranging the target image features corresponding to each of the consecutive video frames in chronological order. The temporal feature sequence can intuitively present the changing patterns of target image features over time, thereby reflecting the dynamic changes in lighting conditions.

[0073] In this embodiment of the application, by integrating the scattered single-frame target image features into sequence data with time dimension attributes, the transformation from single-frame feature analysis to temporal feature analysis is realized, providing a data foundation for subsequent accurate identification of illumination change trends and filtering of short-term illumination fluctuations.

[0074] As one possible implementation of this application, such as Figure 3 As shown, before constructing the temporal feature sequence based on the target image features from consecutive multi-frame video images, the method further includes: D1: Estimates the global motion vector between the current frame and the previous frame of the video image.

[0075] In one possible implementation, a median filtering algorithm is used to estimate the global motion vector. Median filtering can effectively suppress interference from local moving objects (such as other vehicles, pedestrians, etc.) and accurately reflect the overall motion of the vehicle-mounted camera.

[0076] D2: Based on the global motion vector, determine the compensation region in the previous frame video image that corresponds to each grid region of the current frame video image.

[0077] D3: Calculate the brightness difference between each region of the current frame video image and its corresponding compensation region.

[0078] D4: Based on the brightness difference, redetermine the target image features.

[0079] In one possible implementation, if the brightness difference exceeds a preset brightness difference threshold, it indicates that the brightness change in the grid area is mainly caused by changes in the scene content. The area weight of the grid area is then modified, and the weighted average brightness of the video image is re-determined based on the modified area weight.

[0080] For example, the modified region weights are determined according to the following formula (9). : (9) in, w i Indicates the first i The region weight of each grid region This indicates the brightness difference between each region of the current frame's video image and its corresponding compensation region. To adjust the parameters, you can take... .

[0081] Based on the redefined target image features, a temporal feature sequence is constructed.

[0082] Step S104: Calculate the illumination quality score of the current frame video image based on the temporal feature sequence.

[0083] The illumination quality score is a comprehensive quantitative evaluation of the illumination conditions of the current frame.

[0084] In one possible implementation, the target image features include weighted average brightness, brightness dynamic range, and mean image gradient, with these three types of features collaboratively characterizing illumination conditions. Based on preset weights, the average values ​​of the weighted average brightness, the average values ​​of the brightness dynamic range, and the mean image gradient within a time window are weighted and summed to obtain the illumination quality score of the current frame video image. The time window corresponds to the time range of multiple consecutive video frames in the time-series feature sequence, and the preset weights are used to balance the contributions of the weighted average brightness, brightness dynamic range, and mean image gradient to the illumination quality evaluation, ensuring that the illumination quality score is strongly correlated with actual illumination conditions.

[0085] For example, the light quality score is calculated according to the following formula (10). : (10) in, Timing window Internal weighted average brightness The average value; Timing window Internal brightness dynamic range The average value; Timing window Inner image gradient mean The average value; , , For the preset weights, satisfy (For example, it is advisable) , , ).

[0086] In one possible implementation, the light quality score is calculated according to the following formula (11). Normalize it so that it falls within the interval [0, 100]: (11) in, This represents the minimum theoretical score. The theoretical maximum score is calculated based on the range of values ​​for the target image features. For example, the weighted average brightness is based on 8-bit grayscale pixels, ranging from pure black to pure white; the dynamic range of brightness is obtained from the high and low quantile differences of the brightness histogram, theoretically also ranging from 0 to the maximum grayscale range; the image gradient mean is calculated using the Sobel gradient, and its theoretical maximum value is determined by the upper limit of pixel grayscale and the operator coefficients. The theoretical minimum score corresponds to the weighted result when all three target image features are at their minimum values, and the theoretical maximum score corresponds to the weighted result when all three target image features are at their maximum values.

[0087] In this embodiment, by weighted fusion of three types of target image features, multi-dimensional illumination information is transformed into a single quantitative score, providing an intuitive and unified basis for subsequent illumination status determination, and realizing the effective connection between illumination situation analysis and status determination.

[0088] Step S105: Based on the illumination quality score, generate control instructions for the black light function of the vehicle-mounted video equipment.

[0089] In one possible implementation, the control commands for the black light function of the in-vehicle video equipment include three categories: activation commands, deactivation commands, and commands to maintain the current state. In this embodiment, the generation of the black light function control commands needs to match the lighting quality score.

[0090] As one possible implementation of this application Figure 4 A specific implementation flow of step S105 in the black light control method for vehicle-mounted video equipment provided in this application embodiment is shown below: E1: Determine the illumination status of the current frame video image based on the illumination quality score.

[0091] The lighting state determination result is used to determine the lighting level of the current frame, which is divided into three categories: dark light state, bright light state, and transitional state.

[0092] In one possible implementation, the lighting state is determined based on the lighting quality score and preset dark light and bright light thresholds: if the lighting quality score is less than the preset dark light threshold, it indicates that the current lighting conditions are poor and cannot meet the device's clear imaging requirements, so it is determined to be in a dark light state and the black light function needs to be activated; if the lighting quality score is greater than the preset bright light threshold, it indicates that the current lighting conditions are sufficient, so it is determined to be in a bright state and the black light function does not need to be activated; if the lighting quality score is not less than the preset dark light threshold and not greater than the preset bright light threshold, it indicates that the current lighting is in an intermediate transition range and there are no extreme requirements for lighting conditions, so it is determined to be in a transition state and the current black light function state remains unchanged.

[0093] In one possible implementation, the preset low-light threshold and preset bright-light threshold can be set according to the imaging requirements of the in-vehicle video equipment and the activation conditions of the black light function, which can be adapted to different vehicle models and usage scenarios. For example, the preset low-light threshold is 35 and the preset bright-light threshold is 50, forming a lag range between the two to avoid frequent switching near the critical point.

[0094] E2: The lighting status determination results of multiple consecutive video images are statistically analyzed using a sliding window voting mechanism to obtain the statistical results.

[0095] The sliding window voting mechanism is used to statistically verify the results of multi-frame illumination state determination. By fusing multi-frame data, the random error of single-frame determination is reduced, and the state misjudgment caused by short-term fluctuations in illumination is suppressed.

[0096] In one possible implementation, the sliding window is a time window of a preset length. The window length is set according to the frame rate of the in-vehicle video device. The window slides synchronously with the current frame, always covering the latest preset number of frame data.

[0097] In one possible implementation, the illumination state determination results of all frames within the sliding window are counted, and the occurrence frequency of each of the dark light state, bright light state, and transition state is counted. The illumination state with the most occurrences or the highest frequency is taken as the final illumination state. If the two states have the same number of occurrences, the transition state is given priority, which further improves the stability of the state determination.

[0098] For example, the time window length is Q, and the frequency of occurrence of dark light state within the sliding window is calculated according to the following formula (12): (12) For example, the frequency of occurrence of the bright state within the sliding window is calculated according to the following formula (13): (13) For example, the frequency of occurrence of transition states within the sliding window is calculated according to the following formula (14): (14) in, This is an indicator function; it is 1 if the condition is met, and 0 otherwise. For example, the sliding window length is set to 20 frames (corresponding to 0.8 seconds of video). When the vehicle passes through the area of ​​flashing streetlights, 12 frames in the window are determined to be in a transitional state, 5 frames are determined to be in a bright state, and 3 frames are determined to be in a dark state. The transitional state occurs the most often, so the final lighting state is determined to be the transitional state. When the vehicle is driving stably in the tunnel, 18 frames in the window are determined to be in a dark state, and 2 frames are determined to be in a transitional state, so the final lighting state is determined to be the dark state.

[0099] E3: Based on the statistical results and preset control rules, generate control instructions for the black light function of the vehicle-mounted video equipment.

[0100] The preset control rules are based on the final lighting conditions to define the start and stop logic of the black light function, clearly defining the correspondence between different lighting conditions and control commands, and adapting to the balance requirements of imaging quality and system operating efficiency in automotive scenarios. Control commands include three categories: start commands, stop commands, and maintain current state commands, each corresponding to different black light function operating requirements.

[0101] As one possible implementation of this application Figure 5 This application illustrates a specific implementation flow of generating adaptive control commands in the black light control method for in-vehicle video equipment provided in this embodiment, detailed below: E31: Based on the aforementioned time-series characteristic sequence, calculate the light change trend index value, the light change rate index value, and the light stability index value.

[0102] The illumination change trend index is used to determine the overall direction of illumination change. In this embodiment, illumination change trend analysis is performed on the time-series feature sequence, including analyzing the illumination change trend, illumination change rate, and illumination stability of the target image features, and comprehensively judging whether the scene illumination is continuously darkening, continuously brightening, remaining stable, or fluctuating briefly.

[0103] In one possible implementation, the illumination change trend index value is calculated by linear regression. Specifically, for each type of target image feature in the time-series feature sequence, a linear model is fitted, the slope of the model is solved as the change trend of the target image feature, and then the change trends of the three types of target image features are weighted and fused according to preset weights to obtain the illumination change trend index value.

[0104] One possible implementation uses a sliding window normalization method to normalize the three types of target image features. For example, for target image feature f, its normalized value... The following calculation formula (15) is used to calculate: (15) in, This represents the normalized value of the target image feature f at time t. This represents the original (unnormalized) value of the target image feature f at time t. f can be the weighted average brightness, brightness dynamic range, or the mean of the image gradient. Q(t) represents a sliding temporal window (e.g., the corresponding interval [t-K+1,t]) that ends at time t and contains the target image features of the most recent K frames. This represents the mean of f within the time window Q(t). This represents the standard deviation of f within the time window Q(t).

[0105] For example, a linear regression method is used to estimate its changing trend. Within the time window [t-K+1,t] of the time-series feature sequence, a linear model is fitted for the target image features, as shown in equation (16): (16) The following formula (17) uses the least squares method to solve for the slope of the linear regression model. a : (17) Where 'a' represents the changing trend of the target image features within the time window. τ represents the normalized target image feature value corresponding to the time (or frame number), τ represents the frame number (or time sampling point) variable within the time window [t-K+1,t], b represents the intercept term of the linear regression model, t represents the time (or frame number) corresponding to the current frame, and K represents the length of the time window (i.e., the number of frames contained in the window).

[0106] The illumination change trend index value corresponding to the time series characteristic sequence is determined according to the following calculation formula (18). : (18) in, The value of the indicator representing the trend of light intensity variation in weighted average brightness. This indicates its corresponding preset weight; The value of the indicator representing the trend of illumination change within the dynamic range of brightness. This indicates its corresponding preset weight; The indicator value representing the trend of illumination change in the image gradient mean. This indicates the corresponding preset weight.

[0107] In this embodiment, the calculated light change trend index value A positive value indicates that the lighting conditions are continuously improving (becoming brighter), and the indicator value reflects the trend of lighting changes. A negative value indicates that lighting conditions are continuously deteriorating (becoming darker), and the value represents the trend of changes in lighting. If the value approaches 0, it indicates that the illumination is basically stable.

[0108] The illumination change rate index is used to determine how fast the illumination changes. In one possible implementation, the initial change rate is obtained by calculating the time derivative of each type of target image feature in the temporal feature sequence; the initial change rate is then subjected to temporal smoothing to eliminate instantaneous fluctuation interference; and finally, the illumination change rate index is obtained by weighted fusion of the smoothed change rates of the three types of features.

[0109] For example, the initial rate of change of the target image feature f at time t is determined according to the following calculation formula (19). : (19) in, This represents the normalized value of the target image feature f at time t. This represents the normalized target image feature value at time t-Δt. The interval can be 5-10 frames, and the target image feature f can be the weighted average brightness, brightness dynamic range, or image gradient mean.

[0110] The initial rate of change is calculated according to the following formula (20). The time-series smoothing process yields the rate of change in illumination. : (20) in, This represents the rate of illumination change corresponding to the same type of target image features in the previous frame of the video image, and β represents the smoothing coefficient, for example, β=0.3.

[0111] The illumination change rate index value, which comprehensively considers the features of three types of target images, is determined according to the following calculation formula (21). : (twenty one) in, The rate of change of illumination represents the weighted average brightness. This indicates its corresponding preset weight; The rate of change of illumination represents the dynamic range of brightness. This indicates its corresponding preset weight; The rate of change of illumination represents the mean gradient of the image. This indicates the corresponding preset weight.

[0112] In this embodiment, the light change rate index value The larger the value, the faster the change in light intensity.

[0113] The illumination stability index is used to distinguish between real illumination changes and transient fluctuations. One possible implementation calculates the illumination stability index using the sliding variance method. Specifically, for each type of target image feature in the time-series feature sequence, its variance within the sequence window is calculated; the variances of each type of feature are normalized, and the normalized variances are mapped to the 0-1 interval using the hyperbolic tangent function to obtain single-feature stability; then, the illumination stability index is obtained by weighted fusion of the three types of feature stability.

[0114] For example, the variance of the target image feature f within the time window corresponding to time t is determined according to the following calculation formula (22). : (twenty two) in, Used to characterize the degree of fluctuation of this feature. This represents the mean of f within the time window. K represents the normalized target image feature value corresponding to time (or frame number) τ, τ represents the frame number (or time sampling point) variable within the time window [t-K+1,t], and t represents the time or frame number corresponding to the current frame.

[0115] In this embodiment, The larger the value, the more drastic the characteristic fluctuation and the worse the stability.

[0116] The variance of the features of the three types of target images is calculated according to the following formula (23). , , Normalization was performed separately to obtain the normalized stability variance. : (twenty three) in, This represents the variance of the weighted average brightness. The variance represents the dynamic range of brightness. The variance of the mean gradient of the image is represented. To prevent division by zero of small constants (such as...) ).

[0117] The value of the light stability index is determined according to the following formula (24): (twenty four) Where γ is the scaling factor, which can be taken as γ=2, tanh( Let be the hyperbolic tangent function, and map the result to the interval [0,1]. , , To preset weights, .

[0118] In this embodiment, the light stability index value The closer to 1, the more stable the illumination; the closer to 0, the more drastic the illumination fluctuations.

[0119] In this embodiment, the calculated light change trend index, light change rate index, and light stability index comprehensively characterize the dynamic characteristics of light from three dimensions: change direction, change speed, and change stability. The combination of the three in this embodiment enables a comprehensive and accurate analysis of the light change situation.

[0120] E32: Based on the light change trend index value, the light change rate index value, the light stability index value, and the statistical results, determine whether the preset state transition conditions in the state machine are met.

[0121] The state machine includes at least a closed state, an open state, and a pending state; the preset state transition conditions are adaptively adjusted according to the light change rate index value.

[0122] A state machine is a pre-defined logical model used to manage the operation of the black light function. It contains at least three core operating states, each with a clear definition and no overlap: the off state means that the black light function is not started and the device operates in normal mode; the on state means that the black light function is started and low-light imaging quality is improved through technologies such as noise reduction and dynamic range extension; the pending state means that the black light function is not triggered to switch on or off, and the current operating state is maintained. It is used to buffer critical changes or fluctuations in lighting conditions.

[0123] The preset state transition conditions are the criteria defined in the state machine that trigger the switching of the black light function's operating state. The core logic is multi-indicator collaborative verification to avoid erroneous operations caused by a single state or indicator triggering the switch. The transition conditions are not fixed values ​​and need to be adaptively adjusted according to the light change rate indicator value.

[0124] In one possible implementation, the larger the light change rate index value (the faster the light changes), the more relaxed the conversion conditions are, ensuring a rapid response to real light changes; the smaller the light change rate index value (the smoother the light changes), the more strictly the conversion conditions are tightened, avoiding unnecessary switching caused by slight fluctuations.

[0125] E33: If the preset state transition conditions are met, a control command for the black light function of the vehicle-mounted video device is generated.

[0126] If the preset state transition conditions are not met, the current black light function operation state will be maintained, and no switching command will be generated, which is equivalent to generating an implicit command to maintain the current state.

[0127] In one possible implementation, if the final lighting state is a dark light state and its occurrence frequency is greater than a preset dark light frequency threshold, it indicates that the current lighting is insufficient. If both conditions are met simultaneously, an activation command is generated, and the vehicle-mounted video device activates the black light function. This function improves image clarity and image quality through noise reduction and dynamic range expansion technologies. Condition one includes a lighting change trend index value that is less than a lighting continuous deterioration threshold, or a lighting stability index value that is greater than a stable dark light environment threshold. Condition two includes a lighting change rate index value that is greater than a rapid brightening threshold, or a transition state that lasts for more than a preset number of frames.

[0128] In one possible implementation, if the final lighting state is a bright state and its occurrence frequency is greater than a preset bright light frequency threshold, it indicates that the current lighting is sufficient. If both conditions are met simultaneously, a shutdown command is generated to turn off the black light function to reduce system power consumption, and the vehicle video device operates in normal mode. Condition one includes a lighting change trend index value greater than a lighting continuous improvement threshold, or a lighting stability index value greater than a stable bright environment threshold; condition two includes a lighting change rate index value greater than a rapid brightening threshold, or a transition state lasting longer than a preset number of frames.

[0129] In one possible implementation, if the final illumination state is a transitional state, it indicates that the current illumination is in a stable transition range. A command to maintain the current state is generated to avoid the impact of frequent start-stop cycles on the system and imaging effect.

[0130] In this embodiment, by establishing a direct association between the final illumination state and control commands, the illumination situation analysis results are transformed into executable device control signals, enabling precise start and stop control of the black light function. This balances imaging quality and system operating efficiency. Through multi-indicator collaborative judgment and adaptive adjustment of transition conditions, it can accurately distinguish between real illumination changes and slight fluctuations, avoiding erroneous state switching. At the same time, it adapts to illumination change scenarios at different rates, ensuring the timeliness and reliability of state transitions, and providing accurate judgment basis for the generation of subsequent control commands.

[0131] In one possible implementation, historical control data and related temporal characteristics of the black light function are recorded; based on the historical control data, the control parameters in the preset control rules are adaptively optimized. Depending on the different scenarios in which the vehicle is located, parameter configurations corresponding to those scenarios are invoked or learned; wherein, the scenarios are distinguished at least based on the time period of day or night, and the state of the vehicle being in motion or stationary.

[0132] In one possible implementation, to further enhance the long-term adaptability and optimal performance of the black light functional control system, embodiments of this application also provide a long-term performance optimization mechanism based on historical data. This mechanism establishes a quantified performance evaluation index and iteratively optimizes the key parameters of the control system based on this index, thereby enabling the system to adaptively approach its optimal operating state.

[0133] In this embodiment, long-term operational data for evaluation is defined and collected, including: effective black light function activation time, representing the cumulative activation time of the black light function in a real low-light environment; total black light function activation time, representing the total cumulative activation time of the black light function in any environment; switching frequency, which is the number of times the black light function switches between on and off states per unit time; and judgment accuracy, which is an accuracy evaluation value obtained by reviewing and verifying the historical judgment results of the system, and this value is a value between 0 and 1.

[0134] Based on the aforementioned long-term operational data, a comprehensive performance evaluation index is constructed. For example, this performance evaluation index... The following calculation formula (25) is shown: (25) in, Indicates the effective activation time of the black light function. This indicates the total duration the black light function is on. Indicates the switching frequency. Indicates the accuracy rate of the judgment. This represents the effective start time weighting coefficient. This indicates switching the penalty coefficient. This represents the accuracy weighting coefficient. In one possible implementation, =1.0, =0.1, =0.5.

[0135] This ratio is used to measure the effectiveness of the black light function's activation timing; a higher ratio indicates fewer ineffective activations. This is used to penalize frequent switching of control commands; the more frequent the switching, the greater the negative impact on this indicator. This performance evaluation metric is used to reward the accuracy of the system's judgments. The larger the value, the better the overall control performance of the system.

[0136] In one possible implementation, after obtaining the performance evaluation index, the system uses a parameter optimization algorithm, such as gradient descent, to automatically adjust key parameters in the control flow with the goal of maximizing the performance evaluation index.

[0137] This application embodiment employs a long-term performance optimization mechanism, enabling the black light function control system to not rely on fixed parameters but possess self-learning and self-optimization capabilities. This ensures stable control accuracy during long-term operation while minimizing ineffective switching and resource consumption, achieving an optimal balance between energy efficiency and user experience.

[0138] As can be seen from the above, in this embodiment, by acquiring continuous video images captured by the vehicle-mounted camera, the limitations of relying on a single frame image are overcome. Target image features are extracted from the video images, effectively capturing key information reflecting lighting conditions and providing a reliable basis for judging lighting changes. Then, a temporal feature sequence is constructed based on the target image features of multiple consecutive video frames. This fully integrates time-dimensional information, effectively filtering out instantaneous interference caused by brief fluctuations in lighting, and preventing the black light function from being mistakenly triggered by abnormal signals at a single moment, thereby suppressing frequent switching. Furthermore, the lighting quality score of the current frame video image is calculated based on the temporal feature sequence, accurately quantifying the current lighting level, and generating appropriate black light function control commands to achieve precise control of the black light function's start and stop. This solution effectively suppresses frequent switching caused by brief fluctuations in lighting. While improving the accuracy of black light function control, it avoids the additional computational resource consumption caused by unnecessary start and stop due to improper control, reducing processor occupancy and device power consumption, reducing image processing latency, and thus improving system operating efficiency. This ensures that the vehicle-mounted video equipment outputs clear images and maintains stable and efficient operation under various lighting scenarios.

[0139] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0140] Corresponding to the black light control method for vehicle-mounted video equipment described in the above embodiments, Figure 6 A structural block diagram of the vehicle-mounted video equipment black light control device provided in the embodiments of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0141] Reference Figure 6 The vehicle-mounted video equipment black light control device includes: an image acquisition unit 61, a feature extraction unit 62, a sequence construction unit 63, and a black light control unit 64, wherein: Image acquisition unit 61 is used to acquire continuous video images captured by the vehicle-mounted camera; Feature extraction unit 62 is used to extract target image features from the video image; Sequence construction unit 63 is used to construct a temporal feature sequence based on the target image features of consecutive multi-frame video images; The quality scoring unit 64 is used to calculate the illumination quality score of the current frame video image based on the temporal feature sequence. The black light control unit 65 is used to generate control commands for the black light function of the vehicle-mounted video equipment based on the light quality score.

[0142] As one possible implementation of this application, the target image features include weighted average brightness; the feature extraction unit 62 includes: An image segmentation module is used to segment the video image into multiple grid regions; A brightness value calculation module is used to calculate the average brightness value of each of the grid regions; The first feature determination module is used to determine the weighted average brightness of the video image based on the region weight corresponding to each grid region and the average brightness value.

[0143] As one possible implementation of this application, the target image features include brightness dynamic range; the feature extraction unit 62 includes: The histogram acquisition module is used to acquire the brightness histogram of the video image; The numerical determination module is used to determine the first specified percentile value and the second specified percentile value based on the brightness histogram. The second feature determination module is used to determine the brightness dynamic range of the video image based on the difference between the first specified percentile value and the second specified percentile value.

[0144] As one possible implementation of this application, the target image features include the image gradient mean; the feature extraction unit 62 includes: The gradient magnitude calculation module is used to calculate the gradient magnitude of each pixel in the video image using a preset gradient operator. The third feature determination module is used to average the gradient magnitude of all pixels in the video image to obtain the average gradient value of the video image.

[0145] As one possible implementation of this application, the vehicle-mounted video equipment black light control device further includes a motion compensation unit, used for: The motion vector estimation module is used to estimate the global motion vector between the current frame video image and the previous frame video image; The compensation region determination module is used to determine, based on the global motion vector, the compensation region corresponding to each grid region of the current frame video image in the previous frame video image; The difference calculation module is used to calculate the brightness difference between each region of the current frame video image and its corresponding compensation region; A motion compensation module is used to redetermine the target image features based on the brightness difference; The sequence construction unit 63 is also used to construct a temporal feature sequence based on the redefined target image features.

[0146] As one possible implementation of this application, the black light control unit 64 includes: The trend index calculation module is used to calculate the light change trend index value, the light change rate index value, and the light stability index value based on the time-series feature sequence. The quality scoring module is used to calculate the illumination quality score of the current frame video image based on the illumination change trend index value, the illumination change rate index value, and the illumination stability index value. The result determination module is used to determine the illumination status determination result of the current frame video image based on the illumination quality score. The state determination module is used to statistically analyze the illumination state determination results of multiple consecutive video images using a sliding window voting mechanism, and obtain the statistical results. The control module is used to generate control commands for the black light function of the vehicle-mounted video equipment based on the statistical results and preset control rules.

[0147] As one possible implementation of this application, the control module is specifically used for: Based on the light change trend index value, the light change rate index value, the light stability index value, and the statistical results, it is determined whether the preset state transition conditions in the state machine are met; wherein, the state machine includes at least a closed state, an open state, and a pending state; the preset state transition conditions are adaptively adjusted according to the light change rate index value; If the preset state transition conditions are met, a control command for the black light function of the vehicle-mounted video device is generated.

[0148] As can be seen from the above, in this embodiment, by acquiring continuous video images captured by the vehicle-mounted camera, the limitations of relying on a single frame image are overcome. Target image features are extracted from the video images, effectively capturing key information reflecting lighting conditions and providing a reliable basis for judging lighting changes. Then, a temporal feature sequence is constructed based on the target image features of multiple consecutive video frames. This fully integrates time-dimensional information, effectively filtering out instantaneous interference caused by brief fluctuations in lighting, and preventing the black light function from being mistakenly triggered by abnormal signals at a single moment, thereby suppressing frequent switching. Furthermore, the lighting quality score of the current frame video image is calculated based on the temporal feature sequence, accurately quantifying the current lighting level, and generating appropriate black light function control commands to achieve precise control of the black light function's start and stop. This solution effectively suppresses frequent switching caused by brief fluctuations in lighting. While improving the accuracy of black light function control, it avoids the additional computational resource consumption caused by unnecessary start and stop due to improper control, reducing processor occupancy and device power consumption, reducing image processing latency, and thus improving system operating efficiency. This ensures that the vehicle-mounted video equipment outputs clear images and maintains stable and efficient operation under various lighting scenarios.

[0149] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0150] This application embodiment also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements... Figures 1 to 5 The steps of any method for controlling black light in a vehicle-mounted video device are described.

[0151] This application embodiment also provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements... Figures 1 to 5 The steps of any method for controlling black light in a vehicle-mounted video device are described.

[0152] This application also provides a computer program product that, when run on a terminal device, causes the terminal device to execute the implementation of... Figures 1 to 5 The steps of any method for controlling black light in a vehicle-mounted video device are described.

[0153] Figure 7 This is a schematic diagram of a terminal device provided in one embodiment of this application. Figure 7As shown, the terminal device 7 in this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70. When the processor 70 executes the computer program 72, it implements the steps in the various vehicle-mounted video device black light control method embodiments described above, for example... Figure 1 Steps S101 to S105 are shown. Alternatively, when the processor 70 executes the computer program 72, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 6 The functions of units 61 to 65 are shown.

[0154] For example, the computer program 72 may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to complete this application. The one or more modules / units may be a series of computer-readable instruction segments capable of performing a specific function, which describe the execution process of the computer program 72 in the terminal device 7.

[0155] The terminal device 7 may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will understand that... Figure 7 This is merely an example of terminal device 7 and does not constitute a limitation on terminal device 7. It may include more or fewer components than shown, or combine certain components, or different components. For example, terminal device 7 may also include input / output devices, network access devices, buses, etc.

[0156] The processor 70 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0157] The memory 71 can be an internal storage unit of the terminal device 7, such as a hard disk or memory of the terminal device 7. The memory 71 can also be an external storage device of the terminal device 7, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the terminal device 7. Furthermore, the memory 71 can include both internal and external storage units of the terminal device 7. The memory 71 is used to store the computer program and other programs and data required by the terminal device. The memory 71 can also be used to temporarily store data that has been output or will be output.

[0158] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0159] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0160] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / terminal equipment, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0161] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0162] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for controlling black light in a vehicle-mounted video device, characterized in that, include: Acquire continuous video images captured by the vehicle-mounted camera; Extract target image features from the video images; Based on the target image features of consecutive multi-frame video images, a temporal feature sequence is constructed; Based on the temporal feature sequence, calculate the illumination quality score of the current frame video image; Based on the illumination quality score, control instructions for the black light function of the vehicle-mounted video equipment are generated.

2. The method according to claim 1, characterized in that, The target image features include weighted average brightness; the extraction of target image features from the video image includes: The video image is divided into multiple grid regions; Calculate the average brightness value for each of the grid regions; The weighted average brightness of the video image is determined based on the region weight corresponding to each grid region and the average brightness value.

3. The method according to claim 1, characterized in that, The target image features include brightness dynamic range; the extraction of target image features from the video image includes: Obtain the brightness histogram of the video image; Based on the brightness histogram, determine the first specified percentile value and the second specified percentile value; The dynamic range of brightness of the video image is determined based on the difference between the first specified percentile value and the second specified percentile value.

4. The method according to claim 1, characterized in that, The target image features include the image gradient mean; the extraction of target image features from the video image includes: The gradient magnitude of each pixel in the video image is calculated using a preset gradient operator. The average gradient magnitude of all pixels in the video image is obtained by averaging the gradient magnitudes of the video image.

5. The method according to claim 1, characterized in that, Before constructing the temporal feature sequence based on the target image features from consecutive multi-frame video images, the method further includes: Estimate the global motion vector between the current frame and the previous frame of video image; Based on the global motion vector, a compensation region corresponding to each grid region of the current frame video image is determined in the previous frame video image; Calculate the brightness difference between each region of the current frame video image and its corresponding compensation region; Based on the brightness difference, the target image features are redefined; The construction of a temporal feature sequence based on the target image features from multiple consecutive video frames includes: Based on the redefined target image features, a temporal feature sequence is constructed.

6. The method according to claim 1, characterized in that, The target image features include weighted average brightness, brightness dynamic range, and image gradient mean. The calculation of the illumination quality score for the current frame video image based on the temporal feature sequence includes: According to preset weights, the average value of the weighted average brightness, the average value of the brightness dynamic range, and the average value of the image gradient within the time window are weighted and summed to obtain the illumination quality score of the current frame video image; wherein, the time window corresponds to the time range of multiple consecutive video images in the time-series feature sequence, and the preset weights are used to balance the contribution of the weighted average brightness, brightness dynamic range, and image gradient mean to the illumination quality evaluation.

7. The method according to any one of claims 1 to 6, characterized in that, The step of generating control instructions for the black light function of the vehicle-mounted video equipment based on the illumination quality score includes... Based on the illumination quality score, the illumination status determination result of the current frame video image is determined; A sliding window voting mechanism was used to statistically analyze the illumination state determination results of multiple consecutive video frames to obtain statistical results. Based on the statistical results and preset control rules, control instructions for the black light function of the vehicle-mounted video equipment are generated.

8. The method according to claim 7, characterized in that, The step of generating control instructions for the black light function of the vehicle-mounted video equipment based on the statistical results and preset control rules includes: Based on the time-series characteristic sequence, calculate the light change trend index, the light change rate index, and the light stability index. Based on the light change trend index value, the light change rate index value, the light stability index value, and the statistical results, it is determined whether the preset state transition conditions in the state machine are met; wherein, the state machine includes at least a closed state, an open state, and a pending state; the preset state transition conditions are adaptively adjusted according to the light change rate index value; If the preset state transition conditions are met, a control command for the black light function of the vehicle-mounted video device is generated.

9. A black light control device for vehicle-mounted video equipment, characterized in that, include: The image acquisition unit is used to acquire continuous video images captured by the vehicle-mounted camera; The feature extraction unit is used to extract target image features from the video image; A sequence construction unit is used to construct a temporal feature sequence based on the target image features of multiple consecutive video frames; A quality scoring unit is used to calculate the illumination quality score of the current frame video image based on the temporal feature sequence. The black light control unit is used to generate control commands for the black light function of the vehicle-mounted video equipment based on the light quality score.

10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the black light control method for vehicle-mounted video equipment as described in any one of claims 1 to 7.