A method and device for adjusting exposure parameters
By dynamically adjusting the exposure parameters of the video surveillance system, the problem of overexposure of license plates under low illumination at night is solved, and the scene and license plates are clearly displayed at the same time, reducing monitoring costs.
Patent Information
- Application Number
- CN202510183043.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-02-19
AI Technical Summary
In video surveillance, in low-illumination scenes at night, the license plate is prone to overexposed due to the reflective characteristics of the video surveillance image, which cannot meet the clarity requirements of the scene and vehicle license plate at the same time.
Dynamically adjust the exposure parameters by determining whether the headlights and license plates are visible. Specific methods include obtaining the brightness difference of the image block, identifying the position of the headlights, and selecting appropriate exposure parameters based on the relative position relationship between the headlights and the license plate to avoid overexposure of the license plate and ensure clear scenes.
There is no need to split the image data into two independent video streams, which reduces the need for hardware resources and processing capabilities, and realizes the clear display of scenes and license plates at the same time in low-illumination scenarios at night, reducing monitoring costs.
Smart Images

Figure CN119653246B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video surveillance technology, and in particular to an exposure parameter adjustment method and device. Background Art
[0002] In the field of video surveillance, in normal illumination scenes during the day, the video surveillance image is exposed normally and can meet the clarity requirements of the scene and the vehicle license plate at the same time. However, in low-illuminance scenes at night, the license plate is prone to overexposure of the video surveillance image due to its reflective characteristics, making it impossible for the scene and the vehicle license plate to be clearly displayed in the same video surveillance image. Especially in large-scene monitoring, it is impossible to take into account the clarity requirements of the scene and the vehicle license plate. That is, if the clarity requirements of the scene are to be met, the overall brightness of the video surveillance image needs to be increased, but in this case, the vehicle license plate is prone to overexposure and the clarity requirements of the vehicle license plate cannot be met. If the clarity requirements of the vehicle license plate are to be met, the overall brightness of the video surveillance image needs to be dimmed, but in this case, the scene is prone to being too dark and the clarity requirements of the scene cannot be met.
[0003] In order to meet the clarity requirements of both the scene and the vehicle license plate, the existing technology directly outputs high dynamic range (HDR) image data through video surveillance equipment and splits it into two independent video streams: one uses a long exposure strategy to focus on scene monitoring, and the other uses a short exposure strategy specifically for vehicle license plate monitoring or snapshots. This method enables each video stream to achieve the best image quality, thereby meeting the needs of clearly displaying the scene and license plate at the same time. However, this method requires double the hardware resources and processing power, which makes the monitoring cost higher. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method and device for adjusting exposure parameters, which dynamically adjusts exposure parameters by judging whether the headlights and license plates are visible, so as to meet the requirement of clearly displaying the scene and license plates at the same time, thereby reducing monitoring costs. The specific technical solutions are as follows:
[0005] In a first aspect, an embodiment of the present application provides an exposure parameter adjustment method, the method comprising:
[0006] Acquire a first image acquired by an acquisition device at a first moment and a second image acquired by the acquisition device at a second moment; divide the first image and the second image into a plurality of image blocks respectively according to the same division method; determine a first image block that meets a preset first condition in the first image, wherein the preset first condition includes: a brightness difference between the first image block and a corresponding third image block is greater than a preset brightness difference threshold, and the third image block is an image block in the second image that has the same position as the first image block; determine each connected domain composed of the first image blocks in the first image; if the preset vehicle light existence condition is met, connect the first image block in the first image that matches the position of the first image block; The position of the connected domain is taken as the target headlight position; wherein the preset headlight existence condition includes the existence of a connected domain matching the position in the first image; according to the relative position relationship between the preset headlight position and the license plate position, the license plate position corresponding to the target headlight position is determined as the target license plate position; if the preset headlight existence condition is met and the preset license plate existence condition is met, the first exposure parameter is adopted; if the preset headlight existence condition is met and the preset license plate existence condition is not met, the second exposure parameter is adopted; if the preset headlight existence condition is not met, the third exposure parameter is adopted; wherein the preset license plate existence condition includes the existence of a license plate at the target license plate position.
[0007] In a second aspect, an embodiment of the present application provides an exposure parameter adjustment device, the device comprising:
[0008] An image acquisition module, used to acquire a first image acquired by an acquisition device at a first moment and a second image acquired by the acquisition device at a second moment; an image division module, used to divide the first image and the second image into a plurality of image blocks respectively according to the same division method; a first screening module, used to determine a first image block that meets a preset first condition in the first image, wherein the preset first condition includes: a brightness difference between the first image block and a corresponding third image block is greater than a preset brightness difference threshold, and the third image block is an image block in the second image that has the same position as the first image block; a connected domain determination module, used to determine each connected domain composed of the first image blocks in the first image; a position screening module, used to take the position of the connected domain with matching position in the first image as the target headlight position if a preset headlight existence condition is met; wherein the preset headlight existence condition includes the existence of a connected domain with matching position in the first image; A position determination module, used to determine the license plate position corresponding to the target headlight position as the target license plate position according to the relative position relationship between the preset headlight position and the license plate position; a parameter adjustment module, used to adopt a first exposure parameter if the preset headlight existence condition and the preset license plate existence condition are met; adopt a second exposure parameter if the preset headlight existence condition is met and the preset license plate existence condition is not met; adopt a third exposure parameter if the preset headlight existence condition is not met; wherein the preset license plate existence condition includes the existence of a license plate at the target license plate position.
[0009] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0010] The memory is used to store computer programs; the processor is used to implement any of the above-mentioned exposure parameter adjustment methods when executing the programs stored in the memory.
[0011] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned exposure parameter adjustment methods is implemented.
[0012] In a fifth aspect, an embodiment of the present application provides an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the exposure parameter adjustment methods described above.
[0013] Beneficial effects of the embodiments of the present application:
[0014] The embodiment of the present application provides an exposure parameter adjustment method and device. In a low-light scene at night, the brightness of the headlights of a motor vehicle is high, and the movement of the motor vehicle drives the movement of the headlights. Since the first image and the second image are images taken at different times, by comparing the brightness difference of the image blocks at corresponding positions in the first image and the second image, the area with significant brightness change is identified, and the area is the potential position of the headlights. Since the headlights of the motor vehicle appear in pairs, by determining the connected domain composed of these image blocks, if there is no pair of connected domains with matching positions, it is proved that there are no matching headlights, that is, there is no motor vehicle, and the exposure parameters are adjusted to the normal exposure of monitoring to ensure that reliable monitoring images can be obtained under various circumstances. If a pair of connected domains with matching positions are determined, it is proved that there is a pair of headlights of a motor vehicle, that is, there is a motor vehicle, and the position of the pair of connected domains is determined as the position of the headlights, avoiding the misidentification of the connected domain formed by the movement of motorcycle headlights, flying insects, etc. as the connected domain formed by the movement of the motor vehicle, and the possible position of the license plate is inferred by using the preset relative position relationship between the headlights and the license plate. According to the result of determining whether there is a license plate at the possible position, the appropriate exposure parameter is selected. That is, when it is determined that the matching headlight is obtained and the license plate exists, the exposure parameter is adjusted to the first exposure parameter, which effectively avoids the problem of overexposure of the license plate. While ensuring that the license plate is clearly visible, it also ensures the clear display of the scene in the collected image. When it is determined that the matching headlight is obtained, but the license plate does not exist, the second exposure parameter is used to ensure the clear display of the scene in the collected image. There is no need to split the image data into two independent video streams, that is, no additional hardware resources and processing capabilities are required, and the requirements for clear presentation of the scene and the license plate can be met at the same time, thereby effectively reducing the monitoring cost.
[0015] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0017] Figure 1 A schematic diagram of a flow chart of an exposure parameter adjustment method provided in an embodiment of the present application;
[0018] Figure 2 A schematic diagram of the process of matching vehicle lights provided in an embodiment of the present application;
[0019] Figure 3 A flowchart of license plate matching provided in an embodiment of the present application;
[0020] Figure 4 A schematic diagram of a process for adjusting exposure parameters provided in an embodiment of the present application;
[0021] Figure 5 A schematic diagram of the movement of a vehicle light provided in an embodiment of the present application;
[0022] Figure 6 A schematic diagram of a search scope provided for an embodiment of the present application;
[0023] Figure 7 A schematic diagram of a license plate search range provided in an embodiment of the present application;
[0024] Figure 8 A schematic diagram of the structure of the hardware system provided in the embodiment of the present application;
[0025] Fig. 9 A schematic diagram of the structure of a mobile vehicle detection module provided in an embodiment of the present application;
[0026] Fig.10 A schematic diagram of a process for detecting suspected moving vehicle lights provided in an embodiment of the present application;
[0027] Fig.11 A schematic diagram of the structure of an exposure parameter adjustment device provided in an embodiment of the present application;
[0028] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0030] The embodiment of the present application provides an exposure parameter adjustment method and device, which is suitable for low-light scenes at night, with the vehicle lights turned on as a prerequisite, to meet the requirements of clearly displaying the scene and the license plate at the same time, and reduce the monitoring cost. Figure 1 , Figure 1 A schematic diagram of a flow chart of an exposure parameter adjustment method provided in an embodiment of the present application, the method comprising:
[0031] S101, acquiring a first image acquired by an acquisition device at a first moment, and a second image acquired by an acquisition device at a second moment.
[0032] S102: Divide the first image and the second image into a plurality of image blocks respectively according to the same division method.
[0033] S103, determining a first image block that satisfies a preset first condition in the first image, wherein the preset first condition includes: a brightness difference between the first image block and a corresponding third image block is greater than a preset brightness difference threshold, and the third image block is an image block in the second image at the same position as the first image block.
[0034] S104: Determine, in the first image, connected regions formed by the first image blocks.
[0035] S105: If the preset vehicle headlight existence condition is met, the position of the connected domain with matching positions in the first image is used as the target vehicle headlight position.
[0036] The preset vehicle light existence condition includes a connected domain having a matching position in the first image.
[0037] S106, according to the preset relative position relationship between the headlight position and the license plate position, determine the license plate position corresponding to the target headlight position as the target license plate position.
[0038] S107, if the preset headlight existence condition is met and the preset license plate existence condition is met, the first exposure parameter is adopted; if the preset headlight existence condition is met and the preset license plate existence condition is not met, the second exposure parameter is adopted; if the preset headlight existence condition is not met, the third exposure parameter is adopted.
[0039] Among them, the preset license plate existence condition includes the existence of a license plate at the target license plate position.
[0040] By applying the above embodiment, the brightness of the headlights of a motor vehicle in a low-light scene at night is relatively high, and the movement of the motor vehicle drives the movement of the headlights. Since the first image and the second image are images taken at different times, by comparing the brightness difference of the image blocks at corresponding positions in the first image and the second image, the area with significant brightness change is identified, and the area is the potential position of the headlights. Since the headlights of a motor vehicle appear in pairs, by determining the connected domain composed of these image blocks, if there is no pair of connected domains with matching positions, it is proved that there are no matching headlights, that is, there is no motor vehicle, and the exposure parameters are adjusted to the normal exposure of monitoring to ensure that reliable monitoring images can be obtained under various circumstances. If a pair of connected domains with matching positions are determined, it is proved that there is a pair of headlights of a motor vehicle, that is, there is a motor vehicle, and the position of the pair of connected domains is determined as the position of the headlights, avoiding the misidentification of the connected domain formed by the movement of motorcycle headlights, flying insects, etc. as the connected domain formed by the movement of the motor vehicle, and the possible position of the license plate is inferred by using the preset relative position relationship between the headlights and the license plate. According to the result of determining whether there is a license plate at the possible position, the appropriate exposure parameter is selected. That is, when it is determined that the matching headlight is obtained and the license plate exists, the exposure parameter is adjusted to the first exposure parameter, which effectively avoids the problem of overexposure of the license plate. While ensuring that the license plate is clearly visible, it also ensures the clear display of the scene in the collected image. When it is determined that the matching headlight is obtained, but the license plate does not exist, the second exposure parameter is used to ensure the clear display of the scene in the collected image. There is no need to split the image data into two independent video streams, that is, no additional hardware resources and processing capabilities are required, and the requirements for clear presentation of the scene and the license plate can be met at the same time, thereby effectively reducing the monitoring cost.
[0041] The above steps S101 to S107 are described in detail below:
[0042] In step S101, the acquisition device continuously acquires images. Whenever the acquisition device acquires an image, the image is the image acquired at the current moment and can be recorded as the current image frame. Any moment before the current moment is a historical moment, and the image acquired at the historical moment can be recorded as a historical image frame.
[0043] The first moment can be a historical moment or a current moment. When the first moment is the current moment, the second moment is a historical moment, the first image is a current image frame, and the second image is a historical image frame. When the first moment is a historical moment, the second moment is the current moment, the first image is a historical image frame, and the second image is a current image frame, which is not specifically limited here. The acquisition device can be any device with an image acquisition function, including but not limited to infrared cameras, visible light cameras, etc. The acquisition device is set at a position where it can acquire scenes around the road and vehicles traveling on the road. For example, it can be set on walls on both sides of the road or on a bracket above the road.
[0044] In step S102, the first image and the second image are divided into a plurality of image blocks in the same division manner. That is, the historical image frame and the current image frame are divided into a plurality of image blocks in the same division manner. For example, the historical image frame and the current image frame can be divided into a plurality of image blocks of 32x32 pixels, or can be divided into a plurality of image blocks of 64x64 pixels, etc.
[0045] In step S103, the brightness difference is greater than the preset brightness difference threshold, which means that the absolute value of the brightness difference is greater than the preset brightness difference threshold. The preset brightness difference threshold can be set by professional staff according to work experience or industry regulations. When determining whether the brightness difference is greater than the preset brightness difference threshold, the absolute value of the brightness difference can be calculated or not.
[0046] When the exposure parameter adjustment method of the present application is executed by an acquisition device, the video processing element in the acquisition device will respectively count the total brightness value and the total number of pixels of the R / G / B (red / green / blue) channels of each image block, and divide the total brightness value by the total number of pixels to obtain the RGB average brightness value of the image block (i.e., the original RGB statistical information below).
[0047] In order to facilitate subsequent processing, the original RGB statistical information will be converted in this step. Usually, the original RGB statistical information output by the video processing element is processed by WB GAIN (white balance gain) or CCM (color correction matrix) to obtain the RGB statistical information after preliminary processing. In order to determine the first image block, that is, the highlight image block, based on the brightness difference and the preset brightness difference threshold, the RGB statistical information after preliminary processing also needs to be converted into Y (brightness component) of YUV (Y represents brightness, U represents chromaticity, and V represents concentration). Among them, the preset brightness difference threshold can be set by professional staff based on work experience or industry regulations.
[0048] Since the headlights of a motor vehicle are divided into headlights and taillights, usually the headlights are white light and the taillights are red light. The brightness of the headlights is higher than that of the taillights. In order to more accurately detect the movement of the headlights, different preset brightness difference thresholds can be set for the headlights and taillights. Taking the taillights as an example: the preset brightness difference threshold set for the taillights is the taillight brightness difference threshold , the brightness difference is greater than the rear taillight brightness difference threshold, then the image block corresponding to the rear taillight meets the preset first condition. Alternatively, when the brightness difference is a negative value, the preset brightness difference threshold set for the rear taillight is the rear taillight brightness difference negative threshold (i.e. -1 Taillight brightness difference threshold), the absolute value of the brightness difference is greater than the rear taillight brightness difference threshold, then the image block corresponding to the rear taillight meets the preset first condition. In order to facilitate the subsequent matching of headlights, rear headlights, blue license plates, green license plates, etc., it is also necessary to convert the original RGB statistical information into HSV space (hexagonal cone color space, H represents hue, S represents saturation, and V represents brightness). When calculating the brightness difference between the first image block and the third image block, the difference between the brightness component Y of the first image block and the brightness component Y of the third image block can be used as the brightness difference, or the difference between the V component of the HSV space of the first image block and the V component of the HSV space of the third image block can be used as the brightness difference, or the difference between the RGB average brightness value of the first image block and the RGB average brightness value of the third image block can be used as the brightness difference, which is not specifically limited here. The brightness difference between the first image block and the corresponding third image block is greater than the preset brightness difference threshold, that is, the brightness of the image block at the same position of the first image and the second image has changed, which means that the headlight may have moved, and the first image block is the candidate block for the moving headlight.
[0049] It can be understood that the above steps determine the first image block that may be obtained due to the movement of the vehicle headlights through the brightness difference of the image blocks, so the above steps S101 to S103 can be called a suspected moving headlight detection process.
[0050] In step S104, a connected domain composed of first image blocks is determined based on all the determined first image blocks. Specifically, the location of each first image block is taken as a starting point, and within the surrounding range of the starting point, other first image blocks whose brightness, YUV, and HSV satisfy the preset brightness threshold and color threshold (including hue threshold and saturation threshold) are searched, and the area composed of all the first image blocks obtained by the search is taken as a connected domain. The preset brightness threshold and color threshold will be explained below and will not be repeated here. The obtained connected domains are numbered and recorded as connected domain 1, connected domain 2, connected domain 3, etc.
[0051] In step S105, under normal monitoring exposure at night, there will be a halo around the headlights due to overexposure, and the headlights are the brightest. Then the range of the connected domain obtained by screening according to the brightness threshold will be larger than the actual range of the headlights. Therefore, in one possible embodiment, the position of the brightest block of each connected domain (that is, the image block at the brightest position is the brightest block) can be approximately considered as the position of a single headlight. In another possible embodiment, the center position of each connected domain can also be approximately considered as the position of a single headlight. Depending on the fact that the headlights of motor vehicles (motor vehicles in this application do not include motorcycles) appear in pairs, and since each connected domain is used to represent a headlight, the connected domains also appear in pairs. According to the connected domains determined in step S104, taking the position of the brightest block of each connected domain as the position of a single headlight as an example, after determining the position coordinates of the brightest block in each connected domain, the connected domain with matching position is within the surrounding range of the position of the brightest block in each connected domain, so the search range of the matching connected domain can be determined according to the position of the brightest block. How to determine the search range will be explained below and will not be repeated here. "Matching" here means that the relative positions of the two connected domains match the relative positions of the two headlights of a real motor vehicle. When matching connected domains are determined, that is, there are paired connected domain combinations, it can be considered that there are paired headlights, proving that there may be a moving motor vehicle in the captured image.
[0052] It can be understood that in the above steps, the connected domain is used to represent a headlight of a motor vehicle, and a pair of matched connected domains is used to represent a pair of headlights of a motor vehicle. Determining the connected domain of the first image block and determining the connected domain of an object match is a process of determining a headlight and matching a pair of headlights. Therefore, the above steps S104 and S105 can be referred to as a headlight matching process. For ease of understanding, the headlight matching process will be described in detail below in conjunction with the flowchart, see Figure 2 , Figure 2 The schematic diagram of the process of matching vehicle lights provided in the embodiment of the present application includes:
[0053] S201, starting from the position of each first image block, search for the connected domain containing the first image block according to the brightness threshold and color threshold. S202, determine the position coordinates of the brightest block in each connected domain. S203, determine the search range according to the position coordinates of the brightest block. S204, based on the position of the brightest block in each connected domain and its search range, search other connected domains to match them, and mark them as paired connected domain combinations. S205, determine whether there is a paired connected domain combination, if there is no paired connected domain combination, execute step S206, if there is a paired connected domain combination, execute step S207. S206, no moving motor vehicle is detected. S207, enter the license plate matching process.
[0054] In the above step S205, there is no pair of connected domain combinations, that is, no paired headlights are detected. In this case, it is considered that no moving motor vehicle is detected, and the exposure parameter of the acquisition device remains at the second exposure parameter. The license plate matching process in step S207 is the above steps S106 and S107, which will be described below.
[0055] In step S106, the relative position relationship between the headlight position and the license plate position is preset. For example, for most motor vehicles, the license plate is located at the midpoint of the line connecting the two headlights, and the area including the midpoint is used to determine the license plate position corresponding to the target headlight position as the target license plate position. The license plate can also be located above the midpoint of the line connecting the two headlights, and the area including the midpoint is used to determine the license plate position corresponding to the target headlight position as the target license plate position.
[0056] In step S107, the first exposure parameter, the second exposure parameter, and the third exposure parameter are different parameters. The first exposure parameter is a relatively conservative or low-brightness exposure setting, which is used to prevent image overexposure, especially under high-brightness conditions (such as strong light reflected by the license plate), the license plate details can be kept clear and visible. The third exposure parameter is a standard exposure setting, which is used for daily monitoring tasks. It can provide high image quality in most monitoring environments without special adjustment for high-brightness or low-brightness conditions. It is the default or preferred exposure configuration to ensure that reliable monitoring images can be obtained under various conditions. The second exposure parameter is an intermediate transition exposure, which is a brighter or enhanced exposure setting, which is used to appropriately reduce the overall image brightness, so that the overexposure situation is controlled to a certain extent, and the image is prevented from being too dark, so that the details and features in the scene can be clearly displayed. Its exposure brightness can be set based on the normal exposure brightness, for example, set to 80% of the normal exposure brightness, or other indicators can be used as a benchmark. That is, in actual applications, if the headlights are detected under normal exposure (the third exposure parameter), the license plate may be easily overexposed and difficult to match the license plate. Appropriately reducing the image brightness can be beneficial to the matching of the license plate. Exemplarily, compared with the second exposure parameter, the first exposure parameter has a higher fill light brightness, a lower exposure target brightness, a lower maximum shutter speed and gain, and a lower highlight.
[0057] In the case of matching headlights, a search is performed at the target license plate position to determine whether a license plate exists. If a license plate exists, the exposure parameters of the acquisition device are adjusted to the first exposure parameters. If a license plate does not exist, the exposure parameters of the acquisition device are adjusted to the second exposure parameters.
[0058] For ease of understanding, the license plate matching process and exposure parameter adjustment process are described in detail below with the help of a flowchart. Figure 3 , Figure 3 The flowchart of the license plate matching provided in the embodiment of the present application includes:
[0059] S301, determine the license plate search range according to the position of each pair of connected domain combinations. S302, search for the license plate according to the license plate search range for each pair of connected domain combinations. S303, determine whether there is a matching license plate, if there is no matching license plate, execute step S304, if there is a matching license plate, execute step S305. S304, no moving motor vehicle with a license plate is detected. S305, a moving motor vehicle with a license plate is detected.
[0060] In step S301, the position of each pair of connected domain combinations is the aforementioned target vehicle light position, and the license plate search range is the aforementioned target license plate position.
[0061] See also Figure 4 , Figure 4 The schematic diagram of the process of adjusting the exposure parameters provided in the embodiment of the present application includes:
[0062] S401, obtain and correct the headlight detection result and license plate detection result. S402, determine the headlight detection result (i.e., the aforementioned determination whether the preset headlight existence condition is met). If yes (i.e., the aforementioned determination meets the preset headlight existence condition), execute step S403; if no (i.e., the aforementioned determination does not meet the preset headlight existence condition), execute step S404. S403, determine the license plate detection result (i.e., the aforementioned determination whether the preset license plate existence condition is met). If yes (i.e., the aforementioned determination meets the preset license plate existence condition), execute step S406; if no (i.e., the aforementioned determination does not meet the preset license plate existence condition), execute step S405. S404, switch the normal monitoring exposure parameter (i.e., switch to the third exposure parameter) and the normal monitoring image parameter. S405, switch the intermediate exposure (i.e., switch to the second exposure parameter) and the image parameter. S406, switch the license plate priority exposure (i.e., switch to the first exposure parameter) and switch to the license plate priority image parameter. Switching to the first exposure parameter specifically includes increasing the fill light brightness, reducing the exposure target brightness, reducing the maximum shutter and gain, and suppressing the highlight. Switch to license plate priority image parameters, including: color, noise reduction, sharpening, contrast, etc.
[0063] In step S401, the detection of a moving motor vehicle in the first image needs to meet the requirements of detecting movement, matching headlights and matching license plates at the same time. The movement of motor vehicles is a continuous process, and a single detection result is not completely reliable. Therefore, it is necessary to refer to the detection result of the second image to correct the detection result of the first image. For example, if more than 2 of the last 3 detection results are moving motor vehicles, the vehicle in the image is finally determined to be a moving motor vehicle.
[0064] In step 402-step S405, the exposure and image parameters of the current mode to be adopted are determined according to the corrected vehicle light detection results and license plate detection results. Considering the accuracy of motor vehicle detection, in some scenes, there may be a motor vehicle in the image captured by the acquisition device at the 0th second, and no motor vehicle in the image at the 2nd second. However, it is understandable that the motor vehicle will not drive out of the image in a short time, so the detection result at the 2nd second may be a false detection.
[0065] Based on this, in order to avoid the occurrence of such false detection, in a possible embodiment, if a moving motor vehicle with a license plate is detected, or although a moving motor vehicle with a license plate is not detected, but the time interval from the last detection of a moving motor vehicle with a license plate is less than the preset interval threshold, the exposure parameters (i.e., the first exposure parameters) and image parameters suitable for the license plate are used. If no moving motor vehicle is detected, and the time interval from the last detection of a moving motor vehicle is greater than or equal to the preset interval threshold, the exposure parameters (i.e., the third exposure parameters) and image parameters suitable for normal monitoring are used. If the current exposure parameter is the third exposure parameter and a moving motor vehicle without a license plate is detected, or if the current exposure parameter is the second exposure parameter and no moving motor vehicle is detected, but the time interval from the last detection of a moving motor vehicle without a license plate is less than the preset interval threshold, the intermediate exposure (i.e., the second exposure parameter) and image parameters are used. That is, when the exposure parameter is the first exposure parameter, since the first exposure parameter is an exposure parameter that is conducive to license plate matching, if only the headlights can be detected but not the license plate under the first exposure parameter, then switching to the second exposure parameter will make it even harder to detect the license plate. Therefore, when the exposure parameter is the first exposure parameter, if the license plate cannot be detected, the exposure parameter is directly switched to the exposure parameter for normal monitoring (i.e., the third exposure parameter). For the convenience of description, the above preset interval threshold is recorded as the holding time.
[0066] In order to distinguish the vehicle headlights from other objects, obtain an accurate first image block, and further distinguish the headlights and taillights in the image, in a possible embodiment, the preset first condition also includes: the brightness of the image block is greater than a preset brightness threshold, the hue of the image block is within a preset second hue interval, and the saturation of the image block is greater than a preset saturation threshold. That is, in this embodiment, the preset first condition is: the brightness difference between the first image block and the corresponding third image block is greater than the preset brightness difference threshold, the brightness of the first image block is greater than the preset brightness threshold, the hue of the first image block is within the preset second hue interval, and the saturation of the first image block is greater than the preset saturation threshold.
[0067] Among them, different preset brightness thresholds, preset second hue intervals, and preset saturation thresholds can be set for the headlights and taillights respectively. Taking the taillights as an example, the preset brightness threshold set for the taillights is the taillight brightness threshold. The second hue interval is preset as the lower limit of the hue threshold of the rear taillight To the upper limit of the taillight hue threshold , the preset saturation threshold is the rear taillight saturation threshold , the preset first condition that the image block corresponding to the rear taillight needs to meet is: Y > , < H < , S> .
[0068] Considering that if the image at the headlight is overexposed, the saturation may decrease, therefore, the brightness threshold, hue interval, and saturation threshold can also be set to more than one set of values as needed, for example, two sets of values can be set. 1. 1, 2. 2. When any of the two groups of conditions are met, it can be determined that the image block corresponding to the rear tail lamp needs to meet the preset first condition. When the second image block is determined to be obtained in the second image, the preset second condition that is the same as the preset first condition can be set, or the preset second condition that is different from the preset first condition can be set, which will not be repeated here.
[0069] By applying the above embodiment, when determining the first image block, the characteristics of different brightness, color and saturation of the front and rear lights of a motor vehicle are utilized, and a more accurate preset first condition is set, including the judgment of the brightness, hue and saturation of the image block. This can not only more accurately distinguish the vehicle lights from other objects, but also distinguish the headlights and taillights of the vehicle lights, thereby improving the accuracy of determining the image blocks in the image, and further improving the accuracy of the exposure parameter adjustment.
[0070] Based on the above steps, various image blocks representing possible movement of motor vehicles can be obtained, and based on these image blocks, it can be judged that there may be moving motor vehicles in the image. However, in some scenes, there may be a brightness difference between the image blocks at the same position in the current image frame and the historical image frame due to flying insects, changes in the tilt angle of the acquisition device, or other external conditions, thereby mistakenly determining flying insects and "non-self-moving motor vehicles" as moving motor vehicles. It can be understood that the moving speed of a moving motor vehicle should be greater than the moving speed of flying insects and "non-self-moving motor vehicles".
[0071] Based on this, in order to improve the accuracy of judging the moving motor vehicle, and thus improve the accuracy of adjusting the exposure parameters, the speed of the image block movement (used to characterize the speed of the vehicle movement) can be used to judge whether the brightness difference of the image block at the same position in the current image frame and the historical image frame is caused by the displacement of the motor vehicle itself. It can be understood that the speed can be calculated based on the displacement and time. Therefore, in a possible embodiment, the movement speed of the image block can be calculated by the displacement between the first image block in the first image and the second image block in the second image, and the time interval between the first moment and the second moment. By comparing with the preset speed threshold, it is determined that there is actually a moving motor vehicle in the image. The method includes:
[0072] S501, determining a second image block that satisfies a preset second condition in a second image. The preset second condition includes: a brightness difference between the second image block and a corresponding fourth image block is greater than a preset brightness difference threshold, and the fourth image block is an image block in the first image at the same position as the second image block. S502, calculating a distance between the second image block and the first image block. S503, calculating a target rate based on the distance and an interval between a first moment and a second moment. The target rate is positively correlated with the distance and negatively correlated with the interval.
[0073] The preset license plate existence condition also includes: the target rate is greater than the preset rate threshold. That is, only when the target rate is greater than the preset rate threshold, it is determined that there is actually a moving motor vehicle in the image. In this case, the license plate matching process is entered. When calculating the movement rate of the image block based on the displacement between the image blocks, the displacement of the image block can be calculated by calculating the average position coordinates of all the first image blocks in the first image and all the second image blocks in the second image, and the target rate is calculated based on the displacement and the time interval. For example, the average position coordinates of all the first image blocks in the first image can be calculated by the following formula (1):
[0074] ...Formula (1)
[0075] The average position coordinates of all second image blocks in the second image can be calculated by the following formula (2):
[0076] ...Formula (2)
[0077] In formula (1), is the average position abscissa of all first image blocks in the first image, is the sum of the horizontal coordinates of all first image blocks in the first image, is the number of all first image blocks in the first image. is the average position ordinate of all first image blocks in the first image, is the sum of the ordinates of all first image blocks in the first image. In formula (2), is the average position abscissa of all second image blocks in the second image, is the sum of the horizontal coordinates of all second image blocks in the second image, is the number of all second image blocks in the second image. is the average position ordinate of all second image blocks in the second image, is the sum of the vertical coordinates of all second image blocks in the second image.
[0078] The sum of the horizontal coordinates in the first image , the sum of the vertical coordinates And the number of all first image blocks It can be obtained by:
[0079] If the image block in the first image satisfies the preset first condition set for the headlight (taillight) at the same time, it means that the first image may be a moving headlight (taillight) at that location, and the coordinates (i, j) at that location are recorded, and the image block is marked as a candidate block of the headlight (taillight) in the first image, that is, the first image block, and the counter represents the number of first image blocks that may be moving headlights (rear taillights) in the first image, let = + 1, its coordinates (i, j) are added to and . , as well as The initial value of is 0.
[0080] The sum of the horizontal coordinates in the second image , the sum of the vertical coordinates And the number of all second image blocks It can be obtained by:
[0081] If the image block in the second image satisfies the preset second condition set for the headlights (taillights), it means that the second image may be a moving headlight (taillight) at that location, and the coordinates (i, j) at that location are recorded, and the image block is marked as a candidate block of the headlight (taillight) in the second image, i.e., the second image block, and the counter represents the number of second image blocks that may be moving headlights (rear taillights) in the second image, let = + 1, its coordinates (i, j) are added to and . , as well as The initial value of is 0. After calculating the average position coordinates of all first image blocks in the first image and the average position coordinates of all second image blocks in the second image, the displacement of the image blocks can be calculated by the following formula (3):
[0082] ...Formula (3)
[0083] The magnitude of the displacement is calculated using the following formula (4):
[0084] ...Formula (4)
[0085] The above steps have explained how to calculate the displacement. It is understandable that calculating the rate also requires time. The time can be the interval between the first moment and the second moment, or the frame difference n between the first image and the second image. When the time is the interval between the first moment and the second moment, the target rate is calculated according to the following formula (5):
[0086] ...Formula (5)
[0087] After the target rate is obtained, it is compared with the preset rate threshold. When the target rate is greater than the preset rate threshold, it is determined that the brightness difference between the image block at the same position in the current image frame and the historical image frame is caused by the movement of the motor vehicle itself. Therefore, it can be determined that there is a real moving motor vehicle in the image. In this case, the license plate matching process is entered. Among them, the preset rate threshold is used to characterize that the image block moving at this rate can indicate that the motor vehicle has moved more obviously. It can be formulated by professional and technical workers based on work experience or industry regulations, and is not specifically limited here.
[0088] See also Figure 5 , Figure 5 A schematic diagram of the movement of vehicle lights provided in an embodiment of the present application, taking the first image as a historical image frame and the second image as a current image frame as an example, the two vehicle lights of the motor vehicle move from positions P1 and P2 in the first image to positions P11 and P22 in the second image respectively. If the movement of the vehicle lights is to be observed, as well as At least both should be greater than 0, then it should be observed that the first image and the second image both have headlight candidate blocks (i.e., the first image block and the second image block) and their positions are different. In order to further filter out the misjudgments caused by some bright moving objects that are not motor vehicle headlights (such as electric vehicles, motorcycles, and flying insects), a preset number threshold is set to filter the image blocks. Based on the fact that motor vehicle headlights are paired, while the number of first image blocks corresponding to electric vehicles, motorcycles, and flying insects is not paired, the preset number threshold can be set to a minimum of 2. as well as Should be at least 2, only as well as Only when the number of lights is greater than the preset threshold at the same time can it be determined as the headlights of a moving motor vehicle.
[0089] By applying the above embodiment, the target motion rate is determined by the brightness change between the corresponding image blocks in the first image and the second image and by calculating the displacement between the image blocks and their corresponding time intervals. Only when the detected target rate exceeds the threshold, it is considered that there is a real moving motor vehicle, which effectively eliminates the interference of non-moving or weakly moving objects (such as light and shadow changes, swaying leaves, etc.), improves the accuracy of mobile motor vehicle identification, and further improves the accuracy of exposure parameter adjustment.
[0090] It is understandable that the motor vehicle travels along the direction of the lane during the driving process, that is, the moving direction of the image block in the image should be roughly the same as the lane direction. Based on this, in order to save computing resources, reduce monitoring costs, improve the accuracy of mobile motor vehicle identification, and thus improve the accuracy of exposure parameter adjustment, the moving direction of the image block can also be judged, and the method includes:
[0091] S601, calculating the relative direction between the second image block and the first image block. S602, the preset license plate existence condition further includes: the angle between the relative direction and the preset lane direction is less than a preset angle threshold.
[0092] The relative direction between the second image block and the first image block can be determined by the direction of displacement in the above formula (3). The preset angle threshold should be the critical angle of whether the moving direction of the motor vehicle is roughly the same as the lane direction. It can be formulated by professional and technical workers based on work experience or industry regulations, and is not specifically limited here. Only when the speed and direction of movement meet the preset conditions can the headlight matching process be entered, otherwise it is considered that no moving motor vehicle is detected in the image.
[0093] By applying the above embodiment, the relative movement direction between the second image and the corresponding image block in the first image is accurately calculated and compared with the preset lane direction. When the angle between the relative movement direction of the vehicle and the lane direction is detected to exceed the preset angle threshold, the vehicle is determined to be a vehicle moving in an unexpected direction and it is considered that no moving motor vehicle is detected in the image, thereby skipping the subsequent license plate recognition process, avoiding unnecessary calculations, saving computing resources, reducing monitoring costs, and improving the accuracy of mobile motor vehicle recognition, thereby improving the accuracy of exposure parameter adjustment.
[0094] The above has explained how to determine whether there is a moving motor vehicle in an image based on the motion rate and motion direction of the image block. It can be seen from the above explanation that when distinguishing between a moving vehicle and a non-moving vehicle, it is necessary to determine a pair of matching connected domains formed by the image blocks. Therefore, how to accurately determine a pair of matching connected domains formed by the image blocks is very important. The following will explain the specific method of how to accurately determine a pair of matching connected domains:
[0095] When determining a pair of connected domains with matching positions, the position of the headlights in the image has certain characteristics. For example, when the acquisition device is installed diagonally downward, the distance between the two headlights above the image is small, while the distance between the two headlights below the image is large due to the relationship that the near ones are large and the far ones are small. Correspondingly, when the distance between the two headlights is small, the distance between the matching connected domains is also small, and when the distance between the two headlights is large, the distance between the matching connected domains is also large. That is, based on the different distances between the acquisition device and each connected domain, the search range when determining the connected domain with matching positions is also different. If the search range is determined to be too large, the connected domain corresponding to the headlights of other motor vehicles may be determined as the connected domain corresponding to the headlights of this motor vehicle. If the search range is determined to be too small, the connected domain corresponding to another headlight of this motor vehicle may not be searched.
[0096] Based on this, in a possible embodiment, in order to improve the accuracy of determining the connected domain with matching positions, it can be determined whether the preset vehicle light existence condition is met by the following methods, including:
[0097] S1051, for each connected domain, determine whether there are other connected domains in the search range corresponding to the connected domain. The search range corresponding to each connected domain is negatively correlated with the distance of the connected domain from the collection device. In step S1051, it is determined whether there are other connected domains in the search range corresponding to the connected domain based on the position coordinates of the brightest block in each connected domain. S1052, if there are, the preset vehicle light existence condition is met.
[0098] The above embodiment is applied, and the positional features of the connected domain of the headlights in the image are utilized to determine the corresponding search range for each connected domain of the headlights, that is, the relationship of near large and far small caused by the different distances between the acquisition device and each connected domain of the headlights, and the search range corresponding to the connected domain is negatively correlated with its distance from the acquisition device, and the influence of the distance between the connected domain of the headlights in the image and the acquisition device on the search range is fully considered. When the distance between the two headlights is small, the search range is also reduced accordingly, thereby reducing the possibility of mismatching, and when the distance between the two headlights is large, the search range is appropriately enlarged to ensure that a matching connected domain can be found, and the found connected domain and the original connected domain are determined as connected domains with matching positions. This method of dynamically adjusting the search range not only improves the matching accuracy, simplifies the matching process, but also reduces the computational complexity by limiting the search range, thereby improving the efficiency of exposure parameter adjustment.
[0099] In order to further reduce the possibility of mismatching of the matched connected domain and improve the accuracy and reliability of the matching, in a possible embodiment, the aforementioned step S1051 includes:
[0100] S10511, for each connected domain, determine the first search radius, the second search radius, the first tilt angle and the second tilt angle according to the distance of the connected domain from the collection device. Among them, the first search radius, the second search radius, the first tilt angle and the second tilt angle are negatively correlated with the distance of the connected domain from the collection device. In step S10511, the first search radius, the second search radius, the first tilt angle and the second tilt angle are determined according to the position coordinates of the brightest block in each connected domain and the distance of the connected domain from the collection device. S10512, for each connected domain, determine whether there are other connected domains within the fan-shaped search range with the position of the connected domain as the center, the first search radius as the inner diameter, the second search radius as the outer diameter, the first tilt angle as the positive tilt angle, and the second tilt angle as the negative tilt angle. In step S10512, if connected domain 1 and connected domain 3 match, the connected domain combination is marked as (connected domain 1, connected domain 3).
[0101] For example, see Figure 6 , Figure 6 A schematic diagram of the search range provided in the embodiment of the present application. Assuming that the brightest block position of the current connected domain is (i, j), if you want to search to the right, the minimum search radius is obtained according to the preset rules. (i, j), maximum search radius (i, j), positive tilt angle (i, j), negative tilt angle (i, j), thus obtaining the fan-shaped search range marked by the line segment filling in the figure. It can be understood that when the acquisition device is arranged to capture the image on the lane, the acquisition device is arranged so that the lane in the captured image is located at the bottom of the image. Therefore, when determining the search range, the search range on the left can also be determined. The determination method is the same as the aforementioned method for determining the search range on the right, which will not be repeated here. Minimum search radius (i, j), maximum search radius (i, j), positive tilt angle (i, j) and negative tilt angle (i, j) is related to the position (i, j) of the brightest block in the current connected domain, that is, it is related to the position of the current connected domain in the image. After obtaining the position of the current connected domain in the image, the distance between the current connected domain and the acquisition device can be determined based on the focal length of the acquisition device lens, the installation height of the acquisition device, the tilt angle, etc.
[0102] By applying the above embodiment, the first search radius, the second search radius, the first tilt angle and the second tilt angle are dynamically adjusted according to the distance of the connected domain from the collection device. The farther the connected domain is from the collection device, the smaller the search radius is, and the tilt angle is adjusted accordingly. Secondly, when determining the search range, the relative position relationship between the headlights of the motor vehicle, the possible small directional deflection of the motor vehicle during driving, and the tilt angle of the collection device itself are considered, so as to determine the fan-shaped search range, which takes into account both the distribution of the connected domain in the horizontal direction and its tilt in the vertical direction, so as to be able to more comprehensively and accurately judge whether there are other connected domains. Such a design not only improves the rationality and accuracy of the search range, but also reduces unnecessary calculations and improves the search efficiency of matching connected domains.
[0103] When determining the target license plate position according to the preset relative position relationship between the headlight position and the license plate position, since the license plate of a motor vehicle is located between the two headlights, in a possible embodiment, the proportional relationship between the headlight position and the license plate position can be analyzed based on a large amount of sample data. The proportional relationship can be the ratio between the length of the license plate and the length of the line connecting the two headlights, the ratio between the width of the license plate and the width of the line connecting the two headlights, or the ratio between the position of the headlight relative to the center line of the vehicle and the position of the license plate relative to the center line of the vehicle. After identifying the target headlight position, the target headlight position is calculated according to the preset proportional relationship.
[0104] However, this method may not cover all situations, resulting in inaccurate positioning in certain specific vehicle models or scenarios. Based on this, in order to improve the accuracy of determining the position of the target license plate, thereby improving the accuracy of adjusting the exposure parameters, in another possible embodiment, the aforementioned step S106 includes:
[0105] S1061, according to each target headlight position, determine an area symmetrical to the perpendicular median of the target line as the target license plate position, wherein the target line is the line between each target headlight position, and the size of the area is positively correlated with the distance between each target headlight position. In step S1061, when the distance between the left and right headlights is larger, the length and width of the area are also larger, and when the distance between the left and right headlights is smaller, the length and width of the area are also smaller.
[0106] For example, see Figure 7 , Figure 7 A schematic diagram of the license plate search range provided in an embodiment of the present application is provided. First, a line 701 connecting the left and right headlights, i.e., the target line 701, is determined. An area 703 that is symmetrical to the perpendicular bisector 702 of the target line is determined. Area 703 is the target license plate position. Since the determined area is a rectangle, the area can also be called a rectangular area.
[0107] exist Figure 7 In the equation, L represents the distance between the two headlights, W represents the width of the rectangular area, H represents the height of the rectangular area, and h represents the offset between the height direction of the rectangular area and the headlight line. The relationship between W, H, h and L can be expressed by the following formula (6):
[0108] ...Formula (6)
[0109] In the above formula (6), α represents the preset rectangular area width coefficient, β represents the preset rectangular area height coefficient, and γ represents the preset rectangular area offset coefficient. Since there is a certain difference in the relative height between the headlights and the taillights and the license plate, the above coefficients can be set for the headlights and the taillights respectively.
[0110] By applying the above embodiment, according to the position of each target headlight, a symmetrical area is determined using the perpendicular median of the headlight line. The symmetrical area is the position of the license plate, and the size of the symmetrical area is positively correlated with the distance between the positions of the target headlights. This method of dynamically adjusting the area size fully considers the changes in the headlight spacing under different vehicle models and different shooting conditions, and can accurately identify the license plate position in various complex scenes and shooting angles, thereby improving the accuracy of determining the target license plate position, and further improving the accuracy of exposure parameter adjustment.
[0111] After the target license plate position is determined through the above step S1061, in order to improve the accuracy and efficiency of license plate recognition, in a possible embodiment, a pre-trained license plate recognition model can be used to detect whether a license plate actually exists at the target license plate position. However, the license plate recognition model has limited adaptability to different license plate recognition scenarios and its training cost is also high.
[0112] Based on this, in another possible embodiment, it is possible to determine whether there is a license plate at the target license plate position by judging the hue, saturation and brightness of the image block at the target license plate position, and the method includes:
[0113] S701, at the target license plate position, determine whether there is an image block that meets the preset third condition. The preset third condition is: the hue of the image block is within the preset first hue interval, the saturation of the image block is within the preset saturation interval, and the brightness of the image block is within the preset brightness interval. S702, if there is an image block that meets the preset third condition, determine that there is a license plate at the target license plate position. S703, if there is no image block that meets the preset third condition, determine that there is no license plate at the target license plate position.
[0114] For example, taking a blue license plate as an example, the preset first hue interval is set as the lower limit of the blue license plate hue threshold. To the upper limit of the blue card hue threshold The preset saturation threshold interval is the lower limit of the blue card saturation threshold To the upper limit of the blue card saturation threshold , the preset brightness range is the lower limit of the blue card brightness threshold To the upper limit of the blue card brightness threshold The preset third condition that the image block corresponding to the blue license plate needs to meet is: < H < , < S < s as well as < S < .
[0115] By applying the above embodiment, by judging whether the hue, saturation and brightness of the image block at the target license plate position meet the preset conditions, it is possible to quickly identify whether there is a license plate at the target license plate position, with lower computational complexity and higher robustness, thus reducing monitoring costs. In particular, when facing complex and changeable lighting conditions, it is possible to reduce false detections, improve the accuracy of license plate detection, and thus improve the accuracy of exposure parameter adjustment.
[0116] In order to more clearly explain the aforementioned exposure parameter adjustment method, the following will be described in detail in combination with the hardware system, hardware module and hardware unit that execute the exposure parameter adjustment method:
[0117] See also Figure 8 , Figure 8 The schematic diagram of the structure of the hardware system provided in the embodiment of the present application includes a moving vehicle detection module 801 and an exposure and image adjustment module 802. The moving vehicle detection module 801 is used to execute the aforementioned steps S101 to S106. The exposure and image adjustment module 802 is used to execute the aforementioned step S107.
[0118] See also Fig. 9 , Fig. 9 The schematic diagram of the structure of the mobile vehicle detection module provided in the embodiment of the present application is that the mobile vehicle detection module 801 includes a suspected headlight movement detection unit 901, a headlight matching unit 902 and a license plate matching unit 903. The suspected headlight movement detection unit 901 is used to execute the aforementioned steps S101-step S103, step S501-step S503, step S601-step S602. The steps executed by the suspected headlight movement detection unit 901 will be described in more detail below in conjunction with the flow chart, see Fig.10 , Fig.10 The schematic diagram of the process of detecting suspected moving vehicle lights provided in the embodiment of the present application includes:
[0119] S1001, obtain the first image and preprocess it. S1002, obtain the second image and preprocess it. S1003, subtract the first image from the second image at each position. S1004, judge the brightness difference of the image block at each position and the preset brightness difference threshold. If the image block in the first image is larger than the brightness threshold and within the color threshold range, and the brightness difference > the preset brightness difference threshold, execute step S1005. If the image block in the first image is larger than the brightness threshold and within the color threshold range, and the brightness difference < the preset brightness difference negative threshold, execute step S1006. S1005, record the coordinates (i, j) at this location, mark it as the first image block, and the counter +1, and the coordinates are accumulated and S1006, record the coordinates (i, j) at this location, mark it as the second image block, and counter +1, and the coordinates are accumulated and . S1007, and The number of relative directions is compared with the preset number threshold. If it is greater than the preset number threshold, step S1008 is executed. If it is less than the preset number threshold, step S1009 is executed. S1008, the speed is calculated according to the accumulated coordinates. S1009, no moving motor vehicle is detected. S1010, the speed and speed direction are determined. If the conditions are met (i.e., the speed is greater than the preset speed threshold, and the angle between the relative direction and the preset lane direction is less than the preset angle threshold), step S1011 is executed. If the conditions are not met, step S1009 is executed. S1011, the headlight matching process is entered.
[0120] The above steps S1001 to S1011 have been described in detail above and will not be repeated here. The headlight matching unit 902 is used to execute the above steps S104 to S105 and steps S201 to S207. The license plate matching unit 903 is used to execute the above steps S106 and steps S701 to S703.
[0121] Corresponding to the aforementioned exposure parameter adjustment method, the present application embodiment further provides an exposure parameter adjustment device, see Fig.11 , Fig.11 The structural diagram of the exposure parameter adjustment device provided in the embodiment of the present application includes:
[0122] An image acquisition module 1101 is used to acquire a first image acquired by an acquisition device at a first moment and a second image acquired by the acquisition device at a second moment; an image division module 1102 is used to divide the first image and the second image into a plurality of image blocks respectively according to the same division method; a first screening module 1103 is used to determine a first image block that meets a preset first condition in the first image, wherein the preset first condition includes: a brightness difference between the first image block and a corresponding third image block is greater than a preset brightness difference threshold, and the third image block is an image block in the second image that has the same position as the first image block; a connected domain determination module 1104 is used to determine each connected domain composed of the first image blocks in the first image; a position screening module 1105 is used to use the position of the connected domain with matching position in the first image as the target headlight position if a preset headlight existence condition is met; wherein the preset headlight existence condition includes the existence of a connected domain with matching position in the first image; The position determination module 1106 is used to determine the license plate position corresponding to the target headlight position as the target license plate position according to the relative position relationship between the preset headlight position and the license plate position; the parameter adjustment module 1107 is used to adopt the first exposure parameter if the preset headlight existence condition and the preset license plate existence condition are met; adopt the second exposure parameter if the preset headlight existence condition is met and the preset license plate existence condition is not met; adopt the third exposure parameter if the preset headlight existence condition is not met; wherein the preset license plate existence condition includes the existence of a license plate at the target license plate position.
[0123] By applying the above embodiment, the brightness of the headlights of a motor vehicle in a low-light scene at night is relatively high, and the movement of the motor vehicle drives the movement of the headlights. Since the first image and the second image are images taken at different times, by comparing the brightness difference of the image blocks at corresponding positions in the first image and the second image, the area with significant brightness change is identified, and the area is the potential position of the headlights. Since the headlights of a motor vehicle appear in pairs, by determining the connected domain composed of these image blocks, if there is no pair of connected domains with matching positions, it is proved that there are no matching headlights, that is, there is no motor vehicle, and the exposure parameters are adjusted to the normal exposure of monitoring to ensure that reliable monitoring images can be obtained under various circumstances. If a pair of connected domains with matching positions are determined, it is proved that there is a pair of headlights of a motor vehicle, that is, there is a motor vehicle, and the position of the pair of connected domains is determined as the position of the headlights, avoiding the misidentification of the connected domain formed by the movement of motorcycle headlights, flying insects, etc. as the connected domain formed by the movement of the motor vehicle, and the possible position of the license plate is inferred by using the preset relative position relationship between the headlights and the license plate. According to the result of determining whether there is a license plate at the possible position, the appropriate exposure parameter is selected. That is, when it is determined that the matching headlight is obtained and the license plate exists, the exposure parameter is adjusted to the first exposure parameter, which effectively avoids the problem of overexposure of the license plate. While ensuring that the license plate is clearly visible, it also ensures the clear display of the scene in the collected image. When it is determined that the matching headlight is obtained, but the license plate does not exist, the second exposure parameter is used to ensure the clear display of the scene in the collected image. There is no need to split the image data into two independent video streams, that is, no additional hardware resources and processing capabilities are required, and the requirements for clear presentation of the scene and the license plate can be met at the same time, thereby effectively reducing the monitoring cost.
[0124] In a possible implementation manner, whether the preset vehicle light existence condition is satisfied is determined in the following manner: a first position screening submodule is used to determine, for each connected domain, whether there are other connected domains within the search range corresponding to the connected domain, wherein the search range corresponding to each connected domain is negatively correlated with the distance of the connected domain from the acquisition device; a second position screening submodule is used to determine, if there are other connected domains, the preset vehicle light existence condition is satisfied. In a possible implementation manner, the first position screening submodule includes: a first position screening unit is used to determine, for each connected domain, a first search radius, a second search radius, a first tilt angle, and a second tilt angle according to the distance of the connected domain from the acquisition device, wherein the first search radius, the second search radius, the first tilt angle, and the second tilt angle are negatively correlated with the distance of the connected domain from the acquisition device; a second position screening unit is used to determine, for each connected domain, whether there are other connected domains within a fan-shaped search range with the position of the connected domain as the center, the first search radius as the inner diameter, the second search radius as the outer diameter, the first tilt angle as the positive tilt angle, and the second tilt angle as the negative tilt angle. In a possible implementation, the position determination module includes: a first position determination submodule, used to determine, according to each of the target headlight positions, an area symmetrical to the perpendicular midline of the target line as the target license plate position, wherein the target line is a line between each of the target headlight positions, and the size of the area is positively correlated with the distance between each of the target headlight positions. In a possible implementation, the device also includes: a second screening module, used to determine a second image block that meets a preset second condition in the second image, wherein the preset second condition includes: the brightness difference between the second image block and the corresponding fourth image block is greater than a preset brightness difference threshold, and the fourth image block is an image block in the first image with the same position as the second image block; a distance calculation module, used to calculate the distance between the second image block and the first image block; a rate calculation module, used to calculate the target rate according to the distance and the interval between the first moment and the second moment, wherein the target rate is positively correlated with the distance and negatively correlated with the interval; the preset license plate existence condition also includes: the target rate is greater than a preset rate threshold. In a possible implementation, the device further includes: a direction calculation module for calculating the relative direction between the second image block and the first image block; the preset license plate existence condition also includes: an angle between the relative direction and the preset lane direction is less than a preset angle threshold.In a possible implementation, the device further includes: a third screening module, used to determine whether there is an image block that meets a preset third condition at the target license plate position, wherein the preset third condition is: the hue of the image block is within a preset first hue interval, the saturation of the image block is within a preset saturation interval, and the brightness of the image block is within a preset brightness interval; a fourth screening module, used to determine that there is a license plate at the target license plate position if there is an image block that meets the preset third condition; a fifth screening module, used to determine that there is no license plate at the target license plate position if there is no image block that meets the preset third condition. In a possible implementation, the preset first condition also includes: the brightness of the image block is greater than a preset brightness threshold, the hue of the image block is within a preset second hue interval, and the saturation of the image block is greater than a preset saturation threshold.
[0125] The present application also provides an electronic device, such as Fig.12 As shown, including:
[0126] The memory 1201 is used to store computer programs; the processor 1202 is used to implement the following steps when executing the program stored in the memory 1201: obtaining a first image acquired by an acquisition device at a first moment and a second image acquired by the acquisition device at a second moment; dividing the first image and the second image into a plurality of image blocks respectively according to the same division method; determining a first image block that meets a preset first condition in the first image, wherein the preset first condition includes: a brightness difference between the first image block and a corresponding third image block is greater than a preset brightness difference threshold, and the third image block is an image block in the second image that has the same position as the first image block; determining each connected domain composed of the first image block in the first image; If the preset headlight existence condition is met, the position of the connected domain with matching position in the first image is taken as the target headlight position; wherein the preset headlight existence condition includes the existence of a connected domain with matching position in the first image; according to the relative position relationship between the preset headlight position and the license plate position, the license plate position corresponding to the target headlight position is determined as the target license plate position; if the preset headlight existence condition and the preset license plate existence condition are met, the first exposure parameter is adopted; if the preset headlight existence condition is met and the preset license plate existence condition is not met, the second exposure parameter is adopted; if the preset headlight existence condition is not met, the third exposure parameter is adopted; wherein the preset license plate existence condition includes the existence of a license plate at the target license plate position.
[0127] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 1202, the communication interface, and the memory 1201 communicate with each other via the communication bus.
[0128] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0129] The communication interface is used for communication between the above electronic device and other devices.
[0130] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0131] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0132] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned exposure parameter adjustment methods are implemented.
[0133] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any exposure parameter adjustment method in the above embodiments.
[0134] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0135] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0136] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0137] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A method for adjusting exposure parameters, characterized in that: The method comprises: Acquire a first image acquired by an acquisition device at a first moment and a second image acquired by the acquisition device at a second moment; According to the same division method, the first image and the second image are respectively divided into a plurality of image blocks; Determining a first image block that satisfies a preset first condition in the first image, wherein the preset first condition includes: a brightness difference between the first image block and a corresponding third image block is greater than a preset brightness difference threshold, and the third image block is an image block in the second image at the same position as the first image block; Determining, in the first image, connected domains formed by the first image blocks; If the preset vehicle light existence condition is met, the position of the connected domain with matching position in the first image is used as the target vehicle light position; wherein the preset vehicle light existence condition includes the connected domain with matching position in the first image; According to the relative position relationship between the preset headlight position and the license plate position, the license plate position corresponding to the target headlight position is determined as the target license plate position; If the preset headlight existence condition is met and the preset license plate existence condition is met, the first exposure parameter is adopted; if the preset headlight existence condition is met and the preset license plate existence condition is not met, the second exposure parameter is adopted; if the preset headlight existence condition is not met, the third exposure parameter is adopted; wherein the preset license plate existence condition includes the existence of a license plate at the target license plate position.
2. The method according to claim 1, characterized in that Whether the preset vehicle light existence condition is met is determined by: For each connected domain, determine whether there are other connected domains within the search range corresponding to the connected domain, wherein the search range corresponding to each connected domain is negatively correlated with the distance between the connected domain and the acquisition device; If it exists, then the preset vehicle light existence condition is met.
3. The method according to claim 2, characterized in that The step of determining, for each connected domain, whether there are other connected domains within a search range corresponding to the connected domain comprises: For each connected domain, determine a first search radius, a second search radius, a first tilt angle, and a second tilt angle according to the distance of the connected domain from the acquisition device, wherein the first search radius, the second search radius, the first tilt angle, and the second tilt angle are negatively correlated with the distance of the connected domain from the acquisition device; For each connected domain, determine whether there are other connected domains within a fan-shaped search range with the position of the connected domain as the center, the first search radius as the inner diameter, the second search radius as the outer diameter, the first inclination angle as the positive inclination angle, and the second inclination angle as the negative inclination angle.
4. The method according to claim 1, characterized in that: The method of determining the license plate position corresponding to the target vehicle light position as the target license plate position according to the relative position relationship between the preset vehicle light position and the license plate position includes: According to each of the target headlight positions, an area symmetrical to the perpendicular bisector of the target line is determined as the target license plate position, wherein the target line is the line between each of the target headlight positions, and the size of the area is positively correlated with the distance between each of the target headlight positions.
5. The method according to claim 1, characterized in that The method further comprises: Determining a second image block that satisfies a preset second condition in the second image, wherein the preset second condition includes: a brightness difference between the second image block and a corresponding fourth image block is greater than a preset brightness difference threshold, and the fourth image block is an image block in the first image at the same position as the second image block; Calculating a distance between the second image block and the first image block; Calculate a target speed according to the distance and an interval between the first moment and the second moment, wherein the target speed is positively correlated with the distance and negatively correlated with the interval; The preset license plate existence condition also includes: the target speed is greater than a preset speed threshold.
6. The method according to claim 5, characterized in that The method further comprises: calculating a relative direction between the second image block and the first image block; The preset license plate existence condition also includes: an angle between the relative direction and a preset lane direction is less than a preset angle threshold.
7. The method according to claim 1, characterized in that The method further comprises: At the target license plate position, determining whether there is an image block that meets a preset third condition, wherein the preset third condition is: the hue of the image block is within a preset first hue interval, the saturation of the image block is within a preset saturation interval, and the brightness of the image block is within a preset brightness interval; If there is an image block that meets the preset third condition, it is determined that there is a license plate at the target license plate position; If there is no image block that meets the preset third condition, it is determined that there is no license plate at the target license plate position.
8. The method according to claim 1, characterized in that: The preset first condition also includes: the brightness of the image block is greater than a preset brightness threshold, the hue of the image block is within a preset second hue interval, and the saturation of the image block is greater than a preset saturation threshold.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-8 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Exposure parameter value determining method and device, multi-lens camera and storage medium
CN108377345A
Roller surface defect detection method and system based on image processing
CN114972357A