Local Exposure Adjustment Method, Electronic Device, and Computer-Readable Storage Medium
By detecting the predicted area of the moving target in the monitoring device and calculating the exposure parameters, the problem of low license plate recognition rate in multi-vehicle environments is solved, and the local exposure adjustment of multiple license plate areas is achieved, which improves the exposure effect of the overall image.
Patent Information
- Application Number
- CN202211396468.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-11-07
AI Technical Summary
In the prior art, when the monitoring device photographs multiple vehicles, it is impossible to perform effective local exposure adjustments on multiple license plate areas at the same time, resulting in a decrease in the license plate recognition rate.
The monitoring device acquires the current frame image, detects the predicted area of the moving target, calculates the exposure parameters based on the overlap between the predicted area and the hot spot area, adjusts the exposure parameters of the local exposure area, and realizes local exposure adjustment for multiple predicted areas.
Accurate exposure adjustment of multiple predicted areas is achieved, avoiding the impact of other areas except the local exposure areas and ensuring the exposure effect of the overall picture.
Smart Images

Figure CN116261047B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a local exposure adjustment method, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the continuous development of image recognition technology, more and more monitoring equipment is used for roadside parking management. Monitoring equipment is usually used to identify the license plate area (target area) of the vehicle (moving target). Since the reflectivity of the license plate area is much higher than that of the vehicle itself, if the vehicle is clearly visible in the image captured by the monitoring equipment, the license plate area is usually overexposed (too bright); or the recognition effect of the license plate area in the image is good, but the body is underexposed (too low brightness), resulting in reduced recognition of the body.
[0003] In the prior art, the global brightness is usually adjusted based on the brightness of the license plate area, and the exposure of the entire image is controlled with the license plate area as the center to improve the recognition rate of the license plate area.
[0004] However, the above method only has a good exposure effect when there is a single vehicle in the image. If there are multiple vehicles in the image, the global adjustment control method based on a single license plate area will often affect the exposure effect of the remaining license plate areas in the image because it is impossible to locally expose the license plate areas of the remaining vehicles at the same time, thereby failing to improve the recognition rate of multiple license plate areas at the same time. Summary of the invention
[0005] The main technical problem solved by the present application is to provide a local exposure adjustment method, an electronic device and a computer-readable storage medium, which can solve the problem in the prior art that local exposure adjustment cannot be performed on multiple target areas in an image.
[0006] In order to solve the above technical problems, the first technical solution adopted in the present application is to provide a local exposure adjustment method, including: obtaining a current frame image of a statistical area from a monitoring device; detecting the current frame image to determine the predicted area of the target area of the moving target in the next frame image based on the speed and movement direction of each identified moving target; determining the hot spot area in the current frame image; calculating the exposure parameters of each predicted area according to a first overlap between each predicted area and the hot spot area and a second overlap between each predicted area and the projection line segments of the remaining predicted areas in the first direction; wherein the first direction is the row-by-row exposure direction of row pixels; adjusting the exposure parameters of the local exposure area including the corresponding predicted area based on multiple exposure parameters; wherein the height of the local exposure area is the projection distance of the next frame image in the second direction, and the width of the local exposure area is the projection distance of the prediction area in the first direction; wherein the second direction is the extension direction of the row pixels.
[0007] To solve the above technical problems, the second technical solution adopted by this application is to provide an electronic device, including: a memory for storing program data, which when executed realizes the steps in the local exposure adjustment method as described above; a processor for executing the program data stored in the memory to realize the steps in the local exposure adjustment method as described above.
[0008] To solve the above technical problems, the third technical solution adopted by this application is to provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it realizes the steps in the local exposure adjustment method as described above.
[0009] The beneficial effects of this application are as follows: Different from the prior art, this application provides a local exposure adjustment method, an electronic device, and a computer-readable storage medium. By determining the predicted regions of each moving target in the current frame image in the next frame image, and calculating the exposure parameters of each predicted region according to the overlapping situations of each predicted region with the hot spot region and the other predicted regions, and adjusting the exposure parameters of the local exposure regions including the corresponding predicted regions respectively based on multiple exposure parameters, it can utilize the characteristic of local consistency of moving targets to control the range of exposure adjustment within the local exposure regions including each predicted region, thereby realizing the local exposure adjustment of multiple predicted regions; further, by changing the range of exposure adjustment from global to multiple local exposure regions, it avoids the influence on the other regions except the multiple local exposure regions in the next frame image, thereby ensuring the exposure effect of the overall picture. Description of the Drawings
[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0011] Figure 1 It is a schematic flowchart of the first implementation manner of the local exposure adjustment method of this application;
[0012] Figure 2 It is a schematic flowchart of the second implementation manner of the local exposure adjustment method of this application;
[0013] Figure 3 It is a schematic diagram of the hot spot region in this application;
[0014] Figure 4 It is a schematic diagram of the classification of multiple predicted regions in this application;
[0015] Figure 5 It is a schematic flowchart for calculating and obtaining the exposure parameters of each first prediction area;
[0016] Figure 6 It is a schematic flowchart for calculating and obtaining the exposure parameters of each second prediction area;
[0017] Figure 7 It is a schematic flowchart for calculating and obtaining the exposure parameters of each third prediction position;
[0018] Figure 8 It is a schematic diagram of the row corresponding to the height where the exposure parameters need to be calculated in the first prediction area;
[0019] Figure 9 It is a working flowchart of an application scenario of the local exposure adjustment method 1 of the present application;
[0020] Figure 10 It is a schematic structural diagram of an implementation manner of the local exposure adjustment device of the present application;
[0021] Figure 11 It is a schematic structural diagram of an implementation manner of the electronic device of the present application;
[0022] Figure 12 It is a schematic structural diagram of an implementation manner of the computer-readable storage medium of the present invention. Specific embodiments
[0023] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0024] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "the" and "said" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless clearly indicated otherwise in the above context. "Multiple" generally includes at least two, but does not exclude the case of including at least one.
[0025] It should be understood that the term " / and" used herein is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects.
[0026] It should be understood that the terms "comprising", "including" or any other variants used herein are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, the elements defined by the statement "comprising..." do not exclude the presence of additional identical elements in the process, method, article or device comprising the said elements.
[0027] Please refer to Figure 1 , Figure 1 which is a schematic flow chart of the first embodiment of the local exposure adjustment method of the present application. In this embodiment, the local exposure adjustment method includes:
[0028] S11: Obtain the current frame image of the statistical area from the monitoring device.
[0029] In this embodiment, the monitoring device is an electronic device with a camera function, the statistical area is the target road section for roadside parking, and the current frame image is obtained by the monitoring device set above the target road section.
[0030] In this embodiment, the monitoring device is a COMS (Complementary Metal Oxide Semiconductor) camera. Specifically, the exposure mode of the COMS camera is rolling shutter exposure. In this exposure mode, when the aperture is opened, there is still a rolling shutter with a certain interval to control the exposure time of the sensor, and the rolling shutter exposes line by line from left to right, and the exposure parameters of each row of pixels can be adjusted individually.
[0031] In this embodiment, the exposure parameters include shutter time (or shutter speed) and aperture.
[0032] Specifically, shutter time refers to the specific term used to express the exposure time, that is, the effective time length when the camera's shutter is opened, and the shutter time can be expressed by the T value. Aperture refers to the amount of light that controls the light passing through the lens and entering the photosensitive surface inside the camera body, and it is an extremely important parameter of the lens. Usually inside the lens, the size of the aperture determines the amount of light entering the photosensitive element, and the size of the aperture is usually expressed by the F value.
[0033] In other embodiments, the monitoring device can also be a bayonet camera, or other types of cameras, and the present application does not limit this.
[0034] In this embodiment, the monitoring device can be installed above the target road section in a one-line same-side or one-line opposite-side installation manner. Among them, the one-line refers to the side view. The one-line same-side means that the monitoring device is installed above the road section on the side where the parking spaces are set. The one-line opposite-side means that the monitoring device is installed above the other road section opposite to the road section on the side where the parking spaces are set.
[0035] Among them, the number of monitoring devices can be set according to user needs. In a specific embodiment, only one monitoring device can be set. In another specific implementation scenario, in order to obtain more-dimensional or more accurate monitoring information, multiple monitoring devices can be set. This application does not make any limitations in this regard.
[0036] S12: Detect the current frame image to determine the predicted area of the target area of the moving target in the next frame image based on the speed and moving direction of each identified moving target.
[0037] In this embodiment, the moving targets include vehicles in motion, and the target area includes the license plate area of the vehicle.
[0038] In this embodiment, the current frame image is detected using a vehicle detection algorithm and a license plate recognition algorithm. Among them, only unobstructed moving targets and target areas are detected.
[0039] In a specific implementation scenario, the vehicle detection algorithm can be a two-stage algorithm represented by Faster-RCNN. For example, Faster-RCNN, Cascade-RCNN, Libra-RCNN, YOLOV2, and YOLOV3, etc. In another specific implementation scenario, the vehicle detection algorithm can be a one-stage detection algorithm, such as YOLOV1, RefineDet, Retinanet, FCOS, and ATSS, etc. In yet another specific implementation scenario, the vehicle detection algorithm can be an algorithm represented by transformer, such as DETR, deformable DETR, and VIT, etc. This application does not make any limitations in this regard.
[0040] In a specific implementation scenario, the license plate recognition algorithm can be template matching, probability statistics, geometric classification method, and wavelet operation, etc. In another specific implementation scenario, the license plate recognition algorithm can be support vector machine, neural network analysis, and feature matching, etc. This application does not make any limitations in this regard.
[0041] In this embodiment, a target tracking algorithm based on motion detection can be used to determine the moving direction of the moving target, and means such as an auxiliary radar can be used to measure the speed of the moving target. Then, based on the speed and moving direction of the moving target, the position of the target area of the moving target in the next frame image is predicted.
[0042] Understandably, since the moving target is constantly moving, the position of the target area in the next frame of image will change relative to the current frame of image. If the exposure adjustment of the next frame of image is only based on the position of the target area recognized in the current frame of image, the target area cannot be accurately covered. Therefore, determining the predicted area of the target area of the moving target in the next frame of image based on the speed and moving direction of the moving target can improve the accuracy of local exposure adjustment.
[0043] S13: Determine the hot area in the current frame of image.
[0044] In this embodiment, the hot area refers to the area where the target area of the moving target in the ROI (region of interest) most frequently appears. Among them, the images captured in the statistical area are segmented to obtain some images as the ROI, the target areas entering the ROI within a preset time period are counted, and the area where the target area most frequently appears is determined as the hot area.
[0045] In this embodiment, after obtaining the current frame of image, the range of the hot area is determined in the current frame of image based on the information of the previously statistically hot area, and then the exposure parameter of the hot area is used as the reference exposure parameter for the predicted area in the next frame of image.
[0046] S14: Calculate the exposure parameter of each predicted area according to the first overlapping situation between each predicted area and the hot area and the second overlapping situation between the projection line segments of each predicted area and the other predicted areas in the first direction; where the first direction is the progressive exposure direction of the row pixels.
[0047] In this embodiment, the first overlapping situation refers to whether there is an intersection area between each predicted area and the hot area.
[0048] Understandably, since the hot area is the area where the statistically target area most frequently appears, it is necessary to calculate the exposure parameter of each predicted area with reference to the exposure parameter of the hot area, and the distance from the hot area is an important factor to consider, so it is necessary to determine the intersection area between each predicted area and the hot area.
[0049] In this embodiment, the second overlapping situation refers to whether there is an intersecting line segment between the projection line segments in the first direction of each prediction region and the remaining prediction regions. Specifically, since the multiple prediction regions in the current frame image do not substantially overlap, the overlapping situation of the projection line segments of the prediction regions in the first direction is used to determine whether they are within the exposure range of the same row of pixels as the remaining prediction regions, that is, to determine whether there is local consistency between each prediction region and the remaining prediction regions in terms of row pixels. Here, local consistency means that the exposure parameters of the same row of pixels are the same.
[0050] It can be understood that since the shutter of the monitoring device is a rolling shutter sensor and its exposure method is row-by-row exposure from left to right, although the exposure parameters of each row of pixels can be controlled separately, the exposure parameters of the same row of pixels are the same. Therefore, when adjusting the exposure parameters of each row of pixels, it is necessary to determine whether there are multiple prediction regions in the same row of pixels. If there is only one prediction region corresponding to the same row of pixels, the exposure parameters of the row of pixels where it is located can be directly adjusted based on the exposure parameters of this prediction region. If there are multiple prediction regions corresponding to the same row of pixels, indicating that there is local consistency between multiple moving targets, then it is necessary to consider the characteristics of multiple prediction regions to determine the exposure parameters of this row of pixels.
[0051] S15: Adjust the exposure parameters of the local exposure regions including the corresponding prediction regions respectively based on multiple exposure parameters; where the height of the local exposure region is the projection distance of the next frame image in the second direction, and the width of the local exposure region is the projection distance of the prediction region in the first direction; where the second direction is the extension direction of the row pixels.
[0052] Among them, the projection distance of the next frame image in the second direction is the overall height of the next frame image.
[0053] In this embodiment, each prediction region and the local exposure region including this prediction region both include the row pixels corresponding to the corresponding number of rows, except that the height of the local exposure region is the height of the overall image.
[0054] It can be understood that adjusting the exposure parameters of the local exposure regions including each prediction region based on the exposure parameters of each prediction region can adjust the exposure parameters of multiple prediction regions that appear simultaneously in the image in combination with the characteristics of row exposure, thus not only achieving precise exposure of multiple prediction regions, but also avoiding frequent adjustment of the remaining regions except the above-mentioned local exposure regions, and then improving the overall exposure effect.
[0055] Different from the prior art, in this embodiment, by determining the predicted region of the target region of each moving target in the current frame image in the next frame image, and calculating the exposure parameter of each predicted region according to the overlapping situation of each predicted region with the hot spot region and the other predicted regions, and adjusting the exposure parameters of the local exposure regions including the corresponding predicted regions respectively based on multiple exposure parameters, it is possible to utilize the line exposure characteristic and the local consistency of multiple moving targets, and control the range of exposure adjustment within the local exposure regions including each predicted region, thereby realizing the local exposure adjustment of multiple predicted regions. Further, by changing the range of exposure adjustment from global to multiple local exposure regions, it is avoided that the other regions except the multiple local exposure regions in the next frame image are affected, thereby ensuring the exposure effect of the overall picture.
[0056] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of the second embodiment of the local exposure adjustment method of the present application. In this embodiment, the local exposure adjustment method includes:
[0057] S21: Obtain the current frame image of the statistical region from the monitoring device.
[0058] For the specific process, please refer to the description in S11, and details are not repeated here.
[0059] S22: Detect the current frame image to determine the predicted region of the target region of the moving target in the next frame image based on the speed and moving direction of each identified moving target.
[0060] For the specific process, please refer to the description in S12, and details are not repeated here.
[0061] S23: Determine the hot spot region in the current frame image.
[0062] In this embodiment, first, obtain the video images of the preset time period based on the monitoring video of the statistical region, and detect each frame image in the video images to identify the target regions of each moving target and determine the center points of each target region. Then, accumulate each center point recorded in multiple frame images as a hot spot to determine the dense region where the hot spots are formed in the statistical region. Finally, perform edge compensation on the dense region to obtain the hot spot region.
[0063] Among them, the edge compensation for the dense region is to make the range of the hot spot region more accurate to accommodate more hot spots.
[0064] Specifically, the width and height of the recorded target area can be used to perform edge compensation on the dense area. In a specific implementation scenario, if the coordinates of the upper left corner and the lower right corner of the dense area are (x1, y1) and (x2, y2) respectively, and the width and height of the target area are w1 and h1 respectively, then the coordinates of the upper left corner and the lower right corner of the hotspot area after edge compensation are (x1 - w1 / 2, y1 - h1 / 2) and (x1 + w1 / 2, y1 + h1 / 2) respectively, where x1 < x2 and y1 < y2.
[0065] In a specific implementation scenario, if the moving target is a vehicle and the target area is the license plate area, then the maximum width and height of the license plate are recorded based on the license plate detection frame added to the license plate area, and the center point of the license plate area is determined based on the four corner coordinates of the license plate detection frame. Then, according to the distribution of the license plate areas statistically counted in the video image, the dense area is determined. Finally, edge compensation is performed on the dense area based on the statistically counted width and height of the license plate to obtain the hotspot area.
[0066] Specifically, please refer to Figure 3 , Figure 3 is a schematic diagram of the hotspot area in this application. In this embodiment, the hotspot accumulation Figure 3 includes the hotspot area 301 and the hotspots 302. Among them, the hotspot area 301 includes the vast majority of the hotspots 302.
[0067] Furthermore, in this embodiment, according to the change of the time of day, the hotspot area can be statistically counted multiple times. It can be understood that the light and brightness during the day and at night or in the case of frontlight and backlight are different, and the movement trajectories of moving targets may be different at different times. Therefore, there will be differences in the hotspot areas statistically counted based on preset time periods at different times. If only the exposure parameters of the same hotspot area are used as the brightness reference target, the exposure effect will be affected. Therefore, in this embodiment, by statistically counting the hotspot areas in different time periods, more accurate exposure control can be achieved.
[0068] In this embodiment, if there is no moving target in the current frame image, the brightness value of the row pixels corresponding to the area with the highest hotspot density in the hotspot area is used as the brightness value for global exposure.
[0069] S24: Divide the multiple prediction areas into a first prediction area, a second prediction area, and a third prediction area according to the first overlap situation between each prediction area and the hotspot area and the second overlap situation between the projection line segments in the first direction with the remaining prediction areas.
[0070] In a specific implementation scenario, in response to the prediction area and the hot spot area having an overlapping area, and the projection line segment of the overlapping area in the first direction having no intersection line segment with the projection line segments of at least one overlapping area formed by the remaining prediction areas and the hot spot area in the first direction, the prediction area is determined as the first prediction area.
[0071] In another specific implementation scenario, in response to the prediction area and the hot spot area having an overlapping area, and the projection line segment of the overlapping area in the first direction having an intersection line segment with the projection line segments of at least one overlapping area formed by the remaining prediction areas and the hot spot area in the first direction, the prediction area is determined as the second prediction area.
[0072] In yet another specific implementation scenario, in response to the prediction area and the hot spot area having no overlapping area, the prediction area is divided into the third prediction area.
[0073] Specifically, please refer to Figure 4 , Figure 4 which is a classification schematic diagram of multiple prediction areas in this application. In this implementation manner, the ROI image 40 includes a hot spot area 401, a first prediction area 410, a second prediction area 420, and a third prediction area 430. Among them, the A direction refers to the first direction, that is, the row pixel progressive exposure direction, and the B direction refers to the second direction, that is, the extension direction of the row pixels.
[0074] Among them, the first prediction area 410 and the hot spot area 401 have an overlapping area, but the projection line segment of the overlapping area in the first direction has no intersection line segment with the projection line segments of multiple overlapping areas formed by the remaining prediction areas and the hot spot area 401 in the first direction.
[0075] Among them, the second prediction area 420 and the hot spot area 401 have an overlapping area, have an intersection line segment with the projection line segments of multiple overlapping areas formed by the remaining prediction areas and the hot spot area 401 in the first direction, and each row pixel corresponding to the intersection line segment has local consistency.
[0076] Among them, the third prediction area 430 and the hot spot area 401 have no overlapping area.
[0077] S25: Calculate and obtain the exposure parameters of each first prediction area, the exposure parameters of each second prediction area, and the exposure parameters of each third prediction position respectively.
[0078] In this implementation manner, the calculation formula of the exposure parameter is as follows:
[0079] T = f(V)
[0080] F = f(R)
[0081] Among them, T represents the shutter time, V represents the speed of the moving target, f(V) represents calculating the shutter time based on the speed of the moving target, F represents the aperture, R represents the calculation area of the brightness value, and f(R) represents calculating the aperture based on the brightness value.
[0082] Among them, the greater the speed V of the moving target, the smaller the shutter time T.
[0083] Among them, R may be a hot spot area or a combination of a hot spot area and other areas.
[0084] The above calculation formulas can be represented by the aggregated model, and the model is as follows:
[0085] TF = f(N, V, R)
[0086] Among them, TF represents the shutter time T and the aperture F, and N represents the number of moving targets in the ROI.
[0087] In a specific implementation scenario, when there is only one moving target in the ROI, the model is represented as TF = f(1, V, R).
[0088] Specifically, please refer to Figure 5 、 Figure 6 and Figure 7 , Figure 5 is a schematic flow diagram for calculating and obtaining the exposure parameters of each first prediction area, Figure 6 is a schematic flow diagram for calculating and obtaining the exposure parameters of each second prediction area, Figure 7 is a schematic flow diagram for calculating and obtaining the exposure parameters of each third prediction position.
[0089] In this embodiment, the steps of calculating and obtaining the exposure parameters of each first prediction area specifically include:
[0090] S51: Determine whether each first prediction area completely falls within the hot spot area.
[0091] S52: In response to the first prediction area completely falling within the hot spot area, determine the exposure parameters of each row of pixels in the first prediction area based on the brightness value of each row of pixels in the first prediction area and the speed of the corresponding moving target.
[0092] In this embodiment, the first prediction area completely falling within the hot spot area indicates that the brightness value of each row of pixels in the first prediction area is the brightness value at the corresponding position in the hot spot area.
[0093] Specifically, please refer to Figure 8 , Figure 8It is a schematic diagram of the row corresponding to the height for which the exposure parameter needs to be calculated in the first prediction region. In this embodiment, the current frame image 80 includes a region of interest 81, a hot spot region 801, a first prediction region 810, the row 811 corresponding to the height for which the exposure parameter needs to be calculated, and the row 812 for which the exposure parameter needs to be adjusted.
[0094] Among them, since the first prediction region 810 completely falls within the hot spot region 801, the brightness value of the row 811 corresponding to the height for which the exposure parameter needs to be calculated can be directly obtained from the rolling shutter sensor, and then the exposure parameter of the row 811 corresponding to the height for which the exposure parameter needs to be calculated is calculated based on the brightness value and the speed of the moving target obtained, and then the exposure parameter of the row 812 for which the exposure parameter needs to be adjusted is adjusted based on local consistency using this exposure parameter.
[0095] S53: In response to the first prediction region partially falling within the hot spot region, based on the brightness value of each row of pixels in the overlapping region and the speed of the corresponding moving target, determine the exposure parameter of each row of pixels in the overlapping region, and use the exposure parameter of each row of pixels in the overlapping region to adjust the exposure parameter of each row of pixels in the non-overlapping region to determine the exposure parameter of each row of pixels in the first prediction region.
[0096] In a specific implementation scenario, in response to the projection distances of the overlapping region in the first direction and the second direction being both less than the projection distances of the first prediction region in the first direction and the second direction, determine the exposure parameter of each row of pixels in the overlapping region based on the brightness value of each row of pixels in the overlapping region and the speed of the corresponding moving target.
[0097] Furthermore, use the exposure parameter of each row of pixels in the overlapping region to adjust one by one the exposure parameter of each row of pixels in the non-overlapping region that is connected to each row of pixels in the overlapping region, and use the exposure parameter of the row pixel in the overlapping region that is closest to the non-overlapping region to overwrite the exposure parameter of the remaining row pixels in the non-overlapping region to determine the exposure parameter of each row of pixels in the first prediction region.
[0098] It can be understood that since the brightness value of the overlapping region is the brightness value of the hot spot region, using the brightness value of the hot spot region as a reference brightness value to adjust the exposure parameter of the non-overlapping region can ensure the overall exposure effect of the first prediction region.
[0099] In this embodiment, the step of calculating and obtaining the exposure parameter of each second prediction region specifically includes:
[0100] S61: Obtain the distances between the multiple second prediction regions having the same intersection line segment and the row pixels corresponding to the region with the highest hot spot density in the hot spot region, and sort the multiple distances.
[0101] S62: Obtain the nearest second prediction region corresponding to the smallest sorted distance and the farthest second prediction region corresponding to the largest sorted distance.
[0102] In this embodiment, sorting multiple distances is to combine the characteristic that the nearer is larger and the farther is smaller, so as to assign a larger weight value to the nearest second prediction region and a smaller weight value to the farthest second prediction region subsequently.
[0103] S63: Determine the corresponding nearest moving target and farthest moving target based on the nearest second prediction region and the farthest second prediction region.
[0104] It can be understood that the distance between the second prediction region and the row pixels corresponding to the region with the largest hotspot density in the hotspot region can represent the distance between the corresponding moving target and the relevant row pixels.
[0105] S64: Determine a third speed according to the first speed of the nearest moving target and the second speed of the farthest moving target.
[0106] In this embodiment, the first speed and the second speed are respectively multiplied by the corresponding weight values and then added together to obtain the third speed.
[0107] Among them, the weight value of the first speed is greater than the weight value of the second speed.
[0108] In a specific implementation scenario, the weight value corresponding to the first speed can be 80%, and the weight value corresponding to the second speed can be 20%. In another specific implementation scenario, the weight value corresponding to the first speed can be 70%, and the weight value corresponding to the second speed can be 30%. This application does not make any limitations in this regard.
[0109] S65: Obtain the brightness values of each row pixel projected as an intersection line segment in the nearest second prediction region as multiple first brightness values, and obtain the brightness values of each row pixel projected as an intersection line segment in the farthest second prediction region as multiple second brightness values.
[0110] It can be understood that different positions of the same row pixel have different brightness values. Therefore, it is necessary to respectively count the brightness values of each row pixel projected as an intersection line segment in the nearest second prediction region and the farthest second prediction region based on the specific positions.
[0111] S66: Determine multiple third brightness values based on the multiple first brightness values and the multiple second brightness values.
[0112] In this embodiment, the first brightness value and the second brightness value are respectively multiplied by the corresponding weight values and then added together to obtain the third brightness value.
[0113] Among them, the weight value of the first brightness value is greater than the weight value of the second brightness value.
[0114] In a specific implementation scenario, the weight value corresponding to the first brightness value can be 80%, and the weight value corresponding to the second brightness value can be 20%. In another specific implementation scenario, the weight value corresponding to the first brightness value can be 70%, and the weight value corresponding to the second brightness value can be 30%. This application does not make any limitations in this regard.
[0115] S67: Use the third speed and multiple third brightness values to determine the exposure parameters of each row of pixels in the intersection line segments projected in the multiple second prediction regions.
[0116] S68: Calculate the exposure parameters of each row of pixels in the multiple second prediction regions where the projection is not an intersection line segment respectively, so as to determine the exposure parameters of each row of pixels in each second prediction region.
[0117] In this embodiment, the method of calculating the exposure parameters of each row of pixels in the first prediction region is used to calculate the exposure parameters of each row of pixels in the multiple second prediction regions where the projection is not an intersection line segment respectively.
[0118] It can be understood that each row of pixels in the multiple second prediction regions where the projection is not an intersection line segment is equivalent to the first prediction region, and can be processed in the way of calculating a single target.
[0119] In this embodiment, the steps of calculating and obtaining the exposure parameters of each third prediction region specifically include:
[0120] S71: Obtain the brightness values of the row pixels corresponding to the region with the maximum hotspot density in the hotspot region as the brightness values of each row of pixels in the third prediction region.
[0121] It can be understood that although there is no overlapping region between the third prediction region and the hotspot region, using the brightness value of the hotspot region as the brightness value of the third prediction region can take into account the exposure adjustment of all prediction regions in the region of interest and avoid overexposure or underexposure of some prediction regions.
[0122] S72: Based on the brightness values of each row of pixels in the third prediction region and the speed of the corresponding moving target, determine the exposure parameters of each row of pixels in the third prediction region.
[0123] S26: Based on multiple exposure parameters, adjust the exposure parameters of the first exposure region including the first prediction region, the exposure parameters of the second exposure region including the second prediction region, and the exposure parameters of the third exposure region including the third prediction region respectively.
[0124] Understandably, based on the technology of line-by-line exposure of the rolling shutter sensor in this embodiment, different exposure controls are performed on different rows of pixels in different prediction regions by using the calculated different exposure parameters, so that different regions can have different exposure effects. Further, by using the characteristic that the row pixels corresponding to the intersection line segments have local consistency, the second prediction region is split into the row pixels corresponding to the intersection line segments and the row pixels corresponding to the non-intersection line segments, and the exposure parameters are calculated based on different calculation methods, so as to achieve optimal exposure control for different parts in the second prediction region. At the same time, by sorting based on the distances between different second prediction regions and the row pixels corresponding to the region with the largest hotspot density in the hotspot region, and combining the characteristics of near objects being larger and far objects being smaller, a larger weight value is assigned to the nearest second prediction region, and a smaller weight value is assigned to the farthest second prediction region, which can solve the problem of exposure adjustment when there is local consistency among multiple moving objects. In addition, since only the exposure parameters of the first exposure region, the second exposure region, and the third exposure region are adjusted individually, and the remaining regions in the image are not adjusted, the problem of brightness change caused by frequent adjustment of the screen can be avoided.
[0125] Please refer to Figure 9 , Figure 9 which is a flowchart of the working process of an application scenario of the local exposure adjustment method of this application. In this embodiment, the current frame image of the statistical region is obtained from the monitoring device, and it is determined whether there is only one moving object in the region of interest of the current frame image.
[0126] Among them, in response to there being only one moving object in the region of interest, based on the speed and moving direction of the moving object, the predicted region of the license plate region of the moving object in the next frame image is determined. In response to the predicted region being the first predicted region, based on the brightness value of each row of pixels in the first predicted region and the speed of the corresponding moving object, the exposure parameter of each row of pixels in the first predicted region is determined, and the exposure parameter of the first exposure region including the first predicted region is adjusted based on the above exposure parameter. In response to the predicted region being the third predicted region, the brightness value of the row pixels corresponding to the region with the largest hotspot density in the hotspot region is obtained, and based on the above brightness value and the speed of the corresponding moving object, the exposure parameter of each row of pixels in the third predicted region is determined, and the exposure parameter of the third exposure region including the third predicted region is adjusted based on the above exposure parameter.
[0127] Among them, in response to multiple moving targets in the region of interest, based on the speed and moving direction of each moving target, determine the predicted region of the license plate region of each moving target in the next frame of image, and determine the types of multiple predicted regions. In response to the predicted region being the first predicted region, based on the brightness value of each row of pixels in the first predicted region and the speed of the corresponding moving target, determine the exposure parameter of each row of pixels in the first predicted region, and adjust the exposure parameter of the first exposure region including the first predicted region based on the above exposure parameter. In response to the predicted region being the second predicted region, use the third speed and multiple third brightness values to determine the exposure parameter of each row of pixels in the projected intersection line segment in the second predicted region, and adjust the exposure parameter of the second exposure region including the second predicted region based on the above exposure parameter. In response to the predicted region being the third predicted region, obtain the brightness value of the row pixels corresponding to the region with the maximum hotspot density in the hotspot region, based on the above brightness value and the speed of the corresponding moving target, determine the exposure parameter of each row of pixels in the third predicted region, and adjust the exposure parameter of the third exposure region including the third predicted region based on the above exposure parameter.
[0128] Correspondingly, the present application provides a local exposure adjustment device.
[0129] Please refer to Figure 10 , Figure 10 which is a schematic structural diagram of an embodiment of the local exposure adjustment device of the present application. As Figure 10 shown, the local exposure adjustment device 1000 includes an acquisition module 1001, a predicted region determination module 1002, a hotspot region determination module 1003, a calculation module 1004, and an adjustment module 1005.
[0130] The acquisition module 1001 is configured to acquire the current frame image of the statistical region from the monitoring device.
[0131] The predicted region determination module 1002 is configured to detect the current frame image to determine the predicted region of the target region of the moving target in the next frame image based on the speed and moving direction of each identified moving target.
[0132] The hotspot region determination module 1003 is configured to determine the hotspot region in the current frame image.
[0133] The calculation module 1004 is configured to calculate the exposure parameter of each predicted region according to the first overlap situation between each predicted region and the hotspot region and the second overlap situation between the projected line segments in the first direction with the remaining predicted regions; wherein, the first direction is the progressive exposure direction of the row pixels.
[0134] An adjustment module 1005 is configured to adjust the exposure parameters of local exposure regions including corresponding prediction regions respectively based on multiple exposure parameters; wherein, the height of the local exposure region is the projection distance of the next frame of image in the second direction, and the width of the local exposure region is the projection distance of the prediction region in the first direction; wherein, the second direction is the extension direction of row pixels.
[0135] For the specific process, please refer to the relevant text descriptions in S11 - S15, S21 - S26, S51 - S53, S61 - S68, and S71 - S72, which will not be elaborated here.
[0136] Different from the prior art, in this embodiment, a prediction region determination module 1002 is used to determine the prediction regions of the target regions of each moving target in the current frame of image in the next frame of image, and a calculation module 1004 is used to calculate the exposure parameters of each prediction region according to the overlapping situations between each prediction region and the hot region as well as the other prediction regions, and an adjustment module 1005 is used to adjust the exposure parameters of local exposure regions including corresponding prediction regions respectively based on multiple exposure parameters. It can utilize the characteristic of local consistency of moving targets to control the exposure adjustment range within the local exposure regions including each prediction region, thereby realizing the local exposure adjustment of multiple prediction regions; further, by changing the exposure adjustment range from global to multiple local exposure regions, it avoids the influence on the remaining regions except the multiple local exposure regions in the next frame of image, thus ensuring the exposure effect of the overall picture.
[0137] Correspondingly, the present application provides an electronic device.
[0138] Please refer to Figure 11 , Figure 11 which is a schematic structural diagram of an embodiment of the electronic device of the present application. As Figure 11 shown, the electronic device 1100 includes a memory 1101 and a processor 1102.
[0139] In this embodiment, the memory 1101 is used to store program data, and when the program data is executed, it implements the steps in the local exposure adjustment method as described above; the processor 1102 is used to execute the program instructions stored in the memory 1101 to implement the steps in the local exposure adjustment method as described above.
[0140] Specifically, the processor 1102 is used to control itself and the memory 1101 to implement the steps in the local exposure adjustment method as described above. The processor 1102 may also be referred to as a CPU (Central Processing Unit). The processor 1102 may be an integrated circuit chip with signal processing capabilities. The processor 1102 may also be a general-purpose processor, 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. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Additionally, the processor 1102 may be implemented jointly by multiple integrated circuit chips.
[0141] Different from the prior art, in this embodiment, the processor 1102 determines the predicted region of each moving target in the current frame image in the next frame image, calculates the exposure parameter of each predicted region according to the overlapping situation of each predicted region with the hot region and the other predicted regions, and adjusts the exposure parameter of the local exposure region including the corresponding predicted region based on multiple exposure parameters, which can utilize the characteristic of local consistency of the moving target to control the exposure adjustment range within the local exposure region including each predicted region, thereby realizing the local exposure adjustment of multiple predicted regions; further, by changing the exposure adjustment range from global to multiple local exposure regions, it avoids the influence on the remaining regions except the multiple local exposure regions in the next frame image, thus ensuring the exposure effect of the overall picture.
[0142] Correspondingly, the present application provides a computer-readable storage medium.
[0143] Please refer to Figure 12 , Figure 12 which is a schematic structural diagram of an embodiment of the computer-readable storage medium of the present invention.
[0144] The computer-readable storage medium 1200 includes a computer program 1201 stored on the computer-readable storage medium 1200. When the computer program 1201 is executed by the above-mentioned processor, the steps in the local exposure adjustment method as described above are implemented. Specifically, if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium 1200. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a computer-readable storage medium 1200 and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in various embodiments of this application. The aforementioned computer-readable storage medium 1200 includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0145] In several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation manners described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.
[0146] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0147] In addition, in each embodiment of this application, the various functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0148] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0149] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
[0150] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
Claims
1. A local exposure adjustment method, characterized in that Including: Obtaining a current frame image of a statistical area from a monitoring device; Detecting the current frame image to determine a predicted area of a target area of the moving target in a next frame image based on the speed and moving direction of each identified moving target; Determining a hot spot area in the current frame image; Calculating an exposure parameter for each of the predicted areas according to a first overlapping situation between each of the predicted areas and the hot spot area and a second overlapping situation between projection line segments in a first direction with the remaining predicted areas, including: dividing the multiple predicted areas into a first predicted area, a second predicted area, and a third predicted area according to the first overlapping situation between each of the predicted areas and the hot spot area and the second overlapping situation between the projection line segments in the first direction with the remaining predicted areas; respectively calculating and obtaining an exposure parameter for each of the first predicted areas, an exposure parameter for each of the second predicted areas, and an exposure parameter for each of the third predicted areas; wherein the first direction is the progressive exposure direction of row pixels; Adjusting the exposure parameters of local exposure areas including the corresponding predicted areas respectively based on the multiple exposure parameters, including: adjusting the exposure parameters of a first exposure area including the first predicted area, the exposure parameters of a second exposure area including the second predicted area, and the exposure parameters of a third exposure area including the third predicted area respectively based on the multiple exposure parameters; wherein the height of the local exposure area is the projection distance of the next frame image in a second direction, and the width of the local exposure area is the projection distance of the predicted area in the first direction; wherein the second direction is the extending direction of the row pixels.
2. The local exposure adjustment method according to claim 1, wherein The step of dividing the multiple predicted areas into a first predicted area, a second predicted area, and a third predicted area according to the first overlapping situation between each of the predicted areas and the hot spot area and the second overlapping situation between the projection line segments in the first direction with the remaining predicted areas includes: In response to the predicted area having an overlapping area with the hot spot area, and the projection line segment of the overlapping area in the first direction having no intersection line segment with the projection line segments of at least one overlapping area formed by the remaining predicted areas and the hot spot area, determining the predicted area as the first predicted area; In response to the predicted area having an overlapping area with the hot spot area, and the projection line segment of the overlapping area in the first direction having an intersection line segment with the projection line segments of at least one overlapping area formed by the remaining predicted areas and the hot spot area, determining the predicted area as the second predicted area; In response to the predicted area having no overlapping area with the hot spot area, dividing the predicted area into the third predicted area.
3. The local exposure adjustment method according to claim 2, wherein The step of calculating and obtaining the exposure parameter of each of the first prediction regions includes: Determine whether each of the first prediction regions completely falls within the hot spot region; In response to each of the first prediction regions completely falling within the hot spot region, determine the exposure parameter of each row of pixels in the first prediction region based on the brightness value of each row of pixels in the first prediction region and the speed of the corresponding moving target; In response to each of the first prediction regions partially falling within the hot spot region, determine the exposure parameter of each row of pixels in the overlapping region based on the brightness value of each row of pixels in the overlapping region and the speed of the corresponding moving target, and adjust the exposure parameter of each row of pixels in the non-overlapping region by using the exposure parameter of each row of pixels in the overlapping region to determine the exposure parameter of each row of pixels in the first prediction region.
4. The local exposure adjustment method according to claim 3, wherein the step of, in response to each of the first prediction regions partially falling within the hot spot region, determining the exposure parameter of each row of pixels in the overlapping region based on the brightness value of each row of pixels in the overlapping region and the speed of the corresponding moving target, and adjusting the exposure parameter of each row of pixels in the non-overlapping region by using the exposure parameter of each row of pixels in the overlapping region to determine the exposure parameter of each row of pixels in the first prediction region includes: In response to the projection distances of the overlapping region in the first direction and the second direction both being less than the projection distances of the first prediction region in the first direction and the second direction, determine the exposure parameter of each row of pixels in the overlapping region based on the brightness value of each row of pixels in the overlapping region and the speed of the corresponding moving target; Use the exposure parameter of each row of pixels in the overlapping region to adjust one by one the exposure parameter of each row of pixels in the non-overlapping region that is connected to each row of pixels in the overlapping region, and use the exposure parameter of the row pixel in the overlapping region that is closest to the non-overlapping region to cover the exposure parameter of the remaining row pixels in the non-overlapping region to determine the exposure parameter of each row of pixels in the first prediction region.
5. The local exposure adjustment method according to claim 4, wherein the step of calculating and obtaining the exposure parameter of each of the second prediction regions includes: Obtain the distances between the multiple second prediction regions having the same intersection line segment and the row pixels corresponding to the region with the maximum hot spot density in the hot spot region, and sort the multiple distances; Obtain the nearest second prediction region corresponding to the minimum sorted distance and the farthest second prediction region corresponding to the maximum sorted distance; Determine the corresponding nearest moving target and farthest moving target based on the nearest second prediction region and the farthest second prediction region; Determine a third speed according to the first speed of the nearest moving target and the second speed of the farthest moving target; Obtain the brightness values of each row of pixels projected as the intersection line segment in the second nearest prediction region as a plurality of first brightness values, and obtain the brightness values of each row of pixels projected as the intersection line segment in the second farthest prediction region as a plurality of second brightness values; Determine a plurality of third brightness values based on the plurality of first brightness values and the plurality of second brightness values; Use the third speed and the plurality of third brightness values to determine the exposure parameters of each row of pixels projected as the intersection line segment in the plurality of second prediction regions; Calculate the exposure parameters of each row of pixels projected not as the intersection line segment in the plurality of second prediction regions respectively, so as to determine the exposure parameters of each row of pixels in each second prediction region.
6. The local exposure adjustment method according to claim 5, wherein The step of calculating and obtaining the exposure parameter of each third prediction region includes: Obtain the brightness value of the row pixels corresponding to the region with the maximum hotspot density in the hotspot region as the brightness value of each row of pixels in the third prediction region; Based on the brightness value of each row of pixels in the third prediction region and the speed of the corresponding moving target, determine the exposure parameter of each row of pixels in the third prediction region.
7. The local exposure adjustment method according to claim 6, wherein The step of respectively adjusting the exposure parameters of the first exposure region including the first prediction region, the exposure parameters of the second exposure region including the second prediction region, and the exposure parameters of the third exposure region including the third prediction region based on the plurality of exposure parameters includes: Adjust the exposure parameters of each row of pixels in the corresponding first exposure region based on the exposure parameters of each row of pixels in each first prediction region; Adjust the exposure parameters of each row of pixels in the corresponding second exposure region based on the exposure parameters of each row of pixels in each second prediction region; Adjust the exposure parameters of each row of pixels in the corresponding third exposure region based on the exposure parameters of each row of pixels in each third prediction region.
8. The local exposure adjustment method according to claim 1, wherein Before the step of determining the hotspot region in the current frame image, it includes: Obtain the video image of a preset time period based on the surveillance video of the statistical region; Detect each frame image in the video image to identify the target region of each moving target, and determine the center point of each target region; Accumulate each center point recorded in multiple frames of the images as the hotspot to determine the dense region formed by the hotspot in the statistical region; Perform edge compensation on the dense region to obtain the hotspot region.
9. An electronic device, characterized in that, It includes: A memory for storing program data, and when the program data is executed, it implements the steps in the local exposure adjustment method according to any one of claims 1 to 8; A processor for executing the program data stored in the memory to implement the steps in the local exposure adjustment method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the partial exposure adjustment method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Method and device for controlling light supplementing time of camera module
CN114257712A
Real-time adjustment of a vehicle sensor
CN114845915A