Initialization method and device of vehicle-mounted camera, storage medium and electronic device
By obtaining and assigning business framework information of each hardware of the on-board camera, the problems of coupling and low initialization efficiency between various modules in the on-board camera system are solved, and a more efficient and flexible initialization process is achieved.
Patent Information
- Application Number
- CN202311269645.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2043-09-27
AI Technical Summary
In the on-board camera system, due to the different distances between each camera and the on-board controller, the intervention of the serializer and the deserializer increases the difficulty of drawing out the diagram, and there is coupling in the settings between each module, which affects the efficiency of the settings.
By detecting the initialization instructions of the on-board camera, the business framework information of the image sensor, serializer and deserializer is obtained, and the callback data set of the calling interface of the on-board camera is assigned based on this information to complete hardware initialization.
The coupling between each hardware is removed, and the efficiency and flexibility of initialization are improved, allowing non-professional users to initialize the on-board camera more conveniently and quickly.
Smart Images

Figure CN119729237A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle-mounted cameras, and in particular to an initialization method and device for a vehicle-mounted camera, a storage medium, and an electronic device. Background Art
[0002] In the related technology, in the vehicle camera system, since the distances from each camera to the vehicle controller soc are different and long, it is impossible to use the conventional wiring and camera connection method like mobile phones and other products, so there is the intervention of serializers and deserializers. The serializer and deserializer are connected through a GMSL (Gigabit Multimedia Serial Links) physical line. The sensor image data is converted into a GMSL signal through the serializer. After the deserializer receives the GMSL signal, it converts the GMSL signal into sensor raw data and passes it to the soc. Since GMSL technology has the advantages of high speed, long distance, and strong anti-interference, the sensor and serializer are one part, the deserializer and soc are one part, and the physical GMSL line is used to connect them in the middle, so that the sensor data can be transmitted to the soc end over a long distance.
[0003] Due to the addition of the serializer and deserializer, the serializer and deserializer need to be set up on the basis of the original sensor settings, which increases the difficulty of image output on the camera path. In addition, the settings of the sensor, serializer, and deserializer are coupled to a certain extent, and the settings of each module will also affect each other. When a deserializer is connected to different serializers, the settings of the deserializer will also be different to a certain extent.
[0004] With respect to the above-mentioned problems existing in the related technologies, no efficient and accurate solutions have been found yet. Summary of the invention
[0005] The present invention provides a vehicle-mounted camera initialization method and device, a storage medium, and an electronic device to solve technical problems in related technologies.
[0006] According to one embodiment of the present invention, a method for initializing a vehicle-mounted camera is provided, comprising: detecting an initialization instruction for a vehicle-mounted camera of a target vehicle, wherein the vehicle-mounted camera comprises an image sensor, a serializer, and a deserializer; obtaining first business framework information of the image sensor, obtaining second business framework information of the serializer, and obtaining third business framework information of the deserializer; assigning a callback data set of a calling interface of the vehicle-mounted camera according to the first business framework information, the second business framework information, and the third business framework information to complete hardware initialization of the vehicle-mounted camera.
[0007] Optionally, obtaining the first business framework information of the image sensor includes: obtaining the following business setting items of the image sensor: phase-locked loop frequency, frame frequency, data type, analog gain again, digital gain dgain, linear linear, trigger output, open flow, close flow, and reset.
[0008] Optionally, obtaining the second business framework information of the serializer includes: obtaining the following first business setting items of the serializer: mode, lane mapping, channel pipe mapping of port data, port opening status, video stream pipe opening status, video stream pipe sending, data format, virtual channel, general input and output GPIO, and reset.
[0009] Optionally, obtaining the second business framework information of the serializer includes: parsing the number of image sensor channels of the target vehicle; if the number of image sensor channels is multiple, obtaining the following second business setting items of the serializer: mode, lane mapping, channel pipe mapping of port data, port open status, video stream pipe open status, video stream pipe sending, data format, virtual channel, GPIO, reset, address change of serializer two-wire serial bus I2C slave device, mapping relationship of I2C slave device address corresponding to image sensor, and correspondence between GPIO pin of serializer and fsync pin of image sensor.
[0010] Optionally, obtaining the third business framework information of the deserializer includes: obtaining the following first business setting items of the serializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port port controller, phy copy, GPIO, reset.
[0011] Optionally, obtaining the third business framework information of the deserializer includes: parsing the number of image sensor channels of the target vehicle; if the number of image sensor channels is multiple, obtaining the following second business setting items of the deserializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, reset, and mapping relationship of deserializer GPIO pin to image sensor fsync pin.
[0012] Optionally, assigning a callback data set of the calling interface of the vehicle-mounted camera according to the first business framework information, the second business framework information, and the third business framework information includes: reading a first general data structure of an image sensor, reading a second general data structure of a serializer, and reading a third general data structure of a deserializer, wherein the first general data structure includes multiple first members, each first member corresponds to a set of data sets that implement the first business framework information, the second general data structure includes multiple second members, each second member corresponds to a set of data sets that implement the second business framework information, and the third general data structure includes multiple third members, each third member corresponds to a set of data sets that implement the third business framework information; parsing the first hardware model of the image sensor, parsing the second hardware model of the serializer, and parsing the third hardware model of the deserializer; searching the first data set matching the first hardware model in the first general data structure, searching the second data set matching the second hardware model in the second general data structure, and searching the third data set matching the third hardware model in the third general data structure; using the first data set, the second data set, and the third data set to assign a callback data set of the calling interface of the vehicle-mounted camera.
[0013] Optionally, using the first data set, the second data set, and the third data set to assign a callback data set of the calling interface of the vehicle-mounted camera includes: searching for the first calling interface of the image sensor, searching for the second calling interface of the serializer, and searching for the third calling interface of the deserializer; using the first data set to assign a callback data set of the first calling interface, using the second data set to assign a callback data set of the second calling interface, and using the third data set to assign a callback data set of the third calling interface.
[0014] Optionally, after assigning a callback data set of the calling interface of the vehicle-mounted camera according to the first business framework information, the second business framework information, and the third business framework information, the method further includes: receiving an image output instruction of the vehicle-mounted camera; calling the callback data set of the vehicle-mounted camera based on the image output instruction; and using the callback data set to control the vehicle-mounted camera to start streaming out the image.
[0015] According to another embodiment of the present invention, there is provided an initialization device for a vehicle-mounted camera, comprising: a detection module, used to detect an initialization instruction for a vehicle-mounted camera of a target vehicle, wherein the vehicle-mounted camera comprises an image sensor, a serializer, and a deserializer; an acquisition module, used to acquire first business framework information of the image sensor, acquire second business framework information of the serializer, and acquire third business framework information of the deserializer; an initialization module, used to assign a callback data set of a calling interface of the vehicle-mounted camera according to the first business framework information, the second business framework information, and the third business framework information, so as to complete the hardware initialization of the vehicle-mounted camera.
[0016] Optionally, the acquisition module includes: a first acquisition unit, used to acquire the following business setting items of the image sensor: phase-locked loop frequency, frame frequency, data type, analog gain again, digital gain dgain, linear linear, trigger output, open flow, close flow, and reset.
[0017] Optionally, the acquisition module includes: a second acquisition unit, used to obtain the following first business setting items of the serializer: mode, lane mapping, channel pipe mapping of port data, port opening status, video stream pipe opening status, video stream pipe sending, data format, virtual channel, general input and output GPIO, and reset.
[0018] Optionally, the acquisition module includes: a first parsing unit, used to parse the number of image sensor channels of the target vehicle; a third acquisition unit, used to obtain the following second business setting items of the serializer if the number of image sensors is multiple: mode, lane mapping, channel pipe mapping of port data, port open status, video stream pipe open status, video stream pipe sending, data format, virtual channel, GPIO, reset, address change of serializer two-wire serial bus I2C slave device, mapping relationship of I2C slave device address corresponding to image sensor, and correspondence between GPIO pin of serializer and fsync pin of image sensor.
[0019] Optionally, the acquisition module includes: a fourth acquisition unit, used to obtain the following first business setting items of the serializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port port controller, phy copy, GPIO, reset.
[0020] Optionally, the acquisition module includes: a second parsing unit, used to parse the number of image sensor channels of the target vehicle; a fifth acquisition unit, used to obtain the following second business setting items of the deserializer if the number of image sensors is multiple: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, reset, and mapping relationship of deserializer GPIO pin to image sensor fsync pin.
[0021] Optionally, the initialization module includes: a reading unit, used to read a first general data structure of an image sensor, a second general data structure of a serializer, and a third general data structure of a deserializer, wherein the first general data structure includes multiple first members, each first member corresponds to a set of data sets that implement the first business framework information, the second general data structure includes multiple second members, each second member corresponds to a set of data sets that implement the second business framework information, and the third general data structure includes multiple third members, each third member corresponds to a set of data sets that implement the third business framework information; a parsing unit, used to parse the first hardware model of the image sensor, the second hardware model of the serializer, and the third hardware model of the deserializer; a search unit, used to search for a first data set matching the first hardware model in the first general data structure, search for a second data set matching the second hardware model in the second general data structure, and search for a third data set matching the third hardware model in the third general data structure; an assignment unit, used to assign a callback data set of the calling interface of the vehicle-mounted camera using the first data set, the second data set, and the third data set.
[0022] Optionally, the assignment unit includes: a search subunit, used to search for the first calling interface of the image sensor, search for the second calling interface of the serializer, and search for the third calling interface of the deserializer; an assignment subunit, used to use the first data set to assign a callback data set of the first calling interface, use the second data set to assign a callback data set of the second calling interface, and use the third data set to assign a callback data set of the third calling interface.
[0023] Optionally, the device also includes: a receiving module, used to receive the image output instruction of the vehicle-mounted camera after the initialization module assigns the callback data set of the calling interface of the vehicle-mounted camera according to the first business framework information, the second business framework information, and the third business framework information; a calling module, used to call the callback data set of the vehicle-mounted camera based on the image output instruction; and a control module, used to use the callback data set to control the vehicle-mounted camera to start streaming images.
[0024] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.
[0025] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.
[0026] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0027] Beneficial effects of the present invention:
[0028] 1. To a certain extent, it solves the configuration difficulties and eliminates the configuration coupling caused by the combination of different types of image sensors, serializers, and deserializers; when one of the hardware modules changes its model and needs to be reconfigured, there is no need to set the adaptability of the other two hardware modules, and the configuration is highly flexible;
[0029] 2. When initializing the vehicle-mounted camera, non-professional users do not need to set up the entire link from the image sensor through the serializer to the deserializer. Instead, they can directly use the business framework information of each hardware for adaptation, which makes configuration more convenient, faster and more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0031] Figure 1 is a hardware structure block diagram of a vehicle according to an embodiment of the present invention;
[0032] Figure 2 is a flow chart of a method for initializing a vehicle-mounted camera according to an embodiment of the present invention;
[0033] Figure 3 is a hardware schematic diagram of a vehicle-mounted camera in an embodiment of the present invention;
[0034] Figure 4 is a business logic diagram of a vehicle-mounted camera in an embodiment of the present invention;
[0035] Figure 5 The invention is a structural block diagram of an initialization device for a vehicle-mounted camera according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0038] Example 1
[0039] The method embodiment provided in the first embodiment of the present application can be executed in an onboard chip, a vehicle or a similar processing device. Taking running on a vehicle as an example, Figure 1 FIG. 1 is a hardware structure diagram of a vehicle according to an embodiment of the present invention. Figure 1 As shown, the vehicle may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the above vehicle may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is for illustration only and does not limit the structure of the above vehicle. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0040] The memory 104 can be used to store vehicle programs, for example, software programs and modules of application software, such as a vehicle program corresponding to an initialization method of a vehicle-mounted camera in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the vehicle program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the vehicle via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0041] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the vehicle. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0042] In this embodiment, a method for initializing a vehicle-mounted camera is provided. Figure 2 is a flow chart of a method for initializing a vehicle-mounted camera according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following steps:
[0043] Step S202, detecting an initialization instruction for a vehicle-mounted camera of a target vehicle, wherein the vehicle-mounted camera includes an image sensor, a serializer, and a deserializer;
[0044] In this embodiment, the image sensor (sensor) is connected to the serializer through CSI, the serializer and the deserializer are connected through GMSL, and the deserializer and the soc (chip) are connected through I2C and GPIO (General-purpose input / output). Figure 3It is a hardware schematic diagram of the vehicle-mounted camera in an embodiment of the present invention, wherein the sensor and the serializer are integrated on the camera module, and the deserializer is integrated on the board (circuit board) where the soc is located.
[0045] Step S204, obtaining first service framework information of the image sensor, obtaining second service framework information of the serializer, and obtaining third service framework information of the deserializer;
[0046] Step S206 , assigning a value to a callback data set of a calling interface of the vehicle-mounted camera according to the first service framework information, the second service framework information, and the third service framework information to complete hardware initialization of the vehicle-mounted camera.
[0047] Through the above steps, the initialization instruction for the vehicle-mounted camera of the target car is detected, wherein the vehicle-mounted camera includes an image sensor, a serializer, and a deserializer; the first business framework information of the image sensor is obtained, the second business framework information of the serializer is obtained, and the third business framework information of the deserializer is obtained; the callback data set of the calling interface of the vehicle-mounted camera is assigned according to the first business framework information, the second business framework information, and the third business framework information to complete the hardware initialization of the vehicle-mounted camera, and the business framework information of each hardware of the vehicle-mounted camera is used for initialization, so that multiple models of the same hardware can be adapted during initialization, and the coupling between the various hardware in the vehicle-mounted camera is released, and the technical problem of low initialization setting efficiency caused by high coupling of various hardware in the vehicle-mounted camera in the related technology is solved, thereby improving the initialization efficiency of the vehicle-mounted camera.
[0048] Figure 4 It is the business logic diagram of the vehicle camera in the embodiment of the present invention. The business abstraction and modularization of the vehicle camera flow diagram are carried out. The data collected by the sensor is sequentially passed through the serializer (data line 0~n, line (lane) mapping, controller 0~n, channel (pipe) mapping, channel mapping, channel 0~n, gmsl core), deserializer (gmsl core, channel routing, channel 0~n, controller mapping, controller 0~n, line mapping, data line 0~n), and chip from the sensor to the chip. The business framework information (first business framework information, second business framework information, and third business framework information) of this embodiment is for each logical node after the above abstraction, and the business framework information between two logical nodes.
[0049] In one implementation of this embodiment, obtaining the first business framework information of the image sensor includes: obtaining the following business setting items of the image sensor: phase-locked loop frequency, frame frequency, data type, analog gain again, digital gain dgain, linear linear, trigger output, open flow, close flow, and reset.
[0050] In one example, for different sensor (image sensor) settings, abstraction is performed according to the following business logic: phase-locked loop frequency settings, frame frequency settings, data type settings, again settings, dgain settings, linear settings, trigger output settings, on-flow settings, off-flow settings, and reset settings.
[0051] The logic of setting for sensors of different models is consistent, but they are different in specific registers (data sets used by registers to store data structures). The services of different sensors can be abstracted and modularized. A sensor data structure is established. According to the above business logic division, members corresponding to business setting items are established in the data structure. Each member is a specific data set.
[0052] In one implementation of this embodiment, obtaining the second business framework information of the serializer includes: obtaining the following first business setting items of the serializer: mode, lane mapping, channel pipe mapping of port data, port opening status, video stream pipe opening status, video stream pipe sending, data format, virtual channel, general input and output GPIO, reset.
[0053] For serializer settings, they can be divided into the following according to the business: mode settings, lane mapping settings, port data mapping to video pipe settings, port opening, video stream pipe opening, video stream pipe sending, data format settings, virtual channel settings, GPIO settings, and reset settings.
[0054] In some scenarios, the serializer is connected to multiple image sensors, and obtaining the second business framework information of the serializer includes: parsing the number of image sensor channels of the target vehicle; if the number of image sensor channels is multiple, obtaining the following second business setting items of the serializer: mode, lane mapping, channel pipe mapping of port data, port open state, video stream pipe open state, video stream pipe sending, data format, virtual channel, GPIO, reset, serializer I2C (Inter-Integrated Circuit, two-wire serial bus) slave device address change, corresponding image sensor I2C slave device address mapping relationship, and the correspondence between the serializer GPIO pin and the image sensor fsync pin.
[0055] If multiple cameras are used to output images, in order to avoid the problem of overlapping I2C slave addresses between multiple cameras of the same model, the following settings need to be made: change the serializer I2C slave device address, and map the corresponding sensor's I2C slave device address to a different I2C slave device address. Considering another problem of multiple cameras outputting images, the following settings need to be made to synchronize the output between cameras: the serializer gpio pin is used as the receiving end to pass the signal sent by the deserializer gpio to the sensor fsync pin settings.
[0056] The logical business of serializers of different models in terms of settings is consistent. According to the business settings mentioned above, the business of different serializers can be abstracted and modularized. Establish a serializer data structure, and according to the above business logic division, establish members corresponding to the above business settings in the data structure, and each member is a specific data set.
[0057] In one implementation of this embodiment, obtaining the third business framework information of the deserializer includes: obtaining the following first business setting items of the serializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port port controller, phycopy, GPIO, reset.
[0058] For the deserializer settings, the services are divided into the following: video stream pipe routing settings, port controller mapping settings, mode settings, Lane mapping settings, mapping of video stream pipe data from src space to dest space settings, mapping of dest space to port controller settings, phy copy settings, GPIO settings, and reset settings.
[0059] In some scenarios, the serializer is connected to multiple image sensors, and obtaining the third service framework information of the deserializer includes: parsing the number of image sensor channels of the target vehicle; if the number of image sensor channels is multiple, obtaining the following second service setting items of the deserializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, reset, and mapping relationship of deserializer GPIO pin to image sensor fsync pin.
[0060] If multiple cameras are used for image output, the following settings need to be made to ensure synchronization between cameras: the deserializer gpio pin is used as the transmitter and is mapped to the sensor fsync pin through the serializer.
[0061] The logical services of different deserializer models in terms of settings are consistent. Based on the services mentioned above, the services of different deserializers can be abstracted and modularized. A deserializer data structure is established. Based on the abstraction of the above business logic, members corresponding to the business setting items are established in the data structure. Each member is a specifically implemented data set.
[0062] In an example of the present embodiment, assigning a callback data set of a calling interface of a vehicle-mounted camera according to the first business framework information, the second business framework information, and the third business framework information includes: reading a first general data structure of an image sensor, reading a second general data structure of a serializer, and reading a third general data structure of a deserializer, wherein the first general data structure includes a plurality of first members, each first member corresponds to a set of data sets implementing the first business framework information, the second general data structure includes a plurality of second members, each second member corresponds to a set of data sets implementing the second business framework information, and the third general data structure includes a plurality of third members, each third member corresponds to a set of data sets implementing the third business framework information; parsing a first hardware model of the image sensor, parsing a second hardware model of the serializer, and parsing a third hardware model of the deserializer; searching for a first data set matching the first hardware model in the first general data structure, searching for a second data set matching the second hardware model in the second general data structure, and searching for a third data set matching the third hardware model in the third general data structure; and using the first data set, the second data set, and the third data set to assign a callback data set of the calling interface of the vehicle-mounted camera.
[0063] Optionally, using the first data set, the second data set, and the third data set to assign a callback data set of the calling interface of the vehicle-mounted camera includes: searching for the first calling interface of the image sensor, searching for the second calling interface of the serializer, and searching for the third calling interface of the deserializer; using the first data set to assign a callback data set of the first calling interface, using the second data set to assign a callback data set of the second calling interface, and using the third data set to assign a callback data set of the third calling interface.
[0064] By establishing a configuration file parsing layer at the call layer, the configuration file records the models of the sensor, serializer, and deserializer to be used, so as to achieve a flexible and free combination of sensors, serializers, and deserializers. After completing the parsing of the configuration file, the parsing layer obtains the model of the sensor, the model of the serializer, and the model of the deserializer according to the configuration file, finds the data set in the corresponding data structure according to these models, and assigns the sensor data structure, the serializer data structure, and the deserializer data structure to the calling interface, that is, assigns the members (callback data sets) in the sensor calling interface, the serializer calling interface, and the deserializer calling interface.
[0065] In this embodiment, after assigning the callback data set of the calling interface of the vehicle camera according to the first business framework information, the second business framework information, and the third business framework information, it also includes: receiving the output instruction of the vehicle camera; calling the callback data set of the vehicle camera based on the output instruction; and using the callback data set to control the vehicle camera to start streaming the output image.
[0066] When the upper-layer application calls the camera to output images, it only needs to call the callback data sets in the sensor, serializer, and deserializer data structures according to the business logic of opening, initializing, opening the stream to output images, closing the stream to stop outputting images, deinitializing, closing, and resetting. For example, the callback data set in the sensor call interface is empty at the beginning. Only when the parsing layer finds the business data set of the corresponding model according to the device ID of the configuration file, then the members (callback data sets) in the sensor call interface have specific content, and then the callback data set in the sensor call interface can be called according to the business.
[0067] In this embodiment, the setting methods of sensors, serializers, and deserializers are abstracted and modularized according to fixed business logic, and different models of sensors, serializers, and deserializers provide a unified calling interface. In this embodiment, only the setting methods of different sensors, serializers, and deserializers need to be provided, and the caller only needs to select these setting methods, which can solve the difficulty of configuration to a certain extent and eliminate the coupling of configurations brought about by the combination of different sensors, serializers, and deserializers; even if the model of one of the hardware modules changes, only the setting method of the hardware module under this framework needs to be provided, and then it can be selected to use it, without setting the other two hardware modules.
[0068] For example, a successful image output combination, that is, the sensor model, serializer model, and deserializer model are all fixed. Once the deserializer model is changed, the previous method requires re-matching the settings between the deserializer, serializer, and sensor; according to the solution of this embodiment, it is only necessary to abstract these settings of the deserializer according to the business logic under the framework, and the caller only needs to choose to use the setting solution provided by the new model deserializer to complete the hardware initialization.
[0069] By adopting the solution of this embodiment, the business is extracted, abstracted and modularized. When encountering different types of sensors, serializers and deserializers in the future, it is only necessary to adapt them according to this idea and implement the sensor, serializer and deserializer callback data sets, so that the flow chart can be opened well. There is no need to set up the entire link from the sensor through the serializer to the deserializer. When using it, it is only necessary to select the callback function of the corresponding model according to the actual situation and the combination of the specific sensor model, serializer model and deserializer model. It is also friendly to novices who debug cameras. When replacing hardware modules, it can reduce a certain amount of workload and reduce the coupling between sensors, deserializers and serializers. At the same time, it can also allow the caller to better understand the working mode of sensors, serializers and deserializers, so as to achieve higher flexibility in configuration and make configuration more convenient and quick.
[0070] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0071] Example 2
[0072] In this embodiment, a vehicle camera initialization device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements 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.
[0073] Figure 5is a structural block diagram of an initialization device for a vehicle-mounted camera according to an embodiment of the present invention, such as Figure 5 As shown, the device comprises:
[0074] A detection module 50, configured to detect an initialization instruction for an onboard camera of a target vehicle, wherein the onboard camera includes an image sensor, a serializer, and a deserializer;
[0075] An acquisition module 52, configured to acquire first service framework information of the image sensor, acquire second service framework information of the serializer, and acquire third service framework information of the deserializer;
[0076] The initialization module 54 is used to assign a callback data set of the calling interface of the vehicle-mounted camera according to the first service framework information, the second service framework information, and the third service framework information to complete the hardware initialization of the vehicle-mounted camera.
[0077] Optionally, the acquisition module includes: a first acquisition unit, used to acquire the following business setting items of the image sensor: phase-locked loop frequency, frame frequency, data type, analog gain again, digital gain dgain, linear linear, trigger output, open flow, close flow, and reset.
[0078] Optionally, the acquisition module includes: a second acquisition unit, used to obtain the following first business setting items of the serializer: mode, lane mapping, channel pipe mapping of port data, port opening status, video stream pipe opening status, video stream pipe sending, data format, virtual channel, general input and output GPIO, and reset.
[0079] Optionally, the acquisition module includes: a first parsing unit, used to parse the number of image sensor channels of the target vehicle; a third acquisition unit, used to obtain the following second business setting items of the serializer if the number of image sensors is multiple: mode, lane mapping, channel pipe mapping of port data, port open status, video stream pipe open status, video stream pipe sending, data format, virtual channel, GPIO, reset, address change of serializer two-wire serial bus I2C slave device, mapping relationship of I2C slave device address corresponding to image sensor, and correspondence between GPIO pin of serializer and fsync pin of image sensor.
[0080] Optionally, the acquisition module includes: a fourth acquisition unit, used to obtain the following first business setting items of the serializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port port controller, phy copy, GPIO, reset.
[0081] Optionally, the acquisition module includes: a second parsing unit, used to parse the number of image sensor channels of the target vehicle; a fifth acquisition unit, used to obtain the following second business setting items of the deserializer if the number of image sensors is multiple: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, reset, and mapping relationship of deserializer GPIO pin to image sensor fsync pin.
[0082] Optionally, the initialization module includes: a reading unit, used to read a first general data structure of an image sensor, a second general data structure of a serializer, and a third general data structure of a deserializer, wherein the first general data structure includes multiple first members, each first member corresponds to a set of data sets that implement the first business framework information, the second general data structure includes multiple second members, each second member corresponds to a set of data sets that implement the second business framework information, and the third general data structure includes multiple third members, each third member corresponds to a set of data sets that implement the third business framework information; a parsing unit, used to parse the first hardware model of the image sensor, the second hardware model of the serializer, and the third hardware model of the deserializer; a search unit, used to search for a first data set matching the first hardware model in the first general data structure, search for a second data set matching the second hardware model in the second general data structure, and search for a third data set matching the third hardware model in the third general data structure; an assignment unit, used to assign a callback data set of the calling interface of the vehicle-mounted camera using the first data set, the second data set, and the third data set.
[0083] Optionally, the assignment unit includes: a search subunit, used to search for the first calling interface of the image sensor, search for the second calling interface of the serializer, and search for the third calling interface of the deserializer; an assignment subunit, used to use the first data set to assign a callback data set of the first calling interface, use the second data set to assign a callback data set of the second calling interface, and use the third data set to assign a callback data set of the third calling interface.
[0084] Optionally, the device also includes: a receiving module, used to receive the image output instruction of the vehicle-mounted camera after the initialization module assigns the callback data set of the calling interface of the vehicle-mounted camera according to the first business framework information, the second business framework information, and the third business framework information; a calling module, used to call the callback data set of the vehicle-mounted camera based on the image output instruction; and a control module, used to use the callback data set to control the vehicle-mounted camera to start streaming images.
[0085] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0086] Example 3
[0087] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0088] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0089] S1, detecting an initialization instruction for an onboard camera of a target vehicle, wherein the onboard camera includes an image sensor, a serializer, and a deserializer;
[0090] S2, obtaining first service framework information of the image sensor, obtaining second service framework information of the serializer, and obtaining third service framework information of the deserializer;
[0091] S3, assigning a callback data set of the calling interface of the vehicle-mounted camera according to the first service framework information, the second service framework information, and the third service framework information to complete hardware initialization of the vehicle-mounted camera.
[0092] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0093] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0094] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0095] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0096] S1, detecting an initialization instruction for an onboard camera of a target vehicle, wherein the onboard camera includes an image sensor, a serializer, and a deserializer;
[0097] S2, obtaining first service framework information of the image sensor, obtaining second service framework information of the serializer, and obtaining third service framework information of the deserializer;
[0098] S3, assigning a callback data set of the calling interface of the vehicle-mounted camera according to the first service framework information, the second service framework information, and the third service framework information to complete hardware initialization of the vehicle-mounted camera.
[0099] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0100] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for initializing a vehicle-mounted camera, characterized in that: include: Detecting an initialization instruction for an onboard camera of a target vehicle, wherein the onboard camera includes an image sensor, a serializer, and a deserializer; Acquire first service framework information of the image sensor, acquire second service framework information of the serializer, and acquire third service framework information of the deserializer; The callback data set of the calling interface of the vehicle-mounted camera is assigned a value according to the first service framework information, the second service framework information, and the third service framework information to complete the hardware initialization of the vehicle-mounted camera.
2. The method according to claim 1, characterized in that Acquiring the first service framework information of the image sensor includes: The following business setting items of the image sensor are obtained: phase-locked loop frequency, frame frequency, data type, analog gain again, digital gain dgain, linear linear, trigger image output, open flow, close flow, reset.
3. The method according to claim 1, characterized in that Acquiring the second service framework information of the serializer includes: Get the following first business setting items of the serializer: mode, lane mapping, channel pipe mapping of port data, port opening state, video stream pipe opening state, video stream pipe sending, data format, virtual channel, general input and output GPIO, reset.
4. The method according to claim 1, characterized in that: Acquiring the second service framework information of the serializer includes: Analyze the number of image sensors of the target vehicle; If the image sensor has multiple channels, obtain the following second business setting items of the serializer: mode, lane mapping, channel pipe mapping of port data, port opening status, video stream pipe opening status, video stream pipe sending, data format, virtual channel, GPIO, reset, serializer two-wire serial bus I2C slave device address change, corresponding image sensor I2C slave device address mapping relationship, the correspondence between the serializer GPIO pin and the image sensor fsync pin.
5. The method according to claim 1, characterized in that Acquiring the third service framework information of the deserializer includes: Obtain the following first business setting items of the serializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port port controller, phy copy, GPIO, reset.
6. The method according to claim 1, characterized in that Acquiring the third service framework information of the deserializer includes: Analyze the number of image sensors of the target vehicle; If the image sensor has multiple channels, obtain the following second business setting items of the deserializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phycopy, GPIO, reset, and mapping relationship of deserializer GPIO pin to image sensor fsync pin.
7. The method according to claim 1, characterized in that Assigning a callback data set of the calling interface of the vehicle-mounted camera according to the first service framework information, the second service framework information, and the third service framework information includes: A first general data structure for reading an image sensor, a second general data structure for reading a serializer, and a third general data structure for reading a deserializer, wherein the first general data structure includes a plurality of first members, each of which corresponds to a set of data sets that implement the first business framework information, the second general data structure includes a plurality of second members, each of which corresponds to a set of data sets that implement the second business framework information, and the third general data structure includes a plurality of third members, each of which corresponds to a set of data sets that implement the third business framework information; Parsing a first hardware model of the image sensor, parsing a second hardware model of the serializer, and parsing a third hardware model of the deserializer; Searching the first universal data structure for a first data set matching the first hardware model, searching the second universal data structure for a second data set matching the second hardware model, and searching the third universal data structure for a third data set matching the third hardware model; The first data set, the second data set, and the third data set are used to assign values to the callback data set of the calling interface of the vehicle-mounted camera.
8. The method according to claim 7, characterized in that Using the first data set, the second data set, and the third data set to assign a value to a callback data set of a calling interface of the vehicle-mounted camera includes: Searching for a first calling interface of the image sensor, searching for a second calling interface of the serializer, and searching for a third calling interface of the deserializer; The first data set is used to assign a value to the callback data set of the first calling interface, the second data set is used to assign a value to the callback data set of the second calling interface, and the third data set is used to assign a value to the callback data set of the third calling interface.
9. The method according to claim 1, characterized in that: After assigning a value to the callback data set of the calling interface of the vehicle-mounted camera according to the first service framework information, the second service framework information, and the third service framework information, the method further includes: Receiving an image output instruction from the vehicle-mounted camera; Calling a callback data set of the vehicle-mounted camera based on the image output instruction; The callback data set is used to control the vehicle-mounted camera to start streaming images.
10. An initialization device for a vehicle-mounted camera, characterized in that: include: A detection module, used to detect an initialization instruction for an on-board camera of a target vehicle, wherein the on-board camera includes an image sensor, a serializer, and a deserializer; An acquisition module, used for acquiring first service framework information of the image sensor, acquiring second service framework information of the serializer, and acquiring third service framework information of the deserializer; An initialization module is used to assign a callback data set of the calling interface of the vehicle-mounted camera according to the first service framework information, the second service framework information, and the third service framework information to complete the hardware initialization of the vehicle-mounted camera.
11. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 9 when executed.
12. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Vehicle-mounted camera system, automatic driving vehicle and configuration method of vehicle-mounted camera
CN112272276A
Vehicle-mounted camera configuration method and device, electronic equipment and storage medium
CN112689083A
Configuration method and device
CN114697512A
Camera configuration method and device and computer readable storage medium
CN114840262A
Driving method and device of vehicle-mounted camera system
CN115734070A
Cited By
Camera configuration system and method, vehicle, storage medium and program product
CN120786173A