Image brightness adjustment method, device, electronic device and storage medium

By determining the brightness mode of the area of ​​interest and adjusting the exposure parameters, the problem that the license plate exposure algorithm cannot take into account both the license plate display and the overall image display is solved, and moderate adjustment of the license plate brightness and the global image brightness is achieved, improving the image display effect.

CN115734077BActive Publication Date: 2025-08-29ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211290413.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-21
Publication Date
2025-08-29
Estimated Expiration
2042-10-21

AI Technical Summary

Technical Problem

In the prior art, the license plate exposure algorithm cannot take into account the license plate display effect and the overall display effect of the image, resulting in the problem of overexposed image under backlight and the overall brightness of the image under straight light.

Method used

By determining the brightness mode of the area of ​​interest, selecting the image to be detected in the subject frame, and adjusting the overall exposure parameters based on the brightness of the area of ​​interest in the subject frame, so that the brightness of the area of ​​interest in the subject frame and the global brightness of the image to be detected in the non-subject frame are both within the preset brightness range, realizing the adjustment of dynamic exposure parameters.

Benefits of technology

While ensuring the display effect of the license plate, the global display effect of the image is improved, so that the license plate brightness and the global brightness of the image are within a moderate brightness range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115734077B_ABST
    Figure CN115734077B_ABST
Patent Text Reader

Abstract

The present application relates to an image brightness adjustment method, device, electronic device, and storage medium, wherein the image brightness adjustment method includes: determining a brightness mode of an area of ​​interest in an image to be detected based on the brightness of the area of ​​interest and the global brightness; determining a subject frame to be detected from a long-frame image to be detected and a short-frame image to be detected based on the determined brightness mode; adjusting the overall exposure parameters of the image to be detected based on the brightness of the subject frame area of ​​interest of the subject frame to be detected image, so that the brightness of the subject frame area of ​​interest and the global brightness of the non-subject frame to be detected images are both within a preset brightness range, thereby obtaining a target image. The method can dynamically adjust the exposure parameters based on different brightness modes, thereby taking into account the license plate brightness and the global image brightness, so that both are within a moderate brightness range, thereby ensuring the display effect of the license plate while improving the overall display effect of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to an image brightness adjustment method, device, electronic device, and storage medium. Background Art

[0002] Currently, with increasing demands for superior vehicle capture in road surveillance, the automatic exposure and license plate exposure algorithms used in related technologies often sacrifice overall image quality in order to maintain a good license plate display. However, the more severe the backlighting and frontlighting of the license plate, the worse the overall image quality. This results in overexposure in backlight conditions and low brightness in frontlight conditions. Consequently, current license plate exposure algorithms struggle to balance the effects of both license plate and overall image quality.

[0003] With regard to the problem in related technologies that it is impossible to balance the license plate display effect and the overall image display effect, no effective solution has been proposed so far. Summary of the Invention

[0004] In this embodiment, a method, device, electronic device and storage medium for adjusting image brightness are provided to solve the problem in related technologies that both the license plate display effect and the overall image display effect cannot be taken into account.

[0005] In a first aspect, this embodiment provides an image brightness adjustment method, including:

[0006] Determine a brightness mode of the region of interest based on the brightness of the region of interest in the image to be detected and the global brightness; wherein the image to be detected includes a long-frame image to be detected and a short-frame image to be detected; and the brightness mode is a light projection method of the region of interest;

[0007] Determining a main frame image to be detected from the long frame image to be detected and the short frame image to be detected according to the determined brightness mode;

[0008] The overall exposure parameters of the image to be detected are adjusted based on the brightness of the subject frame's region of interest of the subject frame's image to be detected, so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range, thereby obtaining a target image.

[0009] In some embodiments, determining the brightness mode of the region of interest based on the brightness of the region of interest and the global brightness in the image to be detected includes:

[0010] The brightness mode of the region of interest is determined according to a brightness ratio of the brightness of the region of interest to the global brightness in the image to be detected.

[0011] In some embodiments, before determining the brightness pattern of the region of interest based on the brightness ratio of the region of interest to the global brightness in the image to be detected, the method further includes:

[0012] When the global brightness of the short-frame image to be detected meets a preset first brightness condition, the ratio of the brightness of the region of interest in the short-frame image to be detected to the global brightness of the short-frame image to be detected is determined as the brightness ratio; otherwise, the ratio of the brightness of the region of interest in the long-frame image to be detected to the global brightness of the long-frame image to be detected is determined as the brightness ratio.

[0013] In some embodiments, determining the brightness mode of the region of interest based on a brightness ratio of the region of interest to the global brightness in the image to be detected includes:

[0014] When a brightness ratio of the luminance of the region of interest to the global luminance in the image to be detected meets a preset first ratio range, determining the luminance mode of the region of interest as a front light mode;

[0015] When the brightness ratio falls within a preset second ratio range, determining the brightness mode as a normal mode;

[0016] When the brightness ratio conforms to a preset third ratio range, the brightness mode is determined as a backlight mode; wherein the value of the first ratio range is greater than the value of the second ratio range, and the value of the second ratio range is greater than the value of the third ratio range.

[0017] In some embodiments, determining the subject frame image to be detected from the long frame image to be detected and the short frame image to be detected according to the determined brightness mode includes:

[0018] When the brightness mode is a front-light mode, determining the short-frame image to be detected as a main-frame image to be detected;

[0019] When the brightness mode is the backlight mode, the long-frame image to be detected is determined as the main-frame image to be detected.

[0020] In some embodiments, when the brightness mode is a front-light mode or a backlight mode, adjusting the overall exposure parameters of the image to be detected based on the brightness of the subject frame region of interest of the subject frame image to be detected so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range, to obtain a target image, includes:

[0021] Based on the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected, the overall exposure parameters of the image to be detected are adjusted so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range, and a target image is obtained based on the adjusted exposure parameters.

[0022] In some embodiments, adjusting the overall exposure parameter of the image to be detected based on the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range includes:

[0023] When the brightness of the subject frame region of interest meets a preset high brightness condition, an adjustment ratio is calculated according to the brightness of the subject frame region of interest, and whether the global brightness of the non-subject frame to be detected image meets a preset brightness increase condition;

[0024] If so, adjusting the overall exposure parameter according to the adjustment ratio to increase the global brightness of the non-subject frame to be detected image and reduce the brightness of the subject frame region of interest;

[0025] Otherwise, the overall exposure parameter is reduced in combination with the adjustment ratio and a preset exposure algorithm so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range.

[0026] In some embodiments, adjusting the overall exposure parameter of the image to be detected based on the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range further includes:

[0027] When the brightness of the subject frame region of interest meets the preset low brightness condition, an adjustment ratio is calculated according to the brightness of the subject frame region of interest, and whether the global brightness of the non-subject frame to be detected image meets the preset brightness reduction condition;

[0028] If so, adjusting the overall exposure parameter according to the adjustment ratio to reduce the global brightness of the non-subject frame to be detected image and increase the brightness of the subject frame region of interest;

[0029] Otherwise, the overall exposure parameter is increased in combination with the adjustment ratio and a preset exposure algorithm so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range.

[0030] In some embodiments, adjusting the overall exposure parameter of the image to be detected based on the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range further includes:

[0031] When the brightness of the subject frame region of interest is within a preset brightness range, the exposure parameters of the non-subject frame image to be detected are adjusted according to the global brightness of the non-subject frame image to be detected so that the global brightness of the non-subject frame image to be detected is within the preset brightness range.

[0032] In some embodiments, adjusting the overall exposure parameter of the image to be detected based on the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range further includes:

[0033] When the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range, determining whether the non-subject frame region of interest of the non-subject frame image to be detected meets a preset exposure condition;

[0034] If not, the overall exposure parameter is adjusted based on the brightness of the non-subject frame region of interest, so that the non-subject frame region of interest meets the preset exposure condition.

[0035] In some embodiments, when the brightness mode is the normal mode, adjusting the overall exposure parameter of the image to be detected based on the brightness of the subject frame region of interest of the subject frame image to be detected so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range, to obtain a target image, includes:

[0036] When the brightness of the subject frame region of interest is outside a preset brightness range, adjusting the overall exposure parameter according to the brightness of the subject frame region of interest so that the brightness of the subject frame region of interest is within the preset brightness range;

[0037] When the brightness of the subject frame region of interest is within a preset brightness range, determine whether the non-subject frame region of interest of the non-subject frame to be detected image meets the preset exposure conditions; if not, adjust the exposure parameters of the non-subject frame to be detected image based on the brightness of the non-subject frame region of interest so that the non-subject frame region of interest meets the preset exposure conditions to obtain a target image.

[0038] In a second aspect, an image brightness adjustment device is provided in this embodiment, comprising: a first determination module, a second determination module, and an adjustment module; wherein:

[0039] The first determination module is configured to determine a brightness mode of the region of interest based on the brightness of the region of interest in the image to be detected and the global brightness; wherein the image to be detected includes a long-frame image to be detected and a short-frame image to be detected; and the brightness mode is a light projection method of the region of interest;

[0040] The second determining module is configured to determine a main frame image to be detected from the long frame image to be detected and the short frame image to be detected according to the determined brightness mode;

[0041] The adjustment module is used to adjust the overall exposure parameters of the image to be detected based on the brightness of the subject frame area of ​​interest of the subject frame image to be detected, so that the brightness of the subject frame area of ​​interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range to obtain a target image.

[0042] In a third aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image brightness adjustment method described in the first aspect when executing the computer program.

[0043] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored. When the program is executed by a processor, the image brightness adjustment method described in the first aspect is implemented.

[0044] Compared to related art, the image brightness adjustment method, apparatus, electronic device, and storage medium provided in this embodiment determine a brightness mode for the region of interest based on the brightness of the region of interest and the global brightness in the image to be detected. The image to be detected includes a long-frame image to be detected and a short-frame image to be detected. The brightness mode is the way light is projected across the region of interest. Based on the determined brightness mode, a subject frame image to be detected is determined from the long-frame image to be detected and the short-frame image to be detected. Based on the brightness of the subject frame region of interest of the subject frame image to be detected, the overall exposure parameters of the image to be detected are adjusted so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame images to be detected are both within a preset brightness range, thereby obtaining a target image. This method can dynamically adjust exposure parameters based on different brightness modes, thereby balancing the license plate brightness and the global image brightness, ensuring that both are within a moderate brightness range. This improves the overall image display quality while ensuring the license plate display quality.

[0045] The details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0047] Figure 1 is a hardware structure block diagram of a terminal of the image brightness adjustment method of this embodiment;

[0048] Figure 2 is a flow chart of the image brightness adjustment method of this embodiment;

[0049] Figure 3 is a flow chart of the license plate brightness mode determination method of the preferred embodiment;

[0050] Figure 4 This is a flow chart of the method for adjusting the brightness of a license plate in the forward lighting mode of the preferred embodiment;

[0051] Figure 5 This is a flow chart of the brightness adjustment method in the license plate backlight mode of the preferred embodiment;

[0052] Figure 6 This is a flow chart of the method for adjusting the brightness of a license plate in normal mode according to the preferred embodiment;

[0053] Figure 7 It is a structural block diagram of an image brightness adjustment device. DETAILED DESCRIPTION

[0054] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0055] Unless otherwise defined, the technical terms or scientific terms involved in this application should have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "an", "a", "the", "these" and the like in this application do not indicate quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "plurality" involved in this application refers to two or more. "And / or" describes the relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, and B exists alone. Generally, the character " / " indicates that the related objects are in an "or" relationship. The terms "first," "second," "third," etc. used in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0056] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a block diagram of the hardware structure of the terminal of the image brightness adjustment method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0057] The memory 104 can be used to store computer programs, such as software programs and modules of application software, such as the computer program corresponding to the image brightness adjustment method in this embodiment. The processor 102 executes the computer program stored in the memory 104 to execute various functional applications and data processing, thereby implementing the above-mentioned method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0058] The transmission device 106 is used to receive or send data via a network. The network may include a wireless network provided by the terminal's telecommunications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0059] In this embodiment, a method for adjusting image brightness is provided. Figure 2 is a flow chart of the image brightness adjustment method of this embodiment. Figure 2 As shown, the process includes the following steps:

[0060] Step S210, determining a brightness mode of the region of interest based on the brightness of the region of interest in the image to be detected and the global brightness; wherein the image to be detected includes a long-frame image to be detected and a short-frame image to be detected; and the brightness mode is a light projection method of the region of interest.

[0061] Specifically, based on High Dynamic Range Imaging (HDR or HDRI), an image sensor can be used to collect long-frame images to be detected and short-frame images to be detected. The long-frame images to be detected are images with a longer exposure time, and the short-frame images to be detected are images with a shorter exposure time. Exemplarily, the exposure time of the long-frame images to be detected can be the product of the exposure time of the short-frame images to be detected and the exposure ratio. In addition, the region of interest in the image to be detected is an area identified from the image to be detected based on the needs of the actual application scenario and in combination with a preset image recognition algorithm. For example, for a vehicle capture scene, since it is necessary to clarify the identity information of the vehicle based on the license plate, the license plate area in the image to be detected can be determined as the region of interest. For another example, for a pedestrian detection scene, the area where the target human body is located in the image to be detected can be determined as the region of interest. In addition, the brightness mode of the above-mentioned region of interest refers to the light projection method of the region of interest, such as front light mode, backlight mode or normal mode.

[0062] Taking the vehicle capture scene as an example, the long frame image to be detected and the short frame image to be detected captured are subjected to vehicle recognition by a preset vehicle recognition algorithm to determine whether a vehicle is present. If so, the identification information, license plate area coordinates, and license plate color of the target vehicle are output. Otherwise, the image to be detected is not subjected to subsequent processing. Next, the average brightness of the global image of the long frame image to be detected can be calculated as the global brightness of the long frame image to be detected, and the average brightness of the global image of the short frame image to be detected can be calculated as the global brightness of the short frame image to be detected. And, the brightness of the region of interest of the long frame image to be detected and the brightness of the region of interest of the short frame image to be detected are calculated respectively. Based on the brightness and global brightness of the above-mentioned region of interest, the brightness pattern of the region of interest is determined. Preferably, the brightness ratio of the brightness of the region of interest to the global brightness can be calculated, and the brightness ratio is compared with different ratio ranges to determine the brightness pattern of the region of interest.

[0063] Step S220 : determining a main frame image to be detected from the long frame image to be detected and the short frame image to be detected according to the determined brightness mode.

[0064] The subject frame image to be detected is determined from the long frame image to be detected and the short frame image to be detected, and the brightness of its region of interest needs to be maintained within a preset brightness range. For example, if the long frame image to be detected is set as the subject frame image to be detected, the brightness of the region of interest of the long frame image to be detected needs to be controlled within a preset brightness range; correspondingly, if the short frame image to be detected is set as the subject frame image to be detected, the brightness of the region of interest of the short frame image to be detected needs to be controlled within a preset brightness range.

[0065] In addition, the selection relationship between the brightness mode and the main frame image to be detected can be roughly as follows: if the brightness mode is the front-light mode, the region of interest after the fusion of the long and short frame images to be detected needs to be mainly based on the region of interest of the short frame image to be detected, so the short frame image to be detected is set as the main frame image to be detected; if the brightness mode is the backlight mode, the region of interest after the fusion of the long and short frame images to be detected needs to be mainly based on the region of interest of the long frame image to be detected, so the long frame image to be detected is set as the main frame image to be detected; if the brightness mode is the normal mode, at this time the brightness ratio of the brightness of the region of interest to the global brightness is in a moderate range. In order to avoid the problem of the target in the region of interest being blurred due to the fast movement speed of the detection object, the short frame image to be detected can be set as the main frame image to be detected, and the brightness of its region of interest is controlled to be within a preset brightness range.

[0066] Step S230 , adjusting the overall exposure parameters of the image to be detected based on the brightness of the subject frame region of interest of the subject frame image to be detected, so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range, thereby obtaining a target image.

[0067] In this embodiment, in order to take into account the display effect of the global image while ensuring that the brightness of the region of interest is moderate, it is also necessary to control the global brightness of the non-subject frame to be detected image relative to the main frame to be detected image within a preset brightness range. For example, if the short frame to be detected image is the main frame to be detected image, then the long frame to be detected image is the non-subject frame to be detected image. In this case, it is necessary to adjust the brightness of the region of interest of the short frame to be detected image and the global brightness of the long frame to be detected image to a preset brightness range. Specifically, the brightness of the region of interest of the main frame and the global brightness of the non-subject frame to be detected image can be controlled within a preset brightness range by dynamically setting the overall exposure parameters. The overall exposure parameters include the exposure parameters of the long frame to be detected image and the exposure parameters of the short frame to be detected image. The exposure parameters can specifically be related parameters such as shutter, camera gain, and aperture.

[0068] Preferably, when the brightness mode is the front light mode, the exposure parameters of the long and short frame images to be detected can be adjusted according to the brightness of the region of interest of the short frame image to be detected and the global brightness of the long frame image to be detected, so as to control the brightness of the region of interest of the short frame image to be detected and the global brightness of the long frame image to be detected within a preset brightness range. When the brightness mode is the backlight mode, the exposure parameters of the long and short frame images to be detected can be adjusted according to the brightness of the region of interest of the long frame image to be detected and the global brightness of the short frame image to be detected, so as to control the brightness of the region of interest of the long frame image to be detected and the global brightness of the short frame image to be detected within a preset brightness range. When the brightness mode is the normal mode, there is no need to consider the two situations of overexposure of the region of interest of the short frame image to be detected and the long frame image to be detected being too dark, or overexposure of the region of interest of the long frame image to be detected and the short frame image to be detected. Therefore, the overall exposure parameters can be adjusted according to the brightness of the region of interest of the short frame image to be detected.

[0069] Furthermore, in front-lit mode or backlit mode, if the brightness of the subject frame's region of interest is overexposed and the non-subject frame's brightness is too dark, the exposure ratio is adjusted based on the brightness of the subject frame's region of interest, and the overall exposure parameters are remapped based on the adjusted exposure ratio. If the global brightness of the non-subject frame's image to be detected needs to be lowered, the exposure ratio is maintained unchanged, and based on the brightness of the subject frame's region of interest, combined with a preset exposure algorithm, the brightness of the region of interest and the global brightness are metered and calculated to adjust the overall exposure parameters. If the brightness of the subject frame's region of interest is too dark and the global brightness of the non-subject frame's image to be detected is too bright, it is necessary to adjust the exposure ratio to reduce the global brightness of the non-subject frame and increase the brightness of the subject frame's region of interest. If the global brightness of the non-subject frame's image to be detected needs to be increased, the exposure ratio is maintained unchanged, and based on the brightness of the subject frame's region of interest, combined with a preset exposure algorithm, the brightness of the region of interest and the global brightness are metered and calculated to adjust the overall exposure parameters.

[0070] In steps S210 to S230, the brightness mode of the region of interest is determined based on the brightness of the region of interest and the global brightness in the image to be detected. The image to be detected includes a long-frame image to be detected and a short-frame image to be detected. The brightness mode is the light projection method of the region of interest. Based on the determined brightness mode, the subject frame image to be detected is determined from the long-frame image to be detected and the short-frame image to be detected. Based on the brightness of the subject frame region of interest of the subject frame image to be detected, the overall exposure parameters of the image to be detected are adjusted so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame images to be detected are both within a preset brightness range, thereby obtaining a target image. This method can dynamically adjust the exposure parameters based on different brightness modes, thereby taking into account the license plate brightness and the global image brightness, so that both are within a moderate brightness range, thereby ensuring the display effect of the license plate while improving the overall image display effect.

[0071] Furthermore, in one embodiment, based on the above step S210, determining the brightness mode of the region of interest according to the brightness of the region of interest and the global brightness in the image to be detected may specifically include the following steps:

[0072] Step S211 : determining a brightness mode of the region of interest according to a brightness ratio of the region of interest to the global brightness in the image to be detected.

[0073] This embodiment determines the brightness mode of the region of interest based on the brightness ratio of the region of interest to the global brightness, which can more clearly reflect the degree of front light or back light in the region of interest, thereby improving the accuracy of determining the brightness mode of the region of interest.

[0074] Furthermore, in one embodiment, based on the above-mentioned step S211, before determining the brightness mode of the region of interest according to the brightness ratio of the brightness of the region of interest in the image to be detected to the global brightness, it may also include: when the global brightness of the short-frame image to be detected meets a preset first brightness condition, determining the ratio of the brightness of the region of interest in the short-frame image to be detected to the global brightness of the short-frame image to be detected as the brightness ratio; otherwise, determining the ratio of the brightness of the region of interest in the long-frame image to be detected to the global brightness of the long-frame image to be detected as the brightness ratio.

[0075] Among them, when the region of interest is the license plate region, the brightness of the license plate region can also be multiplied by the corresponding preset coefficient according to the license plate color to obtain the final brightness of the license plate region. The preset coefficient can be the ratio of the preset target brightness of the image to be detected to the target brightness corresponding to the license plate color. Next, after obtaining the global brightness of the short-frame image to be detected and the global brightness of the long-frame image to be detected, it is determined whether the global brightness of the short-frame image to be detected meets the preset first brightness condition, for example, whether it is greater than the preset first brightness threshold. If so, it is considered that the short-frame image to be detected is not completely black and the data of the short-frame image to be detected is available. Therefore, the ratio of the brightness of the region of interest of the short-frame image to be detected to the global brightness of the short-frame image to be detected is determined as the above-mentioned brightness ratio. Otherwise, it is considered that the short-frame image to be detected is completely black and its data is unavailable. The data of the long-frame image to be detected is used, so the brightness ratio is set to the ratio of the brightness of the region of interest of the long-frame image to be detected to the global brightness of the long-frame image to be detected.

[0076] This embodiment determines whether the global brightness of the short-frame image to be detected meets the preset first brightness condition, and then determines the selection of the brightness ratio, thereby determining the brightness mode based on the brightness ratio, which can further improve the accuracy of the judgment result of the brightness mode of the area of ​​interest.

[0077] Additionally, in one embodiment, based on the above-mentioned step S211, the brightness mode of the region of interest is determined according to the brightness ratio of the brightness of the region of interest in the image to be detected to the global brightness, and it may also include: when the brightness ratio of the brightness of the region of interest in the image to be detected to the global brightness meets the preset first ratio range, the brightness mode of the region of interest is determined as the front light mode; when the brightness ratio meets the preset second ratio range, the brightness mode is determined as the normal mode; when the brightness ratio meets the preset third ratio range, the brightness mode is determined as the backlight mode; wherein the value of the first ratio range is greater than the value of the second ratio range, and the value of the second ratio range is greater than the value of the third ratio range.

[0078] For example, when the brightness ratio is greater than a preset first ratio threshold, the brightness ratio belongs to a first ratio range, and the brightness mode of the region of interest is determined to be a front-lit mode; when the brightness ratio is greater than a preset second ratio threshold and less than the first ratio threshold, the brightness ratio belongs to a second ratio range, and the brightness mode of the region of interest is determined to be a normal mode that is neither front-lit nor backlit; when the brightness ratio is less than a preset second ratio threshold, the brightness ratio belongs to a third ratio range, and the brightness mode of the region of interest is considered to be a backlit mode. It can be understood that the above-mentioned first ratio threshold is greater than the second ratio threshold. This embodiment can improve the accuracy of determining the brightness mode of the region of interest by determining the brightness mode of the region of interest based on the brightness ratio and the preset ratio range.

[0079] Additionally, in one embodiment, based on the above step S220, determining the subject frame image to be detected from the long frame image to be detected and the short frame image to be detected according to the determined brightness mode may specifically include the following steps:

[0080] Step S221: When the brightness mode is the front-light mode, the short-frame image to be detected is determined as the main frame image to be detected. In the front-light mode, the region of interest after the fusion of the long and short-frame images to be detected should be mainly the region of interest of the short-frame image to be detected. Therefore, the short-frame image to be detected is determined as the main frame image to be detected.

[0081] Step S222: When the brightness mode is backlight mode, the long-frame image to be detected is determined as the main frame image to be detected. Similarly, in backlight mode, the region of interest after the fusion of the long and short-frame images to be detected should be primarily the region of interest of the long-frame image to be detected. Therefore, the long-frame image to be detected is determined as the main frame image to be detected.

[0082] Additionally, in one embodiment, based on the above step S230, when the brightness mode is the front-light mode or the back-light mode, adjusting the overall exposure parameters of the image to be detected based on the brightness of the subject frame region of interest of the subject frame image to be detected, so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range, thereby obtaining a target image. Specifically, the following steps may be included:

[0083] In step S231, based on the brightness of the region of interest of the subject frame and the global brightness of the image to be detected of the non-subject frame, the overall exposure parameters of the image to be detected are adjusted so that the brightness of the region of interest of the subject frame and the global brightness of the image to be detected of the non-subject frame are both within a preset brightness range, and the target image is obtained based on the adjusted exposure parameters.

[0084] In the front-light mode and the back-light mode, this embodiment adjusts the exposure parameters based on the brightness of the area of ​​interest of the subject frame and the global brightness of the image to be detected of the non-subject frame, so that the brightness of the area of ​​interest of the subject frame and the global brightness of the image to be detected of the non-subject frame can be controlled within a preset brightness range. In this way, in the back-light mode and the front-light mode, while improving the display effect of the area of ​​interest, the global display effect of the image to be detected is taken into account, thereby improving the display effect of the image to be detected.

[0085] In one embodiment, based on the above step S231, based on the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected, the overall exposure parameter of the image to be detected is adjusted so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range. Specifically, the following steps may be included:

[0086] Step S2311 , when the brightness of the subject frame's ROI meets a preset high brightness condition, an adjustment ratio is calculated based on the brightness of the subject frame's ROI, and it is determined whether the global brightness of the non-subject frame's to-be-detected image meets a preset brightness up adjustment condition.

[0087] The preset high brightness condition may specifically be that the brightness of the subject frame's region of interest is higher than a preset second brightness threshold. Calculating the adjustment ratio may specifically be calculating the ratio between the brightness of the subject frame's region of interest and the high brightness threshold. The preset brightness increase condition may be that the global brightness of the non-subject frame's to-be-detected image is lower than a preset third brightness threshold.

[0088] Step S2312: If yes, adjust the overall exposure parameters according to the adjustment ratio to increase the global brightness of the non-subject frame to be detected image and reduce the brightness of the subject frame region of interest.

[0089] In this case, the area of ​​interest of the subject frame is overexposed, while the image to be detected of the non-subject frame is too dark. Therefore, it is necessary to adjust the exposure ratio based on the above adjustment ratio to increase the global brightness of the image to be detected of the non-subject frame and reduce the brightness of the area of ​​interest of the subject frame.

[0090] Step S2313: Otherwise, the overall exposure parameter is reduced by combining the adjustment ratio and the preset exposure algorithm so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range.

[0091] In this case, the global brightness of the non-subject frame to be detected can be further reduced. Therefore, the brightness of the area of ​​interest and the global brightness can be metered and calculated in combination with the adjustment ratio calculated above, and the preset exposure algorithm can be used to reduce the overall exposure parameters, so that the brightness of the area of ​​interest of the subject frame and the global brightness of the non-subject frame to be detected are both within the preset brightness range.

[0092] Here we take the license plate area as an example. In the front light mode, if the short frame license plate brightness plateY 短 If the brightness is higher than the preset brightness threshold E1, the plate brightness needs to be lowered. In this case, the ratio that needs to be lowered is calculated as ratioX1 = plateY 短 / E3. If the long frame global brightness Y 长 If the brightness of the long frame is too dark and the license plate in the short frame is overexposed, the exposure ratio needs to be increased to increase the global brightness of the long frame and reduce the brightness of the license plate in the short frame. The exposure ratio is updated as follows: N = N * ratio X 1. After that, the overall exposure parameters are remapped based on the updated exposure ratio. If the brightness of the license plate in the short frame is plateY 短 Higher than the preset brightness threshold E1, and Y 长 If it is greater than the threshold F1, the brightness of the license plate area and the global brightness are measured and calculated based on the preset license plate exposure algorithm in combination with the above ratioX1 to reduce the overall exposure parameters.

[0093] Similarly, in backlight mode, if the long frame license plate brightness plateY 长 If the brightness is higher than the preset threshold E1, the plate brightness needs to be lowered. In this case, the ratio that needs to be lowered is calculated as ratioX5 = plateY 长 / E3. If the short frame global brightness Y 短 If the brightness of the short frame is too dark and the license plate in the long frame is overexposed, the exposure ratio needs to be reduced to increase the global brightness of the short frame and reduce the brightness of the license plate in the long frame. The exposure ratio is updated as follows: N = N / ratioX5. After that, the overall exposure parameters are remapped based on the updated exposure ratio. If the brightness of the license plate in the long frame is plateY 长Higher than the preset brightness threshold E1, and Y 短 If it is greater than the threshold F1, the brightness of the license plate area and the global brightness are measured and calculated based on the preset license plate exposure algorithm in combination with the above ratioX5 to reduce the overall exposure parameters.

[0094] In the above steps S2311 to S2313, when the region of interest of the subject frame is overexposed and the image to be detected of the non-subject frame is too dark, the global brightness of the image to be detected of the non-subject frame is increased by adjusting the exposure ratio, and the brightness of the region of interest of the subject frame is reduced; and when the brightness of the region of interest of the subject frame and the image to be detected of the non-subject frame needs to be reduced, the brightness of the region of interest of the subject frame and the brightness of the image to be detected of the non-subject frame are controlled within a preset brightness range by reducing the overall exposure parameters, so that the global brightness of the image to be detected and the brightness of the region of interest can be taken into account, thereby improving the display effect of the image to be detected.

[0095] Additionally, in one embodiment, based on the above step S231, based on the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected, the overall exposure parameter of the image to be detected is adjusted so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range. The following steps may also be included:

[0096] Step S2314 , when the brightness of the subject frame's ROI meets the preset low brightness condition, the adjustment ratio is calculated based on the brightness of the subject frame's ROI, and it is determined whether the global brightness of the non-subject frame's to-be-detected image meets the preset brightness reduction condition.

[0097] It is understandable that the preset low brightness condition can be specifically that the brightness of the subject's area of ​​interest is lower than a preset fourth brightness threshold. The preset brightness reduction condition can be specifically that the global brightness of the non-subject frame to be detected is higher than a preset fifth brightness threshold.

[0098] In step S2315 , if yes, the overall exposure parameters are adjusted according to the adjustment ratio to reduce the global brightness of the non-subject frame to be detected image and increase the brightness of the region of interest of the subject frame.

[0099] Step S2316 , otherwise, the overall exposure parameter is increased by combining the adjustment ratio and a preset exposure algorithm so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range.

[0100] For example, in the front light mode, if the short frame license plate brightness plateY 短 If the brightness is lower than the preset threshold E2, the plate brightness needs to be increased. In this case, the ratio that needs to be increased is calculated as ratioX2 = plateY 短 / E3. If the long frame global brightness Y 长 If the value is greater than the threshold F2, the long frame is too bright and the short frame is too dark. The exposure ratio needs to be reduced to reduce the long frame global brightness and increase the short frame license plate brightness. The exposure ratio is updated as follows: N = N * ratio X 2. After that, the overall exposure parameters are remapped based on the updated exposure ratio. If the short frame license plate brightness plateY 短 Lower than the preset brightness threshold E2, and Y 长 If it is less than the threshold F2, the brightness of the license plate area and the global brightness are measured and calculated based on the preset license plate exposure algorithm in combination with the above ratioX2 to improve the overall exposure parameters.

[0101] Similarly, in backlight mode, if the long frame license plate brightness plateY 长 If the brightness is lower than the preset brightness threshold E2, the license plate brightness needs to be increased. In this case, the ratio that needs to be increased is calculated as ratioX6 = plateY 长 / E3. If the short frame global brightness Y 短 If the brightness of the short frame is too bright and the long frame license plate is too dark, the exposure ratio needs to be increased to reduce the global brightness of the short frame and increase the brightness of the long frame license plate. The exposure ratio is updated as follows: N = N / ratioX6. After that, the overall exposure parameters are remapped based on the updated exposure ratio. If the long frame license plate brightness plateY 长 Lower than the preset brightness threshold E2, and Y 短 If it is less than the threshold F2, the brightness of the license plate area and the global brightness are measured and calculated based on the preset license plate exposure algorithm in combination with the above ratioX6 to improve the overall exposure parameters.

[0102] The above steps S2314 to S2316 can avoid the problem of the subject frame's region of interest being too dark and the non-subject frame being too bright globally, thereby taking into account both the global brightness of the image to be detected and the brightness of the region of interest, thereby improving the display effect of the image to be detected.

[0103] Additionally, in one embodiment, based on the above step S231, based on the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected, the overall exposure parameter of the image to be detected is adjusted so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range. Specifically, the following steps may be further included:

[0104] Step S2317, when the brightness of the subject frame's region of interest is within a preset brightness range, the exposure parameters of the non-subject frame's image to be detected are adjusted according to the global brightness of the non-subject frame's image to be detected, so that the global brightness of the non-subject frame's image to be detected is within the preset brightness range.

[0105] For example, in the front light mode, if the short frame license plate brightness is greater than the brightness threshold E2 and less than the brightness threshold E1, it can be confirmed that the short frame license plate brightness is within the preset brightness range. At this time, it is necessary to determine whether the long frame global brightness needs to be adjusted. Specifically, if the long frame global brightness Y 长 If the brightness is less than the brightness threshold F1, the global brightness of the long frame is too dark, and it is necessary to increase the exposure ratio to improve the global brightness of the long frame. Further, the exposure ratio adjustment ratio ratioX3 = F2 / Y can be calculated 长 , and then update the exposure ratio N=N*ratioX3 according to ratioX3. Then use the updated exposure ratio to remap the exposure parameters of the long frame image to be detected. If Y 长 If the brightness is greater than the brightness threshold F3, it is determined that the long frame global brightness is too bright and it is necessary to reduce the long frame global brightness by reducing the exposure ratio. Similarly, ratioX3=F2 / Y 长 , then update the exposure ratio based on ratioX3, and then remap the long frame exposure parameters based on the exposure ratio and the short frame exposure value. It should be noted that the brightness threshold F1 is less than the brightness threshold F2, and the brightness threshold F2 is less than the brightness threshold F3.

[0106] Accordingly, in backlight mode, if the long-frame license plate brightness is greater than the brightness threshold E2 and less than the brightness threshold E1, it can be confirmed that the long-frame license plate brightness is within the preset brightness range. At this time, it is necessary to determine whether the short-frame global brightness needs to be adjusted. Specifically, if the short-frame global brightness Y 短 If the brightness is less than the brightness threshold F1, the global brightness of the short frame is too dark, and it is necessary to increase the global brightness of the short frame by reducing the exposure ratio. Further, the exposure ratio adjustment ratio ratioX7 = F2 / Y can be calculated. 短 , and then update the exposure ratio N=N / ratioX7 according to ratioX7. Then use the updated exposure ratio to remap the exposure parameters of the long frame image to be detected. If Y 短 If the brightness is greater than the brightness threshold F3, it is determined that the global brightness of the short frame is too bright, and it is necessary to reduce the global brightness of the short frame by increasing the exposure ratio. Similarly, ratioX7=F2 / Y 短 , then update the exposure ratio based on ratioX7, and then remap the long frame exposure parameters based on the exposure ratio and the long frame exposure value.

[0107] In the above steps, when the brightness of the interest region of the subject frame is within a preset brightness range, the global brightness of the image to be detected in the non-subject frame is adjusted, thereby improving the overall display effect of the image to be detected.

[0108] Additionally, in one embodiment, based on the above step S231, based on the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected, the overall exposure parameter of the image to be detected is adjusted so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range. Specifically, the following steps may be further included:

[0109] Step S2318 , when the brightness of the subject frame interest region and the global brightness of the non-subject frame to be detected image are both within a preset brightness range, it is determined whether the non-subject frame interest region of the non-subject frame to be detected image meets the preset exposure condition.

[0110] The preset exposure condition refers to whether the global brightness of the non-subject frame to be detected is overexposed or too dark. For example, in the front light mode, if the short frame license plate brightness and the long frame global brightness are both within the preset brightness range, it is necessary to determine whether the long frame license plate is overexposed based on the long frame license plate brightness. 长 If the brightness threshold G1 is greater than the long-frame license plate, it means that the long-frame license plate is overexposed, indicating that the non-subject frame area of ​​interest meets the preset exposure conditions. Similarly, in backlight mode, if the long-frame license plate brightness and the short-frame global brightness are both within the preset brightness range, the short-frame license plate brightness plateY is determined. 短 Is the brightness less than the preset threshold G3? If so, it means that the license plate in the short frame is completely dark and the non-subject frame's region of interest meets the preset exposure conditions. In both cases, it can be ensured that the region of interest after the long and short frame images are fused will not have overlapping images due to the rapid movement of the detection target.

[0111] If not, in step S2319 , the overall exposure parameters are adjusted based on the brightness of the non-subject frame region of interest, so that the non-subject frame region of interest meets the preset exposure conditions.

[0112] For example, in front light mode, if the long frame license plate is not overexposed, the exposure ratio needs to be increased. Specifically, the exposure ratio can be updated to N = N * G2 / plateY 长 Where G2 is a preset brightness value, and G2 is greater than G1. The overall exposure parameters are remapped based on the updated exposure ratio. This reduces the brightness of the short-frame license plate and increases the brightness of the long-frame license plate, resulting in a complete overexposure of the long-frame license plate. This resolves the issue of license plate overlap caused by excessive speed in front-lit mode.

[0113] In backlight mode, if the short frame license plate is not too dark, the exposure ratio needs to be increased. Specifically, the exposure ratio can be updated to N = N * plateY 短 / G4. G4 is a preset brightness value, and G4 is less than G3. The overall exposure parameters are remapped based on the updated exposure ratio. This reduces the brightness of the short-frame license plate, rendering it completely dark, thus resolving the issue of license plate overlap caused by excessive vehicle speed in backlight mode.

[0114] Additionally, in one embodiment, based on the above step S230, when the brightness mode is the normal mode, adjusting the overall exposure parameters of the image to be detected based on the brightness of the subject frame region of interest of the subject frame image to be detected, so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range, thereby obtaining a target image, may specifically include the following steps:

[0115] Step S232 , when the brightness of the subject frame ROI is outside the preset brightness range, adjusting the overall exposure parameters according to the brightness of the subject frame ROI so that the brightness of the subject frame ROI is within the preset brightness range.

[0116] For example, in normal mode, it is determined whether the brightness of the short frame license plate is within a preset brightness range. Specifically, it is determined whether the brightness of the short frame license plate plateY 短 Is it greater than the brightness threshold E1 or less than the brightness threshold E2? If so, the brightness of the short-frame license plate is outside the preset brightness range, and the ratio of the short-frame license plate brightness that needs to be increased is calculated as ratioX4=plateY 短 / E3, then, based on the ratio ratioX4 and combined with the preset license plate exposure algorithm, the overall exposure parameters are reduced so that the brightness of the short-frame license plate is within the preset brightness range.

[0117] In step S233, when the brightness of the subject frame's region of interest is within a preset brightness range, it is determined whether the non-subject frame's region of interest of the non-subject frame's image to be detected meets a preset exposure condition; if not, the exposure parameters of the non-subject frame's image to be detected are adjusted based on the brightness of the non-subject frame's region of interest, so that the non-subject frame's region of interest meets the preset exposure condition, thereby obtaining a target image.

[0118] For example, if the brightness of the short-frame license plate is within the preset brightness range, it is determined whether the long-frame license plate is overexposed. If it is not overexposed, it is necessary to determine the brightness of the long-frame license plate based on the plateY 长 To improve the exposure ratio. Among them, the exposure ratio N can be made into N*G2 / plateY 长 Among them, G1 is less than G2. Then, based on the updated exposure ratio and short frame exposure value, the long frame exposure parameters are remapped, so that the long frame license plate is completely overexposed to obtain the target image.

[0119] The present embodiment is described and illustrated below through preferred embodiments.

[0120] Figure 3 Flowchart of the license plate brightness mode determination method of the preferred embodiment. Figure 3 As shown, the license plate brightness mode method includes the following steps:

[0121] Step S301: inputting HDR-based long-frame images and short-frame images to be detected, and obtaining statistical information of the original image data;

[0122] Step S302, performing vehicle recognition on the long and short frame images to be detected;

[0123] Step S303: determine whether a vehicle is detected. If so, execute step S304; otherwise, adjust the overall exposure parameters and end the process.

[0124] Step S304, outputting information such as vehicle number, license plate coordinates, and license plate color;

[0125] Step S305: Calculate the long frame global brightness Y 长 , and short frame global brightness Y 短 , and calculate the long frame license plate brightness plateY 长 and short frame license plate brightness plateY 短 ;

[0126] Step S306: calculate plateY based on the preset coefficient corresponding to the license plate color. 长 and plateY 短 Update and get the updated plateY 长 and plateY 短 ;

[0127] Step S307, determine Y 短 Is it greater than the threshold D? If so, go to step S308; otherwise, go to step S309;

[0128] Step S308: The ratio of the license plate to the global brightness is set to ratio = plateY 短 / Y 短 ;

[0129] Step S309: The ratio of the license plate to the global brightness is set to ratio = plateY 长 / Y 长 ;

[0130] Step S310, determine whether the ratio is greater than the threshold T2, if so, execute step S312; otherwise, execute step S311;

[0131] Step S311, determine whether the ratio is greater than the threshold T1, if so, execute step S313; otherwise, execute step S314;

[0132] Step S312: the current brightness mode is the license plate front light mode, and the image brightness is adjusted according to the license plate front light mode;

[0133] Step S313: the current brightness mode is the normal license plate mode, and the image brightness is adjusted according to the normal license plate mode;

[0134] Step S314: the current brightness mode is the license plate backlight mode, and the image brightness is adjusted according to the license plate backlight mode.

[0135] Figure 4 This is a flow chart of the method for adjusting the brightness of a license plate in the forward lighting mode of the preferred embodiment. Figure 4 As shown, the method for adjusting the brightness of the license plate in the front light mode includes the following steps:

[0136] Step S401, determine plateY 短 Is it greater than the threshold E1? If so, go to step S406; otherwise, go to step S402;

[0137] Step S402, determine plateY 短 Is it less than the threshold E2? If so, go to step S403; otherwise, go to step S411;

[0138] Step S403, calculate the ratio of the short frame license plate brightness that needs to be increased ratioX2=plateY 短 / E3;

[0139] Step S404, determine Y 长 Is it greater than the threshold F2? If so, go to step S405; otherwise, go to step S422;

[0140] Step S405, calculate the exposure ratio N=N*ratioX2, and execute step S409;

[0141] Step S406, calculate the ratio of the short frame license plate brightness that needs to be lowered ratioX1=plateY 短 / E3;

[0142] Step S407, determine Y 长 Is it less than the threshold F1? If so, go to step S408; otherwise, go to step S410;

[0143] Step S408, calculate the exposure ratio N=N*ratioX1, and execute step S409;

[0144] Step S409: No light metering calculation is performed on the current frame, and the overall exposure parameters are remapped according to the updated exposure ratio;

[0145] Step S410 , maintaining the exposure ratio unchanged, combining the ratioX1 license plate exposure algorithm, performing photometric calculations on the license plate and the entire system, and reducing the overall exposure parameters;

[0146] Step S411, determine Y 长 Is it less than the threshold F1? If so, go to step S412; otherwise, go to step S415;

[0147] Step S412, calculate ratioX3=F2 / Y 长 ;

[0148] Step S413, calculating the exposure ratio as N=N*ratioX3;

[0149] Step S414: No light metering calculation is performed on the current frame, and the long frame exposure parameters are remapped according to the updated exposure ratio and the short frame exposure value;

[0150] Step S415, determine Y 长 Is it greater than the threshold F3? If so, go to step S416; otherwise, go to step S418;

[0151] Step S416, calculate ratioX3=F2 / Y 长 ;

[0152] Step S417, calculating the exposure ratio N=N*ratioX3;

[0153] Step S418, determine plateY 长 Is it greater than the threshold G1? If so, go to step S419; otherwise, go to step S420;

[0154] Step S419: do not adjust the exposure ratio and do not perform light metering calculation;

[0155] Step S420, calculate exposure ratio N=N*G2 / plateY 长 ;

[0156] Step S421: No light metering calculation is performed on the current frame, and the overall exposure parameters are remapped according to the updated exposure ratio;

[0157] Step S422 , keeping the exposure ratio unchanged, combining ratioX2 and the preset license plate exposure algorithm, performing photometry calculation on the license plate area and global brightness to improve the overall exposure parameters.

[0158] Figure 5 This is a flow chart of the brightness adjustment method in the license plate backlight mode of the preferred embodiment. Figure 5 As shown, the brightness adjustment method in the license plate backlight mode includes the following steps:

[0159] Step S501, determine plateY 长 Is it greater than the threshold E1? If so, execute step S506; otherwise, execute step S502.

[0160] Step S502, determine plateY 长 Is it less than the threshold E2? If so, go to step S503; otherwise, go to step S511;

[0161] Step S503, calculate the ratio of the long frame license plate brightness that needs to be increased ratioX6=plateY 长 / E3;

[0162] Step S504, determine Y 短 Is it greater than the threshold F2? If so, go to step S505; otherwise, go to step S522;

[0163] Step S505, calculate exposure ratio N=N / ratioX6, and execute step S509;

[0164] Step S506, calculate the ratio of the long frame license plate brightness that needs to be lowered ratioX5=plateY 长 / E3;

[0165] Step S507, determine Y 短 Is it less than the threshold F1? If so, go to step S508; otherwise, go to step S510;

[0166] Step S508, calculate exposure ratio N=N / ratioX5, and execute step S509;

[0167] Step S509: No light metering calculation is performed on the current frame, and the overall exposure parameters are remapped according to the updated exposure ratio;

[0168] Step S510 , keeping the exposure ratio unchanged, combining ratioX5 and the license plate exposure algorithm, performing photometric calculations on the license plate and the entire image, and reducing the overall exposure parameters;

[0169] Step S511, determine Y 短 Is it less than the threshold F1? If so, go to step S512; otherwise, go to step S515;

[0170] Step S512, calculate ratioX7=F2 / Y 短 ;

[0171] Step S513, calculating the exposure ratio as N=N / ratioX7;

[0172] Step S514: No light metering calculation is performed on the current frame, and the short frame exposure parameters are remapped according to the updated exposure ratio and the long frame exposure value;

[0173] Step S515, determine Y 短 Is it greater than the threshold F3? If so, go to step S516; otherwise, go to step S518;

[0174] Step S516, calculate ratioX7=F2 / Y 短 ;

[0175] Step S517, calculating the exposure ratio N=N / ratioX7;

[0176] Step S518, determine plateY 短 Is it less than the threshold G3? If so, go to step S519; otherwise, go to step S520;

[0177] Step S519: do not adjust the exposure ratio and do not perform light metering calculation;

[0178] Step S520, calculate exposure ratio N=N*plateY 短 / G4;

[0179] Step S521: No light metering calculation is performed on the current frame, and the overall exposure parameters are remapped according to the updated exposure ratio;

[0180] Step S522: Keeping the exposure ratio unchanged, combining ratioX6 and the preset license plate exposure algorithm, perform photometry calculation on the license plate area and global brightness to improve the overall exposure parameters.

[0181] Figure 6 This is a flow chart of the method for adjusting the brightness of the license plate in normal mode of the preferred embodiment. Figure 5 As shown, the brightness adjustment method of the license plate in normal mode includes the following steps:

[0182] Step S601, determine plateY 短 Is it greater than E1 or less than E2? If so, go to step S602; otherwise, go to step S604;

[0183] Step S602, calculate ratioX4=plateY 短 / E3;

[0184] Step S603: Keeping the exposure ratio unchanged, combining ratioX4 with the preset license plate exposure algorithm, performing photometric calculations on the license plate area and global brightness, and reducing the overall exposure parameters;

[0185] Step S604, determine plateY 长 Is it greater than the threshold G1? If so, go to step S607; otherwise, go to step S605;

[0186] Step S605, calculate exposure ratio N=N*G2 / plateY 长 ;

[0187] Step S606: No light metering calculation is performed on the current frame, and the long frame exposure parameters are remapped according to the updated exposure ratio and the short frame exposure value;

[0188] Step S607: Do not adjust the exposure ratio and do not perform light metering calculation.

[0189] This embodiment also provides an image brightness adjustment device for implementing the above-mentioned embodiments and preferred implementations. Details already described will not be repeated. The terms "module," "unit," "subunit," etc. used below may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented using software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0190] Figure 7 is a structural block diagram of the image brightness adjustment device 70 of this embodiment, as shown in FIG. Figure 7 As shown, the image brightness adjustment device 70 includes: a first determination module 72, a second determination module 74, and an adjustment module 76; wherein:

[0191] A first determining module 72 is configured to determine a brightness mode of the region of interest based on the brightness of the region of interest in the image to be detected and the global brightness; wherein the image to be detected includes a long-frame image to be detected and a short-frame image to be detected; and the brightness mode is a light projection method of the region of interest;

[0192] A second determining module 74 is configured to determine a subject frame image to be detected from the long frame image to be detected and the short frame image to be detected according to the determined brightness mode;

[0193] The adjustment module 76 is used to adjust the overall exposure parameters of the image to be detected based on the brightness of the subject frame area of ​​interest of the subject frame image to be detected, so that the brightness of the subject frame area of ​​interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range to obtain a target image.

[0194] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0195] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0196] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0197] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:

[0198] S1, determining a brightness mode of the region of interest based on the brightness of the region of interest in the image to be detected and the global brightness; wherein the image to be detected includes a long-frame image to be detected and a short-frame image to be detected; and the brightness mode is a light projection method of the region of interest;

[0199] S2, determining a subject frame image to be detected from the long frame image to be detected and the short frame image to be detected according to the determined brightness mode;

[0200] S3, adjusting the overall exposure parameters of the image to be detected based on the brightness of the subject frame's region of interest of the subject frame's image to be detected, so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range, thereby obtaining a target image.

[0201] It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0202] In addition, in conjunction with the image brightness adjustment method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the method. The storage medium stores a computer program that, when executed by a processor, implements any of the image brightness adjustment methods in the above embodiments.

[0203] It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0204] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0205] Obviously, the accompanying drawings are merely examples or embodiments of the present application. A person skilled in the art can also apply the present application to other similar situations based on these drawings without inventive effort. Furthermore, it is understandable that, although the work involved in this development process may be complex and lengthy, certain design, manufacturing, or production changes based on the technical content disclosed in this application are merely routine technical means for a person skilled in the art and should not be considered to constitute a deficiency in the disclosure of the present application.

[0206] The term "embodiment" as used in this application refers to specific features, structures, or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily mean that the embodiment is the same, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is understood, either explicitly or implicitly, by those skilled in the art that the embodiments described in this application can be combined with other embodiments when there is no conflict.

[0207] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for adjusting image brightness, characterized in that: include: The images to be detected include long-frame images to be detected and short-frame images to be detected; When the global brightness of the short-frame image to be detected is greater than a preset first brightness threshold, a ratio of the brightness of the region of interest in the short-frame image to be detected to the global brightness of the short-frame image to be detected is determined as the target brightness ratio; otherwise, a ratio of the brightness of the region of interest in the long-frame image to be detected to the global brightness of the long-frame image to be detected is determined as the target brightness ratio; Determining a brightness mode of the region of interest based on a target brightness ratio of the brightness of the region of interest in the image to be detected to the global brightness; The brightness mode is a light projection method for the region of interest, and the brightness mode includes a front light mode, a normal mode, and a back light mode; When the brightness mode is the front light mode or the normal mode, determining the short frame image to be detected as the main frame image to be detected; When the brightness mode is a backlight mode, determining the long-frame image to be detected as a main-frame image to be detected; The overall exposure parameters of the image to be detected are adjusted based on the brightness of the subject frame's region of interest of the subject frame's image to be detected, so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range, thereby obtaining a target image.

2. The image brightness adjustment method according to claim 1, wherein: The determining of the brightness mode of the region of interest according to the brightness ratio of the region of interest to the global brightness in the image to be detected includes: When a brightness ratio of the luminance of the region of interest to the global luminance in the image to be detected meets a preset first ratio range, determining the luminance mode of the region of interest as a front light mode; When the brightness ratio falls within a preset second ratio range, determining the brightness mode as a normal mode; When the brightness ratio conforms to a preset third ratio range, the brightness mode is determined as a backlight mode; wherein the value of the first ratio range is greater than the value of the second ratio range, and the value of the second ratio range is greater than the value of the third ratio range.

3. The image brightness adjustment method according to claim 1, wherein: When the brightness mode is the front-light mode or the back-light mode, adjusting the overall exposure parameter of the image to be detected based on the brightness of the subject frame region of interest of the subject frame image to be detected so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range, to obtain a target image, including: Based on the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected, the overall exposure parameters of the image to be detected are adjusted so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range, and a target image is obtained based on the adjusted exposure parameters.

4. The image brightness adjustment method according to claim 3, wherein: The adjusting of the overall exposure parameters of the image to be detected based on the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range includes: When the brightness of the subject frame region of interest meets a preset high brightness condition, an adjustment ratio is calculated according to the brightness of the subject frame region of interest, and whether the global brightness of the non-subject frame to be detected image meets a preset brightness increase condition; If so, adjusting the overall exposure parameter according to the adjustment ratio to increase the global brightness of the non-subject frame to be detected image and reduce the brightness of the subject frame region of interest; Otherwise, the overall exposure parameter is reduced in combination with the adjustment ratio and a preset exposure algorithm so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range.

5. The image brightness adjustment method according to claim 3, wherein: The method further includes adjusting the overall exposure parameters of the image to be detected based on the brightness of the region of interest of the subject frame and the global brightness of the image to be detected of the non-subject frame, so that the brightness of the region of interest of the subject frame and the global brightness of the image to be detected of the non-subject frame are both within a preset brightness range. When the brightness of the subject frame region of interest meets the preset low brightness condition, an adjustment ratio is calculated according to the brightness of the subject frame region of interest, and whether the global brightness of the non-subject frame to be detected image meets the preset brightness reduction condition; If so, adjusting the overall exposure parameter according to the adjustment ratio to reduce the global brightness of the non-subject frame to be detected image and increase the brightness of the subject frame region of interest; Otherwise, the overall exposure parameter is increased in combination with the adjustment ratio and a preset exposure algorithm so that the brightness of the subject frame's region of interest and the global brightness of the non-subject frame's image to be detected are both within a preset brightness range.

6. The image brightness adjustment method according to claim 3, wherein: The method further includes adjusting the overall exposure parameters of the image to be detected based on the brightness of the region of interest of the subject frame and the global brightness of the image to be detected of the non-subject frame, so that the brightness of the region of interest of the subject frame and the global brightness of the image to be detected of the non-subject frame are both within a preset brightness range. When the brightness of the subject frame region of interest is within a preset brightness range, the exposure parameters of the non-subject frame image to be detected are adjusted according to the global brightness of the non-subject frame image to be detected so that the global brightness of the non-subject frame image to be detected is within the preset brightness range.

7. The image brightness adjustment method according to claim 3, wherein: The method further includes adjusting the overall exposure parameters of the image to be detected based on the brightness of the region of interest of the subject frame and the global brightness of the image to be detected of the non-subject frame, so that the brightness of the region of interest of the subject frame and the global brightness of the image to be detected of the non-subject frame are both within a preset brightness range. When the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range, determining whether the non-subject frame region of interest of the non-subject frame image to be detected meets a preset exposure condition; If not, the overall exposure parameter is adjusted based on the brightness of the non-subject frame region of interest, so that the non-subject frame region of interest meets the preset exposure condition.

8. The image brightness adjustment method according to claim 1, wherein: When the brightness mode is the normal mode, adjusting the overall exposure parameter of the image to be detected based on the brightness of the subject frame region of interest of the subject frame image to be detected so that the brightness of the subject frame region of interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range, to obtain a target image, including: When the brightness of the subject frame region of interest is outside a preset brightness range, adjusting the overall exposure parameter according to the brightness of the subject frame region of interest so that the brightness of the subject frame region of interest is within the preset brightness range; When the brightness of the subject frame region of interest is within a preset brightness range, determine whether the non-subject frame region of interest of the non-subject frame to be detected image meets the preset exposure conditions; if not, adjust the exposure parameters of the non-subject frame to be detected image based on the brightness of the non-subject frame region of interest so that the non-subject frame region of interest meets the preset exposure conditions to obtain a target image.

9. An image brightness adjustment device, characterized in that: include: A first determining module, a second determining module, and an adjusting module; wherein: The first determination module is used for the image to be detected, which includes a long-frame image to be detected and a short-frame image to be detected; when the global brightness of the short-frame image to be detected is greater than a preset first brightness threshold, the ratio of the brightness of the region of interest in the short-frame image to be detected to the global brightness of the short-frame image to be detected is determined as the target brightness ratio; otherwise, the ratio of the brightness of the region of interest in the long-frame image to be detected to the global brightness of the long-frame image to be detected is determined as the target brightness ratio; according to the target brightness ratio of the brightness of the region of interest in the image to be detected to the global brightness, the brightness mode of the region of interest is determined; the brightness mode is a light projection method of the region of interest, and the brightness mode includes a front light mode, a normal mode, and a backlight mode; The second determining module is configured to determine the short-frame image to be detected as the main frame image to be detected when the brightness mode is the front-light mode or the normal mode; and to determine the long-frame image to be detected as the main frame image to be detected when the brightness mode is the backlight mode; The adjustment module is used to adjust the overall exposure parameters of the image to be detected based on the brightness of the subject frame area of ​​interest of the subject frame image to be detected, so that the brightness of the subject frame area of ​​interest and the global brightness of the non-subject frame image to be detected are both within a preset brightness range to obtain a target image.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the image brightness adjustment method according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image brightness adjustment method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Character image processing method and device

    CN109862282A

  • Automatic exposure method and device, dynamic range identification method and device, medium and equipment

    CN114449176A