Vehicle-mounted camera test method, device and system
By obtaining the video captured by the vehicle camera on a fixed figure, intercepting the image frame and calculating its similarity with the preset image, it solves the problem of uneven vehicle camera testing standards and achieves more accurate and efficient test results.
Patent Information
- Application Number
- CN202410850682.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-03
AI Technical Summary
Existing vehicle camera testing standards are uneven, resulting in inaccurate test results.
By obtaining the video captured by the vehicle-mounted camera on the fixed figure, intercepting the image frame, determining the similarity between the image frame and the preset image, judging the test results of the vehicle-mounted camera based on the similarity, and using the signal-to-noise ratio of the brightness information and chromaticity information as Similarity index.
Standardizes the test standards for vehicle cameras, improves test accuracy, and ensures the reliability and efficiency of vehicle camera test results.
Smart Images

Figure CN118590640A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicles, and in particular to a testing method, device and system for a vehicle-mounted camera. Background Art
[0002] With the rapid development of the vehicle industry, more and more people have become vehicle users. With the increase in the number of vehicles, the incidence of traffic accidents has also increased year by year. For traffic accidents that occur in monitored areas, traffic police can restore the process of the traffic accident through monitoring, so as to determine the responsibility and pursue the responsibility. However, for traffic accidents that occur in areas without monitoring or where the monitoring cannot work properly, the traffic police cannot restore the process of the traffic accident, so it is impossible to make a fair determination of the responsibility of both parties in the traffic accident. Therefore, the vehicle-mounted camera has become one of the important ways to solve this problem. On this basis, input testing of the vehicle-mounted camera is one of the necessary conditions to ensure the normal operation of the vehicle-mounted camera. However, at present, after the data frame read by the vehicle-mounted camera is displayed on the screen, the experimenter reviews and tests the content of the video output. Due to the uncertainty of the manual review test standard and the uneven test standards of the vehicle-mounted camera, the test results of the vehicle-mounted camera are inaccurate.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide a method, device and system for testing a vehicle-mounted camera, so as to at least solve the technical problem that the test results of the vehicle-mounted camera are inaccurate due to the uneven test standards of the vehicle-mounted camera.
[0005] According to one aspect of an embodiment of the present invention, a method for testing a vehicle-mounted camera is provided, comprising: obtaining a video obtained by shooting a fixed pattern with the vehicle-mounted camera; intercepting the video to obtain an image frame, wherein the image frame includes brightness information and two chromaticity information; determining the similarity between the image frame and a preset image; and determining a test result of the vehicle-mounted camera based on the similarity, wherein the test result is used to characterize whether the vehicle-mounted camera is working normally.
[0006] Furthermore, determining the similarity between the image frame and the preset image includes: separating the preset components in the image frame to obtain first component information; separating the preset components in the preset image to obtain second component information; determining a signal-to-noise ratio between the first component information and the second component information; and using the signal-to-noise ratio as the similarity.
[0007] Further, determining the signal-to-noise ratio between the first component information and the second component information includes: determining a mean square error between the first component information and the second component information; and determining the signal-to-noise ratio based on maximum component information and the mean square error of preset components.
[0008] Further, determining the similarity between the image frame and the preset image includes: obtaining multiple first bytes in the image frame and obtaining multiple second bytes in the preset image; and comparing each first byte with each second byte to obtain the similarity.
[0009] Furthermore, determining the similarity between the image frame and the preset image includes: acquiring a first storage file of the image frame and a second storage file of the preset image, wherein component information of different components in the image frame is stored in different byte addresses in the first storage file, and component information of different components in the preset image is stored in different byte addresses in the second storage file; comparing the first storage file and the second storage file byte by byte to obtain sub-similarity of different components; and summarizing the sub-similarity of different components according to the proportion of different components in the image frame to obtain similarity.
[0010] Furthermore, the first storage file and the second storage file are compared byte by byte to obtain sub-similarity of different components, including: determining the first starting address of the different components in the first storage file according to the proportion of the different components in the image frame; comparing the first storage file and the second storage file byte by byte to obtain byte similarity; based on the first starting address, summarizing the byte similarities belonging to the same component to obtain sub-similarity of the same component.
[0011] Furthermore, after capturing the video and obtaining the image frame, the method also includes: outputting the image frame on a vehicle display screen; receiving feedback results corresponding to the image frame, wherein the feedback results are used to characterize whether the vehicle camera is working normally; and determining the test results based on the similarity and the feedback results.
[0012] According to another aspect of an embodiment of the present invention, a testing device for a vehicle-mounted camera is also provided, including: an acquisition module, used to acquire a video obtained by shooting a fixed pattern with a vehicle-mounted camera; an interception module, used to intercept the video to obtain an image frame, wherein the image frame contains brightness information and two chromaticity information; a first determination module, used to determine the similarity between the image frame and a preset image; and a second determination module, used to determine a test result of the vehicle-mounted camera based on the similarity, wherein the test result is used to characterize whether the vehicle-mounted camera is working normally.
[0013] According to another aspect of an embodiment of the present invention, a test system for a vehicle-mounted camera is also provided, including: a vehicle-mounted camera, used to shoot a fixed image and generate a video; a controller, connected to the vehicle-mounted camera, used to intercept the video, obtain an image frame, determine the similarity between the image frame and a preset image, and determine a test result of the vehicle-mounted camera based on the similarity, wherein the image frame contains brightness information and two chromaticity information, and the test result is used to characterize whether the vehicle-mounted camera is working normally.
[0014] According to another aspect of the embodiments of the present invention, a vehicle is provided, including: a testing system for a vehicle-mounted camera in each embodiment of the present invention.
[0015] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0016] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0017] In an embodiment of the present invention, a video obtained by shooting a fixed pattern with a vehicle-mounted camera is obtained, the video is intercepted to obtain an image frame, the similarity between the image frame and a preset image is determined, and the test result of the vehicle-mounted camera is determined based on the similarity. The present application intercepts the video shot by the vehicle-mounted camera and obtains an image frame, compares the image frame with a preset image based on the brightness information and two chromaticity information of the image frame, obtains the similarity between the image frame and the preset image, and determines the test result of the vehicle-mounted camera based on the similarity. The present application standardizes the test standard of the vehicle-mounted camera by comparing the image frame with the preset image to obtain the similarity, thereby achieving the technical effect of improving the accuracy of the vehicle-mounted camera test, and further solving the technical problem of inaccurate test results of the vehicle-mounted camera caused by uneven test standards of the vehicle-mounted camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0019] Figure 1 is a flow chart of an optional vehicle camera testing method according to an embodiment of the present invention;
[0020] Figure 2 is a schematic diagram of an optional vehicle-mounted camera structure according to an embodiment of the present invention;
[0021] Figure 3 is a schematic diagram of an optional color coding system according to an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of an optional storage file according to an embodiment of the present invention;
[0023] Figure 5 It is a schematic structural diagram of an optional vehicle-mounted camera testing device according to an embodiment of the present invention.
[0024] Among them, the above-mentioned drawings include the following figure marks: 21, vehicle-mounted camera; 22, video; 23, vehicle-mounted display screen; 211, vehicle-mounted camera input terminal; 212, image frame capture unit; 213, similarity comparison unit; 31, preset image; 311, brightness information in the second component information; 312, blue-yellow chromaticity information in the second component information; 313, red-cyan chromaticity information in the second component information. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] Example 1
[0028] According to an embodiment of the present invention, an embodiment of a method for testing a vehicle-mounted camera is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] Figure 1 is a flow chart of an optional vehicle camera testing method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0030] Step S102, obtaining a video obtained by shooting a fixed pattern with a vehicle-mounted camera.
[0031] The above-mentioned vehicle-mounted camera refers to a camera used on a vehicle, including but not limited to: vehicle interior camera, driving recorder, reversing camera, lane keeping assist system and other cameras. The above-mentioned vehicle-mounted camera is used to assist the driver in driving the vehicle or record the vehicle's journey, etc.
[0032] The above-mentioned vehicles refer to vehicles that need to be installed with cameras, including but not limited to: electric cars, electric trucks, electric vans, gasoline cars, gasoline trucks, gasoline vans, hybrid cars, hybrid trucks, hybrid vans, etc.
[0033] The fixed pattern is a pattern that the vehicle camera needs to shoot a video when testing the vehicle camera. The fixed pattern is used to allow the vehicle camera to shoot a stable picture so as to test the vehicle camera. The fixed pattern is a pattern that is pre-set before the vehicle camera is tested.
[0034] In an optional embodiment, a vehicle-mounted camera may be used to perform fixed shooting of a preset fixed pattern to obtain a video obtained by the vehicle-mounted camera shooting the fixed pattern.
[0035] In another optional embodiment, a vehicle-mounted camera may be used to perform mobile shooting of a preset fixed pattern to obtain a video of the fixed pattern shot by the vehicle-mounted camera.
[0036] In the present application, a fixed pattern is photographed by a vehicle-mounted camera to obtain a clearer video, so that the accuracy is higher when testing the vehicle-mounted camera.
[0037] Step S104, intercepting the video to obtain an image frame, wherein the image frame includes brightness information and two chromaticity information.
[0038] The above-mentioned image frame refers to a single still image that constitutes a video in a video file. A video is composed of a series of continuous image frames. In this application, an image frame refers to a single still image that constitutes a video obtained by shooting a fixed pattern with a vehicle-mounted camera.
[0039] The above-mentioned brightness information (Luma, abbreviated as Y) refers to the brightness of the image in the color encoding system. The above-mentioned brightness information is used to represent the grayscale level of the image. In this application, the above-mentioned brightness information refers to the brightness of the image frame in the color encoding system, which is used to represent the grayscale level of the image frame.
[0040] The above two chromaticity information (Luminance, abbreviated as U and V) refer to two chromaticity information representing the chromaticity deviation of blue and yellow and the chromaticity deviation of red and cyan in the image. In the present application, the above two chromaticity information are respectively used to represent the chromaticity deviation of blue and yellow in the image frame, and the chromaticity deviation of red and cyan in the image frame.
[0041] In an optional embodiment, after obtaining a video obtained by shooting a fixed pattern with a vehicle-mounted camera, the video can be intercepted by an image processing unit (IPU) to obtain an image frame at any time in the video, wherein the image frame includes brightness information representing the grayscale of the image frame, and two chromaticity deviations respectively representing the chromaticity deviation of blue and yellow in the image frame and the chromaticity deviation of red and cyan in the image frame.
[0042] In another optional embodiment, after obtaining the video obtained by capturing a fixed graphic with a vehicle-mounted camera, the video can be intercepted by an image controller (IC) to obtain an image frame at any moment in the video, wherein the image frame includes brightness information representing the grayscale of the image frame, and two chromaticity deviations respectively representing the chromaticity deviation between blue and yellow and the chromaticity deviation between red and cyan in the image frame.
[0043] In the present application, image frames are obtained by intercepting the video, and the brightness information and two chromaticity information in the image frames are obtained. By obtaining the brightness information and the two chromaticity information, the description of the image frame is simple and accurate, which effectively improves the accuracy of testing the vehicle-mounted camera.
[0044] Step S106, determining the similarity between the image frame and the preset image.
[0045] The above-mentioned preset image refers to an image of a fixed graphic obtained at the position where the vehicle-mounted camera is about to shoot a video after the fixed graphic is selected, wherein the preset image can be an image taken by placing a camera at the position where the vehicle-mounted camera is about to shoot a video, or it can be an image taken by a successfully tested vehicle-mounted camera at the position where the vehicle-mounted camera is about to shoot a video and capturing an image frame in the video as the preset image.
[0046] The above-mentioned similarity refers to an indicator used to evaluate the degree of similarity between an image frame and a preset image, wherein the above-mentioned similarity can determine the similarity between the image frame and the preset image by the signal-to-noise ratio between the image frame and the preset image, can determine the similarity between the image frame and the preset image by a byte comparison between the image frame and the preset image, and can also determine the similarity between the image frame and the preset image by a comparison of brightness information and two chromaticity information between the image frame and the preset image.
[0047] In an optional embodiment, the similarity between the image frame and the preset image can be determined by the signal-to-noise ratio between the image frame and the preset image, wherein the similarity between the image frame and the preset image is obtained by calculation. Figure 2 is a schematic diagram of an optional vehicle-mounted camera structure according to an embodiment of the present invention, such as Figure 2 As shown, after the vehicle-mounted camera 21 captures the fixed graphic to obtain the video 22, it is transmitted to the image frame capture unit 212 through the vehicle-mounted camera input terminal 211, the image frame is obtained by the image frame capture unit 212, and the similarity between the image frame and the preset image is calculated and determined by the similarity comparison unit 213.
[0048] In another optional embodiment, the similarity between the image frame and the preset image may also be determined by comparing the bytes between the image frame and the preset image, wherein the similarity between the image frame and the preset image is obtained by calculation.
[0049] In another optional embodiment, the similarity between the image frame and the preset image may also be determined by comparing brightness information and two chromaticity information between the image frame and the preset image, wherein the similarity between the image frame and the preset image is obtained by calculation.
[0050] In another optional embodiment, the similarity between the image frame and the preset image may also be determined by a structural similarity index, wherein the structural similarity index is used to measure the phase velocity of the two images in terms of brightness, contrast and structure.
[0051] In the present application, the similarity between the image frame and the preset image is determined by determining the similarity between the image frame and the preset image, so that the similarity between the image frame in the video taken by the vehicle-mounted camera and the preset image can be more accurately judged, which is more accurate than the manual review in the prior art.
[0052] Step S108, determining a test result of the vehicle-mounted camera based on the similarity, wherein the test result is used to indicate whether the vehicle-mounted camera is working normally.
[0053] The above test results are used to determine whether the vehicle-mounted camera can normally generate the required video, wherein the above test results are that the vehicle-mounted camera can work normally, and the vehicle-mounted camera cannot work normally.
[0054] In an optional embodiment, it can be manually determined based on the similarity between the image frame and the preset image whether the similarity between the image frame and the preset image meets the requirements. If the similarity between the image frame and the preset image meets the requirements, the test result of the vehicle camera is determined to be that the vehicle camera can work normally. If the similarity between the image frame and the preset image does not meet the requirements, the test result of the vehicle camera is determined to be that the vehicle camera cannot work normally.
[0055] In another optional embodiment, the program can also judge based on the similarity between the image frame and the preset image whether the similarity between the image frame and the preset image meets the requirements. If the similarity between the image frame and the preset image meets the requirements, the test result of the vehicle camera is determined to be that the vehicle camera can work normally. If the similarity between the image frame and the preset image does not meet the requirements, the test result of the vehicle camera is determined to be that the vehicle camera cannot work normally.
[0056] In the present application, the test result of the vehicle camera is determined by the similarity between the image frame and the preset image to determine whether the vehicle camera can work normally. Determining the test result of the vehicle camera by similarity makes the test result of the vehicle camera more accurate, and obtaining the test result of the vehicle camera is faster, thereby improving the test efficiency of the vehicle camera.
[0057] Through the above steps, the video obtained by the vehicle-mounted camera shooting a fixed pattern is obtained, the video is intercepted to obtain an image frame, the similarity between the image frame and the preset image is determined, and the test result of the vehicle-mounted camera is determined based on the similarity. The present application intercepts the video shot by the vehicle-mounted camera and obtains an image frame, compares the image frame with the preset image based on the brightness information and two chromaticity information of the image frame, obtains the similarity between the image frame and the preset image, and determines the test result of the vehicle-mounted camera based on the similarity. The present application standardizes the test standard of the vehicle-mounted camera by comparing the image frame with the preset image to obtain the similarity, thereby achieving the technical effect of improving the accuracy of the vehicle-mounted camera test, and further solving the technical problem of inaccurate test results of the vehicle-mounted camera caused by the uneven test standards of the vehicle-mounted camera.
[0058] Optionally, determining the similarity between the image frame and the preset image includes: separating the preset components in the image frame to obtain first component information; separating the preset components in the preset image to obtain second component information; determining a signal-to-noise ratio between the first component information and the second component information; and using the signal-to-noise ratio as the similarity.
[0059] The above-mentioned preset components refer to the components obtained by dividing the image frames and are preset before the vehicle-mounted camera test. In the present application, the above-mentioned preset components refer to the components of brightness information or the components of chromaticity information.
[0060] The first component information refers to information in a component of brightness information or a component of chrominance information in an image frame.
[0061] The second component information refers to the information in the components of the brightness information and the two components of the chrominance information in the preset image.
[0062] In an optional embodiment, the components of the brightness information and the two components of the chromaticity information in the image frame are separated to obtain the information in the components of the brightness information and the two components of the chromaticity information in the image frame, and the components of the brightness information and the two components of the chromaticity information in the preset image are separated to obtain the information in the components of the brightness information and the two components of the chromaticity information in the preset image. The signal-to-noise ratio between the first component information and the second component information is determined by the mean square error between the first component information and the second component information, and the signal-to-noise ratio between the first component information and the second component information is used as the similarity. Exemplarily, the preset components of the preset image are the brightness information in the second component information, the blue-yellow information in the second component information, and the red-cyan chromaticity information in the second component information, wherein the brightness information in the second component information, the blue-yellow information in the second component information, and the red-cyan chromaticity information in the second component information together constitute the second component information, and the preset components of the image frame are the brightness information in the first component information, the blue-yellow information in the first component information, and the red-cyan chromaticity information in the first component information, wherein the brightness information in the first component information, the blue-yellow information in the first component information, and the red-cyan chromaticity information in the first component information together constitute the first component information.
[0063] In the present application, the image frame is separated from the preset image by preset components, and the first component information and the second component information are obtained to reduce the amount of calculation of the similarity. By using the signal-to-noise ratio as the similarity, the calculation speed of the signal-to-noise ratio is effectively improved, thereby improving the testing efficiency of the vehicle-mounted camera.
[0064] Optionally, determining the signal-to-noise ratio between the first component information and the second component information includes: determining a mean square error between the first component information and the second component information; and determining the signal-to-noise ratio based on maximum component information and the mean square error of preset components.
[0065] The above-mentioned mean square error (MSE) is a commonly used indicator to measure the accuracy of a prediction model or estimation method, and is mainly used to measure the difference between a predicted value or an estimated value and an actual value. In the present application, the above-mentioned mean square error is used to measure the difference between the first component information and the second component information to determine the degree of matching between the first component information and the second component information.
[0066] In an optional embodiment, after separating the preset components in the image frame to obtain the first component information and separating the preset components in the preset image to obtain the second component information, a mean square error between the first component information and the second component information is determined, wherein the calculation formula of the mean square error is as follows:
[0067]
[0068] Among them, MSE is the mean square error, M refers to the maximum component information of the preset component in the image frame, N refers to the maximum component information of the preset component in the preset image, and x ij is the first component information, y ij is the second component information, where i=1,2,3,…,M and j=1,2,3,…,N.
[0069] After determining the mean square error MSE between the first component information and the second component information, the signal-to-noise ratio between the first component information and the second component information is determined by using the maximum component information and the mean square error of the preset components. The calculation formula of the signal-to-noise ratio between the first component information and the second component information is as follows:
[0070]
[0071] Wherein, PSNR is signal-to-noise ratio and MSE is mean square error. To obtain the signal-to-noise ratio between the first component information and the second component information, since the maximum value of any color is 225, the maximum component information of the preset component is 225.
[0072] In the present application, the signal-to-noise ratio between the first component information and the second component information is determined by the maximum component information and the mean square error, so that the calculation steps of the signal-to-noise ratio are reduced, the calculation speed of the signal-to-noise ratio is effectively improved, and the testing efficiency of the vehicle-mounted camera is improved.
[0073] Optionally, determining the similarity between the image frame and the preset image includes: obtaining multiple first bytes in the image frame and obtaining multiple second bytes in the preset image; and comparing each first byte with each second byte to obtain the similarity.
[0074] The first byte is a byte storing information in an image frame. In an image, information such as pixel values of the image is stored in bytes. In the present application, the image frame information is stored by multiple first bytes.
[0075] The second byte is a byte storing information in a preset image. In an image, information such as pixel values of the image is stored in bytes. In the present application, the preset image information is stored by multiple second bytes.
[0076] In an optional embodiment, multiple first bytes in an image frame are obtained to determine the storage size, resolution, and bit depth of the image frame, multiple second bytes in a preset image are obtained to determine the storage size, resolution, and bit depth of the preset image, each first byte is compared with each second byte, and the similarity between the image frame and the preset image is obtained.
[0077] In the present application, the similarity between the image frame and the preset image is determined by judging the bytes between the image frame and the preset image, and the similarity between the image frame and the preset image is made more accurate by comparing each first byte with the second byte.
[0078] Optionally, determining the similarity between an image frame and a preset image includes: acquiring a first storage file of the image frame and a second storage file of the preset image, wherein component information of different components in the image frame is stored in different byte addresses in the first storage file, and component information of different components in the preset image is stored in different byte addresses in the second storage file; comparing the first storage file and the second storage file byte by byte to obtain sub-similarity of different components; and summarizing the sub-similarity of different components according to the proportion of different components in the image frame to obtain similarity.
[0079] The above-mentioned first storage file refers to a storage file used to store component information of different components in an image frame, wherein the component information of different components in the image frame is stored in different byte addresses in the first storage file.
[0080] The second storage file is a storage file used to store component information of different components in a preset image, wherein the component information of different components in the preset image is stored in different byte addresses in the second storage file.
[0081] Among them, the above-mentioned sub-similarity refers to the sub-similarity of the brightness information component between the image frame and the preset image or the sub-similarity of the two chrominance information components. The similarity between the image frame and the preset image is obtained by summarizing the sub-similarity of the brightness information component between the image frame and the preset image or the sub-similarity of the two chrominance information components.
[0082] In an optional embodiment, after the video is intercepted to obtain an image frame, a first storage file of the image frame and a second storage file of a preset image are obtained. Since the component information of the brightness information component in the image frame and the component information of the two chrominance information components in the image frame are stored in different byte addresses in the first storage file, and the component information of the brightness information component in the preset image and the component information of the two chrominance information components in the preset image are stored in different byte addresses in the second storage file, the first storage file and the second storage file are compared byte by byte to obtain the sub-similarity of the brightness information component and the sub-similarity of the two chrominance information components. The sub-similarity of the brightness information component and the sub-similarity of the two chrominance information components are summarized to obtain the similarity between the image frame and the preset image.
[0083] For example, Figure 3 is a schematic diagram of an optional color coding system according to an embodiment of the present invention. Figure 3As shown, the image frame and the preset image are sampled in a sampling format of 4:2:0, i.e., Y:U:V=4:2:0. The distribution of luminance information Y1, Y2, Y3, Y4, Y5, Y6, Y7, Y8, Y9, Y10, Y11, and Y12, the distribution of blue-yellow information U1, U2, and U3, and the distribution of red-cyan chromaticity information V1, V2, and V3 are shown in FIG. Figure 4 As shown. Among them, Figure 4 is a schematic diagram of an optional storage file according to an embodiment of the present invention, such as Figure 5 As shown, the locations where the brightness information component and the two chrominance information components in the image are stored, that is, the different byte addresses of the storage file are as follows Figure 4 As shown, the different byte addresses of the first storage file of the image frame are the same as the different byte addresses of the second storage file of the preset image. Therefore, the first storage file and the second storage file are compared byte by byte to obtain the sub-similarity of the brightness information component and the sub-similarity of the two chrominance information components. The sub-similarity of the brightness information component and the sub-similarity of the two chrominance information components are summarized to obtain the similarity between the image frame and the preset image.
[0084] In the present application, the first storage file and the second storage file are compared byte by byte to obtain sub-similarity of different components, and the sub-similarity of different components is aggregated to obtain similarity, thereby preventing misalignment and other faults from occurring during the byte comparison process, so as to improve the accuracy of obtaining similarity.
[0085] Optionally, the first storage file and the second storage file are compared byte by byte to obtain sub-similarity of different components, including: determining the first starting address of the different components in the first storage file according to the proportion of the different components in the image frame; comparing the first storage file and the second storage file byte by byte to obtain byte similarity; based on the first starting address, summarizing the byte similarities belonging to the same component to obtain sub-similarity of the same component.
[0086] The first starting address includes a starting address of brightness information, a starting address of blue-yellow chromaticity information, and a starting address of red-cyan chromaticity information.
[0087] In an optional embodiment, after obtaining the first storage file and the second storage file, the starting address of the brightness information, the starting address of the blue-yellow information, and the starting address of the red-cyan chromaticity information are determined according to the proportion of the brightness information, the blue-yellow information, and the red-cyan chromaticity information. After comparing the first storage file and the second storage file byte by byte, the similarity of each byte is obtained, and based on the starting address of the brightness information, the starting address of the blue-yellow information, and the starting address of the red-cyan chromaticity information, the byte similarities of the brightness information are summarized to obtain the sub-similarity of the brightness information, the byte similarities of the blue-yellow information are summarized to obtain the sub-similarity of the blue-yellow information, and the byte similarities of the red-cyan chromaticity information are summarized to obtain the sub-similarity of the red-cyan chromaticity information.
[0088] In the present application, by determining the first starting address, the problem of misalignment in aggregation when obtaining the sub-similarity of the component is prevented, thereby improving the stability of obtaining the sub-similarity of different components.
[0089] Optionally, after capturing the video and obtaining image frames, the method also includes: outputting the image frames on a vehicle display screen; receiving feedback results corresponding to the image frames, wherein the feedback results are used to characterize whether the vehicle camera is working normally; and determining the test results based on the similarity and the feedback results.
[0090] The above feedback result refers to the feedback information fed back by the vehicle display screen indicating whether the vehicle camera is working normally. If the image frame is normal, it is judged that the vehicle camera is working normally. If the image frame is abnormal, it is judged that the vehicle camera is not working normally.
[0091] In an optional embodiment, after obtaining the image frame, the image frame can be output on the vehicle display screen through the High-Definition Multimedia Interface (HDMI), and the feedback result corresponding to the image frame is received. If the image frame is normal, it is determined that the vehicle camera is working normally, and the test result is determined based on the similarity. If the image frame is abnormal, it is determined that the vehicle camera is not working properly, and the vehicle camera needs to be adjusted to make it work normally before determining the test result based on the similarity. For example, Figure 2 As shown, the image frame interception unit 212 outputs the image frame to the vehicle-mounted display screen 23 through the similarity comparison unit 213 to obtain a feedback result corresponding to the image frame.
[0092] In this application, whether the vehicle camera is working normally is judged by the feedback results corresponding to the image frame, avoiding testing the vehicle camera when it is blocked. When the image frame is abnormal, it is judged that the vehicle camera is not working normally, and the vehicle camera needs to be adjusted to make it work normally before determining the test result based on the similarity, which effectively improves the reliability of vehicle camera detection.
[0093] Example 2
[0094] According to another aspect of an embodiment of the present invention, a testing device for a vehicle-mounted camera is also provided, which can execute the testing method for the vehicle-mounted camera of the vehicle in the above embodiment. The specific implementation method and preferred application scenario are the same as those in the above embodiment and will not be repeated here.
[0095] Figure 5 is a schematic structural diagram of an optional vehicle camera testing device according to an embodiment of the present invention, such as Figure 5 As shown, the device includes: an acquisition module 50, used to acquire a video obtained by shooting a fixed pattern with a vehicle-mounted camera; an interception module 52, used to intercept the video to obtain an image frame, wherein the image frame includes brightness information and two chromaticity information; a first determination module 54, used to determine the similarity between the image frame and a preset image; a second determination module 56, used to determine a test result of the vehicle-mounted camera based on the similarity, wherein the test result is used to characterize whether the vehicle-mounted camera is working normally.
[0096] Optionally, the first determination module includes: a first separation unit, used to separate preset components in the image frame to obtain first component information; a second separation unit, used to separate preset components in the preset image to obtain second component information; a first determination unit, used to determine the signal-to-noise ratio between the first component information and the second component information; and a determination unit, used to use the signal-to-noise ratio as similarity.
[0097] Optionally, the determination unit includes: a first calculation unit, used to determine a mean square error between the first component information and the second component information; and a second calculation unit, used to determine a signal-to-noise ratio based on maximum component information and the mean square error of preset components.
[0098] Optionally, the first determination module further includes: a first acquisition unit, used to acquire multiple first bytes in the image frame and multiple second bytes in the preset image; and a first comparison unit, used to compare each first byte with each second byte to obtain a similarity.
[0099] Optionally, the first determination module also includes: a second acquisition unit, used to acquire a first storage file of an image frame and a second storage file of a preset image, wherein component information of different components in the image frame is stored in different byte addresses in the first storage file, and component information of different components in the preset image is stored in different byte addresses in the second storage file; a second comparison unit, used to compare the first storage file and the second storage file byte by byte to obtain sub-similarity of different components; a second determination unit, used to summarize the sub-similarity of different components according to the proportion of different components in the image frame to obtain similarity.
[0100] Optionally, the second comparison unit includes: an address sub-unit, used to determine the first starting addresses of different components in the first storage file according to the proportions of different components in the image frame; a comparison sub-unit, used to compare the first storage file and the second storage file byte by byte to obtain byte similarity; an acquisition sub-unit, used to summarize the byte similarities belonging to the same component based on the first starting address to obtain sub-similarity of the same component.
[0101] Optionally, the device also includes: a display module, used to output image frames on a vehicle-mounted display screen; a feedback module, used to receive feedback results corresponding to the image frames, wherein the feedback results are used to characterize whether the vehicle-mounted camera is working normally; and a test module, used to determine the test results based on the similarity and the feedback results.
[0102] Example 3
[0103] According to another aspect of an embodiment of the present invention, a testing system for a vehicle-mounted camera is also provided. The system can execute the testing method for the vehicle-mounted camera of the vehicle of the above embodiment. The specific implementation method and preferred application scenario are the same as those of the above embodiment and will not be repeated here.
[0104] The vehicle-mounted camera test system includes: a vehicle-mounted camera, which is used to shoot a fixed image and generate a video; a controller, which is connected to the vehicle-mounted camera and is used to intercept the video to obtain an image frame, determine the similarity between the image frame and a preset image, and determine the test result of the vehicle-mounted camera based on the similarity, wherein the image frame contains brightness information and two chromaticity information, and the test result is used to characterize whether the vehicle-mounted camera is working normally.
[0105] Example 4
[0106] According to another aspect of an embodiment of the present invention, a vehicle is further provided, which includes the testing system for the vehicle-mounted camera of the above-mentioned embodiment and can execute the testing method for the vehicle-mounted camera of the above-mentioned embodiment. The specific implementation method and preferred application scenario are the same as those of the above-mentioned embodiment and will not be repeated here.
[0107] Example 5
[0108] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.
[0109] Example 6
[0110] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.
[0111] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0112] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0113] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0114] 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 on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0116] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0117] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for testing a vehicle-mounted camera, characterized in that: include: Obtain the video obtained by the vehicle-mounted camera shooting a fixed graphic; Intercepting the video to obtain an image frame, wherein the image frame includes brightness information and two chromaticity information; Determining the similarity between the image frame and a preset image; A test result of the vehicle-mounted camera is determined based on the similarity, wherein the test result is used to indicate whether the vehicle-mounted camera operates normally.
2. The method according to claim 1, characterized in that Determining the similarity between the image frame and a preset image includes: Separating the preset components in the image frame to obtain first component information; Separating the preset component in the preset image to obtain second component information; determining a signal-to-noise ratio between the first component information and the second component information; The signal-to-noise ratio is used as the similarity.
3. The method according to claim 2, characterized in that Determining a signal-to-noise ratio between the first component information and the second component information includes: determining a mean square error between the first component information and the second component information; The signal-to-noise ratio is determined based on the maximum component information of the preset components and the mean square error.
4. The method according to claim 1, characterized in that: Determining the similarity between the image frame and a preset image includes: Acquire a plurality of first bytes in the image frame, and acquire a plurality of second bytes in the preset image; Each first byte is compared with each second byte to obtain the similarity.
5. The method according to claim 1, characterized in that Determining the similarity between the image frame and a preset image includes: Acquire a first storage file of the image frame and a second storage file of the preset image, wherein component information of different components in the image frame is stored in different byte addresses in the first storage file, and component information of different components in the preset image is stored in different byte addresses in the second storage file; Comparing the first stored file and the second stored file byte by byte to obtain sub-similarity of different components; According to the proportions of the different components in the image frame, the sub-similarity of the different components is summarized to obtain the similarity.
6. The method according to claim 5, characterized in that Comparing the first storage file and the second storage file byte by byte to obtain sub-similarity of different components includes: Determine, according to the proportions of the different components in the image frame, first starting addresses of the different components in the first storage file; Comparing the first stored file and the second stored file byte by byte to obtain byte similarity; Based on the first starting address, the byte similarities belonging to the same component are aggregated to obtain the sub-similarity of the same component.
7. The method according to any one of claims 1 to 6, characterized in that: After intercepting the video to obtain an image frame, the method further includes: Outputting the image frame on a vehicle-mounted display screen; Receiving a feedback result corresponding to the image frame, wherein the feedback result is used to indicate whether the vehicle-mounted camera is working normally; The test result is determined based on the similarity and the feedback result.
8. A vehicle camera testing device, characterized in that: include: An acquisition module is used to acquire a video obtained by shooting a fixed pattern with a vehicle-mounted camera; An interception module, used for intercepting the video to obtain an image frame, wherein the image frame includes brightness information and two chromaticity information; A first determination module, used to determine the similarity between the image frame and a preset image; The second determination module is used to determine the test result of the vehicle-mounted camera based on the similarity, wherein the test result is used to indicate whether the vehicle-mounted camera works normally.
9. A vehicle camera testing system, characterized in that: include: The vehicle-mounted camera is used to shoot fixed images and generate videos; A controller is connected to the vehicle-mounted camera, and is used to intercept the video to obtain an image frame, determine the similarity between the image frame and a preset image, and determine a test result of the vehicle-mounted camera based on the similarity, wherein the image frame includes brightness information and two chromaticity information, and the test result is used to characterize whether the vehicle-mounted camera is working normally.
10. A vehicle, characterized in that: include: The vehicle-mounted camera testing system as described in claim 9.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
12. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.
