A method, device, and electronic equipment for adjusting license plate lights.
By adjusting the brightness of the license plate ring light using a two-dimensional point cloud image generated by difference calculation, the problem of temporary blindness to drivers caused by supplemental lighting in license plate recognition systems is solved, thereby improving license plate recognition accuracy and driving safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA FAW CO LTD
- Filing Date
- 2023-07-27
- Publication Date
- 2026-06-30
AI Technical Summary
The supplemental lighting of existing license plate recognition systems can cause temporary blindness to drivers behind, increasing driving hazards.
By acquiring the position parameters, intrinsic and extrinsic parameters of the lidar, as well as the distance to the vehicle, a two-dimensional point cloud image is generated. The difference between the image and the image in front is calculated, and the brightness and frequency of the license plate ring light are adjusted to adapt to different lighting conditions.
It improves license plate recognition, avoids eye strain on drivers, and enhances driving safety.
Smart Images

Figure CN116981137B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method, apparatus, medium, and electronic device for adjusting license plate lights. Background Technology
[0002] Currently, license plate recognition systems are installed at major intersections. These systems use cameras to illuminate the license plates of passing vehicles, ensuring that the system can recognize them.
[0003] However, the brightness of the capture device far exceeds the range that the human eye can perceive. The scattering produced when supplementing the light expands the illumination range and strongly stimulates the eyes of drivers of vehicles behind in the direction of the supplementary light, which can easily cause temporary blindness in the eyes of drivers behind, leading to driving dangers.
[0004] Therefore, this application provides a method for adjusting license plate lights to solve the above-mentioned technical problems. Summary of the Invention
[0005] The purpose of this application is to provide a method, device, medium, and electronic device for adjusting license plate lights, which can solve at least one of the aforementioned technical problems. The specific solution is as follows:
[0006] According to a specific embodiment of this application, in a first aspect, this application provides a method for adjusting license plate lights, comprising:
[0007] When the vehicle approaches the intersection, the system acquires the first distance between the capture device and the vehicle, the position parameters of the lidar, the point cloud of the frame in front of the vehicle collected by the lidar, as well as the intrinsic and extrinsic parameters of the camera and the image in front. The capture device is set above the intersection and is used to capture the license plate of the vehicle violating the rules.
[0008] Using the position parameters of the lidar as a reference, and the intrinsic parameters, extrinsic parameters, and the first distance as virtual shooting parameters, a two-dimensional point cloud image is obtained from the frame point cloud;
[0009] The difference between the foreground image and the two-dimensional point cloud image is calculated to obtain the difference value;
[0010] Based on the aforementioned difference values, determine the required brightness and frequency values for the vehicle's license plate ring light;
[0011] The license plate ring light of this vehicle is adjusted based on the brightness value and the frequency value.
[0012] As can be seen, the step of calculating the difference between the foreground image and the two-dimensional point cloud image to obtain the difference value includes:
[0013] Obtain the brightness, contrast, and structure values of the foreground image, as well as the brightness and contrast values of the two-dimensional point cloud image;
[0014] The brightness difference value is obtained based on the brightness value of the foreground image and the brightness value of the two-dimensional point cloud image;
[0015] The contrast difference value is obtained based on the contrast value of the foreground image and the contrast value of the two-dimensional point cloud image;
[0016] The structural difference value is obtained based on the brightness and contrast values of the foreground image and the brightness and contrast values of the two-dimensional point cloud image;
[0017] The difference between the foreground image and the two-dimensional point cloud image is obtained based on the brightness difference value, the contrast difference value, and the structural difference value.
[0018] As can be seen, obtaining the brightness, contrast, and structure values of the foreground image, as well as the brightness and contrast values of the two-dimensional point cloud image, includes:
[0019] A front grayscale image is obtained based on the front image, and a two-dimensional grayscale image is obtained based on the two-dimensional point cloud image;
[0020] A first average gray value is obtained based on the gray value of each pixel in the foreground grayscale image to represent the brightness value of the foreground image, and
[0021] A second average gray value is obtained based on the gray value of each pixel in the two-dimensional grayscale image to represent the brightness value of the two-dimensional point cloud image;
[0022] A first standard deviation is obtained based on the first average gray value of the foreground grayscale image, the number of pixels in the foreground grayscale image, and the gray value of each pixel in the foreground grayscale image to characterize the contrast value of the foreground image.
[0023] The second standard deviation value is obtained based on the second average gray value of the two-dimensional grayscale image, the number of pixels in the two-dimensional grayscale image, and the gray value of each pixel in the two-dimensional grayscale image to characterize the contrast value of the two-dimensional point cloud image.
[0024] As can be seen, the step of obtaining a first standard deviation value based on the first average gray value of the foreground grayscale image, the number of pixels in the foreground grayscale image, and the gray value of each pixel in the foreground grayscale image to characterize the contrast value of the foreground image, and obtaining a second standard deviation value based on the second average gray value of the two-dimensional grayscale image, the number of pixels in the two-dimensional grayscale image, and the gray value of each pixel in the two-dimensional grayscale image to characterize the contrast value of the two-dimensional point cloud image, respectively includes the following formulas:
[0025]
[0026] Where, k i x represents i or y i x i y represents the brightness value of the i-th pixel in the preceding grayscale image. i μ represents the brightness value of the i-th pixel in the two-dimensional grayscale image. x The first average grayscale value (i.e., the brightness value of the foreground image) represents the grayscale image in front of the view, μ. y σ represents the second average grayscale value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image), N represents the number of pixels in the foreground grayscale image (equal to the number of pixels in the foreground image), and σ represents the second average grayscale value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image). x σ represents the first standard deviation (i.e., the contrast value of the foreground image). y This represents the second standard deviation (i.e., the contrast value of the two-dimensional point cloud image).
[0027] As can be seen, the method of obtaining the brightness difference value based on the brightness value of the foreground image and the brightness value of the two-dimensional point cloud image includes the following formula:
[0028]
[0029] Where l(x, y) represents the brightness difference value, μ x The first average grayscale value (i.e., the brightness value of the foreground image) represents the grayscale image in front of the view, μ. y c1 represents the second average gray value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image), and c1 represents the first constant.
[0030] As can be seen, the method of obtaining the contrast difference value based on the contrast value of the foreground image and the contrast value of the two-dimensional point cloud image includes the following formula:
[0031]
[0032] Where c(x, y) represents the contrast difference value, σ x σ represents the first standard deviation (i.e., the contrast value of the foreground image). y c1 represents the second standard deviation (i.e., the contrast value of the two-dimensional point cloud image), and c2 represents the second constant.
[0033] As can be seen, the method of obtaining the structural difference value based on the brightness and contrast values of the foreground image and the brightness and contrast values of the two-dimensional point cloud image includes the following formula:
[0034]
[0035]
[0036] Where s(x, y) represents the structural difference value, σ xy c represents the average normalized value, and c3 represents the third constant.
[0037] As can be seen, the method of obtaining the difference value between the foreground image and the two-dimensional point cloud image based on the brightness difference value, the contrast difference value, and the structural difference value includes the following formula:
[0038] SSIM(x,y)=[l(x,y)] α [c(x,y)] β [s(x,y)] γ ;
[0039] Where α, β, and γ represent contribution values, respectively.
[0040] According to a specific embodiment of this application, in a second aspect, this application provides a license plate light adjustment device, comprising:
[0041] The acquisition unit is used to acquire, when the vehicle approaches the intersection, the first distance between the capture device and the vehicle, the position parameters of the lidar and the frame point cloud in front of the vehicle collected by the lidar, as well as the intrinsic parameters, extrinsic parameters and the front image of the camera. The capture device is set above the intersection and is used to capture the license plate of the vehicle violating the rules.
[0042] The acquisition unit is used to obtain a two-dimensional point cloud image from the frame point cloud, based on the position parameters of the lidar and using the intrinsic parameters, the extrinsic parameters and the first distance as virtual shooting parameters.
[0043] A calculation unit is used to perform difference calculation between the frontal image and the two-dimensional point cloud image to obtain a difference value;
[0044] The determining unit is used to determine the required brightness and frequency values of the license plate ring light of this vehicle based on the difference value;
[0045] An adjustment unit is used to adjust the license plate ring light of the vehicle based on the brightness value and the frequency value.
[0046] As can be seen, the step of calculating the difference between the foreground image and the two-dimensional point cloud image to obtain the difference value includes:
[0047] Obtain the brightness, contrast, and structure values of the foreground image, as well as the brightness and contrast values of the two-dimensional point cloud image;
[0048] The brightness difference value is obtained based on the brightness value of the foreground image and the brightness value of the two-dimensional point cloud image;
[0049] The contrast difference value is obtained based on the contrast value of the foreground image and the contrast value of the two-dimensional point cloud image;
[0050] The structural difference value is obtained based on the brightness and contrast values of the foreground image and the brightness and contrast values of the two-dimensional point cloud image;
[0051] The difference between the foreground image and the two-dimensional point cloud image is obtained based on the brightness difference value, the contrast difference value, and the structural difference value.
[0052] As can be seen, obtaining the brightness, contrast, and structure values of the foreground image, as well as the brightness and contrast values of the two-dimensional point cloud image, includes:
[0053] A front grayscale image is obtained based on the front image, and a two-dimensional grayscale image is obtained based on the two-dimensional point cloud image;
[0054] A first average gray value is obtained based on the gray value of each pixel in the foreground grayscale image to represent the brightness value of the foreground image, and
[0055] A second average gray value is obtained based on the gray value of each pixel in the two-dimensional grayscale image to represent the brightness value of the two-dimensional point cloud image;
[0056] A first standard deviation is obtained based on the first average gray value of the foreground grayscale image, the number of pixels in the foreground grayscale image, and the gray value of each pixel in the foreground grayscale image to characterize the contrast value of the foreground image.
[0057] The second standard deviation value is obtained based on the second average gray value of the two-dimensional grayscale image, the number of pixels in the two-dimensional grayscale image, and the gray value of each pixel in the two-dimensional grayscale image to characterize the contrast value of the two-dimensional point cloud image.
[0058] As can be seen, the step of obtaining a first standard deviation value based on the first average gray value of the foreground grayscale image, the number of pixels in the foreground grayscale image, and the gray value of each pixel in the foreground grayscale image to characterize the contrast value of the foreground image, and obtaining a second standard deviation value based on the second average gray value of the two-dimensional grayscale image, the number of pixels in the two-dimensional grayscale image, and the gray value of each pixel in the two-dimensional grayscale image to characterize the contrast value of the two-dimensional point cloud image, respectively includes the following formulas:
[0059]
[0060] Where, k i x representsi or y i x i y represents the brightness value of the i-th pixel in the preceding grayscale image. i μ represents the brightness value of the i-th pixel in the two-dimensional grayscale image. x The first average grayscale value (i.e., the brightness value of the foreground image) represents the grayscale image in front of the view, μ. y σ represents the second average grayscale value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image), N represents the number of pixels in the foreground grayscale image (equal to the number of pixels in the foreground image), and σ represents the second average grayscale value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image). x σ represents the first standard deviation (i.e., the contrast value of the foreground image). y This represents the second standard deviation (i.e., the contrast value of the two-dimensional point cloud image).
[0061] As can be seen, the method of obtaining the brightness difference value based on the brightness value of the foreground image and the brightness value of the two-dimensional point cloud image includes the following formula:
[0062]
[0063] Where l(x, y) represents the brightness difference value, μ x The first average grayscale value (i.e., the brightness value of the foreground image) represents the grayscale image in front of the view, μ. y c1 represents the second average gray value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image), and c1 represents the first constant.
[0064] As can be seen, the method of obtaining the contrast difference value based on the contrast value of the foreground image and the contrast value of the two-dimensional point cloud image includes the following formula:
[0065]
[0066] Where c(x, y) represents the contrast difference value, σ x σ represents the first standard deviation (i.e., the contrast value of the foreground image). y c1 represents the second standard deviation (i.e., the contrast value of the two-dimensional point cloud image), and c2 represents the second constant.
[0067] As can be seen, the method of obtaining the structural difference value based on the brightness and contrast values of the foreground image and the brightness and contrast values of the two-dimensional point cloud image includes the following formula:
[0068]
[0069]
[0070] Where s(x, y) represents the structural difference value, σ xy c represents the average normalized value, and c3 represents the third constant.
[0071] As can be seen, the method of obtaining the difference value between the foreground image and the two-dimensional point cloud image based on the brightness difference value, the contrast difference value, and the structural difference value includes the following formula:
[0072] SSIM(x,y)=[l(x,y)] α [c(x,y)] β [s(x,y)] γ ;
[0073] Where α, β, and γ represent contribution values, respectively.
[0074] According to a specific embodiment of this application, in a third aspect, this application provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the license plate light adjustment method as described in any of the preceding claims.
[0075] According to a specific embodiment of this application, in a fourth aspect, this application provides an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the license plate light adjustment method as described in any of the preceding claims.
[0076] Compared with the prior art, the above-described solutions of this application have at least the following beneficial effects:
[0077] This application provides a method, device, medium, and electronic device for adjusting license plate lights. When the vehicle approaches an intersection, a forward image is acquired. Using the position parameters of the lidar as a reference, and the intrinsic parameters, extrinsic parameters, and a first distance between the capturing device and the vehicle as virtual shooting parameters, a two-dimensional point cloud image is obtained from the frame point cloud. This image is used as a standard image for difference calculation to obtain the difference value between the two images. Based on the difference value, the required brightness and frequency values for the vehicle's license plate ring light are determined; the license plate ring light is then adjusted based on the brightness and frequency values. This achieves automatic adjustment of the license plate ring light brightness at intersections, improving the recognition accuracy of the license plate by the intersection capturing device. It avoids the need for supplementary lighting for the capturing device, which could harm the driver's eyes, thus improving driving safety. Attached Figure Description
[0078] Figure 1 A flowchart illustrating a method for adjusting license plate lights according to an embodiment of this application is shown;
[0079] Figure 2A schematic diagram of a license plate ring light according to an embodiment of this application is shown;
[0080] Figure 3 A unit block diagram of a license plate light adjustment device according to an embodiment of this application is shown. Detailed Implementation
[0081] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0082] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “said,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.
[0083] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0084] It should be understood that although the terms first, second, third, etc., may be used in the embodiments of this application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, first may also be referred to as second without departing from the scope of the embodiments of this application, and similarly, second may also be referred to as first.
[0085] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”
[0086] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.
[0087] It should be noted that any symbols and / or numbers present in the specification that are not marked in the accompanying drawings are not reference numerals.
[0088] The optional embodiments of this application are described in detail below with reference to the accompanying drawings.
[0089] The embodiments provided in this application are embodiments of a method for adjusting license plate lights.
[0090] The following is combined Figure 1 The embodiments of this application will be described in detail.
[0091] Step S101: When the vehicle approaches the intersection, acquire the first distance between the capture device and the vehicle, the position parameters of the lidar, the frame point cloud in front of the vehicle collected by the lidar, and the intrinsic and extrinsic parameters and the front image of the camera.
[0092] The camera is positioned above the intersection and is used to capture vehicles violating traffic rules.
[0093] When a lidar sensor illuminates the surface of an object, the reflected laser light carries information such as orientation and distance. If the laser beam is scanned along a certain trajectory, the information of the reflected laser points will be recorded as it is scanned. Because the scanning is extremely precise, a large number of laser points can be obtained, thus forming a point cloud.
[0094] A frame point cloud is a point cloud obtained by a lidar scanner after scanning the surrounding environment for one full cycle. The frame point cloud includes data from multiple points.
[0095] The recognition of the capture device adopts the "Fast R-CNN" algorithm. The two-dimensional image is extracted from the point cloud of the LiDAR frame and compared with the camera image by convolution to achieve the fusion effect, thereby obtaining the first distance between the capture device and the vehicle.
[0096] The camera is installed inside the vehicle and is used to take pictures of the area in front of the vehicle.
[0097] Internal parameters refer to the parameters within the camera itself; external parameters refer to the positional and orientational relationship between the two sensors of the camera.
[0098] The aforementioned forward image is a graphic image of the front of the vehicle taken by the camera under both internal and external parameters.
[0099] Step S102: Using the position parameters of the lidar as a reference, and the intrinsic parameters, extrinsic parameters, and the first distance as virtual shooting parameters, obtain a two-dimensional point cloud image from the frame point cloud.
[0100] This can be understood as the process of performing pinhole imaging in a frame point cloud. Based on the position parameters of the lidar, a virtual camera is set up. The virtual camera uses the intrinsic and extrinsic parameters of the vehicle-mounted camera and the first distance as virtual shooting parameters to perform imaging in the frame point cloud and obtain a two-dimensional point cloud image, so as to facilitate the comparison between the front image and the two-dimensional point cloud image.
[0101] Assume the camera intrinsic parameter matrix is K, where fx and fy are the camera's focal lengths, and cx and cy are the translation distances (i.e., the imaging focal points):
[0102]
[0103] Assume the camera extrinsic matrix is T, where R is the rotation matrix and t is the translation vector:
[0104]
[0105] The imaging formula for the midpoint data of the frame point cloud is as follows, where (μ, ν) are pixel coordinates, and (Xw, Yw, Zw) are the three-dimensional coordinates of the midpoint data of the frame point cloud:
[0106]
[0107] Since the two-dimensional point cloud image is extracted from the frame point cloud acquired by the lidar, it is not limited by weather or visibility. Therefore, in this embodiment, the two-dimensional point cloud image is used as the standard image and compared with the front image acquired by the camera, which improves the reliability of the comparison.
[0108] Step S103: Calculate the difference between the front image and the two-dimensional point cloud image to obtain the difference value.
[0109] In some specific embodiments, the step of calculating the difference between the foreground image and the two-dimensional point cloud image to obtain the difference value includes the following steps:
[0110] Step S103-1: Obtain the brightness value, contrast value, and structure value of the foreground image, as well as the brightness value and contrast value of the two-dimensional point cloud image.
[0111] In some specific embodiments, obtaining the brightness value, contrast value, and structure value of the foreground image, as well as the brightness value and contrast value of the two-dimensional point cloud image, includes the following steps:
[0112] Step S103-1-1: Obtain a front grayscale image based on the front image, and obtain a two-dimensional grayscale image based on the two-dimensional point cloud image.
[0113] Step S103-1-2: Obtain a first average gray value based on the gray value of each pixel in the front grayscale image to represent the brightness value of the front image, and obtain a second average gray value based on the gray value of each pixel in the two-dimensional grayscale image to represent the brightness value of the two-dimensional point cloud image.
[0114] This specific embodiment uses the grayscale value of a pixel as its brightness value. This reduces the amount of data processing and improves data processing efficiency.
[0115] The process of obtaining a first average gray value based on the gray value of each pixel in the foreground grayscale image to represent the brightness value of the foreground image, and obtaining a second average gray value based on the gray value of each pixel in the two-dimensional grayscale image to represent the brightness value of the two-dimensional point cloud image, includes the following formulas:
[0116]
[0117] Where, k i x represents i or y i x i y represents the brightness value of the i-th pixel in the preceding grayscale image. i μ represents the brightness value of the i-th pixel in the two-dimensional grayscale image. x The first average grayscale value (i.e., the brightness value of the foreground image) represents the grayscale image in front of the view, μ. y The second average gray value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image) is represented by N, and N represents the number of pixels in the foreground grayscale image (equal to the number of pixels in the foreground image).
[0118] This application uses the average brightness value of the image as the brightness value to represent the image, which can reflect the actual brightness value of the license plate, while reducing the computational complexity.
[0119] Step S103-1-3: Based on the first average gray value of the front grayscale image, the number of pixels in the front grayscale image, and the gray value of each pixel in the front grayscale image, a first standard deviation is obtained to characterize the contrast value of the front image; and based on the second average gray value of the two-dimensional grayscale image, the number of pixels in the two-dimensional grayscale image, and the gray value of each pixel in the two-dimensional grayscale image, a second standard deviation is obtained to characterize the contrast value of the two-dimensional point cloud image.
[0120] This specific embodiment removes the influence of brightness in the measurement of contrast, which means it removes the influence of occasional events on license plates, thus improving the authenticity of license plate data.
[0121] In some specific embodiments, a first standard deviation is obtained based on the first average gray value of the foreground grayscale image, the number of pixels in the foreground grayscale image, and the gray value of each pixel in the foreground grayscale image to characterize the contrast value of the foreground image. A second standard deviation is obtained based on the second average gray value of the two-dimensional grayscale image, the number of pixels in the two-dimensional grayscale image, and the gray value of each pixel in the two-dimensional grayscale image to characterize the contrast value of the two-dimensional point cloud image. These methods include the following formulas:
[0122]
[0123] Where, k i x represents i or y i x i y represents the brightness value of the i-th pixel in the preceding grayscale image. i μ represents the brightness value of the i-th pixel in the two-dimensional grayscale image. x The first average grayscale value (i.e., the brightness value of the foreground image) represents the grayscale image in front of the view, μ. y σ represents the second average grayscale value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image), N represents the number of pixels in the foreground grayscale image (equal to the number of pixels in the foreground image), and σ represents the second average grayscale value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image). x σ represents the first standard deviation (i.e., the contrast value of the foreground image). y This represents the second standard deviation (i.e., the contrast value of the two-dimensional point cloud image).
[0124] This function can be used to measure the difference in blur between the foreground image and the 2D point cloud image.
[0125] Step S103-2: Obtain the brightness difference value based on the brightness value of the foreground image and the brightness value of the two-dimensional point cloud image.
[0126] In some specific embodiments, the step of obtaining the brightness difference value based on the brightness value of the foreground image and the brightness value of the two-dimensional point cloud image includes the following formula:
[0127]
[0128] Where l(x, y) represents the brightness difference value, μ x The first average grayscale value (i.e., the brightness value of the foreground image) represents the grayscale image in front of the view, μ. yc1 represents the second average gray value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image), and c1 represents the first constant.
[0129] Step S103-3: Obtain the contrast difference value based on the contrast value of the foreground image and the contrast value of the two-dimensional point cloud image.
[0130] In some specific embodiments, the step of obtaining the contrast difference value based on the contrast value of the foreground image and the contrast value of the two-dimensional point cloud image includes the following formula:
[0131]
[0132] Where c(x, y) represents the contrast difference value, σ x σ represents the first standard deviation (i.e., the contrast value of the foreground image). y c1 represents the second standard deviation (i.e., the contrast value of the two-dimensional point cloud image), and c2 represents the second constant.
[0133] Step S103-4: Obtain structural difference values based on the brightness and contrast values of the foreground image and the brightness and contrast values of the two-dimensional point cloud image.
[0134] The structure refers to the shape, edges, and / or texture of the traffic camera at the intersection.
[0135] Each pixel signal in the foreground image is normalized by its own standard deviation (i.e., with the average contrast as the baseline 1, the contrast of a single pixel is the contrast value when the average contrast is 1, and the contrast of a single pixel is divided by the average contrast), so that the two signals being compared have a unit standard deviation.
[0136] In some specific embodiments, obtaining the structural difference value based on the brightness and contrast values of the foreground image and the brightness and contrast values of the two-dimensional point cloud image includes the following formula:
[0137]
[0138]
[0139] Where s(x, y) represents the structural difference value, σ xy c represents the average normalized value, and c3 represents the third constant.
[0140] Step S103-5: Obtain the difference value between the foreground image and the two-dimensional point cloud image based on the brightness difference value, the contrast difference value, and the structural difference value.
[0141] In some specific embodiments, obtaining the difference value between the foreground image and the two-dimensional point cloud image based on the brightness difference value, the contrast difference value, and the structural difference value includes the following formula:
[0142] SSIM(x,y)=[l(x,y)] α [c(x,y)] β [s(x,y)] γ ;
[0143] Here, α, β, and γ represent the contribution values. For example, if all three contribution values are 1, it means that the degree of contribution is the same.
[0144] The SSIM algorithm allows for similarity comparison between a foreground image and a calibrated 2D point cloud image. It comprehensively considers the effects of brightness, contrast, and structure on the image, improving the objectivity and accuracy of judging the differences between the foreground image and the 2D point cloud image. The value of SSIM(x, y) is less than or equal to 1. When SSIM(x, y) equals 1, the foreground image and the 2D point cloud image are completely identical.
[0145] Step S104: Determine the required brightness and frequency values for the license plate ring light of this vehicle based on the difference value.
[0146] A similarity function y = f(x1, x2) is created between the foreground image and the two-dimensional point cloud image, where y is the similarity, x1 is the brightness of the ring light, and x2 is the frequency of the ring light. A differentiable two-dimensional multi-order function is obtained by fitting multiple measurement results.
[0147] The Gauss-Newton method, an improvement on Newton's method, is an iterative method for finding regression parameters in nonlinear regression models using least squares. This method uses a Taylor series expansion to approximate the nonlinear regression model, and then iterates and corrects the regression coefficients multiple times, continuously approximating the optimal regression coefficients of the nonlinear regression model, ultimately minimizing the sum of squared residuals of the original model. At this point, the required brightness and frequency values for the vehicle's license plate can maximize the visibility of the license plate by the intersection's camera.
[0148] Step S105: Adjust the license plate ring light of the vehicle based on the brightness value and the frequency value.
[0149] The Gauss-Newton method is used to iterate the similarity function y = f(x1, x2) to obtain the optimal brightness and frequency values. The lighting controller then adjusts the license plate ring light (e.g., ...) around the vehicle's license plate. Figure 2 Adjust as shown.
[0150] In this embodiment, when the vehicle approaches an intersection, a forward image is acquired. Using the position parameters of the lidar as a reference, and the intrinsic parameters, extrinsic parameters, and a first distance between the capture device and the vehicle as virtual shooting parameters, a two-dimensional point cloud image is obtained from the frame point cloud. This image is used as a standard image for difference calculation to obtain the difference value between the two images. Based on the difference value, the required brightness and frequency values for the vehicle's license plate ring light are determined; the license plate ring light is then adjusted based on the brightness and frequency values. This achieves automatic adjustment of the license plate ring light brightness at the intersection, improving the recognition accuracy of the license plate by the intersection capture device. It avoids the need for supplementary lighting for the capture device, which could harm the driver's eyes, thus improving driving safety.
[0151] This application also provides an apparatus embodiment that follows the above embodiments, used to implement the method steps described in the above embodiments. The interpretation of the same names is the same as that in the above embodiments, and the same technical effects are achieved. Therefore, it will not be repeated here.
[0152] like Figure 3 As shown, this application provides a license plate light adjustment device 300, including:
[0153] The acquisition unit 301 is used to acquire, when the vehicle approaches the intersection, the first distance between the capture device and the vehicle, the position parameters of the lidar and the frame point cloud in front of the vehicle collected by the lidar, as well as the intrinsic parameters, extrinsic parameters and front image of the camera. The capture device is set above the intersection and is used to capture the license plate of the vehicle violating the rules.
[0154] The acquisition unit 302 is used to obtain a two-dimensional point cloud image from the frame point cloud based on the position parameters of the lidar and using the intrinsic parameters, the extrinsic parameters and the first distance as virtual shooting parameters.
[0155] The calculation unit 303 is used to perform difference calculation between the front image and the two-dimensional point cloud image to obtain the difference value;
[0156] The determining unit 304 is used to determine the required brightness and frequency values of the license plate ring light of this vehicle based on the difference value;
[0157] The adjustment unit 305 is used to adjust the license plate ring light of the vehicle based on the brightness value and the frequency value.
[0158] As can be seen, the step of calculating the difference between the foreground image and the two-dimensional point cloud image to obtain the difference value includes:
[0159] Obtain the brightness, contrast, and structure values of the foreground image, as well as the brightness and contrast values of the two-dimensional point cloud image;
[0160] The brightness difference value is obtained based on the brightness value of the foreground image and the brightness value of the two-dimensional point cloud image;
[0161] The contrast difference value is obtained based on the contrast value of the foreground image and the contrast value of the two-dimensional point cloud image;
[0162] The structural difference value is obtained based on the brightness and contrast values of the foreground image and the brightness and contrast values of the two-dimensional point cloud image;
[0163] The difference between the foreground image and the two-dimensional point cloud image is obtained based on the brightness difference value, the contrast difference value, and the structural difference value.
[0164] As can be seen, obtaining the brightness, contrast, and structure values of the foreground image, as well as the brightness and contrast values of the two-dimensional point cloud image, includes:
[0165] A front grayscale image is obtained based on the front image, and a two-dimensional grayscale image is obtained based on the two-dimensional point cloud image;
[0166] A first average gray value is obtained based on the gray value of each pixel in the foreground grayscale image to represent the brightness value of the foreground image, and
[0167] A second average gray value is obtained based on the gray value of each pixel in the two-dimensional grayscale image to represent the brightness value of the two-dimensional point cloud image;
[0168] A first standard deviation is obtained based on the first average gray value of the foreground grayscale image, the number of pixels in the foreground grayscale image, and the gray value of each pixel in the foreground grayscale image to characterize the contrast value of the foreground image.
[0169] The second standard deviation value is obtained based on the second average gray value of the two-dimensional grayscale image, the number of pixels in the two-dimensional grayscale image, and the gray value of each pixel in the two-dimensional grayscale image to characterize the contrast value of the two-dimensional point cloud image.
[0170] As can be seen, the step of obtaining a first standard deviation value based on the first average gray value of the foreground grayscale image, the number of pixels in the foreground grayscale image, and the gray value of each pixel in the foreground grayscale image to characterize the contrast value of the foreground image, and obtaining a second standard deviation value based on the second average gray value of the two-dimensional grayscale image, the number of pixels in the two-dimensional grayscale image, and the gray value of each pixel in the two-dimensional grayscale image to characterize the contrast value of the two-dimensional point cloud image, respectively includes the following formulas:
[0171]
[0172] Where, k i x representsi or y i x i y represents the brightness value of the i-th pixel in the preceding grayscale image. i μ represents the brightness value of the i-th pixel in the two-dimensional grayscale image. x The first average grayscale value (i.e., the brightness value of the foreground image) represents the grayscale image in front of the view, μ. y σ represents the second average grayscale value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image), N represents the number of pixels in the foreground grayscale image (equal to the number of pixels in the foreground image), and σ represents the second average grayscale value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image). x σ represents the first standard deviation (i.e., the contrast value of the foreground image). y This represents the second standard deviation (i.e., the contrast value of the two-dimensional point cloud image).
[0173] As can be seen, the method of obtaining the brightness difference value based on the brightness value of the foreground image and the brightness value of the two-dimensional point cloud image includes the following formula:
[0174]
[0175] Where l(x, y) represents the brightness difference value, μ x The first average grayscale value (i.e., the brightness value of the foreground image) represents the grayscale image in front of the view, μ. y c1 represents the second average gray value of the two-dimensional grayscale image (i.e., the brightness value of the two-dimensional point cloud image), and c1 represents the first constant.
[0176] As can be seen, the method of obtaining the contrast difference value based on the contrast value of the foreground image and the contrast value of the two-dimensional point cloud image includes the following formula:
[0177]
[0178] Where c(x, y) represents the contrast difference value, σ x σ represents the first standard deviation (i.e., the contrast value of the foreground image). y c1 represents the second standard deviation (i.e., the contrast value of the two-dimensional point cloud image), and c2 represents the second constant.
[0179] As can be seen, the method of obtaining the structural difference value based on the brightness and contrast values of the foreground image and the brightness and contrast values of the two-dimensional point cloud image includes the following formula:
[0180]
[0181]
[0182] Where s(x, y) represents the structural difference value, σ xy c represents the average normalized value, and c3 represents the third constant.
[0183] As can be seen, the method of obtaining the difference value between the foreground image and the two-dimensional point cloud image based on the brightness difference value, the contrast difference value, and the structural difference value includes the following formula:
[0184] SSIM(x,y)=[l(x,y)] α [c(x,y)] β [s(x,y)] γ ;
[0185] Where α, β, and γ represent contribution values, respectively.
[0186] In this embodiment, when the vehicle approaches an intersection, a forward image is acquired. Using the position parameters of the lidar as a reference, and the intrinsic parameters, extrinsic parameters, and a first distance between the capture device and the vehicle as virtual shooting parameters, a two-dimensional point cloud image is obtained from the frame point cloud. This image is used as a standard image for difference calculation to obtain the difference value between the two images. Based on the difference value, the required brightness and frequency values for the vehicle's license plate ring light are determined; the license plate ring light is then adjusted based on the brightness and frequency values. This achieves automatic adjustment of the license plate ring light brightness at the intersection, improving the recognition accuracy of the license plate by the intersection capture device. It avoids the need for supplementary lighting for the capture device, which could harm the driver's eyes, thus improving driving safety.
[0187] This embodiment provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method steps described in the above embodiment.
[0188] This application provides a non-volatile computer storage medium storing computer-executable instructions that can perform the steps described in the above embodiments.
[0189] Finally, it should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.
[0190] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for adjusting license plate lights, characterized in that, include: When the vehicle approaches the intersection, the system acquires the first distance between the capture device and the vehicle, the position parameters of the lidar, the point cloud of the frame in front of the vehicle collected by the lidar, as well as the intrinsic and extrinsic parameters of the camera and the image in front. The capture device is set above the intersection and is used to capture the license plate of the vehicle violating the rules. Using the position parameters of the lidar as a reference, and the intrinsic parameters, extrinsic parameters, and the first distance as virtual shooting parameters, a two-dimensional point cloud image is obtained from the frame point cloud; The difference between the foreground image and the two-dimensional point cloud image is calculated to obtain the difference value; Based on the aforementioned difference values, determine the required brightness and frequency values for the vehicle's license plate ring light; The license plate ring light of this vehicle is adjusted based on the brightness value and the frequency value.
2. The method according to claim 1, characterized in that, The step of calculating the difference between the foreground image and the two-dimensional point cloud image to obtain the difference value includes: Obtain the brightness, contrast, and structure values of the foreground image, as well as the brightness and contrast values of the two-dimensional point cloud image; The brightness difference value is obtained based on the brightness value of the foreground image and the brightness value of the two-dimensional point cloud image; The contrast difference value is obtained based on the contrast value of the foreground image and the contrast value of the two-dimensional point cloud image; The structural difference value is obtained based on the brightness and contrast values of the foreground image and the brightness and contrast values of the two-dimensional point cloud image; The difference between the foreground image and the two-dimensional point cloud image is obtained based on the brightness difference value, the contrast difference value, and the structural difference value.
3. The method according to claim 2, characterized in that, The step of acquiring the brightness, contrast, and structure values of the foreground image, as well as the brightness and contrast values of the two-dimensional point cloud image, includes: A front grayscale image is obtained based on the front image, and a two-dimensional grayscale image is obtained based on the two-dimensional point cloud image; A first average gray value is obtained based on the gray value of each pixel in the foreground grayscale image to represent the brightness value of the foreground image, and A second average gray value is obtained based on the gray value of each pixel in the two-dimensional grayscale image to represent the brightness value of the two-dimensional point cloud image; A first standard deviation is obtained based on the first average gray value of the foreground grayscale image, the number of pixels in the foreground grayscale image, and the gray value of each pixel in the foreground grayscale image to characterize the contrast value of the foreground image. The second standard deviation value is obtained based on the second average gray value of the two-dimensional grayscale image, the number of pixels in the two-dimensional grayscale image, and the gray value of each pixel in the two-dimensional grayscale image to characterize the contrast value of the two-dimensional point cloud image.
4. The method according to claim 3, characterized in that, A first standard deviation is obtained based on the first average gray value of the foreground grayscale image, the number of pixels in the foreground grayscale image, and the gray value of each pixel in the foreground grayscale image to characterize the contrast value of the foreground image. A second standard deviation is obtained based on the second average gray value of the two-dimensional grayscale image, the number of pixels in the two-dimensional grayscale image, and the gray value of each pixel in the two-dimensional grayscale image to characterize the contrast value of the two-dimensional point cloud image, each comprising the following formulas: Where, k i x represents i or y i x i y represents the brightness value of the i-th pixel in the preceding grayscale image. i μ represents the brightness value of the i-th pixel in the two-dimensional grayscale image. x The first average gray value, μ, represents the grayscale value of the foreground grayscale image. y The second average grayscale value of the two-dimensional grayscale image is represented by σ, where N represents the number of pixels in the preceding grayscale image. x σ represents the first standard deviation. y This represents the second standard deviation.
5. The method according to claim 3, characterized in that, The brightness difference value is obtained based on the brightness value of the foreground image and the brightness value of the two-dimensional point cloud image, including the following formula: Where l(x, y) represents the brightness difference value, μ x The first average gray value, μ, represents the grayscale value of the foreground grayscale image. y c1 represents the second average gray value of the two-dimensional grayscale image, and c1 represents the first constant.
6. The method according to claim 5, characterized in that, The method of obtaining the contrast difference value based on the contrast value of the foreground image and the contrast value of the two-dimensional point cloud image includes the following formula: Where c(x, y) represents the contrast difference value, σ x σ represents the first standard deviation. y c1 represents the second standard deviation, and c2 represents the second constant.
7. The method according to claim 6, characterized in that, The structural difference value is obtained based on the brightness and contrast values of the foreground image and the brightness and contrast values of the two-dimensional point cloud image, including the following formula: Where s(x, y) represents the structural difference value, σ xy c3 represents the average normalized value, and x represents the third constant. i y represents the brightness value of the i-th pixel in the preceding grayscale image. i The value represents the brightness of the i-th pixel in the two-dimensional grayscale image, and N represents the number of pixels in the preceding grayscale image.
8. The method according to claim 7, characterized in that, The method of obtaining the difference value between the foreground image and the two-dimensional point cloud image based on the brightness difference value, the contrast difference value, and the structural difference value includes the following formula: Where α, β, and γ represent contribution values, respectively.
9. A license plate light adjustment device, characterized in that, include: The acquisition unit is used to acquire, when the vehicle approaches the intersection, the first distance between the capture device and the vehicle, the position parameters of the lidar and the frame point cloud in front of the vehicle collected by the lidar, as well as the intrinsic parameters, extrinsic parameters and the front image of the camera. The capture device is set above the intersection and is used to capture the license plate of the vehicle violating the rules. The acquisition unit is used to obtain a two-dimensional point cloud image from the frame point cloud, based on the position parameters of the lidar and using the intrinsic parameters, the extrinsic parameters and the first distance as virtual shooting parameters. A calculation unit is used to perform difference calculation between the frontal image and the two-dimensional point cloud image to obtain a difference value; The determining unit is used to determine the required brightness and frequency values of the license plate ring light of this vehicle based on the difference value; An adjustment unit is used to adjust the license plate ring light of the vehicle based on the brightness value and the frequency value.
10. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 7.