Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of parts and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the embodiments of the present disclosure unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to persons of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of exemplary embodiments may have different values.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
< hardware configuration >
Fig. 1 is a block diagram showing the structure of a hardware configuration of an electronic device 1000 in which an embodiment of the present invention can be implemented.
The electronic device 1000 may be a TOF camera, a laptop, a desktop computer, a cell phone, a tablet, etc.
As shown in fig. 1, the configuration of the electronic device 1000 includes, but is not limited to, a processor 1031, a memory 1032, an interface device 1033, a communication device 1034, a GPU (Graphics Processing Unit, image processor) 1035, a display device 1036, an input device 1037, a speaker 1038, a microphone 1039, and a camera 1030. The processor 1031 includes, but is not limited to, a central processing unit CPU, a microprocessor MCU, and the like. The memory 1032 includes, but is not limited to, ROM (read only memory), RAM (random access memory), nonvolatile memory such as a hard disk, and the like. The interface device 1033 includes, but is not limited to, a USB interface, a serial interface, a parallel interface, and the like. The communication device 1034 can be capable of wired or wireless communication, and specifically can include WiFi communication, bluetooth communication, 2G/3G/4G/5G communication, and the like, for example. The GPU 1035 is used for processing images. The display device 1036 may include, but is not limited to, a liquid crystal screen, a touch screen, and the like. The input device 1037 may include, but is not limited to, a keyboard, mouse, touch screen, etc.
The electronic device shown in fig. 1 is merely illustrative and is in no way meant to limit the invention, its application or uses. The memory 1200 of the electronic device 1000 is configured to store instructions for controlling the processor 1100 to operate to perform any one of the methods for preventing interference by joint operation of multiple TOF cameras according to the embodiments of the present invention. It will be appreciated by those skilled in the art that although a plurality of devices are shown for electronic device 1000 in fig. 1, the present invention may relate to only some of the devices, e.g., electronic device 1000 may relate to only processor 1100 and storage device 1200. The skilled person can design instructions according to the disclosed solution. How the instructions control the processor to operate is well known in the art and will not be described in detail here.
< method example >
The TOF cameras calculate the distance of the photographed object by calculating the time difference between light emission and light reception, and can generate depth information of the object, so the technology of ranging by using the TOF cameras is widely used, wherein most commonly, a plurality of TOF cameras are applied to the same working scene, but a plurality of TOF cameras work simultaneously and have the problem of abnormal depth images caused by mutual interference. In the prior art, a network clock synchronization mode is utilized to realize the simultaneous operation of multiple TOF cameras, namely, the TOF cameras are communicated with a remote server or a PC (personal computer) through installing a switch or a routing network device in a system, each camera in the system performs clock synchronization, a master camera generally controls the operation of the multiple TOF cameras, and the master camera controls the starting working time point of each slave camera so as to achieve the purpose of time-sharing operation of the multiple TOF cameras.
However, in the prior art, network wires are required to be erected between TOF cameras with large volume and high power consumption or a wireless networking is realized by performing position layout so that each TOF camera has an ethernet communication function, thus increasing cost, and the synchronization precision of a network clock synchronization technology is far lower than the precision of the laser working time sequence of the TOF cameras, so that the method cannot control the working of the TOF cameras from a laser layer, can only control the time sequence of a plurality of TOF cameras through an image frame layer, and a plurality of scenes needing image splicing matching cannot apply the scheme, so that the requirement of a novel multi-TOF camera joint working anti-interference method is generated.
The embodiment of the disclosure provides a multi-TOF camera joint work anti-interference method, which takes a single TOF camera as a main body, when the multi-TOF cameras need to work simultaneously, the multi-TOF cameras all start a random mode, generate seed data according to unique identification codes of the multi-TOF cameras, and generate a plurality of random codes through the seed data. Because the unique identification codes of the TOF cameras are different, the generated seeds are different, and the random code sequences generated by using different seeds are different, before each TOF camera executes laser emission operation and exposure operation, each TOF camera carries out time delay according to the obtained different random codes, so that the purposes that each TOF camera carries out laser emission operation and exposure operation at different moments are achieved, and the probability of mutual interference generated when the multiple TOF cameras work simultaneously is reduced.
Fig. 2 is a schematic diagram of a method for preventing interference by combining multiple TOF cameras according to an embodiment of the present disclosure. The anti-interference method for joint work of multiple TOF cameras provided by the embodiment is realized by a computer technology and can be implemented by the electronic equipment shown in fig. 1.
The method for preventing interference of joint work of multiple TOF cameras provided by the embodiment comprises the steps S102-S108.
S102, acquiring a random code, wherein the random code is a time delay before completing single image data acquisition in a current frame.
In particular, the random code is a time delay for performing a single image data acquisition in each frame, i.e. an interval between performing a plurality of image data acquisitions in each frame, and may be a value which is specifically used to represent a period of time, and may be accurate to the nanosecond level.
In a specific embodiment, the random code may be 5, 15, 25, etc.
Illustratively, as shown in FIG. 3, the generating step includes S202-S206, a flowchart of steps for generating a random code.
S202, under the condition that the TOF camera is turned on in a random mode, reading a unique identification code of the TOF camera, wherein the unique identification code is used for marking the TOF camera.
Specifically, the TOF camera has multiple working modes, and the TOF camera is required to be in a random working mode based on the method of implementing the embodiment of the disclosure, and the change of the working mode of the TOF camera can be implemented by stirring a key, or can be implemented by reading a signal in a memory, which is not limited herein.
Each TOF camera has a unique identification code, which may be in the form of a string, for marking the TOF camera to distinguish between different TOF cameras.
S204, generating seed data according to the unique identification code.
Specifically, seeds are generated with a unique identification code according to a random seed function srnd, and each TOF camera generates different seeds because each TOF camera has a different camera than the other TOF.
S206, generating the random codes through a random code generation function based on the seed data, wherein N number of the random codes is greater than or equal to 40.
Specifically, the seeds obtained in the above steps are used to generate random codes through a random code generation function rand, the number of the random codes is N, N is set according to the actual requirement and the size of the storage area of the device, and the number of the random codes can be set to be greater than 40.
Optionally, the method further comprises:
forming the N random codes into a random code pool and storing the random codes in a memory address;
and reading a random code from the random code resource pool and storing the random code into a random code register for acquiring the random code.
Specifically, a plurality of random codes may form a random code pool, and each TOF camera may have a random code pool including a plurality of random codes stored in a memory address of the TOF camera. When the TOF camera starts the random mode, the TOF camera reads a random code from a random code resource pool, temporarily stores the random code in a random code register, and acquires the random code from the TOF camera random code register before each image acquisition operation.
Optionally, after step S106, the method includes:
re-reading a random code from the random code resource pool and storing the random code into the random code register to update the random code register.
Specifically, only one random code is stored in the random code register at a time, so that the TOF can perform corresponding time delay on the laser emission operation and the exposure operation to be performed after reading the random code in the random code register. Since the image acquisition of each frame needs to be performed with a plurality of laser emission operations and exposure operations, after each laser emission operation and exposure operation is completed, the TOF camera re-reads a random code from the random code pool and stores the random code in the random code register so as to prepare for the next laser emission operation and exposure operation.
Optionally, the method further comprises the step of interval limiting the random code.
Specifically, the interval limitation refers to limiting the value of the random code to a minimum value and a maximum value, so that the minimum value of the random code is longer than the time required for completing one laser emission operation and exposure operation, and the occurrence of the next laser emission operation and exposure operation when the one laser emission operation and exposure operation are not completed yet is avoided. Meanwhile, the maximum value of the random code is limited, so that the condition that the value of the random code is overlarge and the acquisition of the current frame image is influenced is avoided.
S104: and starting timing of the preset time according to the random code.
The random code is a time delay before performing a laser emission operation and an exposure operation, so after the TOF camera acquires the random code from the random code register, the time of the time matched with the random code needs to be started, and when the time is finished, a corresponding operation is performed.
S106: when the timing of the predetermined time is completed, an image data collection operation including a laser emission operation and an exposure operation is performed.
Specifically, the time delay is over, the timing is over, and the TOF camera can perform one laser emission operation and one exposure operation to perform one image acquisition operation.
S108: and repeating the steps S102-S106 according to the preset times until the image data acquisition of the current frame is completed.
Specifically, the embodiment of the disclosure can control the operation of the TOF camera from the laser layer, and each frame of image is completed by performing multiple laser emission operations and exposure operations, and before each laser emission operation and exposure operation is performed, a random code is acquired from a random code register until the image data acquisition of the current frame is completed. When the TOF cameras work simultaneously, the operation is the same.
Optionally, after step S108, the method includes a step of processing and transmitting the image data. Specifically, when the TOF camera completes the data acquisition operation of one frame of image, the TOF camera outputs the image data of the frame, and before the image data is output, the image data needs to be processed, and the processing is a basic conventional processing flow of the image data, which is not described herein.
In one embodiment, a time delay is also required between acquiring image data of each frame by the TOF camera, when the TOF camera is started to run, the TOF camera starts frame interval timing, outputs the image data after the image acquisition operation of the present frame is completed, if at this time, the frame interval timing is not completed yet, the TOF camera performs an idle waiting period until the frame interval timing is completed, and then performs the image acquisition operation of the next frame, and the operation process loops to execute steps S102-S106.
Referring to fig. 4, in a specific embodiment, three TOF cameras are performing synchronous operation, taking an example that each of the three TOF cameras completes one frame of image as an example, each of the TOF cameras 1, 2 and 3 needs to perform 7 laser emission operations and exposure operations in the current frame of image acquisition operation, the random code acquired by the TOF camera 1 from the random code register is 5 ns, the TOF camera 1 immediately starts timing for 5 ns, and completes the first image acquisition operation after the 5 ns timing is finished. The random code acquired by the TOF camera 2 from the random code register is 10 nanoseconds, the TOF camera 2 immediately starts timing for 10 nanoseconds, and the first image acquisition operation is completed after the timing for 10 nanoseconds is finished. The random code acquired by the TOF camera 3 from the random code register is 15 nanoseconds, the TOF camera 3 immediately starts timing of 15 nanoseconds, and the first image acquisition operation is completed after the timing of 8 nanoseconds is finished. Similarly, the TOF camera 1 performs 7 times of time delays of 5 ns, 30 ns, 8 ns, 40 ns, 10 ns, 32 ns and 36 ns, and performs 7 times of laser emission and exposure operations, thereby completing the acquisition operation of one frame of image. The TOF camera 2 performs 7 times of laser emission operation and exposure operation after performing 7 times of time delays of 10 nanoseconds, 28 nanoseconds, 10 nanoseconds, 32 nanoseconds, 38 nanoseconds, 8 nanoseconds and 30 nanoseconds, and completes the acquisition operation of one frame of image. The TOF camera 3 performs 7 times of laser emission operation and exposure operation after performing 7 times of time delays of 15 nanoseconds, 34 nanoseconds, 8 nanoseconds, 32 nanoseconds, 30 nanoseconds, 26 nanoseconds and 30 nanoseconds, and completes the acquisition operation of one frame of image.
According to the multi-TOF camera joint work anti-interference method provided by the embodiment of the disclosure, a single TOF camera is taken as a main body, when the multi-TOF cameras need to work simultaneously, the multi-TOF cameras all start a random mode, seed data are generated according to unique identification codes of the multi-TOF cameras, and then a plurality of random codes are generated through the seed data. Because the unique identification codes of the TOF cameras are different, the generated seeds are different, and the random code sequences generated by using different seeds are different, before each TOF camera executes laser emission operation and exposure operation, each TOF camera carries out time delay according to the obtained different random codes, so that the purposes that each TOF camera carries out laser emission operation and exposure operation at different moments are achieved, and the probability of mutual interference generated when the multiple TOF cameras work simultaneously is reduced.
< device example >
In yet another embodiment of the present disclosure, a TOF camera is provided, please refer to fig. 5, which is a block diagram of a structure of the TOF camera of the embodiment of the present disclosure. As shown, the TOF camera 300 includes: an acquisition module 301, a timing control module 302, an execution module 303, and a counting module 304.
The acquiring module 301 acquires a random code;
the timing control module 302 is configured to start timing of a predetermined time according to the random code acquired by the acquisition module 301;
the execution module 303 is configured to execute an image data acquisition operation after the timing of the predetermined time is over, where the image data acquisition operation includes a laser emission operation and an exposure operation;
the counting module 304 is configured to count operations of the executing module 303.
Optionally, the TOF camera 300 further comprises: the generation module 305 and the storage module 306.
The generating module 305 is configured to generate the random code;
the storage module 306 is configured to store the random code.
< computer-readable storage Medium >
Finally, according to yet another embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a multi-TOF camera joint operation anti-interference method according to any embodiment of the present disclosure.
Embodiments of the present disclosure may be a system, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of embodiments of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of embodiments of the present disclosure may be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of embodiments of the present disclosure are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information of computer readable program instructions, which may execute the computer readable program instructions.
Various aspects of embodiments of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvement in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the embodiments of the present disclosure is defined by the appended claims.