Hardware-in-the-loop test method, device and system for controller

By calibrating the projected image in perspective, it is closer to the images captured by the real vehicle camera, which solves the problem of inaccurate video signals in the hardware in the ring test and improves the accuracy and reliability of the test.

CN119882695AActive Publication Date: 2025-04-25CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202510069327.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-04-25
Estimated Expiration
2045-01-16

AI Technical Summary

Technical Problem

The video signal of the hardware in-loop test is inaccurate, resulting in the test results of the controller to be tested inaccurate enough.

Method used

By calibrating the view angle of the projected image based on the real image, adjusting the view angle of the projected image to make it closer to the image angle and size taken by the real vehicle camera, thereby improving the accuracy of the video signal.

Benefits of technology

Through the perspective calibration of the projected image, the similarity between the projected image and the real vehicle shooting scene is improved, making the test environment and test data more realistic, and the accuracy of the video signal and the test reliability of the controller to be tested are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119882695A_ABST
    Figure CN119882695A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of automatic driving test, and discloses a hardware-in-the-loop test method, device and system for a controller, and the method comprises the steps: calibrating the visual angle of a projection image based on a real image which is a road image collected by a camera at a to-be-tested position on a real vehicle, the projection image is a simulated road image displayed on the electronic display screen; controlling a camera obscura camera in the video camera obscura to shoot a projection image; and controlling the camera obscura camera to send the collected video signal to the controller to be tested, so as to test the controller to be tested through the video signal. According to the invention, the test environment and the test data are more real, the accuracy of the video signal is improved, and the test reliability of the subsequent to-be-tested controller is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of autonomous driving testing technology, and in particular to a hardware-in-the-loop testing method, device and system for a controller. Background Art

[0002] Hardware-in-the-loop testing in the field of intelligent driving refers to generating vehicle signals through simulation and transmitting the simulated signals to the controller under test to test whether the controller under test can make correct decisions after receiving the simulated vehicle signals. Among them, some test items of the controller under test require the use of road video signals collected by the vehicle. In order to simulate the road video signals, some test systems are implemented by arranging a video darkbox. Specifically, an electronic display screen is installed on one side of the video darkbox and a camera is installed on the other side. Then, the simulated road scene is played on the electronic display screen. The camera on the other side simulates the road video signal collected by the vehicle by shooting the electronic display screen, and then transmits the shot video signal to the controller under test for relevant tests. However, the video images captured by the camera in the video darkbox are often different from the image angles and image sizes captured by the camera on the vehicle, resulting in inaccurate test results for the controller under test using inaccurate images. Summary of the invention

[0003] In view of this, the present invention provides a method, device and system for hardware-in-the-loop testing of a controller to solve the problem of inaccurate video signals in hardware-in-the-loop testing.

[0004] In a first aspect, the present invention provides a hardware-in-the-loop testing method for a controller, the method comprising: calibrating the viewing angle of a projection image based on a real image, the real image being a road image captured by a camera at a position to be tested on a real vehicle, and the projection image being a simulated road image for display on an electronic display screen; controlling a darkbox camera in a video darkbox to capture the projection image; controlling the darkbox camera to send the captured video signal to the controller to be tested, so as to test the controller to be tested through the video signal.

[0005] According to the above-mentioned technical means, before the electronic display screen plays the projection image, the present invention first calibrates the simulated road image viewing angle according to the real camera shooting angle on the real vehicle, so as to obtain the calibrated projection image, and then displays the projection image on the electronic display screen, and then controls the darkbox camera to collect the calibrated projection image, so as to test the controller to be tested. By calibrating the projection image, the similarity between the projection image and the real vehicle shooting scene is further improved, thereby making the test environment and test data more realistic, improving the accuracy of the video signal, and then improving the test reliability of the subsequent controller to be tested.

[0006] In some optional embodiments, the viewing angle of the projected image is calibrated based on the real image, including: creating a virtual space, and setting a virtual vehicle model and a virtual calibration plate in the virtual space, the virtual vehicle model including a virtual camera, and the virtual calibration plate being set at a position that the virtual camera can capture; importing a real image, the real image including a real calibration plate; overlapping and comparing the real image and the virtual space image captured by the virtual camera; if the comparison result indicates that the virtual calibration plate and the real calibration plate do not overlap, adjusting the position of the virtual calibration plate in the virtual space, and adjusting the shooting parameters of the virtual camera; when the comparison result indicates that the virtual calibration plate and the real calibration plate overlap, completing the shooting parameter calibration of the virtual camera; creating a virtual road environment; controlling the virtual camera to capture images of the virtual road environment based on the calibrated shooting parameters to obtain a calibrated projection image.

[0007] According to the above technical means, the present invention sets a virtual calibration plate and a virtual vehicle model in the created virtual space, and then imports the real image shot by the real vehicle into it, and takes the overlap of the real calibration plate and the virtual calibration plate in the real image as the standard, adjusts the position of the virtual calibration plate and the shooting parameters of the virtual camera, and when the real calibration plate and the virtual calibration plate overlap, the perspective of the virtual camera can be considered to be consistent with the perspective of the real camera on the real vehicle, thereby completing the calibration. Then, the adjusted shooting parameters are used to control the virtual camera to collect images of the virtual road environment, and a more realistic road simulation image can be obtained.

[0008] In some optional embodiments, before testing the controller to be tested through a video signal, it also includes: obtaining preset lane line parameters; reading captured lane line parameters from the video signal; calculating parameter errors between captured lane line parameters and preset lane line parameters; when the parameter error is greater than a preset error threshold, performing a secondary adjustment on the shooting parameters of the virtual camera; based on the secondary adjusted shooting parameters, controlling the virtual camera to re-capture the image of the virtual road environment to obtain a secondary adjusted projection image; and returning to the step of controlling the darkbox camera in the video darkbox to capture the projection image.

[0009] According to the above technical means, after the projection image is captured by the darkroom camera, the present invention does not directly conduct a test, but measures the relevant shooting lane line parameters in the video signal collected by the darkroom camera based on the image display software, and then compares the shooting lane line parameters with the preset lane line parameters when creating the virtual scene, and analyzes the error between the two. If the error between the two is within the allowable range, subsequent tests can be performed. If the error between the two is large, the shooting parameters of the virtual camera are adjusted for the second time, and the video signal is collected again until the error between the shooting lane line parameters and the preset lane line parameters is reduced to the allowable range. The projection image is further calibrated through the secondary fine-tuning process, thereby improving the accuracy of the video signal collected by the darkroom camera.

[0010] In some optional embodiments, the darkbox camera is installed in the video darkbox via an adjustable base mechanism. Before the controller to be tested is tested via a video signal, the process also includes: adjusting the adjustable base mechanism according to the shooting effect of the video signal to change the position of the darkbox camera; and returning to the step of controlling the darkbox camera in the video darkbox to shoot the projected image.

[0011] According to the above technical means, the darkbox camera is installed in the video darkbox through an adjustable base mechanism. When the shooting effect is not clear enough or the angle is not good enough, the position of the darkbox camera in the darkbox can be adjusted through the adjustable base mechanism, thereby improving the image shooting clarity and further improving the display effect of the video signal.

[0012] In some optional embodiments, the adjustable base mechanism is adjusted according to the shooting effect of the video signal, including: setting a virtual obstacle in the projected image, and recording the setting distance from the virtual obstacle to the virtual camera; measuring the first observation distance from the virtual obstacle to the darkroom camera in the video signal; and adjusting the adjustable base mechanism according to a first error between the setting distance and the first observation distance.

[0013] According to the above technical means, after the projection image is calibrated once by adjusting the shooting parameters of the virtual camera, adjusting the darkbox camera through the adjustable base mechanism can be regarded as a secondary calibration. The present invention sets a virtual obstacle in the projection image, and the setting distance between the virtual obstacle and the virtual camera is known. The video signal obtained by shooting the projection image with the darkbox camera is used to measure the first observation distance from the virtual obstacle to the darkbox camera. After comparing the first observation distance and the setting distance, if the two are almost the same, it means that the front and rear positions of the darkbox camera are not much different from the position of the camera on the real vehicle. If the two distances are greatly different, it means that the front and rear positions of the darkbox camera and the camera on the real vehicle are greatly different. The front and rear positions of the darkbox camera can be further changed through the adjustable base mechanism, thereby further improving the accuracy of the video signal.

[0014] In some optional embodiments, the method also includes: measuring a second observation distance from the virtual obstacle to the darkroom camera from the received video signal through a test program of the controller to be tested; comparing the set distance and the second observation distance; when the second error between the set distance and the second observation distance is less than a preset error threshold, controlling the controller to be tested to continue to perform the test; when the second error between the set distance and the second observation distance is greater than or equal to the preset error threshold, returning to the step of calibrating the viewing angle of the projected image based on the real image.

[0015] According to the above technical means, during the test process, the controller to be tested is used again to repeat the observation distance and set distance comparison process of the virtual obstacle, and the accuracy of the calibration is further determined based on the output result of the controller to be tested. If it is accurate, the test is continued, otherwise the above calibration is repeated, thereby improving the calibration reliability.

[0016] In a second aspect, the present invention provides a hardware-in-the-loop testing device for a controller, the device comprising: a projection image calibration module, used to calibrate the viewing angle of the projection image based on a real image, the real image is a road image captured by a camera at a position to be tested on a real vehicle, and the projection image is a simulated road image for display on an electronic display screen; a shooting module, used to capture the projection image using a darkbox camera in a video darkbox; a data transmission module, used to control the darkbox camera to send the captured video signal to the controller to be tested, so as to test the controller to be tested through the video signal.

[0017] In a third aspect, the present invention provides a hardware-in-the-loop test system for a controller, comprising: a host computer, a real-time machine, a video darkbox, an electronic display screen, a darkbox camera, and a controller to be tested; the host computer is used to execute the steps of calibrating the viewing angle of a projection image based on a real image, and to control the real-time machine; the real-time machine is used to output a vehicle virtual signal; the video darkbox is used to provide an environment for collecting simulated road images, the electronic display screen and the darkbox camera are respectively installed at both ends of the video darkbox, the electronic display screen is used to display simulated road images, and the darkbox camera is used to shoot simulated road images and send the shot video signals to the controller to be tested.

[0018] In some optional embodiments, the system further includes an adjustable base mechanism, and the darkbox camera is installed in the video darkbox via the adjustable base mechanism, and the adjustable base mechanism is used to adjust the position of the darkbox camera in the video darkbox.

[0019] In some optional implementations, a CAN board, an analog quantity board, and a digital quantity board are installed in the real-time machine.

[0020] The technical solution provided by the present invention has the following advantages:

[0021] (1) According to the above technical means, before the projection image is played on the electronic display screen, the present invention first calibrates the viewing angle of the simulated road image according to the shooting angle of the real camera on the real vehicle, so as to obtain the calibrated projection image, and then displays the projection image on the electronic display screen, and then controls the darkroom camera to collect the calibrated projection image, so as to test the controller to be tested. By calibrating the projection image, the similarity between the projection image and the real vehicle shooting scene is further improved, thereby making the test environment and test data more realistic, improving the accuracy of the video signal, and further improving the test reliability of the subsequent controller to be tested.

[0022] (2) According to the above technical means, the present invention sets a virtual calibration plate and a virtual vehicle model in the created virtual space, and then imports the real image shot by the real vehicle into it. Taking the overlap of the real calibration plate and the virtual calibration plate in the real image as the standard, the position of the virtual calibration plate and the shooting parameters of the virtual camera are adjusted. When the real calibration plate and the virtual calibration plate overlap, the perspective of the virtual camera can be considered to be consistent with the perspective of the real camera on the real vehicle, thereby completing the calibration. Then, the adjusted shooting parameters are used to control the virtual camera to capture the image of the virtual road environment, so that a more realistic road simulation image can be obtained.

[0023] (3) According to the above technical means, after the projection image is captured by the darkroom camera, the present invention does not directly conduct a test, but measures the relevant captured lane line parameters in the captured video signal based on the image display software, and then compares the captured lane line parameters with the preset lane line parameters when creating the virtual scene, and analyzes the error between the two. If the error between the two is within the allowable range, subsequent tests can be performed. If the error between the two is large, the shooting parameters of the virtual camera are adjusted for the second time, and the video signal is captured again until the error between the captured lane line parameters and the preset lane line parameters is reduced to the allowable range. In this way, the projection image is further calibrated through the process of secondary fine-tuning, thereby improving the accuracy of the video signal captured by the darkroom camera.

[0024] (4) According to the above technical means, the darkbox camera is installed in the video darkbox through an adjustable base mechanism. When the shooting effect is not clear enough or the angle is not good enough, the position of the darkbox camera in the darkbox can be adjusted through the adjustable base mechanism, thereby improving the image shooting clarity and further improving the display effect of the video signal.

[0025] (5) According to the above technical means, after the projection image is calibrated once by adjusting the shooting parameters of the virtual camera, adjusting the darkroom camera through the adjustable base mechanism can be regarded as a secondary calibration. The present invention sets a virtual obstacle in the projection image, and the setting distance between the virtual obstacle and the virtual camera is known. Then, the video signal obtained by shooting the projection image with the darkroom camera is used to measure the first observation distance from the virtual obstacle to the darkroom camera. After comparing the first observation distance with the setting distance, if the two are almost the same, it means that the front and rear positions of the darkroom camera are not much different from the virtual camera position. If the two distances differ greatly, it means that the front and rear positions of the darkroom camera and the virtual camera are quite different. The front and rear positions of the darkroom camera can be further changed through the adjustable base mechanism, thereby further improving the accuracy of the video signal.

[0026] (6) According to the above technical means, during the test process, the controller under test is used again to repeat the process of comparing the observed distance and the set distance of the virtual obstacle. Based on the output result of the controller under test, it is further determined whether the calibration is accurate. If it is accurate, the test is continued. Otherwise, the above calibration is repeated, thereby improving the calibration reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 is a structural schematic diagram of a hardware-in-the-loop test system for a controller according to an embodiment of the present invention;

[0029] Figure 2 is a flowchart of a hardware-in-the-loop testing method for a controller according to an embodiment of the present invention;

[0030] Figure 3 is another flowchart of a hardware-in-the-loop testing method for a controller according to an embodiment of the present invention;

[0031] Figure 4 is another flowchart of a hardware-in-the-loop testing method for a controller according to an embodiment of the present invention;

[0032] Figure 5 is another structural schematic diagram of a hardware-in-the-loop test system for a controller according to an embodiment of the present invention;

[0033] Figure 6It is a structural schematic diagram of a hardware-in-the-loop testing device of a controller according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0035] According to an embodiment of the present invention, a hardware-in-the-loop test system for a controller is provided, such as Figure 1 As shown, it includes: a host computer, a real-time machine, a video dark box, an electronic display screen, a dark box camera, and a controller to be tested.

[0036] Among them, the host computer is the main center for generating a series of control strategies and executing the control strategies. The host computer can be a personal computer. The strategies it executes include the strategies for calibrating the viewing angle of the projected image based on the real image in the subsequent method embodiments, generating a virtual projected image and inputting the projected image into the electronic display screen, etc. The real-time machine is installed with simulation software, and it is necessary to simulate the dynamic response of the vehicle by generating a virtual signal of the vehicle, such as the throttle, brake, etc., so as to input the virtual signal of the vehicle into the controller to be tested for testing, and the real-time machine is connected to the controller to be tested by a hard line. Because the work of the real-time machine is more complicated, the real-time machine is a more powerful computer, such as a server device, and the real-time machine is connected to the host computer through a network cable communication. The video dark box is used to provide a collection environment for the projected image to block the ambient light and avoid affecting the display effect of the electronic display screen. The electronic display screen and the dark box camera are respectively installed at both ends of the video dark box, and the center line of the electronic display screen and the dark box camera are in the same straight line. The electronic display screen is connected to the host computer through an LVDS cable to display the projection image generated by the host computer. The darkroom camera is a real camera connected to the controller under test through a connecting line to shoot the projection image and send the shot video signal to the controller under test to provide test data for the controller under test.

[0037] In some optional implementations, a CAN board, an analog board, and a digital board are installed in the real-time machine, wherein the CAN board is used to simulate the CAN signals required by the system, the analog board is used to simulate some analog signals required by the controller to be tested, and the digital board simulates the switch signals and control signals required by the controller to be tested.

[0038] In some optional embodiments, an adjustable base mechanism is also installed in the video darkbox, and the darkbox camera is installed in the video darkbox through the adjustable base mechanism. In some specific embodiments, the adjustable base mechanism includes but is not limited to a six-degree-of-freedom adjustment platform, a three-degree-of-freedom pan-tilt bracket, etc., wherein the adjustable base mechanism is mainly used to adjust the position of the darkbox camera in the video darkbox, including front, back, left, right, up, down and in-situ rotation angles. As long as the mechanism can achieve the position adjustment of the darkbox camera, it can be applied. The embodiments of the present invention do not make special limitations on the specific structure of the mechanism. For example, the six-degree-of-freedom adjustment platform and three-degree-of-freedom pan-tilt bracket used are both prior art and will not be repeated in the present invention.

[0039] According to an embodiment of the present invention, there is also provided an embodiment of a hardware-in-the-loop testing method for a controller, which is applied to the above-mentioned in-the-loop testing system. 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.

[0040] In this embodiment, a hardware-in-the-loop testing method for a controller is provided. Figure 2 1 is a flowchart of a hardware-in-the-loop test method for a controller according to an embodiment of the present invention, and the process includes the following steps:

[0041] Step S201, calibrating the viewing angle of the projection image based on the real image, where the real image is a road image captured by a camera at a position to be measured on a real vehicle, and the projection image is a simulated road image for display on an electronic display screen;

[0042] Step S202, controlling the dark box camera in the video dark box to capture the projection image;

[0043] Step S203, controlling the dark box camera to send the collected video signal to the controller to be tested, so as to test the controller to be tested through the video signal.

[0044] Specifically, when conducting hardware-in-the-loop testing, the controller under test needs to control the darkbox camera to capture the projection image on the electronic display screen. The projection image is a simulated road image generated by the host computer. After the darkbox camera captures the projection image on the electronic display screen, the captured video signal is transmitted to the controller under test to "fool" the controller under test and make it believe that the received video signal is the real road scene captured by the vehicle camera, so as to conduct subsequent tests.

[0045] Therefore, in order to make the projected image on the electronic display screen more realistic, the present invention first calibrates the perspective of the simulated road image according to the real image captured by the real camera on the real vehicle before playing the projected image on the electronic display screen, and adjusts the distance, perspective, field of view, etc. of the projected image so that the visual effect of the projected image is almost the same as the real image, thereby obtaining a calibrated projected image. Then, this embodiment displays the calibrated projected image on the electronic display screen, and then controls the dark box camera to collect the calibrated projected image, so as to test the controller to be tested. The present invention further improves the similarity between the projected image and the real vehicle shooting scene by calibrating the projected image, thereby making the test environment and test data more realistic, improving the accuracy of the video signal, and further improving the test reliability of the subsequent controller to be tested.

[0046] In some optional embodiments, Figure 3 As shown, the above step S201 includes:

[0047] Step a1, creating a virtual space, and setting a virtual vehicle model and a virtual calibration plate in the virtual space, wherein the virtual vehicle model includes a virtual camera, and the virtual calibration plate is set at a position that can be photographed by the virtual camera;

[0048] Step a2, importing a real image, where the real image includes a real calibration plate;

[0049] Step a3, overlapping and comparing the real image and the virtual space image captured by the virtual camera;

[0050] Step a4: if the comparison result indicates that the virtual calibration plate and the real calibration plate do not overlap, the position of the virtual calibration plate in the virtual space is adjusted, and the shooting parameters of the virtual camera are adjusted;

[0051] Step a5: when the comparison result indicates that the virtual calibration plate and the real calibration plate coincide with each other, the shooting parameter calibration of the virtual camera is completed;

[0052] Step a6, creating a virtual road environment;

[0053] Step a7, controlling the virtual camera to capture images of the virtual road environment based on the calibrated shooting parameters to obtain a calibrated projection image.

[0054] Specifically, the image calibration method provided by the present invention aims to improve the real effect of the projected image and make the display angle of the projected image closer to the shooting angle of the external camera on the real vehicle. First, the present invention first creates a virtual space on the host computer, and the virtual space can be understood as a 3D animation space. Then, a virtual vehicle model and a virtual calibration plate are set in the virtual space, wherein the virtual vehicle model is a 3D model created based on the structural parameters of the real vehicle, and the virtual calibration plate is a virtual plate with some special marks drawn on it, for example, 6 square marks with different positions are drawn on the virtual calibration plate, which is only an example and is not limited to this.

[0055] Among them, the virtual vehicle model includes a virtual camera. The virtual camera is also a 3D model created based on the structural parameters of the camera on the real vehicle. It is used to simulate the shooting function of the real vehicle camera, and the placement position of the virtual calibration plate is set at a position that the virtual camera can capture.

[0056] Before calibration, you also need to prepare a real image. The real image refers to the image of the real vehicle taken by the on-board camera and includes the real calibration plate. The real calibration plate refers to a plate in real life with the same special marks as the virtual calibration plate drawn on its surface, such as 6 square marks in different positions, and the size is the same as the set virtual calibration plate.

[0057] When calibrating, first roughly set the distance between the virtual calibration plate and the virtual vehicle model, and ensure that the virtual camera can capture the virtual calibration plate. The virtual camera needs to adjust the resolution to be consistent with the real camera. The virtual camera captures the virtual calibration plate to obtain a virtual space image. Then, import the real image into the virtual space. Because the calibration plate is captured in both the virtual space image and the real image, the real image and the virtual space image are overlapped for comparison. Because the placement of the virtual calibration plate and the shooting parameters of the virtual camera are different from those in the real world, the calibration plates in the real image and the virtual space image cannot completely overlap. At this time, the embodiment of the present invention fine-tunes the placement of the virtual calibration plate and the shooting parameters of the virtual camera.

[0058] Among them, the shooting parameters of the virtual camera include but are not limited to the pitch angle, horizontal position, focal length and other internal and external parameters of the virtual camera. It should be noted that since the relative distance data between the real calibration plate and the real vehicle is based on the center of the rear axle of the real vehicle as the origin of the coordinate axis, and the origin of the virtual vehicle model coordinate is at the intersection of the rear center axis and the ground, after the coordinate data conversion, the position of the virtual calibration plate is adjusted according to the coordinate error. By repeatedly adjusting the position of the virtual calibration plate and the shooting parameters of the virtual camera, the virtual space image is continuously collected through the virtual camera until the virtual calibration plate in the virtual space image and the real calibration plate in the real image completely overlap, it can be considered that the shooting parameters such as the angle, position, focal length and the real camera on the real vehicle are consistent, so that the captured virtual space image is more accurate, and the perspective calibration of the projected image is completed.

[0059] After the calibration is completed, the virtual space image captured at this time still has a virtual calibration plate and cannot be directly displayed on the electronic display screen. The image is not directly used as a simulated road image for testing, so it is necessary to create a virtual road environment, and then use the aforementioned calibrated shooting parameters to control the virtual camera to capture the image of the virtual road environment. The captured image is the calibrated projection image, which is the image that needs to be displayed on the electronic display screen.

[0060] Through the solution provided by the embodiment of the present invention, a virtual calibration plate and a virtual vehicle model are set in the created virtual space, and then the real image shot by the real vehicle is imported into it. The position of the virtual calibration plate and the shooting parameters of the virtual camera are adjusted based on the overlap of the real calibration plate and the virtual calibration plate in the real image. When the real calibration plate and the virtual calibration plate overlap, the viewing angle of the virtual camera can be considered to be consistent with the viewing angle of the real camera on the real vehicle, thereby completing the calibration. Then, the virtual camera is controlled to capture the image of the virtual road environment using the adjusted shooting parameters, so that a more realistic road simulation image can be obtained, which improves the accuracy of the image displayed on the electronic display screen.

[0061] Specifically, Figure 4 As shown, in some optional implementation manners, before testing the controller to be tested, a controller hardware-in-the-loop testing method provided by the present invention further includes the following steps:

[0062] Step b1, obtaining preset lane line parameters;

[0063] Step b2, reading the lane line parameters from the video signal;

[0064] Step b3, calculating the parameter error between the captured lane line parameters and the preset lane line parameters;

[0065] Step b4, when the parameter error is greater than a preset error threshold, the shooting parameters of the virtual camera are adjusted for a second time;

[0066] Step b5, based on the second adjusted shooting parameters, controlling the virtual camera to re-capture images of the virtual road environment to obtain a second adjusted projection image;

[0067] Step b6, returning to the step of controlling the dark box camera in the video dark box to capture the projection image.

[0068] Specifically, after the projection image is captured by the dark box camera, the present invention does not directly test it, but also provides a method for calibrating and fine-tuning the projection image. First, the captured video signal is displayed in other devices based on the image display software, such as Figure 5 As shown, the image display software is software installed in an external smart device and is used to display and edit video signals.

[0069] The image display software measures the relevant captured lane line parameters in the collected video signal through the lane line extraction algorithm (the lane line extraction algorithm is a prior art, and the implementation principle is not repeated here). The captured lane line parameters measured by the present invention include but are not limited to lane line width, distance between lane lines, etc. Since the parameters of the lane lines in the virtual space have preset values ​​when creating the virtual scene, the embodiment of the present invention compares the captured lane line parameters with the preset lane line parameters when creating the virtual scene, and analyzes the error between the two. If the error between the two is within the preset allowable range, it means that the display effect of the projected image on the electronic display screen is good, and subsequent tests can be performed. If the error between the captured lane line parameters and the preset lane line parameters is large, it means that the display effect of the projected image on the electronic display screen is not good enough. The embodiment of the present invention will make a secondary adjustment to the shooting parameters of the virtual camera, and the secondary adjustment is a small fine-tuning, and then re-collect the video signal until the error between the captured lane line parameters and the preset lane line parameters is reduced to the allowable range. Through the technical solution provided by the embodiment of the present invention, the projection image is further calibrated based on the secondary fine-tuning process, and the accuracy of the darkroom camera in collecting video signals is improved.

[0070] In some optional embodiments, the dark box camera is installed in the video dark box through an adjustable base mechanism, and before the controller to be tested is tested through a video signal, the method further includes:

[0071] Step c1, adjusting the adjustable base mechanism according to the shooting effect of the video signal to change the position of the darkroom camera;

[0072] Step c2, returning to the step of controlling the dark box camera in the video dark box to capture the projection image.

[0073] Specifically, the darkbox camera is installed in the video darkbox through an adjustable base mechanism. When the shooting effect is not clear enough or the angle is not good enough, the position of the darkbox camera in the darkbox can be adjusted through the adjustable base mechanism, thereby improving the image shooting clarity and further improving the display effect of the video signal.

[0074] In some optional implementations, the above step c1 includes:

[0075] Step d1, setting a virtual obstacle in the projection image and recording the setting distance from the virtual obstacle to the virtual camera;

[0076] Step d2, measuring a first observation distance from a virtual obstacle in a video signal to a darkroom camera;

[0077] Step d3, adjusting the adjustable base mechanism according to a first error between the set distance and the first observation distance.

[0078] Specifically, after the projection image is calibrated once by adjusting the shooting parameters of the virtual camera, the embodiment of the present invention can also change the position of the dark box camera through the adjustable base mechanism, so as to perform a secondary calibration and obtain a more accurate video signal. The specific steps are as follows: the present invention sets a virtual obstacle in the projection image, and the setting distance between the virtual obstacle and the virtual camera is known, and then uses the dark box camera to shoot the projection image to obtain a video signal, and uses the image display software to measure the first observation distance from the virtual obstacle to the dark box camera. Afterwards, the first observation distance and the setting distance are compared. If the two are almost the same, it means that the front and rear positions of the dark box camera and the setting position of the virtual camera are not much different, and the dark box camera does not need to be adjusted. If the first observation distance and the setting distance differ greatly, it means that the front and rear positions of the dark box camera and the virtual camera differ greatly. For example, the front and rear positions of the dark box camera can be further changed by adjusting the six-degree-of-freedom platform, and then the error between the first observation distance and the setting distance is re-shot and judged until the error between the two is less than the preset error threshold, thereby further improving the accuracy of the video signal.

[0079] In some optional implementations, the hardware-in-the-loop testing method for the controller provided by the present invention further includes:

[0080] Step e1, measuring a second observation distance from the virtual obstacle to the darkroom camera from the received video signal through a test program of the controller to be tested;

[0081] Step e2, comparing the set distance and the second observation distance;

[0082] Step e3, when the second error between the set distance and the second observation distance is less than a preset error threshold, controlling the controller to be tested to continue to perform the test;

[0083] Step e4, when the second error between the set distance and the second observation distance is greater than or equal to a preset error threshold, return to the step of calibrating the viewing angle of the projection image based on the real image.

[0084] Specifically, in the test process, the embodiment of the present invention uses the controller to be tested to repeat the comparison process of the observed distance and the set distance of the virtual obstacle. The comparison principle is the same as the comparison principle of the first observed distance in the above embodiment, and will not be repeated. According to the CAN message output result of the controller to be tested, it is further determined whether the secondary calibration is accurate. If it is accurate, the test is continued, otherwise, the calibration is restarted. The scheme provided by the embodiment of the present invention further improves the reliability of the calibration.

[0085] In this embodiment, a hardware-in-the-loop test device for a controller is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0086] This embodiment provides a hardware-in-the-loop test device for a controller, such as Figure 6 As shown, including:

[0087] The projection image calibration module 601 is used to calibrate the viewing angle of the projection image based on the real image, where the real image is a road image captured by a camera at a position to be measured on a real vehicle, and the projection image is a simulated road image for display on an electronic display screen;

[0088] A shooting module 602 is used to shoot a projection image using a dark box camera in a video dark box;

[0089] The data transmission module 603 is used to control the darkroom camera to send the collected video signal to the controller to be tested, so as to test the controller to be tested through the video signal.

[0090] In some optional implementations, the projection image calibration module 601 includes:

[0091] A virtual space creation unit, used to create a virtual space and set a virtual vehicle model and a virtual calibration plate in the virtual space, wherein the virtual vehicle model includes a virtual camera, and the virtual calibration plate is set at a position that can be photographed by the virtual camera;

[0092] A real image importing unit, used for importing a real image, wherein the real image includes a real calibration plate;

[0093] An image comparison unit, used for overlapping and comparing the real image and the virtual space image captured by the virtual camera;

[0094] A virtual parameter adjustment unit, used to adjust the position of the virtual calibration plate in the virtual space and adjust the shooting parameters of the virtual camera if the comparison result indicates that the virtual calibration plate and the real calibration plate do not overlap;

[0095] A virtual camera calibration completion unit, used to complete the calibration of shooting parameters of the virtual camera when the comparison result indicates that the virtual calibration plate and the real calibration plate coincide with each other;

[0096] A virtual road creation unit, used for creating a virtual road environment;

[0097] The projection image generation unit is used to control the virtual camera to collect images of the virtual road environment based on the calibrated shooting parameters to obtain the calibrated projection image.

[0098] In some optional implementations, before the data transmission module 603, the following is further included:

[0099] A preset lane line parameter acquisition unit, used to acquire preset lane line parameters;

[0100] A lane line parameter acquisition unit is used to read lane line parameters from a video signal.

[0101] A parameter error calculation unit, used to calculate a parameter error between a captured lane line parameter and a preset lane line parameter;

[0102] A virtual camera secondary adjustment unit, used for performing secondary adjustment on the shooting parameters of the virtual camera when the parameter error is greater than a preset error threshold;

[0103] A re-capturing unit, used to control the virtual camera to re-capture the virtual road environment based on the second-adjusted shooting parameters to obtain a second-adjusted projection image;

[0104] The reshooting unit is used to return to the step of controlling the dark box camera in the video dark box to shoot the projection image.

[0105] In some optional implementations, before the data transmission module 603, the following is further included:

[0106] A mechanism adjustment unit, used for adjusting the adjustable base mechanism according to the shooting effect of the video signal to change the position of the darkroom camera;

[0107] The reshooting unit is used to return to the step of controlling the dark box camera in the video dark box to shoot the projection image.

[0108] In some optional embodiments, the mechanism adjustment unit comprises:

[0109] A virtual obstacle unit, used to set a virtual obstacle in the projected image and record the setting distance from the virtual obstacle to the virtual camera;

[0110] A first observation unit, used to measure a first observation distance from a virtual obstacle to a dark box camera in a video signal;

[0111] The first comparison unit is used to adjust the adjustable base mechanism according to a first error between a set distance and a first observation distance.

[0112] In some optional embodiments, the device further comprises:

[0113] A second observation unit, used for measuring a second observation distance from the virtual obstacle to the dark box camera from the received video signal through a test program of the controller to be tested;

[0114] A second comparison unit, used for comparing the set distance with the second observation distance;

[0115] A continuing test unit, used for controlling the controller to be tested to continue to perform the test when a second error between the set distance and the second observation distance is less than a preset error threshold;

[0116] The recalibration unit is used to return to the step of calibrating the viewing angle of the projection image based on the real image when the second error between the set distance and the second observation distance is greater than or equal to a preset error threshold.

[0117] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0118] The hardware-in-the-loop test device of the controller in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0119] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0120] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0121] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A controller hardware-in-the-loop testing method, characterized in that: The method comprises: Calibrate the viewing angle of the projected image based on a real image, wherein the real image is a road image captured by a camera at a position to be measured on a real vehicle, and the projected image is a simulated road image for display on an electronic display screen; Controlling a dark box camera in a video dark box to capture the projection image; The dark box camera is controlled to send the collected video signal to the controller to be tested, so as to test the controller to be tested through the video signal.

2. The method according to claim 1, characterized in that The calibrating the viewing angle of the projection image based on the real image includes: Creating a virtual space, and setting a virtual vehicle model and a virtual calibration plate in the virtual space, wherein the virtual vehicle model includes a virtual camera, and the virtual calibration plate is set at a position that can be photographed by the virtual camera; Importing the real image, wherein the real image includes a real calibration plate; Overlap and compare the real image and the virtual space image captured by the virtual camera; If the comparison result indicates that the virtual calibration plate and the real calibration plate do not overlap, adjusting the position of the virtual calibration plate in the virtual space, and adjusting the shooting parameters of the virtual camera; When the comparison result indicates that the virtual calibration plate and the real calibration plate coincide with each other, the shooting parameter calibration of the virtual camera is completed; Creating a virtual road environment; Based on the calibrated shooting parameters, the virtual camera is controlled to capture images of the virtual road environment to obtain the calibrated projection image.

3. The method according to claim 2, characterized in that Before testing the controller to be tested by using the video signal, the method further includes: Get preset lane line parameters; Reading lane line parameters from the video signal; Calculating a parameter error between the captured lane line parameter and the preset lane line parameter; When the parameter error is greater than a preset error threshold, performing a secondary adjustment on the shooting parameters of the virtual camera; Based on the second adjusted shooting parameters, the virtual camera is controlled to re-capture images of the virtual road environment to obtain the second adjusted projection image; Return to the step of controlling the darkbox camera in the video darkbox to capture the projection image.

4. The method according to claim 1, characterized in that The dark box camera is installed in the video dark box through an adjustable base mechanism, and before the controller to be tested is tested through the video signal, the method further includes: Adjusting the adjustable base mechanism according to the shooting effect of the video signal to change the position of the dark box camera; Return to the step of controlling the darkbox camera in the video darkbox to capture the projection image.

5. The method according to claim 4, characterized in that The adjusting the adjustable base mechanism according to the shooting effect of the video signal comprises: Setting a virtual obstacle in the projection image, and recording a setting distance from the virtual obstacle to the virtual camera; Measuring a first observation distance from a virtual obstacle in the video signal to the darkroom camera; The adjustable base mechanism is adjusted according to a first error between the setting distance and the first observation distance.

6. The method according to claim 5, characterized in that The method further comprises: Measuring a second observation distance from the virtual obstacle to the darkroom camera from the received video signal through a test program of the controller to be tested; Comparing the set distance with the second observed distance; When a second error between the set distance and the second observation distance is less than a preset error threshold, controlling the controller to be tested to continue to perform the test; When the second error between the set distance and the second observation distance is greater than or equal to a preset error threshold, return to the step of calibrating the viewing angle of the projection image based on the real image.

7. A hardware-in-the-loop test device for a controller, characterized in that: The device comprises: A projection image calibration module, used to calibrate the viewing angle of the projection image based on a real image, wherein the real image is a road image captured by a camera at a position to be measured on a real vehicle, and the projection image is a simulated road image for display on an electronic display screen; A shooting module, used for shooting the projection image using a dark box camera in a video dark box; The data transmission module is used to control the darkroom camera to send the collected video signal to the controller to be tested, so as to test the controller to be tested through the video signal.

8. A hardware-in-the-loop test system for a controller, characterized in that: include: Host computer, real-time machine, video dark box, electronic display screen, dark box camera, and controller to be tested; The host computer is used to perform the step of calibrating the viewing angle of the projection image based on the real image, and to control the real-time machine; The real-time machine is used to output a vehicle virtual signal; The video darkbox is used to provide a capture environment for the projection image. The electronic display screen and the darkbox camera are respectively installed at two ends of the video darkbox. The electronic display screen is used to display the projection image. The darkbox camera is used to shoot the projection image and send the shot video signal to the controller to be tested.

9. The system according to claim 8, characterized in that It also includes an adjustable base mechanism, through which the dark box camera is installed in the video dark box, and the adjustable base mechanism is used to adjust the position of the dark box camera in the video dark box.

10. The system according to claim 8, characterized in that The real-time machine is equipped with a CAN board, an analog quantity board and a digital quantity board.

Citation Information

Patent Citations

  • Intelligent networked automobile function simulation test system and test method

    CN111026099A

  • Camera calibration method and device, electronic equipment and storage medium

    CN112419420A

  • Intelligent driving function testing device and method

    CN114967653A

  • Intelligent driving test device and test method

    CN115712295A

  • Camera calibration verification method and system based on video camera obscura

    CN115824591A