Data synchronization method and apparatus, and device and storage medium
By performing local clock zero calibration and hardware synchronization triggering in the image acquisition module, and encapsulating data frames with the timestamp of attitude information, the problem of poor synchronization of data collected by multiple cameras is solved, and high-quality image data synchronization and splicing are achieved.
Patent Information
- Application Number
- PCT/CN2024/077918
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-20
- Filing Date
- 2024-02-21
- Publication Date
- 2024-09-26
AI Technical Summary
The existing soft synchronization triggering method has poor synchronization of image data collected by multiple cameras due to the delay between program serialization and different lines of trigger signals, which may lead to image stitching failure.
By performing local clock zero calibration before the image acquisition module receives the acquisition trigger pulse, and using the frequency division module to divide the initial acquisition trigger pulse to obtain multiple acquisition trigger pulses, the image frame and attitude information are encapsulated in In the same data frame, the synchronization of the image acquisition module is improved.
It improves the synchronization of image frames collected by multiple image acquisition modules, ensures the success rate of image splicing and high quality of data, and improves the utilization of image data.
Smart Images

Figure CN2024077918_26092024_PF_FP
Abstract
Description
Data synchronization method, device, equipment and storage medium
[0001] This disclosure claims priority to the Chinese patent application filed with the China Patent Office on March 20, 2023, with application number 202310299725.4 and invention name “Data synchronization method, device, equipment and storage medium”, the entire contents of which are incorporated by reference into this disclosure. Technical Field
[0002] The present disclosure relates to the field of panoramic vision technology, and in particular to a data synchronization method, apparatus, device, and storage medium. Background Art
[0003] Panoramic vision is the process of displaying scenes from 90 to 360 degrees on a two-dimensional plane. It can be achieved through image stitching or through catadioptric optical elements. The image stitching method usually uses a single or multiple cameras to scan the scene at a large angle, obtain multiple continuous frames of images in different directions, and then use stitching technology to obtain a panoramic image.
[0004] When multiple cameras are used to scan a scene, they need to capture images synchronously. Currently, soft-synchronous triggering is commonly used to achieve this, controlling the synchronization of multiple cameras through trigger commands. However, this soft-synchronous triggering method can make trigger synchronization difficult due to the serial nature of the program and delays between different trigger signal lines. This results in poor synchronization of the multi-channel image data captured by multiple cameras. Subsequent image stitching based on this poorly synchronized image data may result in stitching failures.
[0005] Summary of the Invention
[0006] (1) Technical issues to be solved
[0007] The technical problem to be solved by the present disclosure is to solve the problem that the existing soft synchronization triggering method makes it difficult to synchronize the trigger due to the serial nature of the program and the delay between different lines of the trigger signal, resulting in poor synchronization of the multi-channel image data collected by multiple cameras, and further leading to the problem that stitching failure may occur when subsequently performing image stitching based on the image data with poor synchronization.
[0008] (2) Technical solution
[0009] In order to solve the above technical problems, the embodiments of the present disclosure provide a data synchronization method, apparatus, device and storage medium.
[0010] In a first aspect, the present disclosure provides a data synchronization method, the method comprising:
[0011] Acquire multiple image frame sequences acquired by multiple image acquisition modules and multiple posture information acquired by the posture detection module; wherein the image frame sequences include multiple image frames acquired at different acquisition times, the image frames are acquired by the image acquisition modules after receiving an acquisition trigger pulse, the image acquisition modules have previously performed local clock zero calibration after receiving a zero calibration trigger pulse before receiving the acquisition trigger pulse, the acquisition trigger pulses received by the multiple image acquisition modules are obtained by frequency division based on the same initial acquisition trigger pulse, and the zero calibration trigger pulses received by the multiple image acquisition modules are obtained by frequency division based on the same initial zero calibration trigger pulse;
[0012] According to the attribute information of the image frame and the timestamp of the posture information, the image frame and posture information corresponding to the same acquisition time are encapsulated into the same data frame, wherein the attribute information includes the timestamp, the sequence number and the channel number.
[0013] In a second aspect, the present disclosure provides a data synchronization device, the device comprising:
[0014] A first acquisition module is configured to acquire a plurality of image frame sequences acquired by a plurality of image acquisition modules and a plurality of posture information acquired by a posture detection module; wherein the image frame sequences include a plurality of image frames acquired at different acquisition times, the image frames being acquired by the image acquisition modules after receiving an acquisition trigger pulse, the image acquisition modules having previously performed local clock zero calibration after receiving a zero calibration trigger pulse before receiving the acquisition trigger pulse, the acquisition trigger pulses received by the plurality of image acquisition modules being obtained by frequency division based on the same initial acquisition trigger pulse, and the zero calibration trigger pulses received by the plurality of image acquisition modules being obtained by frequency division based on the same initial zero calibration trigger pulse;
[0015] The encapsulation module is used to encapsulate the image frames and posture information corresponding to the same acquisition time into the same data frame according to the attribute information of the image frames and the timestamp of the posture information, wherein the attribute information includes the timestamp, the sequence number and the channel number.
[0016] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including a data synchronization module, wherein the data synchronization module includes:
[0017] one or more processors;
[0018] a storage device for storing one or more programs,
[0019] When one or more programs are executed by one or more processors, the one or more processors implement the data synchronization method provided by the first aspect.
[0020] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data synchronization method provided in the first aspect. (3) Beneficial effects
[0021] The above technical solution provided by the embodiments of the present disclosure has the following advantages compared with the prior art:
[0022] A data synchronization method, apparatus, device and storage medium of the embodiments of the present disclosure can obtain multiple image frame sequences acquired by multiple image acquisition modules and multiple posture information acquired by a posture detection module; wherein the image frame sequence includes multiple image frames acquired at different acquisition times, and the image frames are acquired by the image acquisition module after receiving an acquisition trigger pulse. Before receiving the acquisition trigger pulse, the image acquisition module has previously performed local clock zeroing after receiving a zeroing trigger pulse. The acquisition trigger pulses received by the multiple image acquisition modules are obtained by frequency division according to the same initial acquisition trigger pulse, and the received zeroing trigger pulses are obtained by frequency division according to the same initial zeroing trigger pulse; according to the attribute information of the image frame and the timestamp of the posture information, the image frame and posture information corresponding to the same acquisition time are encapsulated into the same data frame, wherein the attribute information includes a timestamp, a sequence number and a channel number. It can be seen that by adopting the above technical solution, multiple image acquisition modules first perform local clock zeroing before acquisition, and multiple image acquisition modules achieve synchronous acquisition through hardware synchronization triggering with higher triggering accuracy. In this way, the synchronization of image frames acquired by multiple image acquisition modules can be improved, that is, the synchronization of multiple image frame sequences can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0024] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0025] FIG1 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure;
[0026] FIG2 is a flow chart of a data synchronization method provided by an embodiment of the present disclosure;
[0027] FIG3 is a flow chart of another data synchronization method provided by an embodiment of the present disclosure;
[0028] FIG4 is a schematic structural diagram of a data synchronization device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure are clearly and completely described below. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present disclosure.
[0030] In order to solve the above problems, embodiments of the present disclosure provide a data synchronization method, apparatus, device, and storage medium.
[0031] Figure 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. As shown in Figure 1, the electronic device includes a data synchronization module 110, which may include a processor and a memory storing computer program instructions. The processor reads and executes the computer program instructions stored in the memory to perform the steps of the data synchronization method provided by the embodiment of the present disclosure.
[0032] Specifically, the processor may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0033] The memory may include a large capacity memory for information or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory may include removable or non-removable (or fixed) media. Where appropriate, the memory may be internal or external to the integrated gateway device. In a specific embodiment, the memory is a non-volatile solid-state memory. In a specific embodiment, the memory includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0034] Continuing to refer to Figure 1, optionally, the electronic device may also include: multiple image acquisition modules (for example, image acquisition module 1-image acquisition module n shown in Figure 1), a posture detection module 120, and a frequency division module 130; the posture detection module 120 is respectively connected to the data synchronization module 110 and the frequency division module 130, the posture detection module 120 is used to acquire posture information, and is also used to generate an initial zeroing trigger pulse and an initial acquisition trigger pulse; the frequency division module 130 is respectively connected to the multiple image acquisition modules, the frequency division module 130 is used to obtain multiple zeroing trigger pulses according to the initial zeroing trigger pulse, and is also used to obtain multiple acquisition trigger pulses according to the initial acquisition trigger pulse; the image acquisition module is connected to the data synchronization module 110, the image acquisition module is used to perform local clock zeroing after receiving the zeroing trigger pulse, and is also used to acquire image frames after receiving the acquisition trigger pulse.
[0035] Specifically, the posture detection module 120 can detect the posture information of the image acquisition module, wherein the posture detection module 120 can be any module that can realize posture detection, such as an inertial measurement unit (IMU). The posture information is used to represent the posture of the image acquisition module when capturing image frames, and may include three-axis posture angles (or angular velocity) and acceleration, etc., but is not limited to this.
[0036] Specifically, the frequency division module 130 may be any module capable of achieving frequency division, and is not limited thereto.
[0037] Specifically, the image acquisition module may be any module capable of acquiring images, such as a camera, a webcam, a scanner, a mobile phone, etc., but is not limited thereto.
[0038] The data synchronization method provided by the embodiment of the present disclosure is described below with reference to Figures 1 to 3. In the embodiment of the present disclosure, the data synchronization method can be executed by a data synchronization module. The data synchronization module can be the data synchronization module in the electronic device shown in Figure 1, but is not limited thereto.
[0039] FIG2 is a flow chart of a data synchronization method provided in an embodiment of the present disclosure.
[0040] As shown in FIG2 , the data synchronization method may include the following steps.
[0041] S210. Acquire multiple image frame sequences acquired by multiple image acquisition modules and multiple posture information acquired by the posture detection module, wherein the image frame sequence includes multiple image frames acquired at different acquisition times, and the image frames are acquired by the image acquisition module after receiving an acquisition trigger pulse. The image acquisition module has previously performed local clock zeroing after receiving a zeroing trigger pulse before receiving the acquisition trigger pulse. The acquisition trigger pulses received by the multiple image acquisition modules are obtained by frequency division according to the same initial acquisition trigger pulse by the frequency division module, and the received zeroing trigger pulses are obtained by frequency division according to the same initial zeroing trigger pulse by the frequency division module.
[0042] Specifically, the posture detection module can generate an initial zero calibration trigger pulse and an initial acquisition trigger pulse. Furthermore, the initial acquisition trigger pulse can trigger the posture detection module to detect the posture information of the image acquisition device.
[0043] Specifically, the frequency division module can divide the frequency of the initial zero-calibration trigger pulse to obtain multiple zero-calibration trigger pulses, and send the zero-calibration trigger pulses to the multiple image acquisition modules, respectively, to trigger the image acquisition modules to record the timestamps of the zero-calibration trigger pulses and perform local clock zero calibration. The timestamp of the zero-calibration trigger pulse can be the time corresponding to the changing edge (e.g., rising edge or falling edge) of the zero-calibration trigger pulse. The local clock zero calibration determines the timestamp of the zero-calibration trigger pulse to be a preset time (e.g., time 0), but is not limited to this.
[0044] The frequency division module can obtain multiple acquisition trigger pulses according to the frequency division of the initial acquisition trigger pulse, and send the acquisition trigger pulses to multiple image acquisition modules respectively to trigger the image acquisition modules to record the timestamp and serial number of the acquisition trigger pulse (that is, the timestamp and serial number of the image frame corresponding to the acquisition trigger pulse), and start image acquisition to obtain image frames.
[0045] Specifically, for each image acquisition module, the image acquisition module can send the acquired image frames and the attribute information of the image frames to the data synchronization module in real time, thereby continuously sending multiple image frames (i.e., image frame sequences) to the data synchronization module within a period of time. In this way, the data synchronization module receives multiple image frame sequences and their attribute information, wherein the attribute information of the image frame includes a timestamp, a serial number, and a channel number, and the channel number is used to identify the image acquisition module that acquires the image frame.
[0046] Of course, for each image acquisition module, the image acquisition module can also send the image frame sequence and the attribute information of each image frame in the image frame sequence to the data synchronization module after continuously acquiring multiple image frames (i.e., image frame sequence). In this way, the data synchronization module can receive multiple image frame sequences and their attribute information.
[0047] Of course, multiple image frame sequences and their attribute information may also be stored in the memory of the data synchronization module or other external memory. Thus, the data synchronization module may read multiple image frame sequences and their attribute information from the memory, but is not limited thereto.
[0048] Optionally, the method may further include sending a pre-notification regarding a zero calibration trigger pulse to the multiple image acquisition modules, so that the multiple image acquisition modules use the first single pulse received after the pre-notification as the zero calibration trigger pulse. This allows the image acquisition modules to clearly identify whether the currently received pulse is a zero calibration trigger pulse or an acquisition trigger pulse, thereby enabling timely local clock zero calibration or image acquisition.
[0049] For example, referring to step 1, the image acquisition module is pre-configured. Specifically, the relevant attributes of image acquisition (e.g., the size, format, compression, etc. of the image frame) and the fixed exposure time are set. Furthermore, the image acquisition module is configured to perform image acquisition after receiving an external trigger pulse (i.e., an acquisition trigger pulse). Then, the posture detection module can start a single pulse (i.e., an initial zeroing trigger pulse), and the frequency division module divides the single pulse to generate multiple synchronous trigger pulses (i.e., multiple zeroing trigger pulses), and distributes them to multiple image acquisition modules. The image acquisition module uses the single pulse to perform local clock zeroing. Then, the posture detection module can start a continuous pulse (i.e., a continuous initial acquisition trigger pulse), and the frequency division module divides the initial acquisition trigger pulse to generate multiple synchronous trigger pulses (i.e., multiple acquisition trigger pulses) and distributes them to multiple image acquisition modules, triggering the image acquisition module to record the timestamp and sequence number of the synchronous trigger pulse, and start exposure. After the exposure is completed, the image frame and the attribute information of the image frame (including the timestamp, sequence number, and channel number) are output. In this way, the data synchronization module can receive multiple image frame sequences and their attribute information. When the posture detection module starts the continuous pulse, it can start to continuously collect the posture information and send the posture information to the data synchronization module. The data synchronization module can record the timestamp of the posture information when receiving the posture information.
[0050] S220 . Encapsulate the image frames and posture information corresponding to the same acquisition moment into the same data frame according to the attribute information of the image frames and the timestamp of the posture information, wherein the attribute information includes the timestamp, the sequence number, and the channel number.
[0051] Specifically, for multiple image frame sequences, image frames with the same sequence number but different channel numbers and timestamp differences within a first preset error range are encapsulated in the same data frame. Furthermore, gesture information and image frames with timestamp differences within a second preset error range are encapsulated in the same data frame. In this way, image frames and gesture information corresponding to the same acquisition moment can be encapsulated in the same data frame.
[0052] It is understandable that due to the time delay and inconsistent clock settings between multiple image acquisition modules, the synchronization of the image frames captured by the multiple image acquisition modules is poor, which in turn leads to unsatisfactory image fusion effects. However, in the embodiment disclosed in the present invention, the frequency division module can divide the initial zero-calibration trigger pulse to generate multiple zero-calibration trigger pulses and distribute them to multiple image acquisition modules through the hardware circuit. Since the transmission delay of the hardware circuit is very short and negligible, multiple image acquisition modules can receive the zero-calibration trigger pulse at the same time. In this way, after the local clocks of the multiple image acquisition modules are zeroed, the clock settings tend to be consistent. Since the clock settings of the multiple image acquisition modules tend to be consistent, and the delay of the hardware circuit transmitting the acquisition trigger module is very short and negligible, the multiple image acquisition modules can receive the acquisition trigger pulse at the same time, thereby starting image acquisition at the same time. In this way, the image acquisition modules can obtain image frames at the same time, realizing data synchronization between the multiple image acquisition modules.
[0053] In the embodiment of the present disclosure, since multiple image acquisition modules first perform local clock zeroing before acquisition, and multiple image acquisition modules achieve synchronous acquisition through hardware synchronization triggering with higher triggering accuracy, the synchronization of image frames acquired by multiple image acquisition modules can be improved, that is, the synchronization of multiple image frame sequences can be improved.
[0054] Figure 3 is a flow chart of another data synchronization method provided by an embodiment of the present disclosure. The present disclosure embodiment is optimized based on the above embodiment, and the present disclosure embodiment can be combined with various optional solutions in one or more of the above embodiments.
[0055] As shown in FIG3 , the data synchronization method may include the following steps.
[0056] S310. Acquire multiple image frame sequences acquired by multiple image acquisition modules and multiple posture information acquired by the posture detection module, wherein the image frame sequence includes multiple image frames acquired at different acquisition times, and the image frames are acquired by the image acquisition module after receiving an acquisition trigger pulse. The image acquisition module has previously performed local clock zeroing after receiving a zeroing trigger pulse before receiving the acquisition trigger pulse. The acquisition trigger pulses received by the multiple image acquisition modules are obtained by frequency division according to the same initial acquisition trigger pulse by the frequency division module, and the received zeroing trigger pulses are obtained by frequency division according to the same initial zeroing trigger pulse by the frequency division module.
[0057] Specifically, S310 is similar to S210 and is not limited here.
[0058] S320 . Encapsulate the image frames and posture information corresponding to the same acquisition moment into the same data frame according to the attribute information of the image frames and the timestamp of the posture information, wherein the attribute information includes the timestamp, the sequence number, and the channel number.
[0059] Specifically, S320 is similar to S220 and is not limited here.
[0060] S330 : For each image frame sequence, detect whether there is frame loss in the image frame sequence according to the attribute information.
[0061] Specifically, for each serial number (or timestamp), it is detected whether the image frame corresponding to the serial number (or timestamp) has image data (ie, whether it is empty). If there is no image data, the image frame is a lost frame.
[0062] S340: If frame loss is detected and the frame loss meets a preset condition, supplement the image data of the lost frame.
[0063] Specifically, the preset condition can be empty, meaning that for any lost frame, the image data of the lost frame is supplemented. Of course, the preset condition can also include: the image frame adjacent to the lost frame in the image frame sequence to which the lost frame belongs is not a lost frame; or the lost frame is one of a plurality of consecutive lost frames, and the number of the plurality of consecutive lost frames is less than a preset frame number threshold. However, the present invention is not limited to this.
[0064] In some embodiments, S340 may include: inputting the image frame sequence to which the lost frame belongs into the image data supplementation model, and obtaining the image frame sequence after the image data of the lost frame is supplemented, wherein the image data supplementation model is pre-trained based on the image frame sequence including the lost frame and the image frame including the image data corresponding to the lost frame.
[0065] In some other embodiments, S340 may include: S341. If frame loss is detected and the frame loss meets a preset condition, determine a reference image frame corresponding to the frame loss.
[0066] In one example, S341 may include: if the image frame adjacent to the lost frame in the image frame sequence to which the lost frame belongs is not a lost frame, determining that the lost frame meets a preset condition; using a first preset number of image frames adjacent to the image frame before the lost frame in the image frame sequence to which the lost frame belongs as reference image frames for the lost frame; and\or; using a second preset number of image frames adjacent to the image frame after the lost frame in the image frame sequence to which the lost frame belongs as reference image frames for the lost frame.
[0067] Specifically, two image frames being adjacent means that acquisition trigger pulses corresponding to the two image frames are adjacent.
[0068] Specifically, the specific value of the first preset number can be set by those skilled in the art according to actual conditions and is not limited here.
[0069] Specifically, "the first preset number of image frames adjacent to the frame loss" refers to the first preset number of image frames consecutively starting from an image frame adjacent to the frame loss and captured earlier than the frame loss. Similarly, "the first preset number of image frames adjacent to the frame loss" refers to the first preset number of image frames consecutively starting from an image frame adjacent to the frame loss and captured later than the frame loss.
[0070] Exemplarily, if the number of image acquisition modules is n, the image frame sequence includes image frame 1, image frame 2, image frame 3…, image frame n, and the first preset number is 2, then when image frame 3 is a lost frame, for the lost frame 3, image frame 1 and image frame 2 can be used as reference image frames for the lost frame, or image frame 3 and image frame 4 can be used as reference image frames for the lost frame, or image frame 1, image frame 2, image frame 3 and image frame 4 can be used as reference image frames for the lost frame.
[0071] In another example, S342 may include: if the lost frame is one of multiple consecutive lost frames and the number of frames in the multiple consecutive lost frames is less than a preset frame number threshold, determining that the lost frame meets the preset conditions; if the image frames adjacent to or after the lost frame in the image frame sequence to which the lost frame belongs are not lost frames, using a third preset number of image frames adjacent to the lost frame as reference image frames for the lost frame.
[0072] Specifically, the "third preset number of image frames adjacent to the frame loss" can be the third preset number of image frames adjacent to the period before the frame loss; it can also be the third preset number of image frames adjacent to the period after the frame loss; it can also include a partial number of image frames adjacent to the period before the frame loss and a partial number of image frames adjacent to the period after the frame loss, and the total number of frames reaches the third preset number.
[0073] Specifically, the “image frames adjacent to or following the frame loss are not frame loss” mentioned here includes not only not frame loss at the beginning, but also not frame loss after image supplementation data is performed.
[0074] Specifically, the specific values of the preset frame number threshold and the second preset number can be set by those skilled in the art according to actual conditions and are not limited here.
[0075] Exemplarily, if the number of image acquisition modules is n, the image frame sequence includes image frame 1, image frame 2, image frame 3..., image frame n, the preset frame number threshold is 5, and the second preset number is 2, then when image frame 3, image frame 4, image frame 5, and image frame 6 are all lost frames, for image frame 3, which is lost frame, image frame 1 and image frame 2 can be used as reference image frames for the lost frame; when image frame 3, which is lost frame, is supplemented with image data, for image frame 4, which is lost frame, image frame 2 and image frame 3 after the image data is supplemented can be used as reference image frames for the lost frame; when image frame 4, which is lost frame, is supplemented with image data, for image frame 5, which is lost frame, image frame 3 and image frame 4 after the image data is supplemented can be used as reference image frames for the lost frame. Of course, image frame 6 and image frame 5 can also be used as reference image frames for the lost frame.
[0076] S342 : Determine image data of the lost frame according to the posture information corresponding to the lost frame, the reference image frame, and the posture information corresponding to the reference image frame.
[0077] Specifically, the posture information of the lost frame can be determined based on the posture information of the reference image frame. For example, the posture information of the image frame adjacent to the frame before the frame loss (i.e., the reference image frame) is summed with the posture information difference between the adjacent image frames to obtain the posture information of the lost frame; the posture information of the image frame adjacent to the frame after the frame loss (i.e., the reference image frame) is subtracted from the posture information difference between the adjacent image frames to obtain the posture information of the lost frame; and the posture information of the image frame adjacent to the frame before the frame loss and the posture information of the image frame adjacent to the frame after the frame loss are averaged to obtain the posture information of the lost frame.
[0078] Of course, the posture information of the lost frame can also be determined based on the timestamp of the lost frame. For example, from the timestamps of multiple posture information, a target timestamp is determined that is within a second preset error range with the timestamp of the lost frame, and the posture information corresponding to the target timestamp is determined as the timestamp of the lost frame.
[0079] It is understandable that when certain image frames in a certain image frame sequence are lost (i.e., there is frame loss in the image frame sequence), multiple image acquisition modules may also become unable to synchronize. In the related art, when there is frame loss in the image frame sequence, the method of sacrificing unsynchronized image frames is generally adopted to ensure a synchronized image frame sequence. That is, only synchronized image frames are intercepted from multiple image frame sequences, and unsynchronized image frames are discarded. However, this method greatly wastes the utilization rate of image data. However, in the embodiment of the present disclosure, image data can be supplemented for lost frames to recover the lost frames, thereby improving the utilization rate of image data. In addition, since the posture of the image acquisition module continuously changes during the process of scanning the scene, the correlation between adjacent image frames acquired by the image acquisition module is relatively high. Therefore, using one or more consecutive image frames adjacent to the lost frame as reference image frames for the lost frame can enable the lost frame to be recovered based on the image frames with a high correlation with the lost frame, which is beneficial to improving the accuracy of lost frame recovery.
[0080] Optionally, the method further includes: if the lost frame is one of a plurality of consecutive lost frames and the number of frames in the plurality of consecutive lost frames is greater than or equal to a preset frame number threshold, discarding the data frame to which the lost frame belongs.
[0081] It's understandable that if the number of consecutive frame drops is greater than or equal to a preset frame threshold, it indicates that many frames have been lost in the image frame sequence. In this case, accurately recovering each lost frame is difficult, so the consecutive dropped frames can be discarded to save time recovering from them. However, since the probability of losing many consecutive frames is much lower than losing a single frame, the number of consecutive frame drops greater than or equal to the preset frame threshold is rare. This means that in most cases, lost frames can be recovered, resulting in high synchronization availability.
[0082] The disclosed embodiments can achieve synchronous acquisition by triggering multiple image acquisition modules through hardware synchronization with higher triggering precision. Furthermore, when frame loss occurs, it can be recovered if the lost frames meet preset conditions. Thus, the disclosed embodiments can combine hardware synchronization triggering with software frame loss recovery to improve the synchronization of multiple image frame sequences captured by multiple image acquisition modules in both hardware and software aspects, achieving high-quality, high-availability data synchronization.
[0083] FIG4 is a schematic structural diagram of a data synchronization device provided by an embodiment of the present disclosure.
[0084] As shown in FIG4 , the data synchronization apparatus 400 may include:
[0085] A first acquisition module 410 is configured to acquire a plurality of image frame sequences acquired by a plurality of image acquisition modules and a plurality of posture information acquired by a posture detection module; wherein the image frame sequences include a plurality of image frames acquired at different acquisition times, the image frames being acquired by the image acquisition modules after receiving an acquisition trigger pulse, the image acquisition modules having previously performed local clock zero calibration after receiving a zero calibration trigger pulse before receiving the acquisition trigger pulse, the acquisition trigger pulses received by the plurality of image acquisition modules being obtained by frequency division based on the same initial acquisition trigger pulse, and the zero calibration trigger pulses received by the plurality of image acquisition modules being obtained by frequency division based on the same initial zero calibration trigger pulse;
[0086] The encapsulation module 420 is used to encapsulate the image frames and posture information corresponding to the same acquisition time into the same data frame according to the attribute information of the image frames and the timestamp of the posture information, wherein the attribute information includes the timestamp, the sequence number and the channel number.
[0087] In another embodiment of the present disclosure, the device may further include:
[0088] The sending module is used to send a pre-notification for the zero calibration trigger pulse to the multiple image acquisition modules, so that the multiple image acquisition modules use the first single pulse received after the pre-notification as the zero calibration trigger pulse.
[0089] In another embodiment of the present disclosure, the device may further include:
[0090] a detection module for, after encapsulating image frames and posture information corresponding to the same acquisition moment into the same data frame based on the timestamps of the image frames and the timestamps of the posture information, detecting whether there is frame loss in the image frame sequence based on the attribute information for each image frame sequence;
[0091] The supplementing module is used to supplement the image data of the lost frame if frame loss is detected and the lost frame meets a preset condition.
[0092] In another embodiment of the present disclosure, the supplement module may include:
[0093] A first determination submodule is configured to determine a reference image frame corresponding to a frame loss if frame loss is detected and the frame loss satisfies a preset condition;
[0094] The second determining submodule is configured to determine the image data of the lost frame according to the posture information corresponding to the lost frame, the reference image frame, and the posture information corresponding to the reference image frame.
[0095] In yet another embodiment of the present disclosure, the first determining submodule may include:
[0096] a first determining unit, configured to determine that the lost frame satisfies a preset condition if an image frame adjacent to the lost frame in the image frame sequence to which the lost frame belongs is not a lost frame;
[0097] a second determining unit, configured to use a first preset number of image frames adjacent to the frame before the frame loss in the image frame sequence to which the lost frame belongs as reference image frames for the frame loss;
[0098] and\or; using a second preset number of image frames adjacent to the lost frame in the image frame sequence to which the lost frame belongs as reference image frames for the lost frame.
[0099] In yet another embodiment of the present disclosure, the first determining submodule may include:
[0100] a third determining unit, configured to determine that the frame loss satisfies a preset condition if the frame loss belongs to one of a plurality of consecutive frame losses and the number of frames of the plurality of consecutive frame losses is less than a preset frame number threshold;
[0101] The fourth determining unit is configured to use a third preset number of image frames adjacent to the lost frame as reference image frames for the lost frame if the image frames adjacent to or after the lost frame in the image frame sequence to which the lost frame belongs are not lost frames.
[0102] In another embodiment of the present disclosure, the device may further include:
[0103] The discarding module is configured to discard the data frame to which the lost frame belongs if the lost frame belongs to one of a plurality of consecutive lost frames and the number of frames in the plurality of consecutive lost frames is greater than or equal to a preset frame number threshold.
[0104] It should be noted that the data synchronization device 400 shown in FIG4 can execute each step in the method embodiments shown in FIG2 to FIG3 and realize each process and effect in the method embodiments shown in FIG2 to FIG3, which will not be described in detail here.
[0105] The following is an embodiment of a computer-readable storage medium provided in an embodiment of the present disclosure. The computer-readable storage medium and the data synchronization method of the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiment of the computer-readable storage medium, please refer to the embodiment of the above-mentioned data synchronization method.
[0106] This embodiment provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform a data synchronization method. The method includes:
[0107] Acquire multiple image frame sequences acquired by multiple image acquisition modules and multiple posture information acquired by the posture detection module; wherein the image frame sequences include multiple image frames acquired at different acquisition times, the image frames are acquired by the image acquisition modules after receiving an acquisition trigger pulse, the image acquisition modules have previously performed local clock zero calibration after receiving a zero calibration trigger pulse before receiving the acquisition trigger pulse, the acquisition trigger pulses received by the multiple image acquisition modules are obtained by frequency division based on the same initial acquisition trigger pulse, and the zero calibration trigger pulses received by the multiple image acquisition modules are obtained by frequency division based on the same initial zero calibration trigger pulse;
[0108] According to the attribute information of the image frame and the timestamp of the posture information, the image frame and posture information corresponding to the same acquisition time are encapsulated into the same data frame, wherein the attribute information includes the timestamp, the sequence number and the channel number.
[0109] Of course, the storage medium containing computer-executable instructions provided by an embodiment of the present disclosure is not limited to the above method operations, and can also execute related operations in the data synchronization method provided by any embodiment of the present disclosure.
[0110] Through the above description of the implementation methods, those skilled in the art can clearly understand that the present disclosure can be implemented with the help of software and necessary general-purpose hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for enabling a computer cloud platform (which can be a personal computer, server, or network cloud platform, etc.) to execute the data synchronization method provided by each embodiment of the present disclosure.
[0111] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0112] The foregoing description is intended only to provide specific embodiments of the present disclosure, which will enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments shown herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein. Industrial Applicability
[0113] The data synchronization method provided by the present disclosure enables multiple image acquisition modules to perform local clock zeroing before acquisition, and multiple image acquisition modules achieve synchronous acquisition through hardware synchronization triggering with higher triggering accuracy. In this way, the synchronization of image frames acquired by multiple image acquisition modules can be improved, that is, the synchronization of multiple image frame sequences can be improved, which has strong industrial practicality.
Claims
1. A data synchronization method, characterized in that: include: Acquire multiple image frame sequences acquired by multiple image acquisition modules and multiple posture information acquired by the posture detection module; wherein the image frame sequence includes multiple image frames acquired at different acquisition times, the image frames are acquired by the image acquisition module after receiving an acquisition trigger pulse, the image acquisition module has previously performed local clock zeroing after receiving a zeroing trigger pulse before receiving the acquisition trigger pulse, the acquisition trigger pulses received by the multiple image acquisition modules are obtained by frequency division according to the same initial acquisition trigger pulse, and the received zeroing trigger pulses are obtained by frequency division according to the same initial zeroing trigger pulse by the frequency division module; According to the attribute information of the image frame and the timestamp of the posture information, the image frame and the posture information corresponding to the same acquisition time are encapsulated into the same data frame, wherein the attribute information includes a timestamp, a sequence number and a channel number.
2. The method according to claim 1, characterized in that Also includes: A pre-notification for the zero calibration trigger pulse is sent to the plurality of image acquisition modules, so that the plurality of image acquisition modules use the first single pulse received after the pre-notification as the zero calibration trigger pulse.
3. The method according to claim 1, characterized in that After encapsulating the image frame and the posture information corresponding to the same acquisition time into the same data frame according to the timestamp of the image frame and the timestamp of the posture information, the method further includes: For each of the image frame sequences, detecting whether there is frame loss in the image frame sequence according to the attribute information; If frame loss is detected and the frame loss meets a preset condition, the image data of the frame loss is supplemented.
4. The method according to claim 3, characterized in that If the frame loss is detected and the frame loss meets a preset condition, supplementing the image data of the frame loss includes: If frame loss is detected and the frame loss meets a preset condition, determining a reference image frame corresponding to the frame loss; According to the posture information corresponding to the lost frame, the reference image frame and the reference image The posture information corresponding to the image frame is used to determine the image data of the lost frame.
5. The method according to claim 3, characterized in that: If the frame loss is detected and the frame loss meets a preset condition, determining a reference image frame corresponding to the frame loss includes: If an image frame adjacent to the lost frame in the image frame sequence to which the lost frame belongs is not a lost frame, determining that the lost frame meets a preset condition; Using a first preset number of image frames adjacent to the frame before the frame loss in the image frame sequence to which the frame loss belongs as reference image frames for the frame loss; And\or; using a second preset number of image frames in the image frame sequence to which the lost frame belongs and which are adjacent to the lost frame as reference image frames for the lost frame.
6. The method according to claim 3, characterized in that: If the frame loss is detected and the frame loss meets a preset condition, determining a reference image frame corresponding to the frame loss includes: If the frame loss is one of a plurality of consecutive frame losses and the number of frames of the plurality of consecutive frame losses is less than a preset frame number threshold, determining that the frame loss meets a preset condition; If the image frames adjacent to or after the lost frame in the image frame sequence to which the lost frame belongs are not lost frames, a third preset number of image frames adjacent to the lost frame are used as reference image frames for the lost frame.
7. The method according to claim 6, characterized in that Also includes: If the lost frame is one of a plurality of consecutive lost frames and the number of frames of the plurality of consecutive lost frames is greater than or equal to a preset frame number threshold, the data frame to which the lost frame belongs is discarded.
8. A data synchronization device, characterized in that: include: The first acquisition module is used to acquire multiple image frame sequences acquired by multiple image acquisition modules and multiple posture information acquired by the posture detection module; wherein the image frame sequence includes multiple image frames acquired at different acquisition times, the image frames are acquired by the image acquisition module after receiving an acquisition trigger pulse, the image acquisition module has previously performed local clock zeroing after receiving a zeroing trigger pulse before receiving the acquisition trigger pulse, the acquisition trigger pulses received by the multiple image acquisition modules are obtained by frequency division according to the same initial acquisition trigger pulse, and the received zeroing trigger pulses are obtained by frequency division according to the same initial zeroing trigger pulse. Frequently obtained; The encapsulation module is used to encapsulate the image frames and posture information corresponding to the same acquisition time into the same data frame according to the attribute information of the image frames and the timestamp of the posture information, wherein the attribute information includes a timestamp, a sequence number and a channel number.
9. An electronic device, characterized in that: A data synchronization module is included, wherein the data synchronization module includes: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the data synchronization method described in any one of claims 1 to 7.
10. The electronic device according to claim 9, characterized in that: Also includes: Multiple image acquisition modules, posture detection modules, and frequency division modules; The posture detection module is connected to the data synchronization module and the frequency division module respectively, and the posture detection module is used to collect posture information and generate an initial zero calibration trigger pulse and an initial acquisition trigger pulse; The frequency division module is connected to the plurality of image acquisition modules respectively, and is used to obtain a plurality of zero calibration trigger pulses according to the frequency division of the initial zero calibration trigger pulse, and is also used to obtain a plurality of acquisition trigger pulses according to the frequency division of the initial acquisition trigger pulse; The image acquisition module is connected to the data synchronization module, and is used to perform local clock zero calibration after receiving the zero calibration trigger pulse, and is also used to acquire image frames after receiving the acquisition trigger pulse.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the data synchronization method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Bionic eye multichannel IMU and camera hardware time synchronization method and device
CN110567453A
Multi-sensor time synchronization device and method
CN112787740A
Data synchronization method and device, equipment and storage medium
CN116347128A
Data acquisition device and unmanned system
CN214583305U
Image time synchronization method and apparatus, and electronic device and storage medium
WO2022205734A1
