Exposure control method and device, computer equipment and storage medium
By constructing a distance perception model and saliency map based on camera intrinsic parameters, exposure control parameters are generated, solving the problem of low face recognition rate in backlit scenes, realizing adaptive exposure control on embedded devices, and meeting the real-time requirements of security monitoring and vehicle vision.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-03-13
AI Technical Summary
In backlit scenarios, existing technologies struggle to achieve adaptive exposure control of the face region on embedded devices, leading to a decrease in face recognition rates. Furthermore, existing methods suffer from high computational overhead and poor real-time performance, failing to meet the hard real-time requirements of security monitoring and vehicle vision.
By acquiring the multi-scale texture gradient features of the current frame image, a distance-aware model based on camera intrinsic parameters is constructed, a saliency map is generated, and exposure control parameters are determined based on the saliency map to adjust the image exposure, thus avoiding reliance on the initial face detection results.
It effectively improves facial image quality in backlit environments, solves the fundamental problem of exposure control failing to start, achieves adaptive exposure optimization within millisecond-level response time, and improves facial recognition rate.
Smart Images

Figure CN121665121A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an exposure control method, apparatus, computer device, and storage medium. Background Technology
[0002] In monocular camera-based face recognition and intelligent surveillance applications, insufficient exposure of the face region in backlit scenes is a core technical challenge leading to a sharp drop in recognition rate. Existing solutions mainly follow a sequential processing logic of detection followed by optimization, i.e., first relying on face detection algorithms to locate the face region, and then enhancing the exposure of that region. However, under complex lighting conditions such as strong backlight, high dynamic range, or sidelight, the signal-to-noise ratio of the face region in the initial image is too low, causing the face detection module to fail. In addition, existing methods mostly use global statistics or fixed weight exposure strategies, which are difficult to achieve adaptive balance between the face and background lighting under the limited computing power and power consumption constraints of embedded devices. Although some solutions attempt to introduce complex image segmentation or machine learning models to improve robustness, their computational overhead and poor real-time performance cannot meet the hard real-time requirements of millisecond-level response in scenarios such as security monitoring and vehicle vision.
[0003] Therefore, there is an urgent need for an exposure control method that does not rely on initial face detection results, can quickly adapt to complex lighting conditions, and can effectively improve the quality of face images in backlit environments. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide an exposure control method, apparatus, computer equipment, and storage medium.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides an exposure control method, comprising: Get the current frame image; Extract the multi-scale texture gradient features of the current frame image; Construct a distance-aware model based on camera intrinsic parameters, and map the multi-scale texture gradient features into spatial distance weights according to the distance-aware model; A saliency map is generated based on the spatial distance weights; The exposure control parameters are determined based on the saliency map. Adjust the image exposure according to the exposure control parameters.
[0006] Further, the extraction of multi-scale texture gradient features of the current frame image includes: The current frame image is smoothed using multiple Gaussian kernels of different scales; Gradient convolution operations are performed on the smoothed images at each scale to obtain the initial gradient response maps at each scale. Distance compensation is performed on the initial gradient response maps at various scales based on camera optical parameters; The gradient response maps at each scale after distance compensation are weighted and fused to obtain the multi-scale texture gradient features of the current frame image.
[0007] Furthermore, the distance-aware model includes a distance compensation lookup table constructed based on lens focal length, aperture value, and pixel pitch, which is used to normalize multi-scale texture gradient features.
[0008] Further, the step of generating a saliency map based on the spatial distance weights includes: Obtain the saliency map of the previous frame image; Motion compensation is performed on the saliency map of the previous frame image; The historical saliency after motion compensation is fused with the texture gradient features of the current frame image through a recursive filter to generate the saliency map of the current frame.
[0009] Furthermore, the step of generating a saliency map based on the spatial distance weights further includes: A spatial location prior mask is applied to modulate the saliency map, wherein the spatial location prior mask is an asymmetric Gaussian distribution.
[0010] Further, determining the exposure control parameters based on the saliency map includes: The image is divided into multiple blocks, and the average saliency value of each block is calculated. Block weights are calculated using a nonlinear mapping function based on the average saliency value of each block. The target exposure brightness value is calculated by combining global brightness and block weight.
[0011] Furthermore, it also includes: Perform face detection and obtain face detection confidence scores; Based on the comparison results between the face detection confidence and the dynamic threshold, the face region exposure mode or the texture saliency exposure mode is selected. During mode switching, an exponential decay weighting method is used to smoothly transition exposure parameters.
[0012] Furthermore, it also includes: When the confidence level of face detection is below the threshold for multiple consecutive frames, the texture saliency exposure mode is activated, and in this mode, the brightness of texture areas with near-field optical features is increased first.
[0013] Secondly, the present invention also provides an exposure control device, comprising: The acquisition unit is used to acquire the image of the current frame; The extraction unit is used to extract the multi-scale texture gradient features of the current frame image; The construction unit is used to construct a distance-aware model based on camera intrinsic parameters, and to map the multi-scale texture gradient features into spatial distance weights according to the distance-aware model. The first generation unit is used to generate a saliency map based on the spatial distance weights; The second generation unit is used to determine exposure control parameters based on the saliency map; An adjustment unit is used to adjust the image exposure according to the exposure control parameters.
[0014] Thirdly, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement an exposure control method as described above.
[0015] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform an exposure control method as described above.
[0016] The beneficial effects of this invention compared to existing technologies are as follows: An exposure control method includes: acquiring a current frame image; extracting multi-scale texture gradient features of the current frame image; constructing a distance-aware model based on camera intrinsic parameters, and mapping the multi-scale texture gradient features to spatial distance weights according to the distance-aware model; generating a saliency map based on the spatial distance weights; determining exposure control parameters based on the saliency map; and adjusting image exposure according to the exposure control parameters. By analyzing the texture gradient features of the image and using camera intrinsic parameters for distance-aware mapping, it can proactively infer and prioritize the exposure of areas closer to the camera and more likely to be the subject in the image when targets such as faces are not successfully detected. This avoids the problem of the entire exposure process deadlocking due to initial detection failure and solves the fundamental problem of exposure control failing to start under adverse lighting conditions such as backlighting.
[0017] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other objectives, features and advantages of the present invention more obvious and understandable, preferred embodiments are described in detail below. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A flowchart illustrating an exposure control method provided in a specific embodiment of the present invention; Figure 2 A schematic block diagram of an exposure control device provided for a specific embodiment of the present invention; Figure 3 This is a schematic block diagram of a computer device provided for a specific embodiment of the present invention. Detailed Implementation
[0020] The technical solution of the present invention will be clearly and completely described below with reference to specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0022] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0023] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0024] This invention provides an exposure control method, comprising the following steps: S10-S60.
[0025] S10. Obtain the current frame image.
[0026] In this embodiment, an image sensor of a monocular imaging device is used to convert optical signals into digital signals and acquire raw RAW format images. The hardware intrinsic parameters of this monocular imaging device need to be pre-calibrated, specifically including the lens focal length f, for example, 3.8mm, the aperture Fn, for example, F / 2.2, and the image sensor pixel pitch p, for example, 1.12μm. These intrinsic parameters will provide the basic parameters for the subsequent construction of the distance perception model.
[0027] First, the original RAW image is converted to an 8-bit grayscale image to eliminate the interference of color channels on gradient feature extraction. Then, Gaussian filtering is used to denoise the grayscale image, with a Gaussian kernel size of σ=1.5. Convolution operations are then used to filter out random salt-and-pepper noise and electronic noise in the image, avoiding noise interference with subsequent gradient calculations. Simultaneously, the global brightness of the preprocessed image is statistically analyzed. Specifically, this involves calculating the average grayscale value of all pixels in the image. For example, when the image has a resolution of 1920×1080, the grayscale values of all 2,073,600 pixels are traversed and the arithmetic mean is calculated to obtain the global brightness baseline value, which provides a reference for subsequent exposure target value calculation.
[0028] By converting RAW images to grayscale and performing Gaussian denoising, redundant information and noise interference in the color channels were eliminated, ensuring the accuracy of subsequent feature extraction. Pre-calibrating camera intrinsic parameters and statistically analyzing global brightness laid the data foundation for the construction of the distance perception model and the decision-making of exposure parameters.
[0029] S20. Extract the multi-scale texture gradient features of the current frame image.
[0030] By using multi-scale gradient operators and optical parameter compensation, gradient responses of different textures in the image are extracted, thereby characterizing the edge and contour information of objects in the image and providing core features for subsequent spatial distance weight mapping.
[0031] In some embodiments, step S20 specifically includes the following steps: S201-S204.
[0032] S201. Use multiple Gaussian kernels of different scales to smooth the current frame image.
[0033] S202. Perform gradient convolution operations on the smoothed images at each scale to obtain the initial gradient response maps at each scale.
[0034] S203. Distance compensation is performed on the initial gradient response map at each scale based on the camera optical parameters.
[0035] S204. Weighted fusion of the gradient response maps at each scale after distance compensation is performed to obtain the multi-scale texture gradient features of the current frame image.
[0036] For steps S201-S204, in this embodiment, a Gaussian kernel scale set is selected. Gaussian smoothing was applied to the preprocessed grayscale images, where σ=1.2 corresponds to fine texture scale, σ=2.0 corresponds to medium texture scale, and σ=3.5 corresponds to coarse outline scale.
[0037] For the images after Gaussian smoothing at each scale, convolution operations are performed using multi-scale gradient operators (such as Sobel and Scharr operators) to obtain the initial gradient response maps at each scale, and eight orientation angles are selected. For directional weighted fusion, taking pixel (x, y) as an example, the gradient magnitude calculation formula is as follows: In the formula, x and y are the horizontal and vertical coordinates of the pixel, respectively, and I is the input image; This is a convolution operation; The Scharr kernel function has a scale of [value missing]. The initial gradient response value of the pixel at the corresponding scale is obtained by merging the average gradient magnitudes of the eight directions.
[0038] Distance compensation is performed on the initial gradient response maps at various scales based on camera optical parameters, using a distance compensation lookup table. Where k is an empirical coefficient, with a reasonable value range of 0.5 to 2.0. is the Gaussian kernel scale, used to control the degree of blurring in the gradient; f is the lens focal length. Where is the lens aperture, and p represents the pixel pitch of the image sensor, i.e., the physical distance between the centers of two adjacent pixels, in micrometers (μm). Weighted fusion of the distance-compensated gradient response maps at each scale yields the multi-scale texture gradient features of the current frame image, mathematically expressed as: In the formula, The scale weights are empirical values (0.3, 0.4, 0.7). The Gaussian kernel scale controls the texture coarseness; The result of convolution using the Scharr operator; This is a lookup table for distance compensation based on optical parameters (focal length, aperture, and pixel pitch).
[0039] For steps S201-S204, multi-scale Gaussian smoothing and orientation-weighted fusion ensure the scale robustness and rotation invariance of gradient features; the distance compensation mechanism deeply couples optical hardware parameters with gradient features, realizes the correlation between texture gradient and object imaging distance, significantly enhances the gradient response of near objects, and provides a core basis for subsequent prediction of face regions.
[0040] S30. Construct a distance-aware model based on camera intrinsic parameters, and map multi-scale texture gradient features to spatial distance weights according to the distance-aware model. The distance-aware model includes a distance compensation lookup table built based on lens focal length, aperture value, and pixel pitch. The distance-compensated lookup table is used to normalize multi-scale texture gradient features.
[0041] Step S30 involves transforming the multi-scale texture gradient features extracted in the previous step S2, which only reflect the two-dimensional texture features of the image, into spatial distance weights that can reflect the three-dimensional spatial information of the scene, through a mathematical model based on the physical laws of camera optical imaging.
[0042] The core principle of distance-aware models is that the intensity of the texture gradient response of near-field objects is negatively correlated with the imaging distance under optical constraints. That is, the closer the object is to the camera, the stronger the gradient response, and the greater the corresponding spatial distance weight. Specifically, this involves calculating the multi-scale texture gradient value for each pixel in the image. Combined with its corresponding The values are normalized to obtain the spatial distance weight of the pixel: In the formula, The maximum gradient value of the entire image is denoted as . After normalization, the weight values range from [0,1]. The larger the weight value, the closer the object corresponding to the pixel is to the camera, and the more likely it is to be a face region that needs to be exposed first.
[0043] For step S30, the distance perception model decouples the algorithm from the hardware intrinsic parameters; the spatial distance weight mapping transforms the texture gradient features into spatial distance representations, enabling the prediction of near-field face regions without detection, and solving the deadlock problem of initial detection failure under backlight (referring to the vicious cycle of insufficient exposure, detection failure, inability to optimize exposure, and further detection failure that a monocular imaging system falls into due to initial face detection failure under complex lighting conditions such as backlight).
[0044] S40. Generate a saliency map based on spatial distance weights.
[0045] Step S40 generates a saliency map that combines spatiotemporal consistency and facial region bias through temporal recursive filtering, motion compensation, and spatial prior mask modulation, thereby quantifying the visual importance of each region in the image.
[0046] In some embodiments, step S40 specifically includes the following steps: S401-S403.
[0047] S401. Obtain the saliency map of the previous frame image.
[0048] S402. Perform motion compensation on the saliency map of the previous frame image.
[0049] S403. The historical saliency after motion compensation is fused with the texture gradient features of the current frame image through a recursive filter to generate the saliency map of the current frame.
[0050] For S401-S403, in this embodiment, the saliency map SPrev of the previous frame image is obtained, and motion compensation is performed on it using a block matching algorithm, that is... The image is divided into 16×16 blocks. Using the corresponding image block in the current frame as a reference, the optimal matching block is searched within a range of ±8 pixels. The inter-frame displacement offset (Δx, Δy) is calculated, and the image is then processed according to this offset. Pixel offset compensation is performed to obtain the motion-compensated historical saliency map. This ensures the continuity of saliency information between frames.
[0051] The IIR recursive filter is used to fuse the historical saliency after motion compensation with the texture gradient features of the current frame. The fusion formula is as follows: ; In the formula, λ is the dynamic smoothing coefficient: It will adjust according to the gradient direction difference; MC is for motion compensation, and the offset (Δx, Δy) is calculated using optical flow; C is the center prior mask. ; The saliency of the previous frame is represented by W; the image width is represented by H; and the image height is represented by H.
[0052] Post-processing optimization involves performing connected component analysis on the fused preliminary saliency map, removing isolated noise regions with an area less than 32 pixels, and then smoothing it using a 3×3 median filter. Finally, the optimized current frame saliency map S is obtained. The larger the pixel value in the map, the higher the visual importance of the region, and the more priority should be given to ensuring its exposure.
[0053] For step S40, motion compensation and temporal recursive filtering ensure the inter-frame smoothness of the saliency map and reduce the amplitude of exposure parameter jumps; the asymmetric spatial prior mask enhances the saliency of the face region, making the saliency map have a face position bias; after post-processing optimization, it provides accurate regional importance basis for subsequent exposure parameter decisions.
[0054] S50. Determine the exposure control parameters based on the saliency map.
[0055] Step S50 calculates the precise target exposure brightness and corresponding exposure control parameters through block-based weight mapping and multi-factor fusion.
[0056] In some embodiments, step S50 specifically includes the following steps: S501-S503.
[0057] S501. Divide the image into multiple blocks and calculate the average saliency value of each block.
[0058] S502. Calculate the block weight using a nonlinear mapping function based on the average saliency value of each block.
[0059] S503. Calculate the target exposure brightness value by combining global brightness and block weight.
[0060] For steps S501-S503, in this embodiment, the current frame image is divided into M×N grid blocks, each with a resolution of Width / M∗Height / N, and the average saliency value Sb of each block is calculated; an S-shaped nonlinear mapping function is used to convert Sb into block exposure weights. In the formula, the sensitivity coefficient k = 0.1, and T is the adaptive threshold, determined by the histogram bimodal method. and .
[0061] Target exposure brightness calculation combined with global brightness Block weight and block brightness The robust target exposure brightness value is calculated using the following formula: Where α=0.3 is the global weight coefficient, which is periodically fine-tuned to prevent background overexposure; This is to prevent the removal of the zero constant.
[0062] For steps S501-S503, the block-based weight mapping realizes the differentiation of exposure priorities at the regional level, and the S-shaped function ensures the smoothness of weight transition; the target exposure brightness integrates global and local regional features, which avoids background overexposure and ensures sufficient exposure of highly salient areas (such as faces); the exposure parameter conversion realizes the accurate conversion of brightness target to hardware parameters, meeting the real-time requirements.
[0063] S60. Adjust the image exposure according to the exposure control parameters.
[0064] Specifically, the shutter speed and gain parameters obtained in step S50 are sent to the image signal processor (ISP) of the monocular imaging device. The ISP then performs hardware adjustments to the exposure parameters, such as adjusting the shutter speed from 1 / 500s to 1 / 120s and the gain from 1x to 2x, to achieve exposure compensation for the current frame image.
[0065] In some embodiments, the exposure control method further includes the following steps: S70-S90.
[0066] S70. Perform face detection and obtain face detection confidence.
[0067] S80. Based on the comparison results of face detection confidence and dynamic threshold, select to use either face region exposure mode or texture saliency exposure mode.
[0068] S90. During mode switching, an exponential decay weight is used to smoothly transition exposure parameters.
[0069] For S70-S90, in this embodiment, after completing the exposure adjustment, the Lightweight Face Detection DFL-SBD is immediately invoked to re-perform face detection and obtain the face detection confidence score. Simultaneously calculate the dynamic switching threshold: In the formula, Y(t) is the global brightness of the current frame, C(t-1) is the face confidence of the previous frame, and t is the frame.
[0070] when > When, smoothly switch to Face-ROI exposure mode (precise exposure based on the face region); when During mode switching, maintain the Texture exposure mode (robust exposure based on texture saliency). An exponentially decaying weight ω is used when switching modes. The transition formula is: This avoids image flickering caused by sudden changes in exposure parameters.
[0071] For example, the initial face detection confidence level in a backlit scene. =0.3, =0.42, after exposure in Texture mode, the image brightness is increased to the target value, and the confidence score for face detection rises to 0.85. > The system smoothly switches to Face-ROI mode within 2 frames, further improving the exposure accuracy of the face region. Finally, the average grayscale value of the face region reaches 120, which meets the image quality requirements for face recognition.
[0072] In summary, by analyzing the texture gradient features of images and using camera intrinsic parameters for distance-aware mapping, the system can proactively infer and prioritize the exposure of areas closer to the camera and more likely to be the subject when targets such as faces are not successfully detected. This avoids the problem of the entire exposure process being deadlocked due to initial detection failure and solves the fundamental problem of exposure control failing to start under adverse lighting conditions such as backlighting.
[0073] 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 the present invention.
[0074] This invention also provides an exposure control device for performing the steps of any of the aforementioned embodiments of the exposure control method. Specifically, please refer to... Figure 2 , Figure 2 A schematic block diagram of an exposure control device 100 provided in an embodiment of this application is shown. The exposure control device 100 specifically includes: The acquisition unit 110 is used to acquire the current frame image; the extraction unit 120 is used to extract the multi-scale texture gradient features of the current frame image; the construction unit 130 is used to construct a distance-aware model based on camera intrinsic parameters, and map the multi-scale texture gradient features to spatial distance weights according to the distance-aware model; the first generation unit 140 is used to generate a saliency map according to the spatial distance weights; the second generation unit 150 is used to determine the exposure control parameters according to the saliency map; and the adjustment unit 160 is used to adjust the image exposure according to the exposure control parameters.
[0075] In one embodiment, the extraction unit 120 is specifically used to: smooth the current frame image using multiple Gaussian kernels of different scales; perform gradient convolution operations on the smoothed images at each scale to obtain initial gradient response maps at each scale; perform distance compensation on the initial gradient response maps at each scale based on camera optical parameters; and perform weighted fusion on the distance-compensated gradient response maps at each scale to obtain multi-scale texture gradient features of the current frame image.
[0076] In one embodiment, the first generation unit 140 is specifically used to: obtain the saliency map of the previous frame image; perform motion compensation on the saliency map of the previous frame image; and fuse the motion-compensated historical saliency with the texture gradient features of the current frame image through a recursive filter to generate the saliency map of the current frame.
[0077] In one embodiment, the first generation unit 140 is further specifically used to: apply a spatial location prior mask to modulate the saliency map, wherein the spatial location prior mask is an asymmetric Gaussian distribution.
[0078] In one embodiment, the second generation unit 150 is specifically used to: divide the image into multiple blocks and calculate the average saliency value of each block; calculate the block weights based on the average saliency value of each block using a nonlinear mapping function; and calculate the target exposure brightness value by combining the global brightness and the block weights.
[0079] In one embodiment, the exposure control device is further configured to: perform face detection and obtain face detection confidence; select a face region exposure mode or a texture saliency exposure mode based on the comparison result of the face detection confidence and a dynamic threshold; and use exponential decay weighting to smoothly transition the exposure parameters during the mode switching process.
[0080] In one embodiment, the exposure control device is further configured to: activate a texture saliency exposure mode when the confidence level of face detection is lower than a threshold for multiple consecutive frames, and in this mode, prioritize increasing the brightness of texture regions with near-field optical features.
[0081] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned exposure control device 100 and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0082] The aforementioned exposure control device can be implemented as a computer program, which can, for example, Figure 3 It runs on the computer device shown.
[0083] Please see Figure 3 , Figure 3 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 700 can be a server, wherein the server can be a standalone server or a server cluster composed of multiple servers.
[0084] like Figure 3 As shown, the computer device includes 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 exposure control method steps described above.
[0085] The computer device 700 includes a processor 720, a memory, and a network interface 750 connected via a system bus 710, wherein the memory may include a non-volatile storage medium 730 and internal memory 740.
[0086] The non-volatile storage medium 730 can store an operating system 731 and a computer program 732. When the computer program 732 is executed, it causes the processor 720 to perform an exposure control method.
[0087] The processor 720 provides computing and control capabilities to support the operation of the entire computer device 700.
[0088] The internal memory 740 provides an environment for the operation of the computer program 732 in the non-volatile storage medium 730. When the computer program 732 is executed by the processor 720, the processor 720 can perform an exposure control method.
[0089] This network interface 750 is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 3The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 700 to which the present application is applied. The specific computer device 700 may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. The processor 720 is used to run program code stored in memory to implement the exposure control method.
[0090] Those skilled in the art will understand that Figure 3 The embodiments of the computer device shown do not constitute a limitation on the specific configuration of the computer device. In other embodiments, the computer device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. For example, in some embodiments, the computer device may include only memory and a processor. In such embodiments, the structure and function of the memory and processor are different from those shown. Figure 3 The embodiments shown are consistent and will not be repeated here.
[0091] It should be understood that in the embodiments of this application, the processor 720 may be a central processing unit (CPU), or it may be 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 may be a microprocessor or any conventional processor.
[0092] In another embodiment of the present invention, a computer-readable storage medium is provided. This computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the exposure control method disclosed in the embodiments of the present invention.
[0093] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.
[0094] In the embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Units with the same function may be grouped into one unit. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, or may be electrical, mechanical, or other forms of connection.
[0095] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.
[0096] Furthermore, the functional units in the various embodiments of the present invention 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.
[0097] 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 storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks.
[0098] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An exposure control method, characterized in that, include: Get the current frame image; Extract the multi-scale texture gradient features of the current frame image; Construct a distance-aware model based on camera intrinsic parameters, and map the multi-scale texture gradient features into spatial distance weights according to the distance-aware model; A saliency map is generated based on the spatial distance weights; The exposure control parameters are determined based on the saliency map. Adjust the image exposure according to the exposure control parameters.
2. The exposure control method according to claim 1, characterized in that, The extraction of multi-scale texture gradient features of the current frame image includes: The current frame image is smoothed using multiple Gaussian kernels of different scales; Gradient convolution operations are performed on the smoothed images at each scale to obtain the initial gradient response maps at each scale. Distance compensation is performed on the initial gradient response maps at various scales based on camera optical parameters; The gradient response maps at each scale after distance compensation are weighted and fused to obtain the multi-scale texture gradient features of the current frame image.
3. The exposure control method according to claim 1, characterized in that, The distance-aware model includes a distance compensation lookup table built based on lens focal length, aperture value, and pixel pitch. The distance compensation lookup table is used to normalize multi-scale texture gradient features.
4. The exposure control method according to claim 1, characterized in that, The step of generating a saliency map based on the spatial distance weights includes: Obtain the saliency map of the previous frame image; Motion compensation is performed on the saliency map of the previous frame image; The historical saliency after motion compensation is fused with the texture gradient features of the current frame image through a recursive filter to generate the saliency map of the current frame.
5. The exposure control method according to claim 4, characterized in that, The step of generating a saliency map based on the spatial distance weights further includes: A spatial location prior mask is applied to modulate the saliency map, wherein the spatial location prior mask is an asymmetric Gaussian distribution.
6. The exposure control method according to claim 1, characterized in that, The step of determining the exposure control parameters based on the saliency map includes: The image is divided into multiple blocks, and the average saliency value of each block is calculated. Block weights are calculated using a non-linear mapping function based on the average saliency value of each block. The target exposure brightness value is calculated by combining global brightness and block weight.
7. The exposure control method according to claim 1, characterized in that, Also includes: Perform face detection and obtain face detection confidence scores; Based on the comparison results between the face detection confidence and the dynamic threshold, the face region exposure mode or the texture saliency exposure mode is selected. During mode switching, an exponential decay weighting method is used to smoothly transition exposure parameters.
8. The exposure control method according to claim 7, characterized in that, Also includes: When the confidence level of face detection is below the threshold for multiple consecutive frames, the texture saliency exposure mode is activated, and in this mode, the brightness of texture areas with near-field optical features is increased first.
9. An exposure control device, characterized in that, include: The acquisition unit is used to acquire the image of the current frame; The extraction unit is used to extract the multi-scale texture gradient features of the current frame image; The construction unit is used to construct a distance-aware model based on camera intrinsic parameters, and to map the multi-scale texture gradient features into spatial distance weights according to the distance-aware model. The first generation unit is used to generate a saliency map based on the spatial distance weights; The second generation unit is used to determine exposure control parameters based on the saliency map; An adjustment unit is used to adjust the image exposure according to the exposure control parameters.
10. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements an exposure control method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform an exposure control method as described in any one of claims 1 to 8.