Camera-driven test method, apparatus, device, and storage medium

By loading a virtual camera device into the autonomous driving system and simulating image data input, and using the camera driver to set state parameters, the problem of camera driver trigger mode switching function testing relying on physical devices is solved, achieving low-cost and high-efficiency testing.

CN115866242BActive Publication Date: 2026-05-15GUANGZHOU WERIDE TECH LTD CO
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU WERIDE TECH LTD CO
Filing Date
2022-11-30
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, testing the trigger mode switching function of camera drivers requires physical camera equipment, resulting in high testing costs and low efficiency.

Method used

By loading a virtual camera device and simulating image data input, the camera driver is used to set the status parameters of the virtual camera device, simulate the switching of different trigger modes, and obtain the image data output results to determine whether the trigger mode switching of the camera driver is normal.

Benefits of technology

This reduces the dependence of camera-driven testing on physical camera equipment, lowers testing costs, and improves testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115866242B_ABST
    Figure CN115866242B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of testing, and discloses a camera driving test method, device, equipment and storage medium, which are used for reducing the cost of camera driving test and improving test efficiency. The camera driving test method comprises the following steps: loading at least one virtual camera device, and performing image data input simulation on each virtual camera device; setting at least one group of state parameters of each virtual camera device through a camera driving to be tested, obtaining image data output results corresponding to each group of state parameters of each virtual camera device, and each group of state parameters corresponds to a switching mode of a camera trigger mode; and determining whether the camera trigger mode switching of the camera driving to at least one virtual camera device is normal according to all the image data output results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of testing technology, and in particular to a camera-driven testing method, apparatus, device, and storage medium. Background Technology

[0002] In autonomous driving systems, the image output mode of the camera device is controlled by switching the camera trigger mode. The switching of the camera trigger mode is usually completed by the camera driver. Therefore, in order to ensure that the image output mode of the camera device is correct, it is necessary to test the camera trigger mode switching function of the camera driver.

[0003] In existing technologies, testing the camera trigger mode switching function typically requires connecting the physical camera device to the autonomous driving system. The camera trigger mode is manually switched, and the output image from the physical camera device is observed to determine if it meets expectations, thus confirming the functionality of the camera-driven trigger mode switching function. This method relies on the physical camera device, resulting in high testing costs and low efficiency. Summary of the Invention

[0004] This invention provides a camera driver testing method, apparatus, device, and storage medium to reduce the cost of camera driver testing and improve testing efficiency.

[0005] The first aspect of this invention provides a camera driver testing method, comprising:

[0006] Load at least one virtual camera device and simulate image data input for each of the virtual camera devices;

[0007] By setting at least one set of state parameters for each virtual camera device through the camera driver under test, the image data output result corresponding to each set of state parameters of each virtual camera device is obtained, and each set of state parameters corresponds to a switching method of camera trigger mode.

[0008] Based on the output of all image data, determine whether the camera driver's switching of the camera trigger mode for the at least one virtual camera device is normal.

[0009] Optionally, in a first implementation of the first aspect of the present invention, the step of setting at least one set of state parameters for each virtual camera device through the camera driver under test, and obtaining the image data output result corresponding to each set of state parameters for each virtual camera device, includes:

[0010] Obtain at least one set of state parameters, each set of state parameters including initial state parameters and mode switching parameters, wherein the initial state parameters are used to indicate the initial camera trigger mode, and the mode switching parameters are used to indicate at least one switched camera trigger mode;

[0011] Based on the initial state parameters in each set of state parameters, the initial camera trigger mode is set for each virtual camera device to obtain the initial trigger mode virtual camera device corresponding to each set of state parameters of each virtual camera device.

[0012] Based on the mode switching parameters in each set of state parameters, the camera driver under test switches at least one camera trigger mode for each virtual camera device corresponding to each set of state parameters, thereby obtaining the image data output results after switching at least one camera trigger mode for each set of state parameters of each virtual camera device.

[0013] Optionally, in a second implementation of the first aspect of the present invention, the step of setting an initial camera trigger mode for each virtual camera device based on the initial state parameters in each set of state parameters, to obtain an initial trigger mode virtual camera device corresponding to each set of state parameters of each virtual camera device, includes:

[0014] According to the preset reset parameters, the camera trigger mode of each virtual camera device is reset to obtain at least one reset virtual camera device;

[0015] Using a preset state writing tool, the initial state parameters in each set of state parameters are written to each of the reset virtual camera devices, thereby obtaining the initial trigger mode virtual camera device corresponding to each set of state parameters of each virtual camera device.

[0016] Optionally, in a third implementation of the first aspect of the present invention, the camera triggering mode includes an external signal triggering mode and a non-external signal triggering mode. The step of switching at least one camera triggering mode for each virtual camera device corresponding to each set of state parameters based on the mode switching parameters in each set of state parameters, through the camera driver under test, to obtain the image data output result after switching at least one camera triggering mode for each set of state parameters of each virtual camera device, includes:

[0017] If the initial camera trigger mode is an external signal trigger mode, then based on the mode switching parameters in each set of state parameters, the trigger mode of the virtual camera device corresponding to each set of state parameters of each virtual camera device is switched to a non-external signal trigger mode by the camera driver under test, so as to obtain the image data output result after switching at least one camera trigger mode corresponding to each set of state parameters of each virtual camera device.

[0018] Optionally, in a fourth implementation of the first aspect of the present invention, the image data output result corresponding to each set of state parameters of each of the virtual camera devices is used to indicate whether the output image data after switching conforms to the switched camera trigger mode. The step of determining whether the camera driver's switching of the camera trigger mode for the at least one virtual camera device is normal based on all image data output results includes:

[0019] If the image data output result corresponding to each set of state parameters of each virtual camera device indicates that the output image data after switching matches the switched camera trigger mode, then it is determined that the camera trigger mode switching of the camera driver is normal.

[0020] If the image data output result corresponding to any set of state parameters indicates that the output image data after the switch does not conform to the switched camera trigger mode, then it is determined that the camera trigger mode switching of the camera driver is abnormal.

[0021] Optionally, in a fifth implementation of the first aspect of the present invention, loading at least one virtual camera device and simulating image data input for each of the virtual camera devices includes:

[0022] At least one virtual camera device is loaded, and image data is written to each virtual camera device according to a preset writing cycle using a preset image writing tool, so as to simulate the image data of a real camera device for each virtual camera device.

[0023] Optionally, in a sixth implementation of the first aspect of the present invention, loading at least one virtual camera device and simulating image data input for each of the virtual camera devices includes:

[0024] Load a virtual control device and at least one virtual camera device, wherein the virtual control device is used to set the status parameters of the at least one virtual camera device;

[0025] The virtual control device simulates the input of image data to each of the virtual camera devices.

[0026] A second aspect of the present invention provides a camera-driven testing apparatus, comprising:

[0027] A simulation module is used to load at least one virtual camera device and simulate image data input for each of the virtual camera devices;

[0028] The setting module is used to set at least one set of state parameters for each virtual camera device through the camera driver to be tested, and to obtain the image data output result corresponding to each set of state parameters of each virtual camera device. Each set of state parameters corresponds to a switching method of camera trigger mode.

[0029] The determination module is used to determine, based on the output results of all image data, whether the camera driver's switching of the camera trigger mode for the at least one virtual camera device is normal.

[0030] Optionally, in a first implementation of the second aspect of the present invention, the setting module includes:

[0031] The parameter acquisition unit is used to acquire at least one set of state parameters. Each set of state parameters includes an initial state parameter and a mode switching parameter. The initial state parameter is used to indicate the initial camera trigger mode, and the mode switching parameter is used to indicate at least one switched camera trigger mode.

[0032] The mode setting unit is used to set the initial camera trigger mode for each virtual camera device based on the initial state parameters in each group of state parameters, so as to obtain the initial trigger mode virtual camera device corresponding to each group of state parameters of each virtual camera device.

[0033] The switching setting unit is used to switch at least one camera trigger mode for each virtual camera device corresponding to each set of state parameters based on the mode switching parameters in each set of state parameters, through the camera driver under test, and to obtain the image data output result after switching at least one camera trigger mode corresponding to each set of state parameters of each virtual camera device.

[0034] Optionally, in a second implementation of the second aspect of the present invention, the mode setting unit is specifically used for:

[0035] According to the preset reset parameters, the camera trigger mode of each virtual camera device is reset to obtain at least one reset virtual camera device;

[0036] Using a preset state writing tool, the initial state parameters in each set of state parameters are written to each of the reset virtual camera devices, thereby obtaining the initial trigger mode virtual camera device corresponding to each set of state parameters of each virtual camera device.

[0037] Optionally, in a third implementation of the second aspect of the present invention, the camera triggering mode includes an external signal triggering mode and a non-external signal triggering mode, and the switching setting unit is specifically used for:

[0038] If the initial camera trigger mode is an external signal trigger mode, then based on the mode switching parameters in each set of state parameters, the trigger mode of the virtual camera device corresponding to each set of state parameters of each virtual camera device is switched to a non-external signal trigger mode by the camera driver under test, so as to obtain the image data output result after switching at least one camera trigger mode corresponding to each set of state parameters of each virtual camera device.

[0039] Optionally, in a fourth implementation of the second aspect of the present invention, the image data output result corresponding to each set of state parameters of each virtual camera device is used to indicate whether the image data output after switching conforms to the camera triggering mode after switching, and the determining module is specifically used for:

[0040] If the image data output result corresponding to each set of state parameters of each virtual camera device indicates that the output image data after switching matches the switched camera trigger mode, then it is determined that the camera trigger mode switching of the camera driver is normal.

[0041] If the image data output result corresponding to any set of state parameters indicates that the output image data after the switch does not conform to the switched camera trigger mode, then it is determined that the camera trigger mode switching of the camera driver is abnormal.

[0042] Optionally, in a fifth implementation of the second aspect of the present invention, the simulation module is used for:

[0043] At least one virtual camera device is loaded, and image data is written to each virtual camera device according to a preset writing cycle using a preset image writing tool, so as to simulate the image data of a real camera device for each virtual camera device.

[0044] Optionally, in a sixth implementation of the second aspect of the present invention, the simulation module is further configured to:

[0045] Load a virtual control device and at least one virtual camera device, wherein the virtual control device is used to set the status parameters of the at least one virtual camera device;

[0046] The virtual control device simulates the input of image data to each of the virtual camera devices.

[0047] A third aspect of the present invention provides a camera-driven testing device, comprising: a memory and at least one processor, wherein the memory stores a computer program; the at least one processor invokes the computer program in the memory to cause the camera-driven testing device to execute the camera-driven testing method described above.

[0048] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the camera-driven testing method described above.

[0049] In the technical solution provided by this invention, a virtual camera device is loaded into an autonomous driving system, and image data input to the virtual camera device is simulated. The autonomous driving system includes a camera driver to be tested. At least one set of state parameters are set for the virtual camera device through the camera driver, and image data output results corresponding to each set of state parameters are obtained. Each set of state parameters corresponds to a switching method for a camera trigger mode. Based on all image data output results, it is determined whether the switching method of the camera trigger mode of the camera driver is normal. In this embodiment of the invention, to reduce the dependence of camera driver testing on physical camera devices, a virtual camera device is loaded into the autonomous driving system, and image data input to the physical camera device is simulated through the virtual camera device. Then, the state parameter settings for the virtual camera device are simulated through the camera driver to obtain image data output results under different camera trigger mode switching methods. If the image data output results meet expectations, it can be determined that the switching function of the camera trigger mode of the camera driver is normal. This eliminates the need for camera driver testing to rely on real camera devices, reducing testing costs and improving testing efficiency. Attached Figure Description

[0050] Figure 1 This is a schematic diagram of one embodiment of the camera-driven testing method in this invention;

[0051] Figure 2 This is a schematic diagram of another embodiment of the camera-driven testing method in this invention;

[0052] Figure 3 This is a schematic diagram of one embodiment of the camera-driven testing device in this invention;

[0053] Figure 4 This is a schematic diagram of another embodiment of the camera-driven testing device in this invention;

[0054] Figure 5 This is a schematic diagram of one embodiment of the camera-driven testing device in this invention. Detailed Implementation

[0055] This invention provides a camera driver testing method, apparatus, device, and storage medium to reduce the cost of camera driver testing and improve testing efficiency.

[0056] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0057] It is understood that the executing entity of this invention can be a camera-driven testing device, a terminal, or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as an example.

[0058] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the camera-driven testing method in this invention includes:

[0059] 101. Load at least one virtual camera device and simulate image data input for each virtual camera device;

[0060] It should be noted that loading at least one virtual camera device into the computer treats each virtual camera device as a physical camera device; therefore, the loaded virtual camera device is equivalent to a physical camera device connected to the computer. In one embodiment, since this invention only requires simulating image input and output through virtual camera devices, loading at least one preset virtual camera device handle is sufficient to load at least one virtual camera device. For example, in a Linux operating system, a physical camera device is a device file; similarly, a virtual camera device can also be a device file, which the operating system can read and write. In one embodiment, when simulating image data input to a virtual camera device, writing image data to the device file corresponding to the virtual camera device simulates the image data input of a physical camera device.

[0061] In one embodiment, each virtual camera device is connected to a preset autonomous driving system. To improve testing efficiency, the autonomous driving system in this embodiment includes at least the operating environment of the autonomous driving system, including global data, dependency data, and data links required for camera driver testing, etc., which are not specifically limited here. In this embodiment, the autonomous driving system includes a camera driver to be tested. The camera driver to be tested is used to discover and control physical camera devices. Since the virtual camera devices loaded in the autonomous driving system are equivalent to the physical camera devices connected to the autonomous driving system, the camera driver to be tested can also discover and control the virtual camera devices. Since the autonomous driving system typically connects multiple physical camera devices for environmental perception, this embodiment can test whether the camera driver in the autonomous driving system is properly configured for multiple camera devices by using at least one virtual camera device connected to the autonomous driving system, thereby improving the efficiency of autonomous driving system testing.

[0062] 102. Set at least one set of state parameters for each virtual camera device through the camera driver to be tested, and obtain the image data output results corresponding to each set of state parameters of each virtual camera device. Each set of state parameters corresponds to a switching method of camera trigger mode.

[0063] It is understood that camera trigger mode refers to the image output method of a camera device. As an example, and not a limitation, a camera device must include at least two camera trigger modes, one of which is the default camera trigger mode. The camera device must also include at least one camera trigger mode defined and controlled by the operating system. Typically, the default camera trigger mode is freerun mode. In this mode, the camera's image output method is not controlled by the operating system and outputs images according to its own preset output frequency. To make the camera's image output method controllable by the operating system, the operating system-defined camera trigger mode can output images in the manner defined by the operating system. For example, when the camera device receives a level / trigger signal from the operating system, it switches its camera trigger mode to the operating system-defined camera trigger mode. Specific details are not limited here.

[0064] Understandably, to test whether the camera driver can successfully switch between different camera trigger modes, this embodiment sets the camera trigger mode of the virtual camera device before and after the switch using at least one set of state parameters to obtain the image data output results corresponding to each set of state parameters, and determines whether the camera trigger mode switch is successful based on the image data output results. It is understood that since different camera trigger modes correspond to different image output methods, simulating the image output method of the virtual camera device through the camera driver can simulate the different image output methods corresponding to different camera trigger modes. Specifically, this embodiment sets the image output method corresponding to different camera trigger modes of the virtual camera device using state parameters, thereby obtaining the image data output results before and after switching between different camera trigger modes, to determine whether the camera trigger mode switching function is normal. In this embodiment, the state parameters are used to set the image output method of the virtual camera device, and the state parameters include, but are not limited to, the camera trigger mode flag bit and the image output method flag bit of the camera trigger mode. For example, if a set of state parameters includes a camera trigger mode flag of 1 before switching, a camera trigger mode flag of 2 after switching, an image output mode flag of 0 (no output) under camera trigger mode 1, and an image output mode flag of 1 (output) under camera trigger mode 2, then after setting this set of state parameters, the image data output result should be that no image data is output before switching, and data is output after switching. This confirms that the switching function corresponding to this set of state parameters is normal. The specifics are not limited here.

[0065] In one implementation, a set of state parameters includes the following multiple flag bits and the corresponding values ​​for each flag bit:

[0066] init_state: This is an initialization flag, which defaults to false and changes to true after being written once using the state writing tool.

[0067] ctrl_node: This is the control node. It is false if it is controlled by the driver, and true if it is written by a status writing tool.

[0068] trig_state: There are 3 numerical options: 0 for trigger, 1 for freerun, and 2 for no image output.

[0069] Freerun_output: Whether to output an image after the driver switches the camera trigger mode to freerun. Output is true, and no output is false.

[0070] Trig_output: Whether to output an image after the driver switches the camera trigger mode to trigger. Output is true, no output is false.

[0071] 103. Based on the output results of all image data, determine whether the camera driver is properly switching the camera trigger mode of the at least one virtual camera device.

[0072] Understandably, since the switching of camera trigger modes is controlled by the camera driver in the operating system, the image data output can also represent the camera driver's control result on the switching of camera trigger modes. If the image data output matches the expected result of the camera driver's control on the switching of camera trigger modes, it can be determined that the camera driver's camera trigger mode switching function is normal. And if the camera driver's camera trigger mode switching function is normal, this function can also run normally when the operating system is connected to a physical camera device, thereby improving the testing efficiency of the camera driver. Since the testing process does not require connection to a physical camera device, the testing cost is also reduced.

[0073] In one implementation, each set of state parameters corresponds to at least one camera trigger mode switching result. For example, in one set of state parameters, switching the virtual camera device from camera trigger mode A to camera trigger mode B yields one switching result, and switching back from camera trigger mode B to camera trigger mode A yields another switching result. Therefore, this set of state parameters corresponds to two camera trigger mode switching results, though the specifics are not limited here. Based on this, each set of state parameters corresponds to at least one image output result, where each switching result corresponds to one image output result. In one implementation, if the image data output result corresponding to each set of state parameters matches the expected switching result, it is determined whether the camera trigger mode switching method driven by the camera is normal.

[0074] In this embodiment of the invention, in order to reduce the dependence of camera driver testing on physical camera devices, a virtual camera device is loaded, and the image data input of the physical camera device is simulated through the virtual camera device. Then, the state parameters of the virtual camera device are simulated through the camera driver to obtain the image data output results under different camera trigger mode switching methods. If the image data output results meet the expectations, it can be determined that the camera trigger mode switching function of the camera driver is normal, so that the camera driver test does not need to rely on real camera devices, reducing the testing cost of the camera driver and improving the testing efficiency.

[0075] Please see Figure 2 Another embodiment of the camera-driven testing method in this invention includes:

[0076] 201. Load at least one virtual camera device and simulate image data input for each virtual camera device;

[0077] In one embodiment, step 201 includes: loading virtual camera devices and writing image data to each virtual camera device according to a preset writing cycle using a preset image writing tool, thereby simulating the image data of a real camera device for each virtual camera device. In this embodiment, each virtual camera device loaded into the operating system corresponds to a device file. By writing image files to the device file corresponding to the virtual camera device according to a preset writing cycle using a preset image writing tool, the image data of a real camera device (i.e., a physical camera device) can be simulated for the virtual camera device. This allows camera driver testing to be performed without connecting to a physical camera device, thereby improving the efficiency of camera driver testing and reducing the cost of camera driver testing.

[0078] In one embodiment, loading at least one virtual camera device and simulating image data input for each virtual camera device includes: loading a virtual control device and at least one virtual camera device, wherein the virtual control device is used to set the state parameters of the at least one virtual camera device; and simulating image data input for each virtual camera device through the virtual control device. It is understood that the camera driver processes the virtual camera devices through processes, with each virtual camera device corresponding to one process. Since other programs in the operating system cannot process any virtual camera device while the camera driver is processing it, a virtual control device is loaded along with the at least one virtual camera device. This virtual control device processes the processes of the at least one virtual camera device, including setting the state parameters of each virtual camera device. The camera driver can directly control the virtual control device, thus avoiding process blocking caused by direct control of the virtual camera devices and improving the efficiency of virtual camera device control. In this embodiment, the autonomous driving system can also load multiple virtual camera devices to facilitate subsequent determination of whether the multi-process processing function of the camera driver is normal based on the image data output results corresponding to each virtual camera device.

[0079] 202. Obtain at least one set of state parameters. Each set of state parameters includes initial state parameters and mode switching parameters. The initial state parameters are used to indicate the initial camera trigger mode, and the mode switching parameters are used to indicate at least one switched camera trigger mode.

[0080] In this step, at least one set of state parameters is obtained, i.e., at least one group of state parameters. Each group of state parameters includes initial state parameters and mode switching parameters. The initial state parameters are used to set the initial camera trigger mode of the virtual camera device, and the mode switching parameters are used to set the camera trigger mode of the virtual camera device after switching. For example, assuming a group of state parameters is used to change the camera trigger mode of the virtual camera device from A to B, then the initial state parameters in this group are the state parameters of camera trigger mode A, and the mode switching parameters are the state parameters of camera trigger mode B. Specific details are not limited here. It should be noted that a group of state parameters can contain at least one switched camera trigger mode; that is, a group of state parameters can be used to change the camera trigger mode of the virtual camera device from A to B, then from B to A, and so on. Specific details are not limited here.

[0081] 203. Based on the initial state parameters in each set of state parameters, perform initial camera trigger mode settings for each virtual camera device to obtain the initial trigger mode virtual camera device corresponding to each set of state parameters of each virtual camera device;

[0082] In this step, since the state parameters of each virtual camera device are the same, for ease of understanding, the following explanation uses one virtual camera device as an example. This embodiment of virtual camera device can be fully applied to other virtual camera devices. For each set of state parameters, the camera trigger mode of the virtual camera device is changed from the camera trigger mode set in the previous set of state parameters to the initial state parameter corresponding to the current set of state parameters. This ensures that the camera trigger mode of the virtual camera device is in the initial camera trigger mode indicated by the currently tested set of state parameters. For example, after the previous set of state parameters is set, the camera trigger mode of the virtual camera device is A. Then, the current set of state parameters sets the state parameters of the virtual camera device to the current initial state parameter. The camera trigger mode indicated by the current initial state parameter can be A or other modes; there is no specific limitation here. It should be noted that the setting order of each set of state parameters is not limited, and the total number of state parameter sets depends on the number of camera trigger mode switching methods.

[0083] In one embodiment, step 203 includes: resetting the camera trigger mode of each virtual camera device according to preset reset parameters, obtaining at least one reset virtual camera device; and writing the initial state parameters from each set of state parameters into each reset virtual camera device using a preset state writing tool, obtaining an initial trigger mode virtual camera device corresponding to each set of state parameters for each virtual camera device. In this embodiment, to ensure that the camera driver enters the initialization program for state parameter testing before setting each set of state parameters, preset reset parameters are used to instruct the camera driver to enter the initialization program for state parameter testing and reset the camera trigger mode of the virtual camera device, specifically resetting the state parameters of the virtual camera device to obtain at least one reset virtual camera device. The reset parameter can also be a state parameter or a flag. Then, the initial state parameters from each set of state parameters are written into each reset virtual camera device using a preset state writing tool, obtaining an initial trigger mode virtual camera device corresponding to each set of state parameters for each virtual camera device.

[0084] 204. Based on the mode switching parameters in each set of state parameters, the camera driver under test switches at least one camera trigger mode for each virtual camera device corresponding to the initial trigger mode of each set of state parameters, and obtains the image data output result after switching at least one camera trigger mode for each set of state parameters of each virtual camera device. Each set of state parameters corresponds to a switching method of camera trigger mode.

[0085] In this step, the mode switching parameters in a set of state parameters include state parameters for at least one camera trigger mode. Each camera trigger mode state parameter corresponds to a switched camera trigger mode. For each set of state parameters, the camera driver switches the virtual camera device in the initial trigger mode to at least one camera trigger mode, and records the image data output after each switch. This yields the image data output after switching at least one camera trigger mode for each set of state parameters, where each set of state parameters corresponds to a switching method for a camera trigger mode. For example, if a set of state parameters includes state parameters for camera trigger modes A and B, then when the virtual camera device switches from the initial trigger mode to camera trigger mode A, the image data output after this switch is recorded. Then, after switching from camera trigger mode A to camera trigger mode B, the image data output after this switch is recorded again, resulting in the image data output after two switch settings. The specific details are not limited here.

[0086] In one embodiment, the camera triggering mode includes an external signal triggering mode and a non-external signal triggering mode. Step 204 includes: if the initial camera triggering mode is an external signal triggering mode, then based on the mode switching parameters in each set of state parameters, the triggering mode of the virtual camera device corresponding to each set of state parameters of each virtual camera device is switched to a non-external signal triggering mode through the camera driver under test, thereby obtaining the image data output result after switching at least one camera triggering mode corresponding to each set of state parameters of each virtual camera device. In this embodiment, the camera triggering mode includes a mode triggered by an external signal and a mode not triggered by an external signal. The external signal refers to a signal outside the camera device, such as a signal sent by the camera driver, a signal sent by the autonomous driving system, etc., and is not specifically limited here. In one embodiment, the external signal triggering mode may include more than one type, and the external signal triggering mode is used to indicate the trigger signal triggering mode. In this embodiment, if the initial camera trigger mode is the external signal trigger mode, then switching the camera trigger mode must be switching the external signal trigger mode to the non-external signal trigger mode, and vice versa. That is, if the initial camera trigger mode is the non-external signal trigger mode, then switching the camera trigger mode must be switching the non-external signal trigger mode to the external signal trigger mode.

[0087] 205. Based on the output results of all image data, determine whether the camera driver is switching the camera trigger mode of the at least one virtual camera device normally.

[0088] In one implementation, the image data output result corresponding to each set of state parameters of each virtual camera device is used to indicate whether the output image data after switching conforms to the switched camera trigger mode. Step 205 includes: if the image data output result corresponding to each set of state parameters of each virtual camera device indicates that the output image data after switching conforms to the switched camera trigger mode, then the camera trigger mode switching of the camera driver is determined to be normal; if the image data output result corresponding to any set of state parameters indicates that the output image data after switching does not conform to the switched camera trigger mode, then the camera trigger mode switching of the camera driver is determined to be abnormal. It can be understood that each switch of the camera trigger mode corresponds to an expected image data output result. If the image data output results corresponding to all sets of state parameters indicate that the output image data conforms to the expected image data output result, then the camera trigger mode switching function of the camera driver can be determined to be normal. However, if the image data output result corresponding to any set of state parameters indicates that the output image data does not conform to the expected image data output result, then the camera trigger mode switching method of the camera driver is determined to be abnormal, i.e., the camera driver has an anomaly, and the camera driver test is completed.

[0089] In this embodiment of the invention, in order to reduce the dependence of camera driver testing on physical camera devices, a virtual camera device is loaded in the operating system, and the image data input of the physical camera device is simulated through the virtual camera device. Then, the camera driver simulates the state parameter settings of the virtual camera device to obtain the image data output results under different camera trigger mode switching methods. If the image data output results meet the expectations, it can be determined that the camera trigger mode switching function of the camera driver is normal. This makes the camera driver test not dependent on real camera devices, reducing the testing cost of the camera driver and improving the testing efficiency.

[0090] The above describes the testing method for the camera driver in the embodiments of the present invention. The following describes the testing apparatus for the camera driver in the embodiments of the present invention. Please refer to [link / reference]. Figure 3 One embodiment of the camera-driven testing device in this invention includes:

[0091] The simulation module 301 is used to load at least one virtual camera device and simulate image data input for each of the virtual camera devices;

[0092] The setting module 302 is used to set at least one set of state parameters for each virtual camera device through the camera driver to be tested, and to obtain the image data output result corresponding to each set of state parameters of each virtual camera device. Each set of state parameters corresponds to a switching method of camera trigger mode.

[0093] The determination module 303 is used to determine, based on the output results of all image data, whether the camera driver's switching of the camera trigger mode for the at least one virtual camera device is normal.

[0094] In this embodiment of the invention, in order to reduce the dependence of camera driver testing on physical camera devices, a virtual camera device is loaded in the operating system, and the image data input of the physical camera device is simulated through the virtual camera device. Then, the camera driver simulates the state parameter settings of the virtual camera device to obtain the image data output results under different camera trigger mode switching methods. If the image data output results meet the expectations, it can be determined that the camera trigger mode switching function of the camera driver is normal. This makes the camera driver test not dependent on real camera devices, reducing the testing cost of the camera driver and improving the testing efficiency.

[0095] Please see Figure 4 Another embodiment of the camera-driven testing device in this invention includes:

[0096] The simulation module 301 is used to load at least one virtual camera device and simulate image data input for each of the virtual camera devices;

[0097] The setting module 302 is used to set at least one set of state parameters for each virtual camera device through the camera driver to be tested, and to obtain the image data output result corresponding to each set of state parameters of each virtual camera device. Each set of state parameters corresponds to a switching method of camera trigger mode.

[0098] The determination module 303 is used to determine, based on the output results of all image data, whether the camera driver's switching of the camera trigger mode for the at least one virtual camera device is normal.

[0099] Optionally, the setting module 302 includes:

[0100] The parameter acquisition unit 3021 is used to acquire at least one set of state parameters. Each set of state parameters includes an initial state parameter and a mode switching parameter. The initial state parameter is used to indicate the initial camera trigger mode, and the mode switching parameter is used to indicate at least one switched camera trigger mode.

[0101] The mode setting unit 3022 is used to set the initial camera trigger mode for each virtual camera device based on the initial state parameters in each group of state parameters, so as to obtain the initial trigger mode virtual camera device corresponding to each group of state parameters of each virtual camera device.

[0102] The switching setting unit 3023 is used to switch at least one camera trigger mode for each virtual camera device corresponding to each set of state parameters based on the mode switching parameters in each set of state parameters, through the camera driver under test, and to obtain the image data output result after switching at least one camera trigger mode corresponding to each set of state parameters of each virtual camera device.

[0103] Optionally, the mode setting unit 3022 is specifically used for:

[0104] According to the preset reset parameters, the camera trigger mode of each virtual camera device is reset to obtain at least one reset virtual camera device;

[0105] Using a preset state writing tool, the initial state parameters in each set of state parameters are written to each of the reset virtual camera devices, thereby obtaining the initial trigger mode virtual camera device corresponding to each set of state parameters of each virtual camera device.

[0106] Optionally, the camera triggering mode includes an external signal triggering mode and a non-external signal triggering mode, and the switching setting unit 3023 is specifically used for:

[0107] If the initial camera trigger mode is an external signal trigger mode, then based on the mode switching parameters in each set of state parameters, the trigger mode of the virtual camera device corresponding to each set of state parameters of each virtual camera device is switched to a non-external signal trigger mode by the camera driver under test, so as to obtain the image data output result after switching at least one camera trigger mode corresponding to each set of state parameters of each virtual camera device.

[0108] Optionally, the image data output result corresponding to each set of state parameters of each virtual camera device is used to indicate whether the image data output after switching conforms to the camera trigger mode after switching. The determining module 303 is specifically used for:

[0109] If the image data output result corresponding to each set of state parameters of each virtual camera device indicates that the output image data after switching matches the switched camera trigger mode, then it is determined that the camera trigger mode switching of the camera driver is normal.

[0110] If the image data output result corresponding to any set of state parameters indicates that the output image data after the switch does not conform to the switched camera trigger mode, then it is determined that the camera trigger mode switching of the camera driver is abnormal.

[0111] Optionally, the simulation module 301 is used for:

[0112] At least one virtual camera device is loaded, and image data is written to each virtual camera device according to a preset writing cycle using a preset image writing tool, so as to simulate the image data of a real camera device for each virtual camera device.

[0113] Optionally, the simulation module 301 is further configured to:

[0114] Load a virtual control device and at least one virtual camera device, wherein the virtual control device is used to set the status parameters of the at least one virtual camera device;

[0115] The virtual control device simulates the input of image data to each of the virtual camera devices.

[0116] In this embodiment of the invention, in order to reduce the dependence of camera driver testing on physical camera devices, a virtual camera device is loaded into the autonomous driving system, and the image data input of the physical camera device is simulated through the virtual camera device. Then, the state parameters of the virtual camera device are simulated through the camera driver to obtain the image data output results under different camera trigger mode switching methods. If the image data output results meet the expectations, it can be determined that the camera trigger mode switching function of the camera driver is normal. This makes the camera driver test not dependent on real camera devices, reduces the testing cost of the camera driver, and improves the testing efficiency.

[0117] above Figure 3 and Figure 4 The camera driver testing device in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The camera driver testing device in this embodiment of the invention will be described in detail from the perspective of hardware processing.

[0118] Figure 5 This is a schematic diagram of the structure of a camera-driven test device 500 provided in an embodiment of the present invention. The camera-driven test device 500 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing application programs 533 or data 532. The memory 520 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module including a series of computer program operations on the camera-driven test device 500. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of computer program operations in the storage media 530 on the camera-driven test device 500.

[0119] The camera-driven test device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 5 The illustrated camera-driven test device structure does not constitute a limitation on camera-driven test devices, which may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0120] The present invention also provides a computer device, the computer device including a memory and a processor, the memory storing a computer-readable computer program, which, when executed by the processor, causes the processor to perform the steps of the camera-driven testing method described in the above embodiments.

[0121] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein a computer program is stored in the computer program, which, when run on a computer, causes the computer to perform the steps of the camera-driven test method.

[0122] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0123] If the integrated unit is implemented as 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. This computer software product is stored in a storage medium and includes several computer programs to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0124] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A camera-driven testing method, characterized in that, The method includes: Load at least one virtual camera device and simulate image data input for each of the virtual camera devices; By setting at least one set of state parameters for each virtual camera device through the camera driver under test, the image data output result corresponding to each set of state parameters of each virtual camera device is obtained. Each set of state parameters corresponds to a switching method of camera trigger mode. Different camera trigger modes correspond to different image output methods. The camera device includes the default camera trigger mode and at least one camera trigger mode defined and controlled by the operating system. The image output method under the default camera trigger mode is not controlled by the operating system. A set of state parameters includes a camera trigger mode flag bit before switching, a camera trigger mode flag bit after switching, an image output method flag bit under the camera trigger mode before switching, and an image output method flag bit under the camera trigger mode after switching. The image data output result corresponding to each set of state parameters of each virtual camera device is used to indicate whether the image data output after switching conforms to the switched camera trigger mode. Based on the output results of all image data, determine whether the camera driver's switching of the camera trigger mode for the at least one virtual camera device is normal; The step of determining whether the camera driver's switching of the camera trigger mode for the at least one virtual camera device is normal based on the output results of all image data includes: If the image data output result corresponding to each set of state parameters of each virtual camera device indicates that the output image data after switching matches the switched camera trigger mode, then it is determined that the camera trigger mode switching of the camera driver is normal. If the image data output result corresponding to any set of state parameters indicates that the output image data after the switch does not conform to the switched camera trigger mode, then it is determined that the camera trigger mode switching of the camera driver is abnormal.

2. The method according to claim 1, characterized in that, The step of loading at least one virtual camera device and simulating image data input for each virtual camera device includes: At least one virtual camera device is loaded, and image data is written to each virtual camera device according to a preset writing cycle using a preset image writing tool, so as to simulate the image data of a real camera device for each virtual camera device.

3. The method according to claim 1, characterized in that, The step of loading at least one virtual camera device and simulating image data input for each virtual camera device includes: Load a virtual control device and at least one virtual camera device, wherein the virtual control device is used to set the status parameters of the at least one virtual camera device; The virtual control device simulates the input of image data to each of the virtual camera devices.

4. A camera-driven testing device, characterized in that, The device includes: A simulation module is used to load at least one virtual camera device and simulate image data input for each of the virtual camera devices; The setting module is used to set at least one set of state parameters for each virtual camera device through the camera driver under test, and obtain the image data output result corresponding to each set of state parameters of each virtual camera device. Each set of state parameters corresponds to a switching method of camera trigger mode. Different camera trigger modes correspond to different image output methods. The camera device includes the default camera trigger mode of the camera device and at least one camera trigger mode defined and controlled by the operating system. The image output method under the default camera trigger mode is not controlled by the operating system. A set of state parameters includes a camera trigger mode flag bit before switching, a camera trigger mode flag bit after switching, an image output method flag bit under the camera trigger mode before switching, and an image output method flag bit under the camera trigger mode after switching. The image data output result corresponding to each set of state parameters of each virtual camera device is used to indicate whether the image data output after switching conforms to the switched camera trigger mode. The determination module is used to determine, based on the output results of all image data, whether the camera driver's switching of the camera trigger mode for the at least one virtual camera device is normal; The determining module is specifically used for: If the image data output result corresponding to each set of state parameters of each virtual camera device indicates that the output image data after switching matches the switched camera trigger mode, then it is determined that the camera trigger mode switching of the camera driver is normal. If the image data output result corresponding to any set of state parameters indicates that the output image data after the switch does not conform to the switched camera trigger mode, then it is determined that the camera trigger mode switching of the camera driver is abnormal.

5. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the camera-driven test method according to any one of claims 1-3.

6. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the camera-driven test method according to any one of claims 1-3.