Vehicle-mounted camera stray light test method, device and equipment and storage medium

By collecting and analyzing the image data of the on-board camera at different angles, counting the number of brightness pixels and judging the position of the light source, the problem of complex stray light testing in the existing technology is solved, and simple and accurate stray light testing is realized, ensuring the data quality of the autonomous driving on-board camera.

CN120223873APending Publication Date: 2025-06-27HAOMO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311807956.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, stray light testing of vehicle-mounted cameras relies on standard test cards and professional software, and is complex and costly, making it difficult to achieve simple operation, simple environment, and no need to rely on professional software.

Method used

By collecting data when the light source and the camera's optical axis are at different angles, counting the number of brightness pixels in the image data, determining the position of the light source and the qualification of the image data, and then determining the camera's stray light test results.

Benefits of technology

It realizes the simplification of the stray light testing process and the simplification of the environment, without relying on professional testing software, ensures the data accuracy and interference-freeness provided by autonomous vehicle-mounted cameras, and improves the accuracy of identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120223873A_ABST
    Figure CN120223873A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle-mounted camera stray light test method, device and equipment and a storage medium, and the method comprises the steps: collecting data when a light source and an optical axis of a camera are at different angles, and obtaining multi-frame image data; counting the number of brightness pixels in the image data; determining the position of the light source according to the first brightness pixel number and the total pixel number; whether each frame of image data is qualified image data or unqualified image data is determined according to the position of the light source and the quantity of brightness pixels, and the stray light test result of the camera is determined according to the quantity of the qualified image data and the quantity of the unqualified image data, so that the stray light test process is simple, the environment is simple, professional test software is not needed, and the test efficiency is improved. Therefore, it is ensured that the automatic driving vehicle-mounted camera constantly provides accurate and interference-free data for the downstream sensing module, and then the recognition accuracy is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle-mounted cameras, and in particular to a method, device, equipment and storage medium for testing stray light of vehicle-mounted cameras. Background Art

[0002] With the continuous development of automotive autonomous driving technology, the number of vehicle-mounted cameras installed has increased rapidly. For high-level autonomous driving to improve visual perception effects, more than a dozen cameras need to be installed to provide surrounding environment data for the perception algorithm, and each camera has its own function and is responsible for monitoring different areas around the vehicle. It is necessary to ensure that the vehicle-mounted cameras for autonomous driving always provide accurate and interference-free data for the downstream perception module. Therefore, before the vehicle-mounted cameras are installed and used, it is crucial to test their image quality, especially to test the stray light in the images.

[0003] In the related art, the existing image quality test, that is, the test for stray light, relies on standard test cards and professional test software such as the image quality analysis software Imatest. It is not only complex to operate but also expensive.

[0004] Therefore, how to perform stray light testing to achieve a simple operation process, a simple environment, and no dependence on professional test software, so as to ensure that the vehicle-mounted cameras for autonomous driving always provide accurate and interference-free data for the downstream perception module, has become a technical problem that needs to be urgently solved by those skilled in the art. Summary of the Invention

[0005] In view of this, the embodiments of the present invention provide a method, device, equipment and storage medium for testing stray light of vehicle-mounted cameras, so as to achieve a simple stray light testing process, a simple environment, and no dependence on professional test software, thereby ensuring that the vehicle-mounted cameras for autonomous driving always provide accurate and interference-free data for the downstream perception module, and further ensuring the recognition accuracy.

[0006] To achieve the above object, the embodiments of the present invention provide the following technical solutions:

[0007] The first aspect of the embodiments of the present invention discloses a method for testing stray light of vehicle-mounted cameras, the method comprising:

[0008] Collecting data when the optical axes of the light source and the camera are at different angles to obtain multiple frames of image data;

[0009] For each of the said image data, count the number of luminance pixels in the image data, where the number of luminance pixels includes the first luminance pixel number, the second luminance pixel number, and the total pixel number; wherein, the first luminance pixel number is the number of pixels with a first luminance value in the image data, the second luminance pixel number is the number of pixels with a luminance value greater than a second luminance value in the image data, the first luminance value is the luminance value of the light source area in the image data, and the second luminance value is the upper limit of the luminance value of the non-light source area in the image data;

[0010] For each of the said image data, determine the position of the light source of the image data according to the first luminance pixel number and the total pixel number of the image data; wherein, the position of the light source of the image data is that the light source is within the field of view, or the light source is not within the field of view;

[0011] For each of the said image data, determine whether the image data is qualified image data or unqualified image data according to the position of the light source of the image data and the number of luminance pixels;

[0012] Determine the stray light test result of the camera according to the number of qualified data and the number of unqualified data; wherein, the number of qualified data is the number of the qualified image data, and the number of unqualified data is the number of the unqualified image data.

[0013] Optionally, the image data counts the number of luminance pixels in the image data, including:

[0014] The image data normalizes the luminance values of each pixel in the image data to a preset luminance value range;

[0015] According to the normalized luminance values of each pixel in the image data, calculate the first luminance pixel number, the second luminance pixel number, and the total pixel number of the image data.

[0016] Optionally, the determining the position of the light source of the image data according to the first luminance pixel number and the total pixel number of the image data includes:

[0017] If the quotient of the first luminance pixel number and the total pixel number is greater than a first preset value, determine that the position of the light source of the image data is that the light source is within the field of view;

[0018] If the quotient of the first luminance pixel number and the total pixel number is less than or equal to the first preset value, determine that the position of the light source of the image data is that the light source is not within the field of view.

[0019] Optionally, determining whether the image data is qualified or unqualified according to the position of the light source in the image data and the number of bright pixels includes:

[0020] If the position of the light source in the image data is that the light source is within the field of view, when the quotient of the number of the second bright pixels and the number of the first bright pixels in the image data is greater than a second preset value, determine that the image data is unqualified image data;

[0021] If the position of the light source in the image data is that the light source is within the field of view, when the quotient of the number of the second bright pixels and the number of the first bright pixels in the image data is less than or equal to the second preset value, determine that the image data is qualified image data.

[0022] Optionally, determining whether the image data is qualified or unqualified according to the position of the light source in the image data and the number of bright pixels includes:

[0023] If the position of the light source in the image data is that the light source is not within the field of view, when the quotient of the number of the second bright pixels and the total number of pixels in the image data is greater than a third preset value, determine that the image data is unqualified image data;

[0024] If the position of the light source in the image data is that the light source is not within the field of view, when the quotient of the number of the second bright pixels and the total number of pixels is less than or equal to the third preset value, determine that the image data is qualified image data.

[0025] Optionally, determining the stray light test result of the camera according to the number of qualified and unqualified ones includes:

[0026] If the number of qualified ones is greater than a preset multiple of the number of unqualified ones, determine that the stray light test result of the camera is that the stray light test passes;

[0027] If the number of qualified ones is less than or equal to the preset multiple of the number of unqualified ones, determine that the stray light test result of the camera is that the stray light test fails.

[0028] A second aspect of the present application provides a vehicle-mounted camera stray light test device, and the device includes:

[0029] An acquisition module, configured to acquire data when the light axis of a light source and a camera are at different angles, and obtain multiple frames of image data;

[0030] A statistical module, configured to count, for each of the image data, the number of luminance pixels in the image data, where the number of luminance pixels includes a first number of luminance pixels, a second number of luminance pixels, and a total number of pixels; wherein, the first number of luminance pixels is the number of pixels having a first luminance value in the image data, the second number of luminance pixels is the number of pixels having a luminance value greater than a second luminance value in the image data, the first luminance value is the luminance value of the light source area in the image data, and the second luminance value is the upper limit of the luminance value of the non-light source area in the image data;

[0031] A first determination module, configured to determine, for each of the image data, the position where the light source of the image data is located according to the first number of luminance pixels and the total number of pixels of the image data; wherein, the position where the light source of the image data is located is that the light source is within the field of view, or the light source is not within the field of view;

[0032] A second determination module, configured to determine, for each of the image data, whether the image data is qualified image data or unqualified image data according to the position where the light source of the image data is located and the number of luminance pixels;

[0033] A third determination module, configured to determine the stray light test result of the camera according to the number of qualified data and the number of unqualified data; wherein, the number of qualified data is the number of the qualified image data, and the number of unqualified data is the number of the unqualified image data.

[0034] Optionally, the statistical module includes:

[0035] A normalization unit, configured to normalize the luminance values of the respective pixels in the image data to a preset luminance value range;

[0036] A calculation unit, configured to calculate the first number of luminance pixels, the second number of luminance pixels, and the total number of pixels of the image data according to the normalized luminance values of the respective pixels in the image data.

[0037] A third aspect of the present application provides an electronic device, including a memory and a processor;

[0038] The memory is configured to store a computer program;

[0039] The processor is configured to execute the computer program, and specifically configured to implement the on-vehicle camera stray light test method provided in any item of the first aspect of the present application.

[0040] A fourth aspect of the present application provides a computer-readable storage medium, configured to store a computer program, and when the computer program is executed, it is specifically configured to implement the on-vehicle camera stray light test method provided in any item of the first aspect of the present application.

[0041] Based on the on-vehicle camera stray light test method, device, equipment and storage medium provided by the embodiments of the present invention, the method includes: collecting data when the optical axes of the light source and the camera are at different angles to obtain multiple frames of image data, where the image data includes the brightness values of the stray light generated at each angle; for each image data, counting the number of bright pixels in the image data, where the number of bright pixels includes the number of first bright pixels, the number of second bright pixels and the total number of pixels; the number of first bright pixels is the number of pixels with a first brightness value in the image data, the number of second bright pixels is the number of pixels with a brightness value greater than a second brightness value in the image data, the first brightness value is the brightness value of the light source area in the image data, and the second brightness value is the upper limit of the brightness value of the non-light source area in the image data; for each image data, determining the position of the light source in the image data according to the number of first bright pixels and the total number of pixels in the image data; the position of the light source in the image data is that the light source is within the field of view or the light source is not within the field of view; for each image data, determining whether the image data is qualified or unqualified image data according to the position of the light source in the image data and the number of bright pixels; determining the stray light test result of the camera according to the number of qualified images and the number of unqualified images; the number of qualified images is the number of qualified image data, and the number of unqualified images is the number of unqualified image data.

[0042] In this solution, image data is collected when the optical axes of the light source and the camera are at different angles. By analyzing the number of pixels with the brightness value of the light source area in each image data and the number of pixels with a brightness value exceeding the upper limit of the brightness value of the non-light source area, it is determined whether each image data is qualified. Furthermore, based on the number of qualified images and the number of unqualified images, the stray light test result of the camera is determined. The entire test process only needs to use the camera to capture the light source at different angles and count the number of pixels in the captured data, which has the advantages of simple test process, simple environment, and no need to rely on professional test software. Thus, it ensures that the on-vehicle camera for autonomous driving always provides accurate and interference-free data for the downstream perception module, and further ensures the recognition accuracy. Description of the Drawings

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0044] Figure 1 It is a schematic diagram of the placement position of a light source provided by the embodiments of the present application;

[0045] Figure 2Schematic flow chart of a method for testing stray light of an in-vehicle camera provided by an embodiment of the present application;

[0046] Figure 3 Schematic diagram of another light source placement position provided by an embodiment of the present application;

[0047] Figure 4 Schematic diagram of yet another light source placement position provided by an embodiment of the present application;

[0048] Figure 5 Schematic diagram of still another light source placement position provided by an embodiment of the present application;

[0049] Figure 6 Schematic diagram of another light source placement position provided by an embodiment of the present application;

[0050] Figure 7a Schematic flow chart of another method for testing stray light of an in-vehicle camera provided by an embodiment of the present application;

[0051] Figure 7b Schematic flow chart of another method for testing stray light of an in-vehicle camera provided by an embodiment of the present application;

[0052] Figure 7c Schematic flow chart of another method for testing stray light of an in-vehicle camera provided by an embodiment of the present application;

[0053] Figure 8 Schematic flow chart of a method for testing stray light of an in-vehicle camera provided by an embodiment of the present application;

[0054] Figure 9 Schematic structural diagram of a device for testing stray light of an in-vehicle camera provided by an embodiment of the present application;

[0055] Figure 10 Schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0056] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0057] In this application, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0058] As can be seen from the background art, the existing image quality test, that is, the stray light test, relies on standard test cards and professional test software such as the image quality analysis software Imatest. It is not only complex to operate but also expensive.

[0059] Therefore, the embodiments of the present invention provide a method, device, equipment and storage medium for testing the stray light of an in-vehicle camera. In this solution, data is collected when the acquisition light source and the camera optical axis are at different angles, and the brightness values of the stray light generated at each angle are statistically analyzed. If the brightness values of the stray light generated at each angle meet the stray light test standard, it is determined that the stray light test passes, so as to realize a simple stray light test process and a simple environment without relying on professional test software, thereby ensuring that the in-vehicle camera for autonomous driving always provides accurate and interference-free data for the downstream perception module, and further ensuring the recognition accuracy rate.

[0060] First, the stray light test environment of the in-vehicle camera is introduced. The stray light test of the in-vehicle camera is carried out in a darkroom environment, using a high-brightness circular light source as the only light source, and the camera is clamped by tools such as a fixture and a tripod; before the test starts, the camera optical axis is made to coincide with the center of the light source, and the camera faces the light source directly. This test process is divided into four parts: light source setting, camera exposure control, data acquisition and data analysis.

[0061] The following will explain the entire test process one by one.

[0062] First, the light source is set.

[0063] It should be noted that there is no specific requirement for the placement height of the light source, mainly for the convenience of testing.

[0064] Preferably, in some embodiments, the back of the light source is closely attached to the checkerboard test chart, and it is required that the light source is perpendicular to the checkerboard plane. The checkerboard is used to assist in adjusting the exposure degree of the camera. The distance between the light source and the camera is 200 cm, and it is required that there is no obstruction between the light source and the camera. The placement position of the light source can be seen in Figure 1 , where the circular area represents the light source.

[0065] Secondly, the camera exposure is controlled.

[0066] It should be noted that due to the existence of different optical sensors, lenses, etc., and hardware differences, it is impossible to determine a fixed exposure parameter. However, in some embodiments, the brightness of the entire image can be controlled by means of a checkerboard test pattern, so as to prevent excessive halos from being generated around the light source and affecting data analysis.

[0067] Mainly by calculating the contrast of adjacent white and black blocks in the horizontal direction at any corner of the checkerboard, it is sufficient to ensure that the value of the contrast is greater than 0.1 (or other thresholds, such as 0.2, etc.). The specific calculation formula is as follows.

[0068] Δ = |l wmean - l bmean | ÷ |l wmean + l bmean |

[0069] Where Δ is the contrast of white and black blocks, l wmean is the average brightness of the white blocks, and l bmean is the average brightness of the black blocks.

[0070] Before performing the method for testing stray light of an in-vehicle camera according to this embodiment, the exposure parameter of the camera to be tested can be adjusted using the above calculation formula. After the adjustment is completed, the adjusted camera is used to capture the image data required for the testing method of this embodiment.

[0071] Taking the threshold of the contrast of white and black blocks as 0.1 as an example, the specific adjustment method can be as follows:

[0072] Set the exposure parameter of the camera to the initial value;

[0073] Use the camera to capture Figure 1 the checkerboard shown, and obtain a frame of checkerboard image;

[0074] Then calculate the average brightness of all white blocks in this frame of checkerboard image, and calculate the average brightness of all black blocks in this frame of checkerboard image. Substitute the calculated average brightness into the above calculation formula to obtain the contrast of white and black blocks in this frame of checkerboard image;

[0075] Judge whether the contrast of white and black blocks in this frame of checkerboard image is greater than 0.1. If it is greater than 0.1, it is determined that the currently set exposure parameter is appropriate, and the adjustment process of the exposure parameter ends;

[0076] If the contrast of white and black blocks is not greater than 0.1, it is determined that the currently set exposure parameter is inappropriate, adjust the currently set exposure parameter, and after the adjustment, return to the step of using the camera to capture Figure 1 the checkerboard shown above, and repeat the above judgment process for the newly obtained frame of checkerboard image until the contrast of white and black blocks is greater than 0.1.

[0077] In the test method provided in this embodiment, the image data used can be RAW (unprocessed) image data captured by an in-vehicle camera, or YUV image data captured by an in-vehicle camera.

[0078] Among them, the RAW image data is the image data output by the sensor of the in-vehicle camera without being processed by ISP (Image Signal Processor), and the YUV image data is the image data obtained after the data output by the sensor of the in-vehicle camera is processed by ISP.

[0079] When using RAW image data for testing, the in-vehicle camera can output image data in any one of the output modes of HDR mode (i.e., high dynamic range mode), linear mode, and single-frame mode. In this embodiment, it is recommended to use the HCG frame mode in the single-frame mode to facilitate adjusting the exposure parameters in the above-mentioned manner of adjusting the exposure parameters.

[0080] Generally, the data of YUV images are adjusted by automatic exposure. Therefore, in this case, the exposure parameters can be not adjusted in the above manner and can be used normally.

[0081] Next, in combination with the light source setting and camera exposure control described above, data acquisition and data analysis are carried out, and a method for testing stray light of an in-vehicle camera of the present application is specifically introduced, as Figure 2 shown, which is a schematic flowchart of a method for testing stray light of an in-vehicle camera provided by an embodiment of the present invention.

[0082] The method for testing stray light of the in-vehicle camera mainly includes the following steps:

[0083] Step S201: Collect data when the optical axes of the light source and the camera are at different angles to obtain multiple frames of image data.

[0084] In step S201, by placing the light source at different angles, multiple frames of image data can be captured. Each angle corresponds to one frame of image data captured by the camera, and the image data includes the brightness values of multiple pixels.

[0085] It should be noted that the state of one frame of image data can be a qualified state or an unqualified state. The image data in the qualified state can be called qualified image data, and the image data in the unqualified state can be called unqualified image data.

[0086] The above-mentioned camera can be the in-vehicle camera that needs to be tested for stray light, that is, the camera to be tested.

[0087] In the process of specifically implementing step S201, data is collected when the light source and the camera optical axis are at different angles, that is, data is captured when the light source and the camera optical axis are at different angles, specifically including: data when the light source is at the center position of the image, data when the light source is in the middle horizontal direction of the image, data when the light source is in the middle vertical direction of the image, and data when the light source is in the diagonal direction of the image.

[0088] In practical applications, the data when the light source is at the center position of the image is used to calculate the lens flare size. The light source placement position can be referred to Figure 3 .

[0089] When capturing data with the light source in the middle horizontal direction of the image, starting from the light source being at the exact middle position of the image, it is offset left and right with a step value of 10° each time until the angle between the light source and the lens optical axis is theta. Multiple image data are collected. The light source placement position in this case can be referred to Figure 4 .

[0090] Among them, theta = 0.5HFOV + 20°, where HFOV is the horizontal field of view of the lens.

[0091] When capturing data with the light source in the middle vertical direction of the image, starting from the light source being at the exact middle position of the image, it is offset up and down with a step value of 10° each time until the angle between the light source and the lens optical axis is theta. Multiple data are collected. The light source placement position in this case can be referred to Figure 5 .

[0092] Among them: theta = 0.5VFOV + 20°, where VFOV is the vertical field of view of the lens.

[0093] When capturing data with the light source in the diagonal direction of the image, starting from the light source being at the exact middle position of the image, it is offset in the left and right diagonal directions with a step value of 10° each time until the angle between the light source and the lens optical axis is theta. Multiple data are collected. The light source placement position in this case can be referred to Figure 6 , among which, for the case of offsetting in the left diagonal direction, refer to Figure 6 of (1), and for the case of offsetting in the right diagonal direction, refer to Figure 6 of (2).

[0094] Among them: theta = 0.5DFOV + 20°, where DFOV is the diagonal field of view of the lens.

[0095] In the above several light source placement situations, each time the light source moves according to the step value, one frame of image data is captured by the camera. Thus, multiple frames of image data can be obtained, that is, multiple frames of image data for S201 are obtained.

[0096] When a frame of image data is interfered by stray light, obvious phenomena such as halos, ghost images, and false light sources may occur in this frame of image data.

[0097] The reason for the appearance of halos is that the light source has a high brightness, but it has a range and contour. Outside the contour of the light source in the picture are the pixels of other objects. Because it is a dark room environment, the brightness of these objects that only reflect light and do not emit light is relatively low, while the brightness of the halos is very high and will cover the objects outside the contour and make them invisible, which is equivalent to the area occupied by the light source in the picture becoming larger.

[0098] The formation principle of ghost images is that due to the high brightness of the light source, in addition to the light directly passing through the lens and irradiating on the sensor, the light will also be reflected between the lenses and then irradiate on the sensor again. The phenomenon is that one or more small circular light spots that do not exist in the real world appear in the image.

[0099] The formation principle of false light sources is that the camera has a field of view angle and it cannot see objects outside the field of view angle, just like the human eye cannot see objects behind. However, when the camera shoots a high-brightness light source, a fan-shaped high-brightness area will be formed at the edge of the image within a certain angle range after the light source moves out of the field of view edge. This is because the light that should not irradiate on the sensor is not correctly blocked, thus forming an object similar to a light source (which does not exist in the real world).

[0100] Step S202: For each image data, count the number of bright pixels in the image data.

[0101] In step S202, the number of bright pixels includes the first number of bright pixels, the second number of bright pixels, and the total number of pixels.

[0102] Among them, the first number of bright pixels is the number of pixels with the first brightness value in the image data, the second number of bright pixels is the number of pixels with a brightness value greater than the second brightness value in the image data, the first brightness value is the brightness value of the light source area in the image data, and the second brightness value is the upper limit of the brightness value of the non-light source area in the image data.

[0103] As an example, the first number of bright pixels is the number of pixels L1 with a brightness value of 255.

[0104] The second number of bright pixels is the number of pixels L2 with a brightness value exceeding 30.

[0105] The total number of pixels can be expressed as n.

[0106] It should be noted that under normal conditions, the pixel brightness value of the light source part in the image is 255 (the maximum value). That is to say, the pixels with a brightness value of 255 are the pixels occupied by the light source.

[0107] The brightness values of other part of the pixels are concentrated between 0 and 30. That is to say, the pixels with brightness values lower than 30 can be regarded as non-interfering pixels.

[0108] Correspondingly, those that do not belong to the light source area and have a brightness value exceeding 30 can be regarded as being affected by stray light. That is to say, the pixels with brightness values exceeding 30 can be regarded as abnormal pixels.

[0109] In the process of specifically implementing step S202, for each frame of image data collected, mainly count the number of pixels with different brightness values in the image data. That is to say, count the number of different pixel brightnesses in the entire screen for each frame of image data.

[0110] Step S203: Determine the position of the light source according to the number of first-brightness pixels and the total number of pixels.

[0111] In step S203, the position where the light source is located can be that the light source is within the field of view, or the light source is not within the field of view.

[0112] In the process of specifically implementing step S203, determine whether the light source is within the field of view according to the numerical relationship between the number of first-brightness pixels and the total number of pixels.

[0113] Step S204: Update the number of qualified image data and the number of unqualified image data in the analyzed image data according to the position of the light source, the number of first-brightness pixels, the number of second-brightness pixels, and the total number of pixels.

[0114] In the process of specifically implementing step S204, first select an unanalyzed image data, and analyze whether this collected image data belongs to qualified image data or unqualified image data according to the position of the light source, the number of first-brightness pixels, the number of second-brightness pixels, and the total number of pixels in this image data.

[0115] After the analysis is completed, mark the frame of image data being analyzed as the analyzed image data, and then update the number of qualified image data or the number of unqualified image data in the analyzed image data based on the analysis result image data.

[0116] Specifically, if this frame of image data belongs to qualified image data, increment the number of qualified image data in the analyzed image data by 1. If this frame of image data belongs to unqualified image data, increment the number of unqualified image data in the analyzed image data by 1. The initial values of the number of qualified image data and the number of unqualified image data are both 0.

[0117] After the update, execute step S205.

[0118] Step S205: Determine whether all the image data have been analyzed. If so, execute Step S206; if not, return to execute Step S204.

[0119] In the process of specifically implementing Step S205, determine whether all the image data have been analyzed. If so, execute Step S206; if not, it means that there is still unanalyzed image data that needs to be analyzed. At this time, the image data returns to re - execute the analysis process of S204.

[0120] Through Steps S204 and S205, each frame of image data can be analyzed one by one to determine whether it is qualified or unqualified image data until all the image data obtained in S201 have been analyzed.

[0121] Step S206: Count the number of qualified image data and unqualified image data among all the image data to obtain the qualified quantity and the unqualified quantity.

[0122] In the process of specifically implementing Step S206, when it is determined that all the image data have been analyzed, based on the number of qualified image data and unqualified image data in the updated analyzed - completed image data, obtain the qualified quantity and the unqualified quantity. Specifically, it is to determine the number of qualified image data in the updated analyzed - completed image data as the qualified quantity, and determine the number of unqualified image data in the updated analyzed - completed image data as the unqualified quantity.

[0123] Step S207: Determine whether the stray light test passes according to the qualified quantity and the unqualified quantity.

[0124] In the process of specifically implementing Step S207, according to the numerical relationship between the qualified quantity and the unqualified quantity, determine whether the tested camera in S201 passes the stray light test.

[0125] The test principle of this embodiment is as follows:

[0126] When using a camera to photograph a light source, in an ideal situation without stray light interference, if there is a light source within the field of view of the camera, then in the captured image data, only the pixels in the light source area should have a relatively high first brightness value, and the pixels in the non - light source area should be darker, and these pixel brightness values should be less than or equal to the second brightness value; if there is no light source within the field of view of the camera, then all the pixels in the captured image data should be darker, and these pixel brightness values should be less than or equal to the second brightness value.

[0127] Therefore, if the distribution of the brightness values of each pixel in a frame of image data actually captured by the camera from the light source basically conforms to the above rules, it can be considered that this frame of image data is not interfered by stray light and the image data is qualified. If a frame of image data does not conform to the above rules, it can be considered that this frame of image data is interfered by stray light and the image data is unqualified.

[0128] Furthermore, if most of the multiple frames of image data captured by a camera are interfered by stray light, it can be considered that the camera cannot effectively filter stray light and the camera fails the stray light test. If most of the multiple frames of image data captured by a camera are not interfered by stray light, it can be considered that the camera can effectively filter stray light and the camera passes the stray light test.

[0129] Based on the above principle, the test method of this embodiment collects multiple frames of image data when the optical axes of the light source and the camera are at different angles. By analyzing the number of bright pixels in each image data, it is determined whether each image data is interfered by stray light. Furthermore, based on the number of image data interfered by stray light and the number of image data not interfered by stray light in the multiple frames of image data captured, it is determined whether the tested camera can effectively filter stray light.

[0130] It can be seen that the test method of this embodiment does not need to rely on professional test software. Only by using the camera to capture the light source and counting the brightness of the pixels in the captured image data, the stray light test of the camera can be realized. It has the advantages of simple stray light test process, simple environment, and does not need to rely on professional test software. By executing the method of this embodiment, it can be ensured that the camera passing the test has a strong ability to filter stray light, so as to ensure that the on-vehicle camera for autonomous driving always provides accurate and non-interfered data for the downstream perception module, and further ensure the recognition accuracy.

[0131] Based on the on-vehicle camera stray light test method shown in the above embodiments of the present invention, as Figure 7a 、 Figure 7b 、 Figure 7c shown, it is a schematic flowchart of another on-vehicle camera stray light test method provided by the embodiments of the present invention, which mainly includes the following steps:

[0132] Step S701: Collect data when the optical axes of the light source and the camera are at different angles to obtain multiple frames of image data.

[0133] It should be noted that the execution principle and process of the above step S701 are the same as those of step S201 disclosed in Figure 2 , and can be referred to here and will not be elaborated.

[0134] Step S702: Normalize the brightness values of each pixel in the image data to a preset brightness value range.

[0135] In step S702, the specific value range of the preset brightness value can be determined specifically according to the actual situation of stray light testing. This application does not make any limitations, and all are within the protection scope of this application.

[0136] In some embodiments, the preset brightness value range can be 0 - 255.

[0137] In the process of specifically implementing step S702, the collected image data is normalized, that is, the brightness value of each pixel in the image data is normalized to the preset brightness value range.

[0138] The advantage of performing the normalization process in S702 is that when the brightness value range of the pixels in the image data does not match the preset brightness value range, it will cause the counted number of bright pixels not to truly reflect the situation of the image data being interfered by stray light. Through the normalization process, it can be ensured that the brightness value range of the pixels in the normalized image data matches the preset brightness value range, thereby avoiding the aforementioned situation and ensuring the accuracy of the detection result.

[0139] Step S703: Calculate the number of first-brightness pixels, the number of second-brightness pixels, and the total number of pixels.

[0140] When detecting the number of first-brightness pixels in a frame of image data, it is possible to check one by one whether the brightness value of each pixel in the image data is the first brightness value. For each pixel whose brightness value is the first brightness value detected, increment the number of first-brightness pixels by 1. After checking all the pixels of the image data, the number of first-brightness pixels can be obtained. In this process, the initial value of the number of first-brightness pixels is 0.

[0141] When detecting the number of second-brightness pixels in a frame of image data, it is possible to check one by one whether the brightness value of each pixel is greater than the second brightness value. For each pixel whose brightness value is greater than the second brightness value detected, increment the number of second-brightness pixels by 1. After checking all the pixels of the image data, the number of second-brightness pixels can be obtained. In this process, the initial value of the number of second-brightness pixels is 0.

[0142] The total number of pixels can be calculated from the resolution of the image data. For example, if the resolution is 100 by 100, then the total number of pixels is 10000.

[0143] Step S704: Determine whether the quotient of the number of first-brightness pixels and the total number of pixels is greater than the first preset value. If so, execute step S705; if not, execute step S711.

[0144] In step S704, the specific value of the first preset value can be determined according to the actual situation of stray light testing, which is not limited in this application and is within the protection scope of this application.

[0145] In some embodiments, the first preset value can be 0.005.

[0146] In the process of specifically implementing step S704, calculate the first quotient of the number of first-brightness pixels and the total number of pixels, that is: L1 / n = the first quotient. If this first quotient is greater than the first preset value, execute step S705; if this first quotient is less than or equal to the first preset value, execute step 711.

[0147] Step S705: Determine that the light source is within the field of view.

[0148] In the process of specifically implementing step S705, when it is determined that the first quotient is greater than the first preset value, determine that the light source is within the field of view.

[0149] Step S706: Determine whether the quotient of the number of second-brightness pixels and the number of first-brightness pixels is greater than a second preset value. If so, execute step S707; if not, execute step S709.

[0150] In step S706, the specific value of the second preset value can be determined according to the actual situation of stray light testing, which is not limited in this application and is within the protection scope of this application.

[0151] In some embodiments, the second preset value can be 2.

[0152] In the process of specifically implementing step S706, calculate the second quotient of the number of second-brightness pixels and the number of first-brightness pixels, that is: L2 / L1 = the second quotient. If this second quotient is greater than the second preset value, execute step S707; if this second quotient is less than or equal to the second preset value, execute step 709.

[0153] Step S707: Determine the image data that meets the condition of the light source being within the field of view as unqualified image data.

[0154] In the process of specifically implementing step S707, when it is determined that the second quotient of the number of second-brightness pixels and the number of first-brightness pixels is greater than the second preset value, determine the image data that meets the condition of the light source being within the field of view as an unqualified image.

[0155] Step S708: Update the number of unqualified images in the analyzed image data.

[0156] In step S708, the analyzed image data refers to the image data that has been analyzed according to the process of steps S702 to S716. In this step, since an image data belonging to the unqualified image data is detected, the number of unqualified images can be incremented by 1 on the original basis. As introduced above, the initial value of the number of unqualified images is 0.

[0157] Step S709: Determine the image data with the light source within the field of view as qualified images.

[0158] In the specific implementation process of step S709, when it is determined that the second quotient value of the number of second-brightness pixels and the number of first-brightness pixels is less than or equal to the second preset value, the image data with the light source within the field of view is determined as qualified images.

[0159] Step S710: Update the number of qualified images in the analyzed image data.

[0160] In this step, since an image data belonging to the qualified image data is detected, the number of qualified images can be incremented by 1 on the original basis. As introduced above, the initial value of the number of qualified images is 0.

[0161] Step S711: Determine that the light source is not within the field of view.

[0162] In the specific implementation process of step S711, when the first quotient value of the number of first-brightness pixels and the total number of pixels is less than or equal to the first preset value, it is determined that the light source is not within the field of view.

[0163] Step S712: Judge whether the quotient value of the number of second-brightness pixels and the total number of pixels is greater than the third preset value. If so, execute step S713; if not, execute step S715.

[0164] In step S712, the specific value of the third preset value can be specifically determined according to the actual situation of the stray light test. This application does not make a limit, and all are within the protection scope of this application.

[0165] In some embodiments, the second preset value can be 0.03.

[0166] In the specific implementation process of step S712, calculate the third quotient value of the number of second-brightness pixels and the total number of pixels, that is: L2 / n = the third quotient value. If this third quotient value is greater than the third preset value, execute step S713; if this third quotient value is greater than the third preset value, execute step S715.

[0167] Step S713: Determine the image data with the light source not within the field of view as unqualified images.

[0168] In the process of specifically implementing step S713, when it is determined that the third quotient of the number of second-brightness pixels and the total number of pixels is greater than the third preset value, the image data that satisfies the condition that the light source is not within the field of view is determined as unqualified image data.

[0169] Step S714: Update the number of unqualified images in the analyzed image data.

[0170] In step S714, since an image data belonging to unqualified image data is detected, the number of unqualified images can be incremented by 1 based on the original number.

[0171] Step S715: Determine the image data that satisfies the condition that the light source is not within the field of view as qualified image data.

[0172] In the process of specifically implementing step S715, when it is determined that the third quotient of the number of second-brightness pixels and the total number of pixels is less than or equal to the third preset value, the image data that satisfies the condition that the light source is not within the field of view is determined as qualified image data.

[0173] Step S716: Update the number of qualified images in the analyzed image data.

[0174] In this step, since an image data belonging to qualified image data is detected, the number of qualified images can be incremented by 1 based on the original number.

[0175] Step S717: Determine whether all the image data has been analyzed. If so, execute step S718; if not, return to execute step S702.

[0176] It should be noted that steps S702 to S716 are for analyzing whether a frame of image data belongs to qualified image data or unqualified image data. After analyzing a frame of image data according to this process, the image data can be marked as analyzed image data. In S717, it can be determined whether there is unmarked image data among all the image data, that is, whether there is unanalyzed image data.

[0177] If there is unmarked image data, it is considered that not all the image data has been analyzed, and S702 is executed to continue analyzing another unanalyzed image data according to the process from S702 to S716. If all the image data is marked, it is considered that all the image data has been analyzed, and S718 is executed.

[0178] All the image data in S717 includes all the image data captured by the camera when the light source is at different angles in step S701.

[0179] Exemplarily, in S701, by placing the light source at different angles, 40 frames of image data were captured by the camera. Then, all the image data in S717 is these 40 frames of captured image data.

[0180] Optionally, after S717 determines "No", it can also return to S704. In this case, when executing S702, normalization processing can be performed on each frame of image data first. At the same time, when executing S703, the number of luminance pixels corresponding to each frame of image data can be calculated one by one. Thereafter, through the process from S704 to S716, the number of luminance pixels of each frame of image data can be analyzed one by one to determine whether each frame of image data belongs to qualified image data or unqualified image data.

[0181] Step S718: Count the number of qualified and unqualified.

[0182] In the process of specifically implementing step S718, the number of qualified can be the number of qualified images obtained by the last update after analyzing all the image data, and the number of unqualified can be the number of unqualified images obtained by the last update after analyzing all the image data.

[0183] Step S719: Determine whether the number of qualified is greater than a preset multiple of the number of unqualified. If yes, execute step S720; if no, execute step S721.

[0184] In step S719, the specific value of the preset multiple can be determined according to the actual situation of the stray light test. This application does not make a limitation, and all are within the protection scope of this application.

[0185] In some embodiments, the preset multiple can be 3.

[0186] In the process of specifically implementing step S719, determining whether the number of qualified is greater than a preset multiple of the number of unqualified, that is, determining whether the quotient of the number of qualified and the number of unqualified is greater than the preset multiple. First, calculate the fourth quotient of the number of qualified and the number of unqualified, that is: number of qualified images / number of unqualified images = fourth quotient. If this fourth quotient is greater than the preset multiple, execute step S720; if this fourth quotient is less than or equal to the preset multiple, execute step S721.

[0187] Step S720: Determine that the stray light test passes.

[0188] In the process of specifically implementing step S720, in the case of determining that the number of qualified is greater than a preset multiple of the number of unqualified, that is, in the case where the fourth quotient is greater than the preset multiple, it is determined that the camera under test in S701 passes the stray light test.

[0189] Step S721: Determine that the stray light test fails.

[0190] In the process of specifically implementing step S721, when it is determined that the qualified quantity is less than or equal to a preset multiple of the unqualified quantity, that is, when the fourth quotient value is less than or equal to the preset multiple, it is determined that the camera under test in S701 fails the stray light test.

[0191] To better understand the above description, an example is given below for detailed explanation.

[0192] Suppose that currently 10 frames of image data are collected, which are sequentially recorded as image data 1 to image data 10.

[0193] For each image data, the brightness values of the pixels in the image data are normalized to the preset brightness value range of 0 - 255, that is, the brightness values of the pixels in image data 1 to 10 are sequentially normalized to the preset brightness value range of 0 - 255. This process is equivalent to performing the above step S702 on each image data.

[0194] Calculate the number of bright pixels in each image data, specifically count the first bright pixel quantity L1, the second bright pixel quantity L2, and the total pixel quantity n of each image data in image data 1 to 10. This process is equivalent to performing the above step S703 on each image data.

[0195] For each image data, perform the processes of S704 to S716 according to the first bright pixel quantity, the second bright pixel quantity, and the total pixel quantity of this image data to determine whether this image data belongs to a qualified image or an unqualified image until all of image data 1 to 10 have been analyzed, that is, until it is determined in S717 that all image data have been analyzed.

[0196] The analysis results can be as follows.

[0197] By performing the processes of S704 to S716 on each image data, it is found that 6 frames of image data (such as image data 1 to 6) satisfy the condition that the quotient of the first bright pixel quantity L1 and the total pixel quantity n is greater than the first preset value of 0.005, that is, L1 / n > 0.005, and it is determined that the light sources of these 6 frames of image data are within the field of view.

[0198] Furthermore, among these 6 frames of image data with light sources within the field of view, it is found that 1 frame of image data, such as image data 1, satisfies the condition that the quotient of the second bright pixel quantity L2 and the first bright pixel quantity L1 is greater than the second preset value of 2, that is, L2 / L1 > 2. Therefore, it is determined that image data 1 belongs to an unqualified image.

[0199] Among the image data of these 6 light sources in the field of view, the remaining 5 frames of image data, that is, image data 2 to 6, satisfy the condition that the ratio of the number of second-brightness pixels L2 to the number of first-brightness pixels L1 is less than or equal to the second preset value 2, that is: L2 / L1 is less than or equal to 2. Thus, it is determined that the image data from image data 2 to 6 belongs to qualified image data.

[0200] Among the 10 frames of image data, except for image data 1 to 6, the remaining 4 frames of image data, that is, image data 7 to 10, satisfy the condition that the quotient of the number of first-brightness pixels L1 and the total number of pixels n is less than or equal to the first preset value 0.005, that is: L1 / n is less than 0.005. Thus, it is determined that the light sources of these 4 frames of image data are not in the field of view.

[0201] Among the image data of these 4 light sources not in the field of view, there is 1 frame of image data, for example, image data 7, which satisfies the condition that the quotient of the number of second-brightness pixels L2 and the total number of pixels n is greater than the third preset value 0.03, that is: L2 / n is greater than 0.03. Thus, it is determined that image data 7 belongs to unqualified image data.

[0202] Among the image data of these 4 light sources not in the field of view, the remaining 3 frames of image data, that is, image data 8 to 10, satisfy the condition that the quotient of the number of second-brightness pixels and the total number of pixels is less than or equal to the third preset value, that is: L2 / n is less than or equal to 0.03. Thus, it is determined that the image data from image data 8 to 10 belongs to qualified image data.

[0203] Execute S718 to count the number of qualified and unqualified ones. The statistical result is that among the 10 frames of image data, the number of qualified ones is 8, and the number of unqualified ones is 2.

[0204] Then execute S719 to determine whether the number of qualified ones is greater than the preset multiple of the number of unqualified ones. Assuming the preset multiple is 3, it can be seen that the result of dividing the number of qualified ones by the number of unqualified ones is 5, which is greater than the preset multiple 3. In other words, the number of qualified ones is greater than 3 times the number of unqualified ones. Thus, execute S720 to determine that the camera that captured these 10 frames of image data passes the stray light test.

[0205] Please refer to Figure 8 , which is a flowchart of a method for testing stray light of an in-vehicle camera provided by an embodiment of the present application. The method may include the following steps.

[0206] S801: Collect data when the optical axes of the light source and the camera are at different angles to obtain multiple frames of image data.

[0207] S802: For each image data, count the number of brightness pixels in the image data. The number of brightness pixels includes the number of first-brightness pixels, the number of second-brightness pixels, and the total number of pixels.

[0208] Among them, the number of first-brightness pixels is the number of pixels with the first brightness value in the image data, the number of second-brightness pixels is the number of pixels with a brightness value greater than the second brightness value in the image data, the first brightness value is the brightness value of the light source area in the image data, and the second brightness value is the upper limit of the brightness value of the non-light source area in the image data.

[0209] Statistical brightness pixel count may include:

[0210] Normalize the brightness values of each pixel in the image data to a preset brightness value range;

[0211] According to the normalized brightness values of each pixel in the image data, calculate the number of first-brightness pixels, the number of second-brightness pixels, and the total number of pixels in the image data.

[0212] The above statistical process can refer to steps S702 to S703.

[0213] S803. For each image data, determine the position where the light source of the image data is located according to the number of first-brightness pixels and the total number of pixels of the image data.

[0214] Among them, the position where the light source of the image data is located is that the light source is within the field of view, or the light source is not within the field of view.

[0215] The process of determining the position where the light source of the image data is located according to the number of first-brightness pixels and the total number of pixels of the image data may include:

[0216] If the quotient of the number of first-brightness pixels and the total number of pixels is greater than the first preset value, determine that the position where the light source of the image data is located is that the light source is within the field of view;

[0217] If the quotient of the number of first-brightness pixels and the total number of pixels is less than or equal to the first preset value, determine that the position where the light source of the image data is located is that the light source is not within the field of view.

[0218] The above process of determining the position where the light source is located can refer to steps S704, S705, and S711.

[0219] S804. For each image data, determine whether the image data is qualified image data or unqualified image data according to the position where the light source of the image data is located and the number of brightness pixels.

[0220] In S804, the process of determining whether a frame of image data is qualified image data or unqualified image data may include:

[0221] If the position where the light source of the image data is located is that the light source is within the field of view, when the quotient of the number of second-brightness pixels and the number of first-brightness pixels of the image data is greater than the second preset value, determine that the image data is unqualified image data;

[0222] This process can be referred to in steps S706 and S707;

[0223] If the position of the light source of the image data is that the light source is within the field of view, when the quotient of the number of second-brightness pixels and the number of first-brightness pixels of the image data is less than or equal to a second preset value, determine that the image data is qualified image data;

[0224] This process can be referred to in steps S706 and S709;

[0225] If the position of the light source of the image data is that the light source is not within the field of view, when the quotient of the number of second-brightness pixels and the total number of pixels of the image data is greater than a third preset value, determine that the image data is unqualified image data;

[0226] This process can be referred to in steps S712 and S713;

[0227] If the position of the light source of the image data is that the light source is not within the field of view, when the quotient of the number of second-brightness pixels and the total number of pixels is less than or equal to the third preset value, determine that the image data is qualified image data;

[0228] This process can be referred to in steps S712 and S715.

[0229] Optionally, after each determination that a frame of image data belongs to qualified image data, the number of qualified image data in the analyzed image data can be updated, and the number of qualified image data in the analyzed image data is incremented by 1; after each determination that a frame of image data belongs to unqualified image data, the number of unqualified image data in the analyzed image data can be updated, and the number of unqualified image data in the analyzed image data is incremented by 1.

[0230] The above update steps can be referred to in steps S708, S710, S714, and S716.

[0231] S805. Determine the stray light test result of the camera according to the qualified quantity and the unqualified quantity.

[0232] Among them, the qualified quantity is the number of qualified image data, and the unqualified quantity is the number of unqualified image data.

[0233] The process of determining the stray light test result of the camera can include:

[0234] If the qualified quantity is greater than a preset multiple of the unqualified quantity, determine that the stray light test result of the camera is that the stray light test passes;

[0235] If the qualified quantity is less than or equal to a preset multiple of the unqualified quantity, determine that the stray light test result of the camera is that the stray light test fails.

[0236] The process of determining the stray light test result described above can be referred to Steps S717 to S721.

[0237] Corresponding to the method for testing stray light of an in-vehicle camera shown in the above embodiments of the present invention Figure 2 the embodiments of the present invention also correspondingly provide an in-vehicle camera stray light test device, as Figure 9 shown, the in-vehicle camera stray light test device includes: an acquisition module 901, a statistics module 902, a first determination module 903, a second determination module 904, and a third determination module 905.

[0238] The acquisition module 901 is configured to acquire data when the optical axes of the light source and the camera are at different angles, and obtain multiple frames of image data, where the image data includes the brightness values of the stray light generated at each angle;

[0239] The statistics module 902 is configured to, for each image data, count the number of bright pixels in the image data, where the number of bright pixels includes a first number of bright pixels, a second number of bright pixels, and a total number of pixels; wherein, the first number of bright pixels is the number of pixels having a first brightness value in the image data, the second number of bright pixels is the number of pixels whose brightness value is greater than a second brightness value in the image data, the first brightness value is the brightness value of the light source area in the image data, and the second brightness value is the upper limit of the brightness value of the non-light source area in the image data;

[0240] The first determination module 903 is configured to, for each image data, determine the position where the light source of the image data is located according to the first number of bright pixels and the total number of pixels of the image data; wherein, the position where the light source of the image data is located is that the light source is within the field of view, or the light source is not within the field of view;

[0241] The second determination module 904 is configured to, for each image data, determine whether the image data is qualified image data or unqualified image data according to the position where the light source of the image data is located and the number of bright pixels;

[0242] The third determination module 905 is configured to determine the stray light test result of the camera according to the number of qualified images and the number of unqualified images; wherein, the number of qualified images is the number of qualified image data, and the number of unqualified images is the number of unqualified image data.

[0243] Optionally, the statistics module 902 includes:

[0244] A normalization unit configured to normalize the brightness values of the pixels in the image data to a preset brightness value range;

[0245] A calculation unit configured to calculate the first number of bright pixels, the second number of bright pixels, and the total number of pixels of the image data according to the normalized brightness values of the pixels in the image data.

[0246] Optionally, the first determination module 903 includes:

[0247] A first sub-unit, configured to determine that the position of the light source of the image data is within the field of view if the quotient of the number of first-brightness pixels and the total number of pixels is greater than a first preset value;

[0248] A second sub-unit, configured to determine that the position of the light source of the image data is not within the field of view if the quotient of the number of first-brightness pixels and the total number of pixels is less than or equal to the first preset value.

[0249] Optionally, the second determination module 904 includes:

[0250] A third sub-unit, configured to determine that the image data is unqualified image data if the quotient of the number of second-brightness pixels and the number of first-brightness pixels of the image data is greater than a second preset value when the position of the light source of the image data is within the field of view;

[0251] A fourth sub-unit, configured to determine that the image data is qualified image data if the quotient of the number of second-brightness pixels and the number of first-brightness pixels of the image data is less than or equal to the second preset value when the position of the light source of the image data is within the field of view.

[0252] Optionally, the second determination module 904 includes:

[0253] A fifth sub-unit, configured to determine that the image data is unqualified image data if the quotient of the number of second-brightness pixels and the total number of pixels of the image data is greater than a third preset value when the position of the light source of the image data is not within the field of view;

[0254] A sixth sub-unit, configured to determine that the image data is qualified image data if the quotient of the number of second-brightness pixels and the total number of pixels is less than or equal to the third preset value when the position of the light source of the image data is not within the field of view.

[0255] Optionally, the third determination module 905 includes:

[0256] A seventh sub-unit, configured to determine that the stray light test result of the camera is passed if the number of qualified ones is greater than a preset multiple of the number of unqualified ones;

[0257] An eighth sub-unit, configured to determine that the stray light test result of the camera fails if the number of qualified ones is less than or equal to the preset multiple of the number of unqualified ones.

[0258] It should be noted that the specific principles and execution processes of each module or unit in the above-mentioned on-vehicle camera stray light test device disclosed in the embodiments of the present invention are the same as those of the on-vehicle camera stray light test method implemented in the present invention. For corresponding parts, reference can be made to the on-vehicle camera stray light test method disclosed in the embodiments of the present invention, and details will not be elaborated here.

[0259] For the on-vehicle camera stray light test device provided in this embodiment, its specific working principle and beneficial effects can be referred to the relevant steps and beneficial effects of the on-vehicle camera stray light test method provided in any embodiment of this application, and details will not be elaborated.

[0260] This application embodiment also provides an electronic device. Please refer to Figure 10 , which is a schematic structural diagram of the electronic device. The electronic device may include a memory 1001 and a processor 1002.

[0261] The memory 1001 is used to store computer programs.

[0262] The processor 1002 is used to execute the computer program, specifically for implementing the on-vehicle camera stray light test method provided in any embodiment of this application.

[0263] This application embodiment also provides a computer-readable storage medium for storing a computer program, which can be executed by a processor. When the computer program is executed, it is specifically used to implement the on-vehicle camera stray light test method provided in any embodiment of this application.

[0264] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for a system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For relevant parts, reference can be made to the partial description of the method embodiment. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.

[0265] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered as exceeding the scope of the present invention.

[0266] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for testing stray light of an in-vehicle camera, characterized in that, The method includes: Collecting data when the optical axes of the light source and the camera are at different angles to obtain multiple frames of image data; For each of the image data, counting the number of bright pixels in the image data, where the number of bright pixels includes the number of first bright pixels, the number of second bright pixels, and the total number of pixels; wherein, the number of first bright pixels is the number of pixels with a first brightness value in the image data, the number of second bright pixels is the number of pixels with a brightness value greater than a second brightness value in the image data, the first brightness value is the brightness value of the light source area in the image data, and the second brightness value is the upper limit of the brightness value of the non-light source area in the image data; For each of the image data, determining the position of the light source in the image data according to the number of first bright pixels and the total number of pixels in the image data; wherein, the position of the light source in the image data is that the light source is within the field of view, or the light source is not within the field of view; For each of the image data, determining whether the image data is qualified image data or unqualified image data according to the position of the light source in the image data and the number of bright pixels; Determining the stray light test result of the camera according to the number of qualified data and the number of unqualified data; wherein, the number of qualified data is the number of qualified image data, and the number of unqualified data is the number of unqualified image data.

2. The method according to claim 1, wherein The image data counting the number of bright pixels in the image data includes: The image data normalizes the brightness values of each pixel in the image data to a preset brightness value range; According to the normalized brightness values of each pixel in the image data, calculating the number of first bright pixels, the number of second bright pixels, and the total number of pixels in the image data.

3. The method according to claim 1, characterized in that, The determining the position of the light source in the image data according to the number of first bright pixels and the total number of pixels in the image data includes: If the quotient of the number of first bright pixels and the total number of pixels is greater than a first preset value, determining that the position of the light source in the image data is that the light source is within the field of view; If the quotient of the number of first bright pixels and the total number of pixels is less than or equal to the first preset value, determining that the position of the light source in the image data is that the light source is not within the field of view.

4. The method according to claim 1, characterized in that The determining whether the image data is qualified image data or unqualified image data according to the position of the light source in the image data and the number of bright pixels includes: If the position of the light source in the image data is that the light source is within the field of view, when the quotient of the number of second bright pixels and the number of first bright pixels in the image data is greater than a second preset value, determining that the image data is unqualified image data; If the position of the light source in the image data is that the light source is within the field of view, when the quotient of the number of second bright pixels and the number of first bright pixels in the image data is less than or equal to the second preset value, determining that the image data is qualified image data.

5. The method according to claim 1, wherein The determining whether the image data is qualified image data or unqualified image data according to the position of the light source in the image data and the number of bright pixels includes: If the position of the light source of the image data is such that the light source is not within the field of view, when the quotient of the number of second-brightness pixels of the image data and the total number of pixels is greater than a third preset value, determine that the image data is unqualified image data; If the position of the light source of the image data is such that the light source is not within the field of view, when the quotient of the number of second-brightness pixels and the total number of pixels is less than or equal to the third preset value, determine that the image data is qualified image data.

6. The method according to claim 1, characterized in that, The determining the stray light test result of the camera according to the qualified quantity and the unqualified quantity includes: If the qualified quantity is greater than a preset multiple of the unqualified quantity, determine that the stray light test result of the camera is that the stray light test passes; If the qualified quantity is less than or equal to the preset multiple of the unqualified quantity, determine that the stray light test result of the camera is that the stray light test fails.

7. An on-vehicle camera stray light testing device, characterized in that, The device includes: An acquisition module, configured to acquire data when the light axis of the light source and the camera are at different angles, to obtain multiple frames of image data; A statistics module, configured to, for each of the image data, count the number of brightness pixels in the image data, where the number of brightness pixels includes the number of first-brightness pixels, the number of second-brightness pixels, and the total number of pixels; wherein, the number of first-brightness pixels is the number of pixels having a first brightness value in the image data, the number of second-brightness pixels is the number of pixels whose brightness value is greater than a second brightness value in the image data, the first brightness value is the brightness value of the light source area in the image data, and the second brightness value is the upper limit of the brightness value of the non-light source area in the image data; A first determination module, configured to, for each of the image data, determine the position of the light source of the image data according to the number of first-brightness pixels and the total number of pixels of the image data; wherein, the position of the light source of the image data is that the light source is within the field of view, or the light source is not within the field of view; A second determination module, configured to, for each of the image data, determine whether the image data is qualified image data or unqualified image data according to the position of the light source of the image data and the number of brightness pixels; A third determination module, configured to determine the stray light test result of the camera according to the qualified quantity and the unqualified quantity; wherein, the qualified quantity is the number of qualified image data, and the unqualified quantity is the number of unqualified image data.

8. The device according to claim 7, wherein The statistics module includes: A normalization unit, configured to normalize the brightness values of the respective pixels in the image data to a preset brightness value range; A calculation unit, configured to calculate the number of first-brightness pixels, the number of second-brightness pixels, and the total number of pixels of the image data according to the normalized brightness values of the respective pixels in the image data.

9. An electronic device, characterized in that, Includes a memory and a processor; The memory is used to store a computer program; The processor is configured to execute the computer program, specifically for implementing the on-vehicle camera stray light test method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, For storing a computer program which, when executed, is specifically used to implement the on-vehicle camera stray light test method according to any one of claims 1 to 6.