Camera control method and device, image acquisition equipment and VR equipment
By introducing switching switches into the processor and dynamically switching the camera interface, the problem of limited number of processor interfaces is solved, effective control and power supply of multiple cameras is achieved, and the flexibility and efficiency of image acquisition function is improved.
Patent Information
- Application Number
- CN202411747419.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-07
AI Technical Summary
In the prior art, the number of camera interfaces that the processor can connect is limited, resulting in insufficient interfaces when multiple cameras are required to collect images, which limits the function of image acquisition.
By introducing a toggle switch into the processor, connecting multiple cameras, and dynamically switching the camera interface with the toggle switch control instructions and camera configuration instructions, the camera interface is achieved to effectively control and power supply to multiple cameras.
It realizes the expansion of the number of cameras connected to the processor, solves the problem of insufficient interfaces, and improves the flexibility and efficiency of image acquisition functions.
Smart Images

Figure CN119583970A_ABST
Abstract
Description
Background Art
[0002] There are more and more cameras used in existing image acquisition, but the number of camera interfaces that the processor can connect to is limited. When more cameras are needed to acquire images, it cannot be realized due to the limited interfaces, thus limiting the function of image acquisition.
[0003] 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
[0004] The present disclosure provides a camera control method, device, image acquisition device and VR device, which at least to a certain extent overcome the problem of limited camera expansion caused by insufficient number of interfaces.
[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0006] According to one aspect of the present disclosure, a camera control method is provided, which is applied to a processor of an image acquisition device, wherein the processor is connected to a switch, and the switch is connected to two cameras. The method includes:
[0007] According to the camera start instruction, determining a target camera from the two cameras;
[0008] Based on the target camera, determining a switch control instruction and a camera configuration instruction;
[0009] Sending the switch control instruction to the switch to control the switch to switch to the path corresponding to the target camera and supply power to the target camera;
[0010] The camera configuration instruction is sent to the target camera to control the target camera to start up and perform image acquisition.
[0011] In some embodiments, the two cameras connected to the switch include: a first camera and a second camera; the switch has a first end, a second end and a third end, the first end and the second end constitute a first path, the first end and the third end constitute a second path, and only one of the first path and the second path is connected at the same time; the processor, the first camera and the second camera all have a camera serial interface;
[0012] The camera serial interface of the processor is connected to the first end of the switch; the camera serial interface of the first camera is connected to the second end of the switch, and the camera serial interface of the second camera is connected to the second end of the switch.
[0013] In some embodiments, the processor further includes: a switching switch control instruction sending terminal, an internal integrated circuit bus control terminal, and a camera power supply output terminal;
[0014] The switching switch further includes: a switching switch control instruction receiving terminal;
[0015] The first camera and the second camera both have a power supply receiving terminal;
[0016] The switching switch control instruction sending end is connected to the switching switch control instruction receiving end to form a switching switch control instruction control channel, wherein the switching switch control instruction control channel is used to transmit the switching switch control instruction;
[0017] The camera power supply output terminal is connected to the first terminal of the switch, the first camera power supply receiving terminal is connected to the second terminal of the switch, and the second camera power supply receiving terminal is connected to the third terminal of the switch; the first path and the second path are also used to transmit electric energy to the target camera to power the target camera;
[0018] The internal integrated circuit bus control end is connected to the first camera and the second camera to send the camera configuration instruction to a target camera in the first camera or the second camera; or the internal integrated circuit bus control end is connected to the switching switch to send the camera configuration instruction to the target camera through the switching switch.
[0019] In some embodiments, if there are multiple switching switches, the internal integrated circuit bus control end includes multiple internal integrated circuit bus sub-control ends, and the internal integrated circuit bus sub-control ends correspond to the switching switches one by one; each of the internal integrated circuit bus sub-control ends is connected to two cameras connected to the corresponding single switching switch to send the camera configuration instruction to the target camera in the first camera or the second camera; or,
[0020] If there are multiple switching switches, the internal integrated circuit bus control terminal is single; the two cameras connected to each of the multiple switching switches are commonly connected to the single internal integrated circuit bus control terminal; the internal integrated circuit bus control terminal sends the camera configuration instruction to the target camera among the multiple connected cameras.
[0021] In some embodiments, according to the camera start instruction, determining the target camera from the two cameras includes:
[0022] The application determines a camera start instruction according to a usage scenario, wherein the application runs on the processor;
[0023] According to the camera start instruction, the first camera or the second camera is determined as a target camera.
[0024] In some embodiments, the processor runs an operating system, the operating system comprising: a software development kit, a framework layer, a hardware abstraction layer, and a driver layer; the first camera and the second camera are registered as one camera in the driver layer;
[0025] Based on the target camera, determining a switch control instruction and a camera configuration instruction includes:
[0026] Based on the target camera, determining the path corresponding to the target camera as a target opening path through the software development kit;
[0027] Determining a switch control instruction according to a target opening path of the switch;
[0028] The switch control instruction is sent to the hardware abstraction layer and the driver layer via the framework layer to determine the camera configuration instruction.
[0029] In some embodiments, the processor runs an operating system, the operating system includes: a framework layer, a hardware abstraction layer and a driver layer; the first camera and the second camera are respectively registered as different cameras in the driver layer;
[0030] Based on the target camera, determining a switch control instruction and a camera configuration instruction includes:
[0031] Sending the target camera to the driver layer via the framework layer and the hardware abstraction layer;
[0032] If the driving layer determines that another camera connected to the switch together with the target camera is in an off state, the driving layer is used to determine the path corresponding to the target camera as a target open path;
[0033] According to the target opening path, the switch control instruction and the camera configuration instruction are determined.
[0034] In some embodiments, the processor runs an operating system, the operating system comprising: a software development kit, a framework layer, a hardware abstraction layer, and a driver layer; the first camera and the second camera are respectively registered as different cameras in the driver layer;
[0035] Based on the target camera, determining a switch control instruction and a camera configuration instruction includes:
[0036] Based on the target camera, determining, by means of the software development kit, a working state of another camera connected to the switch together with the target camera;
[0037] If the software development kit determines that the working state of another camera connected to the switch together with the target camera is in an off state, the software development kit is used to determine the path corresponding to the target camera as a target open path;
[0038] According to the target opening path, determining the switch control instruction and the camera configuration instruction;
[0039] The switch control instruction and the camera configuration instruction are sent to the driver layer via the framework layer and the hardware abstraction layer.
[0040] According to another aspect of the present disclosure, a camera control device is provided, which is applied to a processor of an image acquisition device, wherein the processor is connected to a switch, and the switch is connected to two cameras. The method includes:
[0041] A target camera determination module, used to determine a target camera from the two cameras according to a camera start instruction;
[0042] An instruction determination module, used for determining a switch control instruction and a camera configuration instruction based on the target camera;
[0043] A switch control instruction sending module, used for sending the switch control instruction to the switch to control the switch to switch to the path corresponding to the target camera and supply power to the target camera;
[0044] The camera configuration instruction sending module is used to send the camera configuration instruction to the target camera to control the target camera to start up and perform image acquisition.
[0045] According to another aspect of the present disclosure, there is also provided an image acquisition device, comprising: a processor, a switch, and two cameras; the processor is connected to the switch, and the switch is connected to the two cameras;
[0046] The processor is used to determine a target camera from the two cameras according to a camera start instruction; determine a switch control instruction and a camera configuration instruction based on the target camera; send the switch control instruction to the switch; send the camera configuration instruction to the target camera;
[0047] The switching switch is used to switch to the path corresponding to the target camera and supply power to the target camera according to the switching switch control instruction;
[0048] The target camera is used to start image acquisition according to the camera configuration instruction.
[0049] According to another aspect of the present disclosure, a VR device is also provided, comprising the above-mentioned image acquisition device.
[0050] According to another aspect of the present disclosure, an electronic device is also provided, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the camera control methods described above by executing the executable instructions.
[0051] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the camera control method described in any one of the above is implemented.
[0052] According to another aspect of the present disclosure, a computer program product is further provided, including: a computer program or instructions, wherein when the computer program or instructions are executed by a processor, any of the above-mentioned camera control methods is implemented.
[0053] The camera control method, device, image acquisition device and VR device provided in the embodiments of the present disclosure are applied to the processor of the image acquisition device, the processor is connected to the switching switch, the switching switch is connected to two cameras, including: according to the camera start instruction, determining the target camera from the two cameras; based on the target camera, determining the switching switch control instruction and the camera configuration instruction; sending the switching switch control instruction to the switching switch to control the switching switch to switch to the path corresponding to the target camera and power the target camera; sending the camera configuration instruction to the target camera to control the target camera to start image acquisition. The embodiment of the present disclosure connects two cameras by switching the switch, and connects the switching switch to the processor, so as to expand the number of cameras connected to the processor. When the processor needs to perform image acquisition, the target camera to be imaged is determined from the two cameras according to the camera start instruction, and the switching switch control instruction and the camera configuration instruction are generated. The switching switch is controlled by the switching switch control instruction to connect the path corresponding to the target camera, power the target camera, and control the target camera to start image acquisition by the camera configuration instruction, thereby realizing the image acquisition function of the extended camera. The cost is reduced while improving the user experience.
[0054] 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
[0055] 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.
[0056] Figure 1 A first schematic diagram of the architecture of an image acquisition device in an embodiment of the present disclosure is shown.
[0057] Figure 2 A schematic diagram of a camera control method in an embodiment of the present disclosure is shown.
[0058] Figure 3 A schematic diagram of a second framework structure of the image acquisition device in an embodiment of the present disclosure is shown.
[0059] Figure 4 A schematic diagram showing the port connections of the first frame of the image acquisition device in an embodiment of the present disclosure is shown.
[0060] Figure 5 Another port connection schematic diagram of the first frame of the image acquisition device in the embodiment of the present disclosure is shown.
[0061] Figure 6 A first port connection schematic diagram of the second frame structure of the image acquisition device in an embodiment of the present disclosure is shown.
[0062] Figure 7 A second port connection schematic diagram of the second frame structure of the image acquisition device in an embodiment of the present disclosure is shown.
[0063] Figure 8 A third port connection schematic diagram of the second frame structure of the image acquisition device in an embodiment of the present disclosure is shown.
[0064] Fig. 9 A schematic diagram showing a process of determining a target camera in a camera control method according to an embodiment of the present disclosure is shown.
[0065] Fig.10 A schematic diagram of a first process of determining a switching switch control instruction and a camera configuration instruction in a camera control method according to an embodiment of the present disclosure is shown.
[0066] Fig.11 A schematic diagram showing a process of determining camera configuration instructions in a camera control method according to an embodiment of the present disclosure is shown.
[0067] Fig.12 A first flow chart of a camera control method in an embodiment of the present disclosure is shown.
[0068] Fig.13A schematic diagram of a second process of determining a switching switch control instruction and a camera configuration instruction in a camera control method according to an embodiment of the present disclosure is shown.
[0069] Fig.14 A second flow chart of a camera control method in an embodiment of the present disclosure is shown.
[0070] Fig.15 A schematic diagram of a third process of determining a switching switch control instruction and a camera configuration instruction in a camera control method according to an embodiment of the present disclosure is shown.
[0071] Fig.16 A third flow chart of a camera control method in an embodiment of the present disclosure is shown.
[0072] Fig.17 A schematic diagram of a camera control device in an embodiment of the present disclosure is shown.
[0073] Fig.18 A schematic diagram of a computer-readable storage medium showing a camera control method in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0074] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0075] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0076] For ease of understanding, before introducing the embodiments of the present disclosure, several terms involved in the embodiments of the present disclosure are first explained as follows:
[0077] VR (Virtual Reality) is a computer technology that allows users to feel like they are in a virtual world by simulating an environment. This technology uses peripherals such as head-mounted display devices, handles, gloves, and full-body tracking systems to provide users with an immersive experience of multiple senses such as vision, hearing, and touch. The application range of VR technology is very wide. VR equipment refers to a device used to create a virtual environment that allows users to immerse themselves in a digitally generated world.
[0078] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0079] There are more and more scenarios in which cameras are used in image acquisition, but the number of interfaces that the processor used for image acquisition can connect to the camera is limited. For example, when a VR device is used as an image acquisition device, 6DOF (6 Degrees of Freedom) positioning tracking requires multiple cameras to acquire images, the see-through function requires multiple cameras to acquire images, and spatial modeling requires multiple cameras to acquire images of the space in which it is located. Therefore, the demand for the number of cameras in the usage scenarios is extremely high. However, as a hardware device, the processor has a limited number of camera interfaces, which results in the number of cameras that can be connected to the image acquisition device being limited, limiting the image acquisition function.
[0080] Figure 1 FIG. 1 shows a first schematic diagram of an image acquisition device that can be used in the embodiment of the present disclosure. Figure 1 As shown, the image acquisition device 10 may include a processor 1 , a switch 2 , and cameras 31 and 32 .
[0081] In an image acquisition device, a processor refers to a chip used to run an operating system, run applications, and control connected devices. Processor 1 is connected to switch 2, and switch 2 is connected to two cameras 31 and 32. Switch 2 and two cameras 31 and 32 are registered in the processor, that is, the processor can recognize the switch and the two cameras. In some embodiments, the processor may include an application processor (AP), which is used in a mobile device and can meet the requirements of high energy efficiency ratio of the mobile device to meet the requirements of the mobile device for battery capacity.
[0082] An application is running on the processor. The application determines the camera that needs to be turned on according to different usage scenarios, generates corresponding camera turn-on instructions, and determines the target camera from the two cameras registered in the processor; the target camera is the camera that the application needs to turn on; based on the target camera, a switching switch control instruction and a camera configuration instruction are determined, the switching switch control instruction is sent to the switching switch, and the camera configuration instruction is sent to the target camera.
[0083] The two cameras connected by the switch respectively correspond to the paths, receive the switch control instruction sent by the processor, switch to the path corresponding to the target camera according to the switch control instruction and supply power to the target camera.
[0084] The target camera receives the camera configuration instruction, executes the start action according to the camera configuration instruction, and the turned-on target camera performs image acquisition.
[0085] The image acquisition device in the embodiment can be various electronic devices with multiple cameras, including but not limited to VR devices, augmented reality devices, smart phones, tablet computers, laptop computers, desktop computers, smart speakers, smart watches, wearable devices, etc.
[0086] Under the above system architecture, a camera control method is provided in an embodiment of the present disclosure, and the method can be executed by any electronic device with computing and processing capabilities.
[0087] Figure 2 A schematic diagram of a camera control method in an embodiment of the present disclosure is shown. Figure 2 As shown, the camera control method provided in the embodiment of the present disclosure is applied to a processor of an image acquisition device, the processor is connected to a switch, and the switch is connected to two cameras. The control method includes the following steps:
[0088] Step S202: determining a target camera from two cameras according to a camera start instruction;
[0089] Step S204: determining a switch control instruction and a camera configuration instruction based on the target camera;
[0090] Step S206: sending a switch control instruction to the switch to control the switch to switch to the path corresponding to the target camera and supply power to the target camera;
[0091] Step S208: Sending a camera configuration instruction to the target camera to control the target camera to start up and perform image acquisition.
[0092] The disclosed embodiment connects two cameras through a switching switch, and connects the switching switch to a processor, thereby expanding the number of cameras connected to the processor. When the processor needs to perform image acquisition, the target camera to be imaged is determined from the two cameras according to the camera start instruction, and a switching switch control instruction and a camera configuration instruction are generated. The switching switch is controlled by the switching switch control instruction to connect the path corresponding to the target camera, power is supplied to the target camera, and the target camera is controlled to start up for image acquisition through the camera configuration instruction, thereby realizing the image acquisition function of the extended camera. This reduces costs while improving user experience.
[0093] like Figure 1 The image acquisition device shown in the figure exemplarily shows that the processor has an interface for connecting to the camera externally, so that Figure 1 The switch 2 in the embodiment can expand the two cameras of camera 31 and camera 31; in the embodiment, the processor can also have two interfaces for externally connecting the cameras, such as Figure 3 The second frame structure diagram of the image acquisition device shown in the figure, in the image acquisition device 20, the processor has two interfaces for external connection to the camera, and two switching switches are configured accordingly, and each switching switch is connected to two cameras. The switching switch 21 is connected to the first interface of the processor, and the switching switch 21 is connected to the camera 31 and the camera 32; the switching switch 22 is connected to the second interface of the processor, and the switching switch 22 is connected to the camera 33 and the camera 34. When the processor has two interfaces for external connection to the camera, it can control the connection of four cameras, further realizing the expansion of the number of cameras. Figure 1 The processor shown has an interface for connecting to an external camera that can be expanded to two cameras, and Figure 3 The processor shown has two interfaces for connecting external cameras, which is expanded to a connection mode of four cameras. If the number of interfaces for connecting external cameras of the processor is N, where N is a positive integer, N switching switches are configured, each switching switch is connected to two cameras, thereby realizing the expansion of the processor to connect and control 2N cameras.
[0094] In the embodiment, the two cameras connected by the switching switch include: a first camera and a second camera; the switching switch has a first end, a second end and a third end, the first end and the second end constitute a first path, the first end and the third end constitute a second path, and only one of the first path and the second path is conductive at the same time; the processor, the first camera and the second camera all have a camera serial interface CSI; the camera serial interface CSI of the processor is connected to the first end of the switching switch; the camera serial interface CSI of the first camera is connected to the second end of the switching switch, and the camera serial interface CSI of the second camera is connected to the second end of the switching switch.
[0095] Figure 4 A schematic diagram of the port connection of the first frame of the image acquisition device is shown, as shown in FIG. Figure 4 As shown, the two cameras connected to the switching switch 2, camera 31 is used as the first camera, and camera 32 is used as the second camera. The switching switch 2 has a first end W1, a second end W2 and a third end W3. The first end W1 and the second end W2 constitute a first path, and the first end W1 and the third end W3 constitute a second path. Only one of the first path and the second path in the switching switch 2 is turned on at the same time, that is, at the same time, if the first path is turned on, then the second path is turned off; if the first path is turned off, then the second path is turned on. The processor has a port CSIA1; the camera 31 has a port C1, and CSI is provided in C1; the camera 32 has a port C2, and CSI is provided in C2. The CSIA1 of the processor is connected to the first end W1 of the switching switch 2 to form a CSI transmission channel D1. The CI of the camera 31 is connected to the second end W2 of the switching switch 2 to form a first camera transmission channel, wherein the CSI in C1 of the camera 31 is connected to the second end W2 of the switching switch 2. The CI of camera 32 is connected to the third end W3 of switch 2 to form a second camera transmission channel, wherein the CSI in C2 of camera 33 is connected to the third end W3 of switch 2. In this way, the first channel is connected to camera 31, and the second channel is connected to camera 32, so that the time-sharing use between camera 31 and camera 32 can be realized, and the allocation of different functions of the two cameras in different application scenarios can be realized.
[0096] CSI (Camera Serial Interface) is a standard interface for connecting processors to cameras. Its purpose is to simplify the connection between cameras and processors and improve the efficiency and reliability of data transmission. Among them, CSI is a standard developed by the MIPI Alliance (Mobile Industry Processor Interface Alliance) for transmitting image data between camera modules and processors. The MIPI CSI interface is a standard interface developed by the MIPI Alliance for transmitting image data between cameras and processors. The MIPI CSI interface is widely used in mobile devices, embedded systems and other devices that require camera functions, and is favored for its high efficiency, low power consumption and high reliability.
[0097] In the embodiment, the processor further includes: a switching switch control instruction sending terminal, an internal integrated circuit bus I2C control terminal, and a camera power supply output terminal;
[0098] The switching switch also includes: a switching switch control instruction receiving terminal;
[0099] The first camera and the second camera both have a power supply receiving terminal;
[0100] The switch control instruction sending end is connected to the switch control instruction receiving end to form a switch control instruction control channel, wherein the switch control instruction control channel is used to transmit the switch control instruction;
[0101] The power supply output end of the camera is connected to the first end of the switch, the power supply receiving end of the first camera is connected to the second end of the switch, and the power supply receiving end of the second camera is connected to the third end of the switch; the first path and the second path are also used to transmit electric energy to the target camera to power the target camera;
[0102] The internal integrated circuit bus control end is connected to the first camera and the second camera to send the camera configuration instruction to the target camera in the first camera or the second camera; or the internal integrated circuit bus control end is connected to the switching switch to send the camera configuration instruction to the target camera through the switching switch.
[0103] I2C (Inter-Integrated Circuit) is a serial communication protocol used to connect low-speed devices over a short distance. I2C can transmit control instructions for various devices, such as the camera configuration instructions in the transmission embodiment. The two-wire design of I2C reduces wiring complexity and supports multi-master and multi-slave architecture, making system design more flexible.
[0104] like Figure 4 The port connection diagram of the first frame of the image acquisition device shown in the figure, the processor also includes a switching switch control instruction sending terminal A3, an I2C control terminal A4, and a camera power supply output terminal A2.
[0105] The switch 2 further includes a switch control instruction receiving terminal W4 and an I2C receiving terminal W5.
[0106] The switch control instruction sending terminal A3 is connected to the switch control instruction receiving terminal W4 to form a switch control instruction control channel D3, and the switch control instruction control channel D3 is used to transmit the switch control instruction sent by the processor.
[0107] The camera power output terminal A2 is connected to the first terminal W1 of the switch to form a power transmission channel D2. The C1 terminal of the camera is a composite interface, which can include multiple types such as CSI, power receiving terminal, and I2C receiving terminal. Similarly, the C2 terminal of the camera is a composite interface, which can include multiple types such as CSI, power receiving terminal, and I2C receiving terminal.
[0108] The power supply receiving end of the camera 31 is connected to the second end W2 of the switching switch 2. When the camera 31 is the target camera, the first path of the switching switch 2 is turned on, connecting the first path and the first camera transmission channel. The power provided by the processor is transmitted to the camera 31 through the power supply transmission channel D2, the first path and the first camera transmission channel to power the camera 31.
[0109] The power supply receiving end of the camera 32 is connected to the third end W2 of the switch 2. When the camera 32 is the target camera, the second path of the switch 2 is turned on, connecting the second path and the second camera transmission channel, and the power provided by the processor is transmitted to the camera 32 through the power supply transmission channel D2, the second path and the second camera transmission channel to power the camera 33.
[0110] I2C control terminal A4 can be directly connected to the camera, and I2C control terminal A4 can also be indirectly connected to the camera through a connection switch.
[0111] When the I2C control terminal A4 is indirectly connected to the camera by connecting the switching switch, the I2C control terminal A4 is connected to the I2C receiving terminal W5 of the switching switch 2 to form an I2C transmission channel D4. The processor sends the camera configuration instruction to the switching switch 2 through the I2C control terminal A4, the I2C transmission channel D4, and the I2C receiving terminal W5, and the switching switch 2 sends the camera configuration instruction to the camera 31 through the first camera transmission channel, or the switching switch 2 sends the camera configuration instruction to the camera 32 through the second camera transmission channel.
[0112] In some embodiments, the I2C control terminal A4 can also be connected to the first terminal W1 of the switching switch 2, and the processor sends the camera configuration instruction to the first terminal W1 of the switching switch 2, and sends the camera configuration instruction to the camera 31 through the first path and the first camera transmission channel, or sends the camera configuration instruction to the camera 32 through the second path and the second camera transmission channel.
[0113] Figure 5 Another port connection diagram of the first frame of the image acquisition device is shown. Figure 5 The port connections shown are Figure 4 The port connections shown are Figure 5 In the port connection mode, the I2C control terminal A4 is directly connected to the camera 31 and the camera 32, forming an I2C transmission channel D4. The processor is directly connected to the camera 31 and the camera 32 through the I2C transmission channel D4, and the processor sends the camera configuration instruction directly to the camera 31 and the camera 32.
[0114] In the embodiment, if there are multiple switching switches, the internal integrated circuit bus control terminal includes multiple internal integrated circuit bus sub-control terminals, and the internal integrated circuit bus sub-control terminals correspond to the switching switches one by one;
[0115] Each internal integrated circuit bus sub-control terminal is connected to two cameras connected to a corresponding single switch to send a camera configuration instruction to a target camera in the first camera or the second camera.
[0116] Each I2C sub-control terminal is connected to the two cameras connected to the corresponding single switching switch, and there are two connection methods. The first connection method is that each I2C sub-control terminal is directly connected to the two cameras under the switching switch, and the camera configuration instruction is directly sent to the target camera in the first camera or the second camera; the second connection method is that each I2C sub-control terminal is connected to the switching switch, and the corresponding two cameras are connected through the switching switch, and the camera configuration instruction is indirectly sent to the target camera in the first camera or the second camera through the switching switch.
[0117] Figure 6 A first port connection diagram of a second frame structure of an image acquisition device is shown. Figure 6 As shown, under the second frame structure, the processor has two ports for connecting to the camera;
[0118] The processor 1 is connected to the switch 21 and the switch 22 ; wherein the switch 21 is connected to the camera 31 and the camera 32 , and the switch 22 is connected to the camera 33 and the camera 34 .
[0119] The switching switch 21 is connected to the first port side of the processor, including the processor having a port CSI A11, a camera power supply output terminal A12, a switching switch control instruction sending terminal A13, and a first I2C sub-control terminal A14.
[0120] The switch 21 has a first terminal W11 , a second terminal W12 , a third terminal W13 , a switch control instruction receiving terminal W14 , and an I2C receiving terminal W15 .
[0121] The camera 31 has a port C11. The C11 end of the camera is a composite interface, and the C11 end may include multiple types such as CSI, power supply receiving end, and I2C receiving end.
[0122] The camera 32 has a port C12. The C12 end of the camera is a composite interface, and the C12 end may include multiple types such as CSI, power supply receiving end, and I2C receiving end.
[0123] The CSI A11 of the processor is connected to the first end W11 of the switch 21 to form a CSI transmission channel D11.
[0124] The camera power supply output terminal A12 is connected to the first terminal W11 of the switch to form a power supply transmission channel D12.
[0125] The switch control instruction sending terminal A13 is connected to the switch control instruction receiving terminal W14 to form a switch control instruction control channel D13.
[0126] The first I2C sub-control terminal A14 is connected to the I2C receiving terminal W15 of the switch 21 to form an I2C transmission channel D14. The processor sends the camera configuration instruction to the switch 21 through the first I2C sub-control terminal A14, the I2C transmission channel D14 and the I2C receiving terminal W15, and sends the camera configuration instruction to the camera 31 through the first path of the switch 21, or sends the camera configuration instruction to the camera 32 through the second path of the switch 21.
[0127] The switching switch 22 is connected to the second port side of the processor, including the processor having a port CSI A21, a camera power supply output terminal A22, a switching switch control instruction sending terminal A23, and a second I2C sub-control terminal A24.
[0128] The switch 22 has a first terminal W21 , a second terminal W22 , a third terminal W23 , a switch control instruction receiving terminal W24 , and an I2C receiving terminal W25 .
[0129] The camera 33 has a port C21. The C21 end of the camera is a composite interface, and the C21 end may include multiple types such as CSI, power supply receiving end, and I2C receiving end.
[0130] The camera 34 has a port C22. The C22 end of the camera is a composite interface, and the C22 end may include multiple types such as CSI, power supply receiving end, and I2C receiving end.
[0131] The CSI A21 of the processor is connected to the first end W21 of the switch 22 to form a CSI transmission channel D21.
[0132] The camera power supply output terminal A22 is connected to the first terminal W21 of the switch to form a power supply transmission channel D22.
[0133] The switch control instruction sending terminal A23 is connected to the switch control instruction receiving terminal W24 to form a switch control instruction control channel D23.
[0134] The second I2C sub-control terminal A24 is connected to the I2C receiving terminal W25 of the switch 22 to form an I2C transmission channel D24. The processor sends the camera configuration instruction to the switch 22 through the second I2C sub-control terminal A24, the I2C transmission channel D24 and the I2C receiving terminal W25, and sends the camera configuration instruction to the camera 33 through the first path of the switch 22, or sends the camera configuration instruction to the camera 34 through the second path of the switch 22.
[0135] When the I2C addresses of two cameras in a switch are different, use Figure 6 The first port connection method of the second frame structure shown is used for wiring, and the camera configuration instruction is sent to the switch through the I2C transmission channel. The camera configuration instruction is indirectly sent to the two cameras using the switch. The two cameras connected to the same switch share the same I2C transmission channel. The two cameras connected by one switch are used as a camera group, which can realize separate control between different camera groups, and can realize parallel control of cameras, and the camera response speed is fast. Under this wiring method, the faster the camera response speed, the higher the hardware resource consumption.
[0136] Figure 7 A second port connection diagram of a second frame structure of an image acquisition device is shown, and Figure 6 Compared with the first port connection method of the second frame structure, Figure 7 The second port connection method of the second frame structure shown is different in that: the first I2C sub-control terminal A14 is directly connected to camera 31 and camera 32 to form an I2C transmission channel D14, and camera 31 and camera 32 share the same directly connected I2C transmission channel D14, and the processor sends the camera configuration instructions directly to camera 31 and camera 32 through the shared I2C transmission channel D14; and the second I2C sub-control terminal A24 is directly connected to camera 33 and camera 34 to form an I2C transmission channel D24, and camera 33 and camera 34 share the same directly connected I2C transmission channel D24, and the processor sends the camera configuration instructions directly to camera 33 and camera 34 through the shared I2C transmission channel D24.
[0137] When the I2C addresses of two cameras in a switch are different, use Figure 7 The second port connection method of the second frame structure shown is used for wiring, and the camera configuration instructions are directly sent to the two cameras using the shared I2C transmission channel connected to the same switch. The two cameras connected by one switch are regarded as a camera group, and the individual control between different camera groups can be realized, and the parallel control of the cameras can be realized, and the camera response speed is fast. In this wiring method, the faster the camera response speed, the higher the hardware resource consumption.
[0138] In an embodiment, if there are multiple switching switches, the internal integrated circuit bus control terminal is single; two cameras connected to each of the multiple switching switches are commonly connected to a single internal integrated circuit bus control terminal; the internal integrated circuit bus control terminal sends the camera configuration instruction to the target camera among the multiple connected cameras.
[0139] Figure 8 A third port connection diagram of the second frame structure of the image acquisition device is shown. Figure 6 The first port connection mode of the second frame structure and Figure 7 Compared with the second port connection mode of the second frame structure shown in FIG. Figure 8 The third port connection mode of the second frame structure shown is different in that all cameras share the same I2C control terminal A4. The I2C control terminal A4 of the processor is directly connected to the camera 31, the camera 32, the camera 33 and the camera 34 to form a common I2C transmission channel D4. The processor directly sends the camera configuration instruction to the target camera among the cameras 31, the camera 32, the camera 33 and the camera 34 through the common I2C transmission channel D4.
[0140] When the I2C addresses of multiple cameras in different switching switches are different, that is, the I2C addresses of all cameras in the image acquisition device are different, use Figure 8 The third port connection method of the second frame structure shown is used for wiring, and all cameras share the I2C transmission channel D4 to form an I2C bus. This wiring method saves the bus resources of the processor, and the selection of the switch is also easier, reducing the number of pins of the switch chip, which can reduce the overall size of the switch chip and make the motherboard smaller.
[0141] Fig. 9 FIG. 4 is a schematic diagram showing a process of determining a target camera in a camera control method according to an embodiment of the present disclosure. Fig. 9 As shown, in the embodiment, according to the camera start instruction, determining the target camera from the two cameras includes:
[0142] Step S902: the application determines a camera start instruction according to a usage scenario, wherein the application runs on a processor;
[0143] Step S904: according to the camera start instruction, determine the first camera or the second camera as the target camera.
[0144] An operating system runs in the processor. Furthermore, an application runs in the operating system. The application needs to call different cameras for image acquisition in different usage scenarios. All cameras are registered in the processor. Therefore, the application determines the camera to be called based on the usage scenario, determines the camera start instruction corresponding to the camera to be called, and according to the camera start instruction, determines the first camera or the second camera connected to the switch as the target camera. The target camera is the camera that needs to be called based on the usage scenario.
[0145] Fig.10 FIG. 1 shows a first process diagram of determining a switch control instruction and a camera configuration instruction in a camera control method according to an embodiment of the present disclosure. Fig.10As shown, in the embodiment, the processor runs an operating system, and the operating system includes: a software development kit SDK, a framework layer, a hardware abstraction layer and a driver layer; the first camera and the second camera are registered as one camera in the driver layer;
[0146] Based on the target camera, determine the switch control instructions and camera configuration instructions, including:
[0147] Step S1002: Based on the target camera, the path corresponding to the target camera is determined as the target opening path through the software development kit;
[0148] Step S1004: determining a switch control instruction according to the target opening path of the switch;
[0149] Step S1006: Send the switch control instruction to the hardware abstraction layer and the driver layer via the framework layer to determine the camera configuration instruction.
[0150] There are many operating systems running on the processor, such as Android, iOS, Linux, Windows, etc. The operating system is divided according to its function, including at least: SDK, framework layer, hardware abstraction layer and driver layer. Taking Android as the operating system running on the processor as an example, the structural framework of the Android operating system is divided into: application layer (Applications), Android framework layer (Framework), system runtime library layer (Libraries and Android Runtime), hardware abstraction layer (HAL, Hardware Abstraction Layer), native library layer (Native Libraries), driver layer (Drivers) and Linux kernel layer (Linux Kernel);
[0151] SDK (Software Development Kit) is a set of tools and resources that help developers develop applications for a specific software platform or framework. In Android development, SDK provides all the tools, libraries, documentation, and sample code required to develop Android applications. SDK is located in the application layer.
[0152] In the embodiment, the first camera and the second camera are registered as one camera in the driver layer. From the perspective of the application, the application can only recognize one camera in the image acquisition device. However, the driver layer contains drivers for various hardware devices and provides the underlying control and access interface of the hardware devices. Therefore, all cameras registered in the processor can be controlled and accessed within the driver layer. When the driver layer feeds back to the application layer, only one camera is provided. If the camera is to be turned on, it must be controlled through the SDK, and the SDK determines and controls whether to turn on the first camera or the second camera as the target camera. Specifically, to turn on the target camera, it is necessary to determine the switch control instruction of the switch and the camera configuration instruction of the corresponding target camera. First, based on the target camera to be turned on, the SDK is used to determine whether the path corresponding to the target camera is the first path or the second path, and the path corresponding to the target camera is used as the path to be turned on, thereby determining it as the target turn-on path, and turning on the target turn-on path is used as the switching purpose of the switch, and the switch control instruction is determined. For example, if the target camera is the first camera, then the first path corresponding to the first camera is used as the target turn-on path, and the first path is turned on as the target, and the switch control instruction is determined. After determining the switch control instruction, the SDK sends the switch control instruction to the hardware abstraction layer and the driver layer through the framework layer to determine the camera configuration instruction.
[0153] Fig.11 FIG. 4 is a schematic diagram showing a process of determining a camera configuration instruction in a camera control method according to an embodiment of the present disclosure. Fig.11 As shown, in the embodiment, the switch control instruction is sent to the driver layer via the framework layer and the hardware abstraction layer to determine the camera configuration instruction, including:
[0154] Step S1102: sending the switch control instruction to the hardware abstraction layer and the driver layer via the framework layer;
[0155] Step S1104: Based on the switch control instruction, the image signal processor of the target camera is configured through the hardware abstraction layer to adjust the parameters and send them to the driver layer;
[0156] Step S1106: Based on the switch control instruction and the image signal processor adjustment parameters of the target camera, the camera configuration instruction is determined through the driver layer.
[0157] SDK sends the switch control layer by layer in the seven-layer structure framework of Android, and sends it to the hardware abstraction layer and the driver layer through the framework layer. In the hardware abstraction layer, the images output by the camera need to be processed by the ISP (Image Signal Processor). The corresponding adjustment parameters (tunning) when the ISP of different cameras is processed are different. For different cameras, different corresponding adjustment parameters will be called. Based on the fact that the first camera and the second camera are registered as one camera in the driver layer in this embodiment, it means that when the application calls the target camera, there is only one camera channel in the system framework. Therefore, it is necessary to configure the ISP adjustment parameters of the target camera in the hardware abstraction layer for the switch control instruction, and the hardware abstraction layer sends the image signal processor adjustment parameters of the target camera to the driver layer.
[0158] In the driver layer, the camera configuration instruction is determined based on the received switching switch control instruction and the image signal processor adjustment parameters of the target camera.
[0159] In an embodiment, sending a switch control instruction to the switch to control the switch to switch to a path corresponding to a target camera and supply power to the target camera includes:
[0160] The driver layer is used to send the switching switch control instruction to the switching switch through the switching switch control instruction control channel to control the switching switch to switch to the target opening path corresponding to the target camera, and power the target camera through the target opening path corresponding to the target camera; wherein, a reset action is performed after the target camera is powered on.
[0161] The driver layer of the processor is used to interact with the hardware device to implement functions such as issuing various control instructions to the hardware device and supplying power to the hardware device. The driver layer is connected to the switching switch, and the switching switch is connected to the first camera and the second camera. The driver layer sends the switching switch control instruction to the switching switch through the switching switch control instruction control channel; the switching switch receives the switching switch control instruction, judges and determines the target opening path corresponding to the target camera. Taking the first camera as the target camera as an example, the target opening path corresponding to the target camera is the first path corresponding to the first camera, and the first camera as the target camera is powered through the first path; the first camera performs a reset action after powering on to prepare for image acquisition.
[0162] In an embodiment, the first camera and the second camera are configured as the same communication address at the driver layer;
[0163] Send camera configuration instructions to the target camera to control the target camera to start image acquisition, including:
[0164] The driver layer sends the camera configuration instruction to the target camera according to the communication address to control the target camera to perform the start action according to the configuration data in the camera configuration instruction to perform image acquisition and obtain image data; the image data is sent to the processor through the CSI via the switching switch.
[0165] Based on registering the first camera and the second camera as one camera in the driver layer, in the first case, the first camera and the second camera are configured as the same communication address in the driver layer; the communication address can be an I2C address, that is, the first camera and the second camera have the same I2C address. When sending the camera configuration instruction to the target camera for control, the driver layer sends the camera configuration instruction to the target camera through the I2C transmission channel according to the communication address. Still taking the above-mentioned first camera as the target camera as an example, the driver layer sends the camera configuration instruction to the first camera through the I2C transmission channel according to the I2C address of the first camera; the first camera receives the camera configuration instruction, determines the corresponding configuration data according to the camera configuration instruction, writes the configuration data as the initial code into the register of the first camera, controls the first camera to perform the start action according to the configuration data to realize initialization, and the first camera is turned on for image acquisition to obtain image data. The image data acquired by the first camera is sent to the driver layer of the processor through CSI, the first camera transmission channel, the first path of the switching switch and the CSI transmission channel. The driver layer reports the image data to the application layer by layer in the Android structure framework, realizing the image acquisition function.
[0166] In an embodiment, the first camera and the second camera are configured as different communication addresses at the driver layer;
[0167] Send camera configuration instructions to the target camera to control the target camera to start image acquisition, including:
[0168] Use the driver layer to determine the communication address corresponding to the target camera;
[0169] The driver layer is used to send the camera configuration instruction to the target camera according to the communication address corresponding to the target camera, so as to control the target camera to perform the start action according to the configuration data in the camera configuration instruction to perform image acquisition and obtain image data; the image data is sent to the processor through the CSI via the switching switch.
[0170] In the embodiment, based on registering the first camera and the second camera as one camera in the driver layer, in the second case, the first camera and the second camera are configured as different communication addresses in the driver layer, that is, the first camera and the second camera have different I2C addresses.
[0171] When sending the camera configuration command to the target camera for control, it is first necessary to query and determine the I2C address corresponding to the target camera in the driver layer to achieve the correct switching of the I2C address. After the driver layer obtains the correct I2C address of the target camera, the driver layer sends the correct I2C address of the target camera with the camera configuration command to the target camera through the I2C transmission channel.
[0172] Still taking the first camera as the target camera as an example, the driver layer queries the I2C addresses of the first camera and the second camera, and takes the first camera as the target camera. Then the driver layer sends the camera configuration instruction to the first camera through the I2C transmission channel according to the I2C address of the first camera; the first camera receives the camera configuration instruction, determines the corresponding configuration data according to the camera configuration instruction, writes the configuration data as the initial code into the register of the first camera, controls the first camera to perform the start action according to the configuration data, and the first camera starts to collect images and obtain image data. The image data obtained by the first camera is sent to the driver layer of the processor through CSI, the first camera transmission channel, the first path of the switching switch and the CSI transmission channel. The driver layer reports the image data to the application layer by layer within the Android structure framework, realizing the image acquisition function.
[0173] Fig.12 FIG. 1 shows a first flow chart of a camera control method according to an embodiment of the present disclosure. Fig.12 As shown, in the embodiment, when the first camera and the second camera are registered as one camera in the driver layer, the process of controlling the target camera to perform image acquisition includes:
[0174] Determine the target camera;
[0175] Use SDK to determine the switch control instruction switch_0;
[0176] The SDK sends the switch control instruction switch_0 to the hardware abstraction layer and driver layer through the framework layer;
[0177] The hardware abstraction layer determines the ISP adjustment parameters corresponding to the target camera according to the switch control instruction switch_0. If the switch control instruction switch_0=0, it means that the target camera is the first camera, and the ISP adjustment parameters of the first camera are configured and sent to the driver layer; if the switch control instruction switch_0≠0, it means that the target camera is the second camera, and the ISP adjustment parameters of the second camera are configured and sent to the driver layer;
[0178] The driver layer determines the camera configuration instruction of the target camera according to the switch control instruction and the image signal processor adjustment parameters of the target camera, and sends the switch control instruction to the switch. If the switch control instruction switch_0=0, it means that the target camera is the first camera, the first channel corresponding to the first camera is turned on to power the first camera, and the camera configuration instruction is sent to the first camera, and the first camera is turned on and collects images. If the switch control instruction switch_0≠0, it means that the target camera is the second camera, the second channel corresponding to the second camera is turned on to power the second camera, and the camera configuration instruction is sent to the second camera, and the second camera is turned on and collects images.
[0179] Fig.13 FIG. 4 shows a schematic diagram of a second process of determining a switch control instruction and a camera configuration instruction in a camera control method according to an embodiment of the present disclosure. Fig.13 As shown, in the embodiment, the processor runs an operating system, and the operating system includes: a framework layer, a hardware abstraction layer, and a driver layer; the first camera and the second camera are respectively registered as different cameras in the driver layer;
[0180] Based on the target camera, determine the switch control instructions and camera configuration instructions, including:
[0181] Step S1302: sending the target camera to the driver layer via the framework layer and the hardware abstraction layer;
[0182] Step S1304: if the driver layer determines that another camera connected to the switch together with the target camera is in the off state, the driver layer determines the path corresponding to the target camera as the target open path;
[0183] Step S1306: Determine the switch control instruction and the camera configuration instruction according to the target opening path.
[0184] In the embodiment, the first camera and the second camera are registered as different cameras in the driver layer. From the perspective of the application, the application can recognize all cameras in the image acquisition device, that is, the first camera and the second camera that the application can recognize. However, only one of the first camera and the second camera is turned on at the same time, that is, the first camera and the second camera cannot be turned on at the same time.
[0185] In this embodiment, the driver layer determines and determines the switch control instruction. Specifically, after determining the target camera, it is sent to the driver layer through the framework layer and the hardware abstraction layer; the driver layer determines and identifies the path of the target camera. Take the first camera as the target camera as an example:
[0186] First, the driver layer identifies the working state of the second camera connected to the switch with the first camera. If the driver layer determines that the second camera is in the on state, it means that the second camera is collecting images, and an error response is returned, indicating that the first camera fails to start.
[0187] If the driving layer determines that the second camera is in the closed state, the driving layer determines the first path corresponding to the first camera as the target open path, and the driving layer needs to control the switching switch to turn on the first path.
[0188] In an embodiment, sending a switch control instruction to the switch to control the switch to switch to a path corresponding to a target camera and supply power to the target camera includes:
[0189] The driver layer is used to send the switching switch control instruction to the switching switch through the switching switch control instruction control channel to control the switching switch to switch to the target opening path corresponding to the target camera, and power the target camera through the target opening path corresponding to the target camera; wherein, a reset action is performed after the target camera is powered on.
[0190] The driver layer of the processor is used to interact with the hardware device to implement functions such as issuing various control instructions to the hardware device and supplying power to the hardware device. The driver layer is connected to the switching switch, and the switching switch is connected to the first camera and the second camera. The driver layer sends the switching switch control instruction to the switching switch through the switching switch control instruction control channel; the switching switch receives the switching switch control instruction, judges and determines the target opening path corresponding to the target camera. Taking the first camera as the target camera as an example, the target opening path corresponding to the target camera is the first path corresponding to the first camera, and the first camera as the target camera is powered through the first path; the first camera performs a reset action after powering on to prepare for image acquisition.
[0191] In an embodiment, the first camera and the second camera are configured as different communication addresses at the driver layer;
[0192] Send camera configuration instructions to the target camera to control the target camera to start image acquisition, including:
[0193] Use the driver layer to determine the communication address corresponding to the target camera;
[0194] The driver layer is used to send the camera configuration instruction to the target camera according to the communication address corresponding to the target camera, so as to control the target camera to perform the start action according to the configuration data in the camera configuration instruction to perform image acquisition and obtain image data; the image data is sent to the processor through the CSI via the switching switch.
[0195] In the embodiment, based on registering the first camera and the second camera as different cameras in the driver layer, the first camera and the second camera are configured with different communication addresses in the driver layer, that is, the first camera and the second camera have different I2C addresses.
[0196] When sending the camera configuration command to the target camera for control, it is first necessary to query and determine the I2C address corresponding to the target camera in the driver layer to achieve the correct switching of the I2C address. After the driver layer obtains the correct I2C address of the target camera, the driver layer sends the correct I2C address of the target camera with the camera configuration command to the target camera through the I2C transmission channel.
[0197] Fig.14 2 shows a second flow chart of the camera control method in the embodiment of the present disclosure. Fig.14 As shown, in the embodiment, the first camera and the second camera are respectively registered as different cameras in the driver layer, and the process of controlling the target camera to perform image acquisition includes:
[0198] Determine the target camera;
[0199] Send the target camera to the driver layer via the framework layer and the hardware abstraction layer;
[0200] In the driver layer, if it is determined that another camera connected to the switch with the target camera is in the turned-on state, an error is returned and the target camera fails to be turned on;
[0201] If it is determined that another camera connected to the switch together with the target camera is in an off state, then determining the switch control instruction and the camera configuration instruction;
[0202] Control the switching path of the switching switch according to the switching switch control instruction;
[0203] Power the target camera;
[0204] Send camera configuration management to the target camera;
[0205] The target camera turns on and acquires images.
[0206] Fig.15 FIG. 4 is a schematic diagram showing a third process of determining a switch control instruction and a camera configuration instruction in the camera control method according to an embodiment of the present disclosure. Fig.15 As shown, in the embodiment, the processor runs an operating system, and the operating system includes: a software development kit SDK, a framework layer, a hardware abstraction layer and a driver layer; the first camera and the second camera are respectively registered as different cameras in the driver layer;
[0207] Based on the target camera, determine the switch control instructions and camera configuration instructions, including:
[0208] Step S1502: Based on the target camera, determine the working status of another camera connected to the switch together with the target camera through the software development kit;
[0209] Step S1504: if the software development kit determines that the working state of another camera connected to the switch together with the target camera is in the off state, the software development kit is used to determine the path corresponding to the target camera as the target open path;
[0210] Step S1506: determining the switch control instruction and the camera configuration instruction according to the target opening path;
[0211] Step S1508: Send the switch control instruction and the camera configuration instruction to the driver layer via the framework layer and the hardware abstraction layer.
[0212] In the embodiment, the first camera and the second camera are registered as different cameras in the driver layer. From the perspective of the application, the application can recognize all cameras in the image acquisition device, that is, the first camera and the second camera that the application can recognize. However, only one of the first camera and the second camera is turned on at the same time, that is, the first camera and the second camera cannot be turned on at the same time.
[0213] In this embodiment, the SDK determines and switches the switch control instructions and the camera configuration instructions. Specifically, taking the first camera as the target camera as an example:
[0214] First, the SDK determines the working status of the second camera connected to the switch together with the first camera. If the SDK determines that the second camera is in the on state, it means that the second camera is collecting images, and an error response is returned, indicating that the first camera fails to start.
[0215] If the SDK determines that the working state of the second camera connected to the switch with the first camera is in the off state, then the SDK will determine the first path corresponding to the first camera as the target opening path; the SDK determines the switch control instruction to turn on the first path based on the first path as the path to be turned on. Furthermore, the SDK determines the camera configuration instruction corresponding to the first camera based on the switch control instruction. The SDK sends the switch control instruction and the camera configuration instruction to the driver layer via the framework layer and the hardware abstraction layer. The driver layer needs to control the switch to turn on the first path.
[0216] In an embodiment, sending a switch control instruction to the switch to control the switch to switch to a path corresponding to a target camera and supply power to the target camera includes:
[0217] The driver layer is used to send the switching switch control instruction to the switching switch through the switching switch control instruction control channel to control the switching switch to switch to the target opening path corresponding to the target camera, and power the target camera through the target opening path corresponding to the target camera; wherein, a reset action is performed after the target camera is powered on.
[0218] The driver layer of the processor is used to interact with the hardware device to implement functions such as issuing various control instructions to the hardware device and supplying power to the hardware device. The driver layer is connected to the switching switch, and the switching switch is connected to the first camera and the second camera. The driver layer sends the switching switch control instruction to the switching switch through the switching switch control instruction control channel; the switching switch receives the switching switch control instruction, judges and determines the target opening path corresponding to the target camera. Taking the first camera as the target camera as an example, the target opening path corresponding to the target camera is the first path corresponding to the first camera, and the first camera as the target camera is powered through the first path; the first camera performs a reset action after powering on to prepare for image acquisition.
[0219] In an embodiment, the first camera and the second camera are configured as different communication addresses at the driver layer;
[0220] Send camera configuration instructions to the target camera to control the target camera to start image acquisition, including:
[0221] Use the driver layer to determine the communication address corresponding to the target camera;
[0222] The driver layer is used to send the camera configuration instruction to the target camera according to the communication address corresponding to the target camera, so as to control the target camera to perform the start action according to the configuration data in the camera configuration instruction to perform image acquisition and obtain image data; the image data is sent to the processor through the CSI via the switching switch.
[0223] In the embodiment, based on registering the first camera and the second camera as different cameras in the driver layer, the first camera and the second camera are configured with different communication addresses in the driver layer, that is, the first camera and the second camera have different I2C addresses.
[0224] When sending the camera configuration command to the target camera for control, it is first necessary to query and determine the I2C address corresponding to the target camera in the driver layer to achieve the correct switching of the I2C address. After the driver layer obtains the correct I2C address of the target camera, the driver layer sends the correct I2C address of the target camera with the camera configuration command to the target camera through the I2C transmission channel.
[0225] Fig.16 FIG. 4 shows a third flow chart of the camera control method in the embodiment of the present disclosure. Fig.16As shown, in the embodiment, the first camera and the second camera are respectively registered as different cameras in the driver layer, and the process of controlling the target camera to perform image acquisition includes:
[0226] Determine the target camera;
[0227] In the SDK, if it is determined that another camera connected to the switch with the target camera is in the turned-on state, an error is returned and the target camera fails to be turned on;
[0228] If it is determined that another camera connected to the switch together with the target camera is in an off state, then determining the switch control instruction and the camera configuration instruction;
[0229] Send the switch control instructions and camera configuration instructions to the driver layer via the framework layer and the hardware abstraction layer;
[0230] Control the switching path of the switching switch according to the switching switch control instruction;
[0231] Power the target camera;
[0232] Send camera configuration management to the target camera;
[0233] The target camera turns on and acquires images.
[0234] It should be noted that the acquisition, storage, use, and processing of data in the technical solution disclosed in this disclosure are in compliance with the relevant provisions of national laws and regulations, and various types of data such as personal identity data, operation data, behavioral data, etc. related to individuals, customers, and groups obtained in the embodiments of this disclosure have all been authorized.
[0235] Based on the same inventive concept, the present disclosure also provides a camera control device in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0236] Fig.17 A schematic diagram of a camera control device according to an embodiment of the present disclosure is shown. Fig.17 As shown, the device comprises:
[0237] A target camera determining module 1701 is used to determine a target camera from the two cameras according to a camera start instruction;
[0238] An instruction determination module 1702 is used to determine a switch control instruction and a camera configuration instruction based on the target camera;
[0239] A switch control instruction sending module 1703 is used to send the switch control instruction to the switch to control the switch to switch to the path corresponding to the target camera and supply power to the target camera;
[0240] The camera configuration instruction sending module 1704 is used to send the camera configuration instruction to the target camera to control the target camera to start up and collect images.
[0241] It should be noted that the examples and application scenarios implemented by the modules in the above-mentioned device embodiment are the same as those of the corresponding steps in the method embodiment, but are not limited to the contents disclosed in the above-mentioned method embodiment. It should be noted that the above-mentioned modules as part of the device can be executed in a computer system such as a set of computer executable instructions.
[0242] The embodiment of the present disclosure also provides a VR device, which includes the above-mentioned image acquisition device.
[0243] Those skilled in the art will appreciate that various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation that combines hardware and software aspects, which may be collectively referred to herein as a "circuit," "module," or "system."
[0244] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present disclosure, the electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned camera control methods by executing the executable instructions. Since the principle of solving the problem in the electronic device embodiment is similar to that in the above-mentioned method embodiment, the implementation of the electronic device embodiment can refer to the implementation of the above-mentioned method embodiment, and the repeated parts will not be repeated.
[0245] Refer to the following Fig.18 1800 according to this embodiment of the present disclosure is described. Fig.18 The electronic device 1800 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0246] like Fig.18 As shown, the electronic device 1800 is in the form of a general computing device. The components of the electronic device 1800 may include but are not limited to: at least one processing unit 1810, at least one storage unit 1820, and a bus 1830 connecting different system components (including the storage unit 1820 and the processing unit 1810).
[0247] The storage unit stores a program code, and the program code can be executed by the processing unit 1810, so that the processing unit 1810 executes the steps described in the "Exemplary Method" section of the specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 1810 can execute the following steps of the above method embodiment: according to the camera start instruction, determine the target camera from the two cameras; based on the target camera, determine the switch control instruction and the camera configuration instruction; send the switch control instruction to the switch to control the switch to switch to the path corresponding to the target camera and power the target camera; send the camera configuration instruction to the target camera to control the target camera to start up for image acquisition.
[0248] The storage unit 1820 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 18201 and / or a cache storage unit 18202 , and may further include a read-only storage unit (ROM) 18203 .
[0249] The storage unit 1820 may also include a program / utility 18204 having a set (at least one) of program modules 18205, such program modules 18205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0250] Bus 1830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0251] The electronic device 1800 may also communicate with one or more external devices 1840 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1800, and / or communicate with any device that enables the electronic device 1800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1850. Furthermore, the electronic device 1800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1860. As shown, the network adapter 1860 communicates with other modules of the electronic device 1800 via a bus 1830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0252] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0253] Based on the same inventive concept, the embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned camera control methods is implemented. Since the principle of solving the problem in the embodiment of the computer-readable storage medium is similar to that in the above-mentioned method embodiment, the implementation of the embodiment of the computer-readable storage medium can refer to the implementation of the above-mentioned method embodiment, and the repeated parts will not be repeated.
[0254] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0255] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0256] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0257] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0258] Based on the same inventive concept, a computer program product is also provided in an embodiment of the present disclosure, including a computer program product, including: a computer program or an instruction, wherein when the computer program or the instruction is executed by a processor, the camera control method of any one of the above method embodiments is implemented. Since the principle of solving the problem in the computer program product embodiment is similar to that in the above method embodiment, the implementation of the computer program product embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0259] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0260] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0261] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0262] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description 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 control method, characterized in that: A processor applied to an image acquisition device, the processor is connected to a switch, the switch is connected to two cameras, and the method includes: According to the camera start instruction, determining a target camera from the two cameras; Based on the target camera, determining a switch control instruction and a camera configuration instruction; Sending the switch control instruction to the switch to control the switch to switch to the path corresponding to the target camera and supply power to the target camera; The camera configuration instruction is sent to the target camera to control the target camera to start up and perform image acquisition.
2. The camera control method according to claim 1, characterized in that: The two cameras connected by the switching switch include: a first camera and a second camera; the switching switch has a first end, a second end and a third end, the first end and the second end constitute a first path, the first end and the third end constitute a second path, and only one of the first path and the second path is connected at the same time; the processor, the first camera and the second camera all have a camera serial interface; The camera serial interface of the processor is connected to the first end of the switch; the camera serial interface of the first camera is connected to the second end of the switch, and the camera serial interface of the second camera is connected to the second end of the switch.
3. The camera control method according to claim 2, characterized in that: The processor further includes: a switching switch control instruction sending terminal, an internal integrated circuit bus control terminal, and a camera power supply output terminal; The switching switch further includes: a switching switch control instruction receiving terminal; The first camera and the second camera both have a power supply receiving terminal; The switching switch control instruction sending end is connected to the switching switch control instruction receiving end to form a switching switch control instruction control channel, wherein the switching switch control instruction control channel is used to transmit the switching switch control instruction; The camera power supply output terminal is connected to the first terminal of the switch, the first camera power supply receiving terminal is connected to the second terminal of the switch, and the second camera power supply receiving terminal is connected to the third terminal of the switch; the first path and the second path are also used to transmit electric energy to the target camera to power the target camera; The internal integrated circuit bus control end is connected to the first camera and the second camera to send the camera configuration instruction to a target camera in the first camera or the second camera; or the internal integrated circuit bus control end is connected to the switching switch to send the camera configuration instruction to the target camera through the switching switch.
4. The camera control method according to claim 3, characterized in that: If there are multiple switching switches, the internal integrated circuit bus control end includes multiple internal integrated circuit bus sub-control ends, and the internal integrated circuit bus sub-control ends correspond to the switching switches one by one; each of the internal integrated circuit bus sub-control ends is connected to two cameras connected to the corresponding single switching switch, so as to send the camera configuration instruction to the target camera in the first camera or the second camera; or, If there are multiple switching switches, the internal integrated circuit bus control terminal is single; the two cameras connected to each of the multiple switching switches are commonly connected to the single internal integrated circuit bus control terminal; the internal integrated circuit bus control terminal sends the camera configuration instruction to the target camera among the multiple connected cameras.
5. The camera control method according to claim 3, characterized in that: According to the camera start instruction, determining a target camera from the two cameras includes: The application determines a camera start instruction according to a usage scenario, wherein the application runs on the processor; According to the camera start instruction, the first camera or the second camera is determined as a target camera.
6. The camera control method according to claim 5, characterized in that: The processor runs an operating system, which includes: a software development kit, a framework layer, a hardware abstraction layer and a driver layer; the first camera and the second camera are registered as one camera in the driver layer; Based on the target camera, determining a switch control instruction and a camera configuration instruction includes: Based on the target camera, determining the path corresponding to the target camera as a target opening path through the software development kit; Determining a switch control instruction according to a target opening path of the switch; The switch control instruction is sent to the hardware abstraction layer and the driver layer via the framework layer to determine the camera configuration instruction.
7. The camera control method according to claim 6, characterized in that: The processor runs an operating system, the operating system comprising: a framework layer, a hardware abstraction layer and a driver layer; the first camera and the second camera are respectively registered as different cameras in the driver layer; Based on the target camera, determining a switch control instruction and a camera configuration instruction includes: Sending the target camera to the driver layer via the framework layer and the hardware abstraction layer; If the driving layer determines that another camera connected to the switch together with the target camera is in an off state, the driving layer is used to determine the path corresponding to the target camera as a target open path; According to the target opening path, the switch control instruction and the camera configuration instruction are determined.
8. The camera control method according to claim 6, characterized in that: The processor runs an operating system, which includes: a software development kit, a framework layer, a hardware abstraction layer and a driver layer; the first camera and the second camera are respectively registered as different cameras in the driver layer; Based on the target camera, determining a switch control instruction and a camera configuration instruction includes: Based on the target camera, determining, by means of the software development kit, a working state of another camera connected to the switch together with the target camera; If the software development kit determines that the working state of another camera connected to the switch together with the target camera is in an off state, the software development kit is used to determine the path corresponding to the target camera as a target open path; According to the target opening path, determining the switch control instruction and the camera configuration instruction; The switch control instruction and the camera configuration instruction are sent to the driver layer via the framework layer and the hardware abstraction layer.
9. A camera control device, characterized in that: A processor applied to an image acquisition device, the processor is connected to a switch, the switch is connected to two cameras, and the method includes: A target camera determination module, used to determine a target camera from the two cameras according to a camera start instruction; An instruction determination module, used for determining a switch control instruction and a camera configuration instruction based on the target camera; A switch control instruction sending module, used for sending the switch control instruction to the switch to control the switch to switch to the path corresponding to the target camera and supply power to the target camera; The camera configuration instruction sending module is used to send the camera configuration instruction to the target camera to control the target camera to start up and perform image acquisition.
10. An image acquisition device, characterized in that: include: Processor, toggle switch, two cameras; The processor is connected to a switch, and the switch is connected to two cameras; The processor is used to determine a target camera from the two cameras according to a camera start instruction; Based on the target camera, determining a switch control instruction and a camera configuration instruction; sending the switch control instruction to the switch; Sending the camera configuration instruction to the target camera; The switching switch is used to switch to the path corresponding to the target camera and supply power to the target camera according to the switching switch control instruction; The target camera is used to start image acquisition according to the camera configuration instruction.
11. A VR device, characterized in that: Includes the image acquisition device as described in claim 10.
12. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the camera control method according to any one of claims 1 to 8 by executing the executable instructions.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the camera control method according to any one of claims 1 to 8 is implemented.
14. A computer program product comprising: A computer program or instruction, characterized in that when the computer program or instruction is executed by a processor, it implements the camera control method described in any one of claims 1 to 8.