Image pickup system and electronic apparatus
By introducing a microcontroller into the camera system and using the communication bus to connect the camera's control interface, the problem of limited resources of the microprocessor interface is solved, and more efficient camera control and richer functions are achieved.
Patent Information
- Application Number
- CN202411934465.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-04
AI Technical Summary
The interface resources of the microprocessor are limited, which limits the number and types of cameras mounted in the camera system, and affects the implementation of camera effects and functions.
Design a camera system, including a microprocessor, multiple cameras and microcontrollers, and connect the camera's control interface and microcontroller through a communication bus. The microprocessor communicates with the microcontroller to control the camera, avoiding direct control through the microprocessor's interface resources.
It effectively increases the number of cameras mounted on the camera system, achieves better camera effects and richer functions, and avoids the problem of the camera not being able to drive normally due to insufficient interface resources.
Smart Images

Figure CN119767135A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of electronic systems, and in particular to a camera system and an electronic device. Background Art
[0002] More and more electronic devices use camera systems with multiple cameras to improve camera effects or expand functions. For example, in VR (virtual reality) / AR (augmented reality) smart devices, multiple cameras are often used to obtain images to achieve perspective, eye tracking, spatial audio, gestures and other functions. Different application scenarios and different functions require the use of different models of cameras, and the number of cameras of the same model is also different. For example, the eye tracking function often uses an IR (infrared) camera of the same model for each eye. For another example, the perspective function uses two cameras of the same model. For another example, when using spatial modeling related functions, 4 or even more cameras of the same model are used.
[0003] Generally, the camera is provided with an IIC (Inter-Integrated Circuit) interface and a MIPI (Mobile Industry Processor Interface) interface. The camera receives various control instructions or configuration parameters through the IIC interface and sends video data through the MIPI interface. However, if the IIC interface resources of the MPU (Microprocessor Unit) are limited, the number of cameras mounted in the camera system will be limited, thereby affecting the function of the camera system.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to overcome the above-mentioned deficiencies of the prior art and to provide a camera system and electronic equipment to avoid the restriction of the interface resources of the microprocessor on the number and types of cameras.
[0006] According to one aspect of the present disclosure, there is provided a camera system, comprising a microprocessor, a plurality of cameras and a microcontroller for controlling each of the cameras; wherein the video interface of each of the cameras is respectively connected to the microprocessor, the control interface of each of the cameras is respectively connected to the microcontroller via a communication bus, and the microprocessor and the microcontroller are communicatively connected; wherein the control interfaces of at least two of the cameras are connected to different communication buses;
[0007] The microprocessor is configured to directly acquire video data from the camera, and is configured to send control instructions for controlling the camera to the microcontroller;
[0008] The microcontroller is configured to control the camera in response to a control instruction from the microprocessor.
[0009] According to an embodiment of the present disclosure, the microprocessor is configured to be able to run the driver of any one of the cameras; the driver of the camera can send the control instruction to the microcontroller;
[0010] The microcontroller is configured to control the camera according to the control instruction sent by the driver of the camera.
[0011] According to one embodiment of the present disclosure, at least one initialization code of at least one camera is stored in the memory of the microcontroller;
[0012] The microprocessor is configured to send an initialization instruction of the selected camera to the microcontroller;
[0013] The microcontroller is configured to, in response to the initialization instruction of the selected camera, write an initialization code corresponding to the initialization instruction of the selected camera into the corresponding selected camera.
[0014] According to an embodiment of the present disclosure, the camera has a reset interface, and the reset interface of the camera is electrically connected to the reset interface of the microcontroller;
[0015] The microprocessor is configured to send a reset instruction of the selected camera to the microcontroller;
[0016] The microcontroller is configured to respond to a reset instruction of the selected camera to reset the selected camera.
[0017] According to an embodiment of the present disclosure, the microprocessor is configured to be able to send a configuration instruction of the selected camera to the microcontroller;
[0018] The microcontroller is configured to respond to a configuration instruction of the selected camera and perform parameter configuration on the selected camera.
[0019] According to an embodiment of the present disclosure, the microprocessor is configured to be able to send a configuration switching instruction of the selected camera to the microcontroller;
[0020] The microcontroller is configured to respond to a configuration switching instruction of the selected camera and write a new initialization code to the selected camera.
[0021] According to an embodiment of the present disclosure, the microprocessor is configured to be able to send a stream opening instruction or a closing instruction of the selected camera to the microcontroller;
[0022] The microcontroller is configured to write an open-stream value to the selected camera in response to an open-stream instruction of the selected camera, and to close the data output of the camera in response to a close instruction of the selected camera.
[0023] According to an embodiment of the present disclosure, the microcontroller and the microprocessor are interactively connected via an IIC bus;
[0024] The camera is connected to the microcontroller via an IIC bus;
[0025] The camera has a MIPI interface, and the MIPI interface of the camera is connected to the MIPI interface of the microprocessor;
[0026] The camera has a clock input interface, and the clock input interface of the camera is connected to the clock output interface of the microcontroller or the clock output interface of the microprocessor.
[0027] According to an implementation manner of the present disclosure, at least two of the cameras are of the same model.
[0028] According to another aspect of the present disclosure, an electronic device is provided, comprising the above-mentioned camera system.
[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0031] Figure 1 The figure is a schematic diagram of the structure of a camera system in one embodiment of the present disclosure.
[0032] Figure 2 The figure is a schematic diagram of the structure of a camera system in one embodiment of the present disclosure.
[0033] Figure 3 The figure is a schematic diagram of the structure of a camera system in one embodiment of the present disclosure.
[0034] Figure 4 The figure is a schematic diagram of the structure of a camera system in one embodiment of the present disclosure.
[0035] Figure 5 The figure is a schematic diagram of a process of calling a camera in one embodiment of the present disclosure. DETAILED DESCRIPTION
[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in a variety of forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present disclosure will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar structures, and thus their detailed description will be omitted. In addition, the drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale.
[0037] Although relative terms such as "upper" and "lower" are used in this specification to describe the relative relationship of one component of the illustration to another component, these terms are used in this specification only for convenience, such as according to the orientation of the examples described in the drawings. It is understood that if the device of the illustration is turned upside down, the component described as "upper" will become the component "lower". When a structure is "on" other structures, it may mean that the structure is formed integrally on the other structure, or that the structure is "directly" disposed on the other structure, or that the structure is "indirectly" disposed on the other structure through another structure.
[0038] The terms "a", "an", "the", "said" and "at least one" are used to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusive meaning and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first", "second" and "third" etc. are used merely as labels and are not intended to limit the quantity of their objects.
[0039] In some electronic devices, cameras of the same model often only support two IIC addresses, or even do not support multi-address configuration. For cameras of the same model that only support two IIC addresses, at most two cameras of the same model can be mounted on each IIC bus. For cameras of the same model that do not support multi-address configuration, these cameras of the same model need to be mounted on different IIC buses. The IIC interface resources on the MPU (microprocessor) are limited, which leads to a limited number of cameras that can be directly mounted, otherwise some cameras will not be able to be driven normally.
[0040] To this end, the present disclosure provides a camera system, see Figure 1, the camera system includes an MPU (microprocessor), multiple cameras and an MCU (microcontroller) for controlling each camera. The video interface (interface for outputting video data, such as a MIPI interface) of each camera is respectively connected to the MPU; the control interface (interface for controlling / configuring the camera) of each camera is respectively connected to the MCU through a communication bus. The MPU and the MCU can be communicatively connected. At least two of the control interfaces of the cameras are connected to different communication buses. The microprocessor is configured to be able to directly obtain video data from the camera, and is configured to be able to send control instructions for controlling the camera to the microcontroller. The microcontroller is configured to control the camera in response to the control instructions of the microprocessor.
[0041] In this implementation, the MPU does not need to directly control the camera, but sends the control instructions for controlling the camera to the MCU, and the MCU controls the corresponding camera according to the control instructions. The communication between the MCU and the MPU only occupies one communication interface, such as only one IIC interface, thereby greatly saving the interface resources of the MPU. At the same time, the interface resources of the MCU are more sufficient, and there will be no problem of limiting the number of cameras due to insufficient interface resources.
[0042] In this embodiment, the video data of the camera can be sent directly to the MPU through the video interface without being forwarded by the MCU, which avoids problems such as video delay. At the same time, the MPU is not very time-sensitive to the control of the camera, so its control instructions can be sent to the MCU, and each camera can be controlled after being parsed by the MCU, which overcomes the problem of insufficient control interface resources of the MPU. In other words, the embodiment of the present disclosure can increase the number of cameras mounted on the camera system to achieve better camera effects or richer functions without affecting the low-latency transmission of video data.
[0043] In one embodiment of the present disclosure, see Figure 2 , the MCU and the MPU are connected through the IIC bus. For example, the MPU has at least one IIC interface (at least including the first IIC interface of the MPU), and the MCU has multiple IIC interfaces (at least including the first IIC interface of the MCU). The first IIC interface of the MPU and the first IIC interface of the MCU are mounted on the first IIC bus. The MPU and the MCU can interact through the first IIC bus. For example, the MPU can send control instructions to the MCU through the first IIC bus. In this way, the MPU can control each camera through only one IIC interface, avoiding the limitation on the number of cameras due to insufficient interface resources on the MPU.
[0044] exist Figure 2 In the example, the IIC bus has a clock line SCL for transmitting a clock signal and a data line SDA for transmitting data; the IIC interface connected to the IIC bus has a clock pin for connecting to the clock line SCL and a data pin for connecting to the data line SDA. When device A and device B are connected through the IIC bus, an IIC interface on device A is connected to an IIC interface on device B through the IIC bus. Among them, the clock pin of the IIC interface on device A, the clock pin of the IIC interface on device B, and the clock line SCL of the IIC bus are electrically connected; the data pin of the IIC interface on device A, the data pin of the IIC interface on device B, and the data line SDA of the IIC bus are electrically connected. When the IIC interface of a device is connected to an IIC bus, the device is mounted on the IIC bus.
[0045] It is understandable that the interaction between the MPU and the MCU is not limited to the MPU sending control instructions to the MCU, and other types of communication can also be performed between the MPU and the MCU. For example, the MPU can send some setting parameters and other data to the MCU, or the MPU can send update information to the MCU to update the configuration or program of the MCU, or the MCU can send its own status information to the MPU, or the MCU can send the status information of the camera to the MPU, etc. The embodiments of the present disclosure do not limit the content of the interaction between the MPU and the MCU.
[0046] exist Figure 2 In the example, the MPU and the MCU are interactively connected via the IIC bus. It is understandable that in other embodiments of the present disclosure, the MPU and the MCU may also interact in other ways.
[0047] In one embodiment of the present disclosure, see Figure 2 , the camera has an IIC interface (as a control interface of the camera), and the IIC interface of the camera is connected to the IIC interface of the MCU through the IIC bus. In other words, the IIC bus connected to the IIC interface of the camera is also connected to an IIC interface of the MCU, so that the camera and the MCU communicate through the IIC bus.
[0048] In this embodiment, in addition to being connected to an IIC interface of the MCU, an IIC bus can also be connected to the IIC interfaces of one or more cameras, subject to the fact that no address conflict occurs between the devices (camera, MCU, MPU, etc.) connected to the IIC interface. In other words, the camera system can have at least one IIC bus, on which one or more cameras and an MCU can be mounted, and the addresses of the cameras mounted on the IIC bus are different.
[0049] In this embodiment, if the address resources allow, two cameras can be mounted on the same IIC bus. For example, two cameras of different models can be mounted on the same IIC bus; or two cameras of the same model but configured with different addresses can be mounted on the same IIC bus.
[0050] exist Figure 1 and Figure 2 In the example of , the camera system is provided with n cameras, namely, camera 1 to camera n. Figure 1 and Figure 2 In the example, n is not less than 6. It is understandable that the number of cameras in the camera system of the embodiment of the present disclosure is not limited thereto, for example, the number of cameras in the camera system may be 2, 3, 4, 5, or 6, or may be greater than 6. In one example, at least two of the cameras are cameras of the same model.
[0051] exist Figure 2 In the example, each camera is connected to the MCU via an IIC bus. It is understandable that the embodiments of the present disclosure are not limited thereto, and multiple cameras can be mounted on the same IIC bus as needed, subject to no address conflict.
[0052] For example, in Figure 3 In the example, the MCU has four IIC interfaces. The first IIC interface of the MCU and the first IIC interface of the MPU are connected to the first IIC bus; the IIC interface of camera 1, the IIC interface of camera 2 and the second IIC interface of the MCU are connected to the second IIC bus; the IIC interface of camera 3, the IIC interface of camera 4 and the third IIC interface of the MCU are connected to the third IIC bus; the IIC interface of camera 5, the IIC interface of camera 6 and the fourth IIC interface of the MCU are connected to the fourth IIC bus. The addresses of cameras mounted on the same IIC bus are different. For example, camera 1 and camera 2 can be two cameras of the same model and are configured with different addresses. For another example, camera 3 and camera 4 can be two cameras of different models.
[0053] In the embodiment of the present disclosure, the IIC interface of the camera is connected to the IIC interface of the MCU via the IIC bus, and the IIC bus is not limited to the IIC bus that only drives the camera. Figure 3 In the example, the IIC bus used to mount the camera only mounts the camera and MCU. However, in other examples, such as Figure 4 In the example, in addition to mounting the MCU, the bus that mounts the IIC can also mount other devices to save port resources and the number of IIC buses in the camera system.
[0054] For example, in Figure 4 In the example, the IIC interfaces of some cameras and the first IIC interface of the MPU and the first IIC interface of the MCU are mounted on the same IIC bus (for example, the first IIC bus that enables the MPU to interact with the MCU), which can save one IIC interface and one IIC bus.
[0055] In one embodiment of the present disclosure, see Figure 2 , the camera has a MIPI interface (as the video interface of the camera), and the MIPI interface of the camera is connected to the MIPI interface of the MPU. In this embodiment, after the camera opens the stream, the video data can be transmitted to the MPU through the MIPI interface, so that other applications and modules can call the video data of the camera. Figure 2 In the example, the MIPI interface includes a data pin for transmitting data (MIPIDATA) and a clock pin for transmitting clock (MIPI CLK); the data pin of the camera's MIPI interface is electrically connected to the data pin of the MPU's MIPI interface via a data trace for transmitting data (MIPIDATA); the clock pin of the camera's MIPI interface is electrically connected to the clock pin of the MPU's MIPI interface via a clock trace for transmitting clock (MIPI CLK). Figure 2 In the example, the MPU has multiple MIPI interfaces, each of which is connected to a camera. In some other embodiments of the present disclosure, the number of MIPI interfaces on the MPU may be less than the number of cameras, for example, multiple cameras are connected to the same MIPI interface of the MPU.
[0056] In one embodiment of the present disclosure, the camera has a reset interface; when the reset interface is loaded with a reset signal RST, the camera can be reset. The MCU has a reset interface, and the reset interface can send a reset signal RST. The reset interface of the camera is electrically connected to the reset interface of the MCU, for example, the reset interface of the camera and the reset interface of the MCU can be electrically connected through a reset trace for loading the reset signal RST. In this embodiment, the MPU can send a reset instruction of the selected camera to the MCU, and the MCU can reset the selected camera in response to the reset instruction of the selected camera, for example, by sending a reset signal to the reset interface of the camera. In this way, the MPU can replace the reset interface with a control instruction, further saving interface resources.
[0057] In one example, the MPU may issue a general reset instruction, and the MCU may respond to the general reset instruction to reset each camera.
[0058] In another example, the MPU may send a reset instruction corresponding to a certain camera to the MCU; the MCU may respond to the reset instruction to reset the camera corresponding to the reset instruction, for example, it may respond to the reset instruction to load a reset signal to the reset interface of the camera corresponding to the reset instruction. For example, the MPU may send a first reset instruction corresponding to camera 1 to the MCU, and the MCU is configured to respond to the first reset instruction to reset the corresponding camera 1, for example, by sending a reset signal to the reset interface of camera 1.
[0059] In one example, the MCU has multiple reset interfaces, each of which is connected to at most one reset interface of a camera, for example, each reset interface of the MCU is connected to only one reset interface of a camera, so that each camera can be reset independently.
[0060] In one embodiment of the present disclosure, the camera has an MCLK (master clock signal) input interface, and the external circuit can load the master clock signal MCLK to the camera through the MCLK (master clock signal) input interface of the camera. The MCLK input interface of the camera is connected to the MCLK (master clock signal) output interface of the MCU or the MCLK (master clock signal) output interface of the MPU. In this way, the MPU or MCU can provide the master clock signal MCLK for the camera.
[0061] exist Figure 2 In the example, the MPU has an MCLK output interface, which can output a master clock signal MCLK; the output interface of the MPU is connected to the MCLK input interface of the camera through a master clock line.
[0062] Optionally, the MCLK input interface of each camera can be connected to the same master clock line. In this way, the MPU can simultaneously load the master clock signal MCLK to each camera through one MCLK output interface.
[0063] It is understandable that in other embodiments of the present disclosure, the master clock signal MCLK may be provided by the MCU instead of the MPU to further save the interface resources of the MPU. For example, the MCU is provided with an MCLK output interface, and the MCLK output interface is electrically connected to the MCLK input interface of each camera through the master clock line.
[0064] In one embodiment of the present disclosure, the camera system further includes a power manager, which can supply power to the MPU, the MCU and the camera.
[0065] In the embodiment of the present disclosure, the MPU is configured to be able to run the driver of any camera; the driver of the camera can send the control instruction to the MCU. The MCU is configured to control the camera according to the control instruction issued by the driver of the camera, for example, to implement at least one of the operations of powering on, resetting, initializing, configuring parameters, opening a stream, and closing the camera.
[0066] In one embodiment of the present disclosure, the microprocessor is configured to send a reset instruction or an initialization instruction of a selected camera to the microcontroller; for example, the driver of the selected camera in the MPU can send a reset instruction or an initialization instruction of the selected camera to the microcontroller. The microcontroller is configured to respond to the reset instruction or the initialization instruction of the selected camera and reset or initialize the selected camera.
[0067] In one embodiment of the present disclosure, the microprocessor is configured to send a configuration instruction of the selected camera to the microcontroller; for example, the driver of the selected camera in the MPU can send the configuration instruction of the selected camera to the microcontroller. The microcontroller is configured to respond to the configuration instruction of the selected camera and perform parameter configuration on the selected camera.
[0068] In one embodiment of the present disclosure, the microprocessor is configured to send a configuration switching instruction of the selected camera to the microcontroller; for example, the driver of the selected camera can send the configuration switching instruction of the selected camera to the microcontroller. The microcontroller is configured to respond to the configuration switching instruction of the selected camera and write a new initialization code to the selected camera to update the configuration.
[0069] In one embodiment of the present disclosure, the microprocessor is configured to send a stream opening instruction of the selected camera to the microcontroller; for example, the driver of the selected camera can send a stream opening instruction of the selected camera to the microcontroller. The microcontroller is configured to write a stream opening value to the selected camera in response to the stream opening instruction of the selected camera, thereby enabling the camera to directly output video data to the MPU.
[0070] In one embodiment of the present disclosure, the microprocessor is configured to send a shutdown instruction of the selected camera to the microcontroller. For example, the driver of the selected camera can send a shutdown instruction of the selected camera to the microcontroller. The microcontroller is configured to write an open stream value to the selected camera in response to the open stream instruction of the selected camera, and to shut down the data output of the camera in response to the shutdown instruction of the selected camera.
[0071] In one embodiment of the present disclosure, at least some parameters or codes required to control the camera are pre-stored in the MCU; the MCU can parse the received control instruction, and then control the camera according to the parsing result. For example, the MCU can parse the control instruction to determine which camera the control instruction corresponds to, what action needs to be performed on the camera, and the parameters, configuration or code required to perform the action.
[0072] In one example, at least one initialization code of at least one camera is stored in the memory of the MCU. The microprocessor is configured to be able to send an initialization instruction of the selected camera to the microcontroller; for example, the driver of the selected camera in the MPU can send an initialization instruction of the selected camera to the microcontroller. The MCU is configured to respond to the initialization instruction of the selected camera and write the initialization code corresponding to the initialization instruction of the selected camera into the corresponding selected camera. For example, an initialization code for camera 1 is stored in the FLASH (flash memory) of the MCU; the MPU can send a control instruction to initialize camera 1, for example, send an identification code (as a control instruction) that can be parsed by the MCU to initialize camera 1; the MCU can parse the control instruction, call the initialization instruction of camera 1 from the FLASH and write the initialization instruction to camera 1 through the IIC bus.
[0073] For example, at least one camera supports a configuration switching function, such as at least one camera supports a resolution switching function; then each configuration of the camera corresponds to an initialization code. Each initialization code of the camera is pre-stored in the memory of the MCU (such as FLASH). When the camera needs to switch configurations, for example, when the camera needs to switch resolutions, the MPU can send a switching configuration instruction for the camera to the MCU, such as sending an instruction to switch to a specified configuration. After receiving the control instruction, the MCU parses it to determine the initialization code required for the camera when switching configurations, and writes the initialization code to the camera through the IIC bus.
[0074] In one embodiment of the present disclosure, the MPU may send the initialization code corresponding to the camera to the MCU, and the MCU may save the received initialization code in a memory, such as saving the initialization code in FLASH. In this way, the MPU may add new initialization code to the MCU, or update the initialization code.
[0075] In one embodiment of the present disclosure, the MCU controls the camera corresponding to the control instruction according to the control instruction, including at least one of the following controls:
[0076] The MCU controls the camera to reset according to a reset instruction or an initialization instruction of the camera issued by the MPU;
[0077] The MCU writes an initialization code into the camera according to the initialization instruction of the camera issued by the MPU;
[0078] In one embodiment of the present disclosure, the core hardware interface of the camera includes an IIC interface, a reset interface, a power interface, a MIPI interface, a master clock interface, etc. The power interface of the camera is connected to the power manager to obtain power.
[0079] In one embodiment of the present disclosure, the MCU may detect the working status of the camera to determine whether the camera is abnormal, for example, detecting whether the IIC communication between the camera and the MCU is abnormal.
[0080] In one embodiment of the present disclosure, the MPU adopts a Linux kernel, which can be driven by a v4l2 architecture.
[0081] In one embodiment of the present disclosure, the MPU sends control instructions to the MCU or obtains information fed back by the MCU (such as the IIC communication status, whether the camera is abnormal, etc.) through the IIC interface.
[0082] In one embodiment of the present disclosure, the MPU has a driver corresponding to each camera. The MPU can run the driver of the camera to complete the configuration of the MPU, such as generating a device file node of the camera, such as configuring the clock size, number of Lans (number of channels), image size, frame rate, etc. during MIPI communication in the device file node of the camera. Optionally, when the MPU runs the driver, it can also initialize the CIF (Common Intermediate Format, commonly used standardized image format) module, MIPI module, etc.
[0083] Optionally, when the camera driver is running, a control instruction may be sent to the MCU to initialize the camera.
[0084] Optionally, after the driver is loaded (ie, ready to receive video data), the driver may send a control instruction to the MCU to control the corresponding camera to open a stream.
[0085] Optionally, the drivers of different models of cameras may be different; different drivers may have different parameters for camera configuration, such as MIPI rate, number of Lans, image size, frame rate, etc.
[0086] As follows, combined Figure 5 , an exemplary description is given of the working process of the camera system calling a camera. Figure 5 In the example of FIG. 1 , the camera system includes an MPU, an MCU, and multiple cameras. An application, such as an Android application, can interact with the MPU to call one or more cameras and obtain video data through the called cameras.
[0087] See also Figure 5 When the system starts, the MPU can first load the camera driver. During the driver loading process, the following parameters will be configured: camera MIPI channel, number of Lans, MIPI rate, default frame rate, image size, etc., to configure related key components. Figure 5 After the driver is loaded, a device file node corresponding to the camera will be generated. The device file node has multiple interfaces for application calls.
[0088] Optionally, the interfaces in the device file node include but are not limited to a camera opening interface, a camera information acquisition interface, a camera configuration interface, a stream opening interface, a data acquisition interface, a closing interface, and the like.
[0089] See also Figure 5 , during the process of MPU loading the driver, the driver will send control instructions to the MCU to initialize the camera. In one example, the driver sends an initialization instruction to the MCU. After receiving the initialization instruction, the MCU can perform power-on, reset, and initialization actions on the camera. Among them, the MCU can first perform a power-on action on the camera, which powers on the camera. Then, the MCU performs a reset action on the camera, such as sending a reset signal RST to the camera, and the camera is reset. Afterwards, the MCU sends an initialization code to the camera, so that the camera writes the initialization code to achieve initialization. Optionally, the initialization code can be pre-stored in the MCU, or it can be pre-written into the driver file and transmitted to the MCU during the driver loading process.
[0090] See also Figure 5After the driver is loaded and the camera is initialized, the application can call the interface in the device file node of the camera to call the camera. For example, the application can call the open camera interface of the device file node of the camera to open the camera. The application can call the get camera information interface of the device file node of the camera to obtain the information of the camera. The application can call the camera configuration interface of the device file node of the camera to configure the camera; when calling the camera configuration interface, the driver will send a configuration instruction to the MCU; the MCU can parse the configuration instruction and configure the camera according to the configuration instruction, that is, configure the parameters in the camera, such as the exposure time, frame rate, gain and other parameters of the camera. The application can call the open stream interface of the device file node of the camera; at this time, the driver can send an open stream instruction to the MCU; the MCU responds to the open stream instruction and writes the open stream value to the MCU, so that the MCU outputs video data to the MPU. The application can call the get data interface of the device file node of the camera to obtain the video data provided by the camera. After using the camera, the application can call the close interface of the device file node of the camera; the driver sends a close instruction to the MCU, and the MCU responds to the close instruction to make the camera close data output.
[0091] Optionally, when the driver sends a configuration instruction to the MCU, the configuration instruction may be in the form of identification code + data; the identification codes corresponding to different cameras, different parameters, etc. may be different. The MCU may parse the identification code to obtain the configuration parameters of the camera, and configure the camera according to the parsed configuration parameters, for example, sending the parsed configuration parameters to the camera through the IIC protocol to write into the parameter register of the camera.
[0092] Optionally, after receiving the open-stream instruction, the MCU can write the open-stream value into the register of the camera; after the camera writes the open-stream value, it starts to expose and output video data.
[0093] In one example, at least one camera supports switching between different resolutions, and each resolution corresponds to a different initialization code. When configuring the camera, if the camera resolution needs to be switched, the camera can be initialized with a new initialization code. The initialization code can be stored in the FLASH of the MCU, and the MCU supports the function of switching the initialization code.
[0094] For example, for a camera that supports resolution switching, the MCU can have multiple sets of initialization codes for the camera built in, as well as the length, size, and number of each initialization code for easy calling. When the MPU (such as the camera driver) sends a configuration switching instruction to the MCU, the MCU can update the current initialization code in the camera with the new initialization code.
[0095] Furthermore, the MCU also supports the function of updating the initialization code. For example, the MPU can add new initialization code to the MCU's FLASH, or overwrite the old initialization code with the new initialization code.
[0096] The present disclosure also provides an electronic device, which includes any one of the camera systems described in the above camera system embodiments. The electronic device can be an AR helmet, VR glasses, an aerial drone, an unmanned vehicle, or other types of electronic devices. Since the electronic device has any one of the camera systems described in the above camera system embodiments, it has the same beneficial effects, and the present disclosure will not be repeated here.
[0097] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A camera system, characterized in that: The invention comprises a microprocessor, a plurality of cameras and a microcontroller for controlling each of the cameras; wherein the video interface of each of the cameras is respectively connected to the microprocessor, the control interface of each of the cameras is respectively connected to the microcontroller via a communication bus, and the microprocessor and the microcontroller are communicatively connected; wherein the control interfaces of at least two of the cameras are connected to different communication buses; The microprocessor is configured to directly acquire video data from the camera, and is configured to send control instructions for controlling the camera to the microcontroller; The microcontroller is configured to control the camera in response to a control instruction from the microprocessor.
2. The camera system according to claim 1, characterized in that: The microprocessor is configured to be able to run the driver of any one of the cameras; the driver of the camera can send the control instruction to the microcontroller; The microcontroller is configured to control the camera according to the control instruction sent by the driver of the camera.
3. The camera system according to claim 1, characterized in that: At least one initialization code of at least one camera is stored in the memory of the microcontroller; The microprocessor is configured to send an initialization instruction of the selected camera to the microcontroller; The microcontroller is configured to, in response to the initialization instruction of the selected camera, write an initialization code corresponding to the initialization instruction of the selected camera into the corresponding selected camera.
4. The camera system according to claim 1, characterized in that: The camera has a reset interface, and the reset interface of the camera is electrically connected to the reset interface of the microcontroller; The microprocessor is configured to send a reset instruction of the selected camera to the microcontroller; The microcontroller is configured to respond to a reset instruction of the selected camera to reset the selected camera.
5. The camera system according to claim 1, characterized in that: The microprocessor is configured to send a configuration instruction of the selected camera to the microcontroller; The microcontroller is configured to respond to a configuration instruction of the selected camera and perform parameter configuration on the selected camera.
6. The camera system according to claim 1, characterized in that: The microprocessor is configured to send a configuration switching instruction of the selected camera to the microcontroller; The microcontroller is configured to respond to a configuration switching instruction of the selected camera and write a new initialization code to the selected camera.
7. The camera system according to claim 1, characterized in that: The microprocessor is configured to send a stream opening instruction or a closing instruction of the selected camera to the microcontroller; The microcontroller is configured to write an open-stream value to the selected camera in response to an open-stream instruction of the selected camera, and to close the data output of the camera in response to a close instruction of the selected camera.
8. The imaging system according to any one of claims 1 to 7, characterized in that: The microcontroller and the microprocessor are interactively connected via an IIC bus; The camera is connected to the microcontroller via an IIC bus; The camera has a MIPI interface, and the MIPI interface of the camera is connected to the MIPI interface of the microprocessor; The camera has a clock input interface, and the clock input interface of the camera is connected to the clock output interface of the microcontroller or the clock output interface of the microprocessor.
9. The imaging system according to any one of claims 1 to 7, characterized in that: At least two of the cameras are of the same model.
10. An electronic device, characterized in that: A camera system comprising any one of claims 1 to 9.