A method and apparatus for screening a synchronization frame, an electronic device, and a storage medium

By collaborating between the user layer and the driver layer, and using a timestamp calculation method to select the image with the closest generation time from the two cameras as the synchronization frame, the problem of high hardware cost and insufficient applicability in the existing technology is solved, and efficient synchronization frame selection is achieved in dynamic frame rate scenarios.

CN116567400BActive Publication Date: 2026-02-24SPREADTRUM COMM (TIANJIN) INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310559265.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-16
Publication Date
2026-02-24
Estimated Expiration
2043-05-16

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately filter out synchronized frames captured by dual cameras in dynamic frame rate scenarios, and hardware-based filtering methods are costly and unsuitable for scenarios with changing frame rates.

Method used

By collaborating between the user layer and the driver layer, the image generated at the closest time between the two cameras is selected as the synchronization frame using a timestamp calculation method, thus avoiding hardware costs and being applicable to dynamic frame rate scenarios.

Benefits of technology

While ensuring the accuracy of the selected synchronization frames, it saves hardware costs and can be widely applied to dynamic frame rate scenarios, improving the flexibility and efficiency of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116567400B_ABST
    Figure CN116567400B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a synchronization frame screening method and device, electronic equipment and storage medium, which can accurately screen synchronization frames from images collected by each dual-camera in a dynamic frame rate scene, thereby ensuring the reliability of subsequent processing of the synchronization frames. The synchronization frame screening method comprises: sending a first photographing instruction from a user layer to a driver layer; obtaining, by the driver layer, a first timestamp of a reference camera when generating a target reference image from a memory; in response to the first timestamp being later than a synchronization frame screening start time, obtaining, by the driver layer, second timestamps of a non-reference camera when generating a plurality of to-be-matched images from a memory of a hardware layer; determining, by the driver layer, a maximum closeness of the target reference image and the plurality of to-be-matched images at a generation time based on the first timestamp and the plurality of second timestamps; and determining, by the driver layer, a corresponding target reference image and a target to-be-matched image as a synchronization frame in response to the maximum closeness exceeding a set degree.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, electronic device, and storage medium for filtering synchronous frames. [Background Technology]

[0002] Currently, dual-camera solutions are commonly used in mobile devices to address photography challenges in various scenarios. When processing the images captured by each of the two cameras, it is essential to ensure that the images are synchronized. In other words, the dual-camera images used for processing should ideally be generated at the same time to achieve optimal processing results.

[0003] In related technologies, adding additional hardware to filter out synchronized frames from the images captured by the dual cameras has two problems. First, the cost is high. Second, hardware-based filtering of synchronized frames is only applicable when the image frame rate is fixed. Once the image frame rate changes, filtering cannot be performed, which means it is not suitable for dynamic frame rate scenarios. [Summary of the Invention]

[0004] This application provides a method, apparatus, electronic device, and storage medium for filtering synchronous frames, which can accurately filter synchronous frames from images captured by dual cameras in dynamic frame rate scenarios, thereby ensuring the reliability of subsequent processing of synchronous frames.

[0005] In a first aspect, embodiments of this application provide a method for filtering synchronization frames, applicable to a terminal, the terminal including a user layer, a driver layer, and a hardware layer, the method comprising:

[0006] The user layer sends a first photo capture command to the driver layer, wherein the first photo capture command carries a reference camera identifier and a synchronization frame filtering start time;

[0007] In response to the first photo capture command, the driver layer retrieves the first timestamp from the memory of the hardware layer when the reference camera corresponding to the reference camera identifier generates the target reference image corresponding to the target reference image identifier.

[0008] In response to the first timestamp being later than the synchronization frame filtering start time, the driver layer obtains the second timestamp of each non-reference camera corresponding to the non-reference camera identifier when generating the matching images corresponding to multiple matching image identifiers from the memory of the hardware layer.

[0009] The driving layer determines the maximum proximity between the target reference image and the multiple images to be matched at the generation time based on the first timestamp and multiple second timestamps.

[0010] In response to the maximum proximity exceeding a set level, the driving layer determines the target reference image and the target image to be matched corresponding to the maximum proximity exceeding the set level as synchronization frames.

[0011] In this embodiment, both the reference camera and the non-reference camera in the hardware layer can be considered to be generating images in real time. After receiving the first shooting command from the user layer, the driver layer can use the target reference image generated by the reference camera after the synchronization frame filtering is enabled as the reference. Then, it filters out the target image to be matched from the multiple images to be matched generated by the non-reference camera, selecting the image whose maximum similarity to the target reference image at the time of generation exceeds a set level. The target reference image and the target image to be matched are then used as synchronization frames. Compared with related technologies that use hardware to filter synchronization frames, this method, while ensuring the accuracy of the synchronization frame filtering, does not require additional hardware, thus saving costs. Furthermore, it is not limited to scenarios with a fixed frame rate, making it widely applicable to dynamic frame rate scenarios.

[0012] Optionally, the driving layer determines the maximum proximity between the target reference image and the plurality of images to be matched at the generation time based on the first timestamp and a plurality of second timestamps, including:

[0013] The driving layer calculates the time difference between the first timestamp and multiple second timestamps respectively to obtain multiple time difference values;

[0014] The minimum time difference is determined from the plurality of time differences;

[0015] In response to the maximum proximity exceeding a set level, the driving layer determines the target reference image and the target image to be matched corresponding to the maximum proximity as synchronization frames, including:

[0016] The driving layer determines whether the minimum time difference is less than half the time interval between the second timestamps; if so, it determines that the target reference image corresponding to the minimum time difference and the target image to be matched are synchronized frames.

[0017] In this embodiment, the time difference between the target reference image and multiple images to be matched at the generation time is calculated, and the minimum time difference is determined among the multiple time differences. The minimum time difference can be considered to indicate the maximum closeness between the target reference image and the target image to be matched among the multiple images to be matched at the generation time. If the minimum time difference is less than half of the generation time interval between the images to be matched, it is considered that the generation time of the target reference image and the generation time of the target image to be matched are relatively close. At this time, it can be determined more accurately that the target reference image and the target image to be matched are synchronous frames.

[0018] Optionally, after the driving layer determines whether the minimum time difference is less than half the duration of the interval between the second timestamps, the method further includes:

[0019] If not, the driving layer will use the image corresponding to the first image identifier after the plurality of image identifiers to be matched as the synchronization frame with the target reference image.

[0020] In this embodiment of the application, if the current multiple images to be matched and the target reference image are generated at significantly different times, that is, if the current multiple images to be matched cannot be used as the synchronization frame of the target reference image, then the first image to be matched generated later than the above multiple images to be matched will be used as the synchronization frame of the target reference image.

[0021] Optionally, before the driver layer responds to the first image capture command and retrieves the first timestamp from the memory of the hardware layer when the reference camera corresponding to the reference camera identifier generates the target reference image corresponding to the target reference image identifier, the method further includes:

[0022] The user layer sends a second photo-taking command to the driver layer for the non-reference camera;

[0023] After the driving layer determines the target reference image and the target image to be matched corresponding to the maximum proximity as synchronization frames in response to the maximum proximity exceeding a set level, the method further includes:

[0024] The driver layer determines that the second photo-taking instruction has not been received, and determines the target image storage address corresponding to the target image identifier based on the established correspondence between the image identifier to be matched and the image storage address to be matched.

[0025] The driver layer sends a lock command to the memory of the hardware layer, and the lock command carries the storage address of the target image to be matched;

[0026] The memory of the hardware layer responds to the locking command and locks the target image to be matched corresponding to the storage address of the target image to be matched.

[0027] In this embodiment, in addition to sending a first image capture command for the reference camera to the driver layer, the user layer also sends a second image capture command for the non-reference camera to the driver layer. The second image capture command is used to instruct the image to be matched captured by the non-reference camera to be input to the image processor of the hardware layer for corresponding image processing. After the driver layer matches the target image to be matched with the target reference image, if it has not yet received the second image capture command, it can lock the target image to be matched to prevent it from being covered by other images to be matched, thereby ensuring that the target image to be matched is available after receiving the second image capture command.

[0028] Optionally, the second image capture command carries a non-reference camera identifier. After the driver layer determines that the second image capture command has not been received and sends a lock command to the memory of the hardware layer, the method further includes:

[0029] In response to the second photo capture command, the driving layer determines whether the non-reference camera identifier carried in the second photo capture command matches the non-reference camera identifier corresponding to the non-reference camera; in response to a match, based on the established correspondence between reference image identifiers and reference image storage addresses, the target reference image storage address corresponding to the target reference image identifier is determined, and based on the established correspondence between image identifiers to be matched and image storage addresses to be matched, the target image storage address corresponding to the target image identifier to be matched is determined.

[0030] The driver layer sends an image processing command to the memory of the hardware layer. The image processing command carries the storage address of the target reference image and the storage address of the target image to be matched.

[0031] In response to the image processing command, the memory of the hardware layer synchronously inputs the target reference image corresponding to the target reference image storage address and the target matching image corresponding to the target matching image storage address into the image processor of the hardware layer.

[0032] In this embodiment, the driver layer needs to verify whether the second photo-taking command from the user layer indicates that an image needs to be captured using a non-reference camera. If so, the memory in the hardware layer is controlled to synchronously input the target reference image and the target image to be matched into the image processor for image processing, thereby obtaining an image with a user-specific effect.

[0033] Optionally, in response to the first image capture command, the driver layer retrieves from the memory of the hardware layer the first timestamp of the reference camera corresponding to the reference camera identifier when generating the target reference image corresponding to the target reference image identifier, including:

[0034] The driving layer responds to the first photo capture command and determines multiple reference image identifiers corresponding to the reference camera identifier based on the established first correspondence between the reference camera identifier and the reference image identifier.

[0035] The driving layer determines the first target timestamp storage address corresponding to the target reference image identifier among the plurality of reference image identifiers based on the second correspondence between the reference image identifier and the timestamp storage address;

[0036] The driver layer sends a first query instruction to the memory in the hardware layer, the query instruction carrying the storage address of the first target timestamp;

[0037] In response to the first query instruction, the memory in the driver layer searches for and sends the first timestamp corresponding to the first target timestamp storage address to the driver layer.

[0038] In this embodiment, the driver layer can be considered to have established a first correspondence between the reference camera identifier and the reference image identifier. Then, based on the reference camera identifier, multiple reference image identifiers can be found, that is, it can be found which images are generated by the reference camera. Then, based on the correspondence between the reference image identifier and the timestamp storage address, the first target timestamp storage address of the target reference image in the hardware layer memory among the multiple reference images generated by the reference camera can be found. Then, based on the first target timestamp storage address, the first timestamp corresponding to the target reference image can be accurately obtained from the memory.

[0039] Optionally, in response to the first timestamp being later than the synchronization frame filtering start time, based on the established third correspondence between the non-reference camera identifier and the image identifier to be matched, a plurality of image identifiers to be matched corresponding to the non-reference camera identifier are determined;

[0040] The driving layer determines the second target timestamp storage address corresponding to each of the plurality of image identifiers to be matched based on the fourth correspondence between the image identifier to be matched and the timestamp storage address.

[0041] The driver layer sends a second query instruction to the memory in the hardware layer, the query instruction carrying the storage address of the second target timestamp;

[0042] The memory in the hardware layer responds to the second query instruction, searches for and sends the second timestamp corresponding to the second target timestamp storage address to the driver layer.

[0043] In this embodiment, the driver layer can be considered to have established a third correspondence between the non-reference camera identifier and the image identifier to be matched. Then, based on the non-reference camera identifier, multiple image identifiers to be matched can be found, that is, it can be found which images to be matched were generated by the non-reference camera. Then, based on the fourth correspondence between the image identifier to be matched and the timestamp storage address, the second target timestamp storage address of the target image to be matched among the multiple images to be matched generated by the non-reference camera in the memory of the hardware layer can be found. Then, based on the above-mentioned second target timestamp storage address, the second timestamp corresponding to each image to be matched can be accurately obtained from the memory.

[0044] Optionally, the memory in the hardware layer includes at least a first cache queue and a second cache queue. The first cache queue stores a set number of second timestamps, and the second cache queue receives second timestamps that flow from the first cache queue after exceeding the set number. The memory in the driver layer responds to the second query instruction by searching for and sending the second timestamp corresponding to the storage address of the second target timestamp to the driver layer, including:

[0045] In response to the second query instruction, the memory in the driver layer searches for and sends the second timestamp corresponding to the second target timestamp storage address in the first cache queue to the driver layer.

[0046] In this embodiment, the second timestamp stored in the first cache queue can be considered as a timestamp that is relatively close to the first timestamp, while the second timestamp stored in the second cache queue can be considered as a timestamp that is relatively far from the first timestamp. Therefore, the second timestamp is only obtained from the first cache queue and compared with the first timestamp, so as to more quickly filter out the target image to be matched that is closest to the target reference image in terms of generation time, thereby reducing the time consumed in the filtering process.

[0047] Secondly, embodiments of this application provide a synchronization frame filtering device, the device comprising: a user layer, a driver layer, and a hardware layer, wherein,

[0048] The user layer is used to send a first photo capture command to the driver layer, wherein the first photo capture command carries a reference camera identifier and a synchronization frame filtering start time;

[0049] The driving layer is used to respond to the first shooting command and obtain from the memory of the hardware layer the first timestamp of the reference camera corresponding to the reference camera identifier when generating the target reference image corresponding to the target reference image identifier;

[0050] The driving layer is further configured to, in response to the first timestamp being later than the synchronization frame filtering start time, obtain from the memory of the hardware layer the second timestamp of each non-reference camera corresponding to the non-reference camera identifier when generating the matching images corresponding to multiple matching image identifiers.

[0051] The driving layer is further configured to determine the maximum proximity between the target reference image and the multiple images to be matched at the generation time based on the first timestamp and multiple second timestamps;

[0052] The driving layer is further configured to, in response to the maximum proximity exceeding a set level, determine the target reference image and the target image to be matched corresponding to the maximum proximity exceeding the set level as synchronization frames.

[0053] Optionally, the driver layer is specifically used for:

[0054] Calculate the time difference between the first timestamp and multiple second timestamps respectively to obtain multiple time differences;

[0055] The minimum time difference is determined from the plurality of time differences;

[0056] If the minimum time difference is less than half the time interval between the second timestamps, then the target reference image corresponding to the minimum time difference and the target image to be matched are determined to be synchronous frames.

[0057] Optionally, the driver layer is further used for:

[0058] If the minimum time difference is not less than half the time interval between the second timestamps, the image to be matched corresponding to the first image to be matched after the plurality of image to be matched images is taken as the synchronization frame with the target reference image.

[0059] Optionally, the user layer is further used for:

[0060] Send a second image capture command for the non-reference camera to the driving layer;

[0061] The driving layer is also used for:

[0062] If the second photo-taking command is not received, the target image storage address corresponding to the target image identifier is determined based on the established correspondence between the image identifier to be matched and the image storage address to be matched.

[0063] Send a lock command to the memory of the hardware layer, the lock command carrying the storage address of the target image to be matched;

[0064] The memory of the hardware layer is also used for:

[0065] In response to the locking command, the target image to be matched corresponding to the storage address of the target image to be matched is locked.

[0066] Optionally, the driver layer is further used for:

[0067] In response to the second photo-taking command, it is determined whether the non-reference camera identifier carried in the second photo-taking command matches the non-reference camera identifier corresponding to the non-reference camera; in response to a match, based on the established correspondence between reference image identifiers and reference image storage addresses, the target reference image storage address corresponding to the target reference image identifier is determined, and based on the established correspondence between image identifiers to be matched and image storage addresses to be matched, the target image storage address corresponding to the target image identifier to be matched is determined.

[0068] An image processing command is sent to the memory of the hardware layer, the image processing command carrying the storage address of the target reference image and the storage address of the target image to be matched;

[0069] The memory in the hardware layer is also used for:

[0070] In response to the image processing command, the target reference image corresponding to the target reference image storage address and the target matching image corresponding to the target matching image storage address are synchronously input into the image processor of the hardware layer.

[0071] Optionally, the driver layer is specifically used for:

[0072] In response to the first photo-taking command, based on the established first correspondence between the reference camera identifier and the reference image identifier, a plurality of reference image identifiers corresponding to the reference camera identifier are determined;

[0073] Based on the second correspondence between the reference image identifier and the timestamp storage address, the first target timestamp storage address corresponding to the target reference image identifier among the plurality of reference image identifiers is determined;

[0074] Send a first query instruction to the memory in the hardware layer, the query instruction carrying the target timestamp storage address;

[0075] The memory in the hardware layer is specifically used for:

[0076] In response to the first query command, the system locates and sends the first timestamp corresponding to the first target timestamp storage address to the driver layer.

[0077] Optionally, the driver layer is specifically used for:

[0078] In response to the first timestamp being later than the synchronization frame filtering start time, based on the established third correspondence between the non-reference camera identifier and the image identifier to be matched, a plurality of image identifiers to be matched corresponding to the non-reference camera identifier are determined;

[0079] Based on the fourth correspondence between the image identifier to be matched and the timestamp storage address, the second target timestamp storage address corresponding to each of the plurality of image identifiers to be matched is determined;

[0080] Send a second query instruction to the memory in the hardware layer, the query instruction carrying the storage address of the second target timestamp;

[0081] The memory in the hardware layer is specifically used for:

[0082] In response to the second query command, the system locates and sends the second timestamp corresponding to the second target timestamp storage address to the driver layer.

[0083] Optionally, the memory of the hardware layer includes at least a first cache queue and a second cache queue. The first cache queue stores a predetermined number of second timestamps, and the second cache queue is used to receive second timestamps that flow from the first cache queue after exceeding the predetermined number. Specifically, the memory of the hardware layer is used for:

[0084] In response to the second query instruction, the system searches for and sends the second timestamp corresponding to the second target timestamp storage address to the driver layer in the first cache queue.

[0085] Thirdly, embodiments of the present invention provide an electronic device, the electronic device including a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the steps of the method as described in any embodiment of the first aspect.

[0086] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method as described in any embodiment of the first aspect.

[0087] It should be understood that the second to fourth aspects of the embodiments of the present invention are consistent with the technical solutions of the first aspect of the embodiments of the present invention, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be described again. [Attached Image Description]

[0088] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0089] Figure 1 A flowchart illustrating a method for filtering synchronization frames provided in an embodiment of this application;

[0090] Figure 2 A flowchart illustrating a method for obtaining a first timestamp of a target reference image, provided in an embodiment of this application;

[0091] Figure 3 A flowchart illustrating a method for obtaining a second timestamp of multiple images to be matched, provided in an embodiment of this application;

[0092] Figure 4 A flowchart illustrating a method for searching a second timestamp in a specific cache queue, provided as an embodiment of this application;

[0093] Figure 5 A flowchart illustrating a method for filtering synchronization frames based on a first timestamp and a second timestamp, provided in an embodiment of this application;

[0094] Figure 6 A flowchart illustrating a method for locking a target image to be matched, provided in an embodiment of this application;

[0095] Figure 7 A flowchart illustrating a method for inputting a synchronization frame to an image processor, provided as an embodiment of this application;

[0096] Figure 8 A schematic diagram of a synchronization frame filtering device provided in an embodiment of this application;

[0097] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

Detailed Implementation Methods

[0098] To better understand the technical solutions in this specification, the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0099] It should be understood that the described embodiments are merely some, not all, of the embodiments in this specification. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without inventive effort are within the scope of protection of this specification.

[0100] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0101] As users' demands for mobile device photography capabilities increase, various technical solutions have emerged that combine multiple cameras to address photography challenges in different scenarios, with the combination of two cameras being the most common. Two cameras typically consist of a main camera and an auxiliary camera. When both the main and auxiliary cameras are color cameras, they can be used to calculate depth of field, achieving background blur and refocusing. When the main camera is a color camera and the auxiliary camera is a monochrome camera, it can improve the quality of low-light / night scene photography. When the main camera is a wide-angle camera and the auxiliary camera is a telephoto camera, it can be used to achieve optical zoom. When the main camera is a color camera and the auxiliary camera is a depth camera, it can be used to achieve 3D reconstruction. In these scenarios requiring two cameras to work together, it is crucial to ensure that the main camera image and the auxiliary camera image input to the image processor at the hardware layer are synchronized; that is, the main camera image and the auxiliary camera image should be generated as close to the same moment as possible.

[0102] The inventors of this application have discovered that in related technologies, the method of filtering synchronized frames from images captured by dual cameras by adding additional hardware has two problems: first, the cost is high; second, hardware-based filtering of synchronized frames is only applicable when the image frame rate is fixed. Once the image frame rate changes, filtering becomes impossible, meaning it is unsuitable for dynamic frame rate scenarios. For example, dynamic frame rate scenarios include at least scenes with varying brightness and scenarios requiring adjustments to image quality and image processing algorithms.

[0103] In view of this, embodiments of this application provide a method for filtering synchronization frames. In this method, a reference image generated by a reference camera in a dual-camera setup is used as a synchronization reference. Then, among multiple images to be matched generated by non-reference cameras, a target image to be matched that is closest to the reference image at the time of its generation and whose similarity exceeds a set threshold is selected. The reference image and the target image to be matched are then used as synchronization frames. In other words, while ensuring the accuracy of the synchronization frame filtering, hardware costs are saved, and it is not limited to scenarios with a fixed frame rate, thus making it widely applicable to dynamic frame rate scenarios.

[0104] The technical solutions provided in the embodiments of this application will be described below with reference to the accompanying drawings. Please refer to... Figure 1This application provides a method for filtering synchronization frames. This method is applied to electronic devices, such as smartphones, tablets, and smart wearable devices equipped with dual cameras, etc., without any particular limitation. The process of this method is described as follows:

[0105] Step 101: The user layer sends the first photo-taking command to the driver layer.

[0106] In this embodiment, the camera application installed in the electronic device can be considered as being at the user layer. When the user clicks the camera option in the aforementioned camera application, it triggers the user layer to send a first camera capture command to the driver layer. This first camera capture command mainly carries a reference camera identifier and a synchronization frame filtering start time. The reference camera identifier is used to inform the driver layer which camera's image should be used as the reference image for subsequent synchronization frame filtering among the existing dual cameras. The synchronization frame filtering start time is used to inform the driver layer which time's generated image should be used as the reference image. Thus, the reference camera identifier and the synchronization frame filtering start time together determine which camera's image generated after which time should be used as the reference image by the driver layer.

[0107] It should be understood that the reference camera identifier is usually the identifier of the main camera in a dual-camera setup, that is, the image generated by the main camera is used as the reference image for subsequent selection of synchronization frames. Of course, the reference camera identifier can also be the identifier of the auxiliary camera in a dual-camera setup, that is, the image generated by the auxiliary camera is used as the reference image for subsequent selection of synchronization frames. There is no special restriction here.

[0108] Step 102: The driver layer responds to the first image capture command and retrieves the first timestamp of the reference camera corresponding to the reference camera identifier when generating the target reference image corresponding to the target reference image identifier from the memory of the hardware layer.

[0109] In this embodiment, after receiving the first image capture command, the driver layer can determine which of the main / auxiliary cameras should be used as the reference for subsequent synchronization frame selection based on the reference camera identifier carried in the first image capture command. Furthermore, to further determine which target reference image from the reference camera can be used as the reference for subsequent synchronization frame selection, the driver layer also needs to obtain the first timestamp from the hardware layer's memory when the reference camera generated the target reference image corresponding to the target reference image identifier, so as to make a judgment in conjunction with the synchronization frame selection time.

[0110] It should be understood that when the reference camera identifier is the identifier of the main camera, the target reference image corresponding to the aforementioned target reference image identifier is the target main camera image corresponding to the target main camera image identifier; when the reference image identifier is the identifier of the auxiliary camera, the target reference image corresponding to the aforementioned target reference image identifier is the target auxiliary camera image corresponding to the target auxiliary camera image identifier.

[0111] Please see Figure 2 This is a flowchart illustrating a method for obtaining a first timestamp of a target reference image according to an embodiment of this application. Step 102 can be implemented by executing sub-steps 1021-1023:

[0112] Step 1021: The driver layer responds to the first photo capture command and, based on the established first correspondence between the reference camera identifier and the reference image identifier, determines multiple reference image identifiers corresponding to the reference camera identifier.

[0113] Step 1022: Based on the second correspondence between the reference image identifier and the timestamp storage address, the driver layer determines the first target timestamp storage address corresponding to the target reference image identifier among multiple reference image identifiers.

[0114] Step 1023: The driver layer sends a first query instruction to the memory in the hardware layer. The first query instruction carries the storage address of the first target timestamp.

[0115] Step 1024: The memory in the hardware layer responds to the first query instruction, finds and sends the first timestamp corresponding to the first target timestamp storage address to the driver layer.

[0116] In this embodiment, the main camera / auxiliary camera in the hardware layer can be considered to generate images in real time even without a first shooting command, and each generated main camera image / auxiliary camera image is assigned a corresponding timestamp by the driver layer. This timestamp is used to characterize the generation time of the corresponding image. Then, each of the above-mentioned main camera images / auxiliary camera images, and the corresponding timestamp, is stored in the memory address of the hardware layer allocated by the driver layer. It should be understood that when the driver layer allocates storage addresses for the main camera image, main camera timestamp, auxiliary camera image, and auxiliary camera timestamp, they can be considered to be consecutive. That is, the storage addresses allocated to the main camera images generated successively are consecutive, the storage addresses allocated to the auxiliary camera images generated successively are consecutive, and similarly, the storage addresses allocated to the main camera timestamp and auxiliary camera timestamp are also consecutive.

[0117] In addition to allocating storage addresses for the main camera image, main camera timestamp, auxiliary camera image, and auxiliary camera timestamp, the driver layer establishes a correspondence between the main camera identifier and the main camera image identifier (i.e., distinguishing which images are generated by the main camera) and a correspondence between the main camera image identifier and the main camera image storage address and the main camera image timestamp storage address (i.e., distinguishing the image storage address and timestamp storage address of images generated by the main camera) to facilitate subsequent retrieval. The driver layer also establishes a correspondence between the auxiliary camera identifier and the auxiliary camera image identifier (i.e., distinguishing which images are generated by the auxiliary camera) and a correspondence between the auxiliary camera image identifier and the auxiliary camera image storage address and the auxiliary camera image timestamp storage address (i.e., distinguishing the image storage address and timestamp storage address of images generated by the auxiliary camera).

[0118] Based on this, the driver layer can first determine the multiple reference image identifiers corresponding to the reference camera identifier, and then determine the first target timestamp storage address corresponding to the target reference image identifier among the multiple reference image identifiers, thereby obtaining the corresponding first timestamp from the memory of the hardware layer based on the first target timestamp storage address.

[0119] Step 103: In response to the first timestamp being later than the synchronization frame filtering start time, the driver layer obtains the second timestamp of each non-reference camera corresponding to the non-reference camera identifier when generating multiple images to be matched corresponding to the images to be matched from the memory of the hardware layer.

[0120] In this embodiment, when the first timestamp of the target reference image corresponding to the target reference image identifier is later than the synchronization frame filtering start time, the target reference image can be considered as the reference for subsequent synchronization frame filtering. Of course, if the first timestamp of the target reference image corresponding to the target reference image identifier is earlier than the synchronization frame filtering start time, then the first timestamp of the next target reference image corresponding to the next target reference image identifier is obtained; the specific acquisition process is described above and will not be repeated here. Then, it is compared with the synchronization frame filtering start time until it is later than the synchronization frame filtering start time.

[0121] After identifying the target reference image that can be used for synchronization frame filtering, the second timestamps of the non-reference camera corresponding to the non-reference camera identifier when generating the matching images corresponding to the multiple matching image identifiers are obtained from the memory of the hardware layer. This is to determine whether there is a target matching image among the multiple matching images that can be used as the target reference image in the synchronization frame based on the first timestamp and the multiple second timestamps.

[0122] It should be understood that when the reference camera identifier is the identifier of the main camera, the non-reference camera identifier is the identifier of the auxiliary camera, the non-reference camera is the auxiliary camera, and the image to be matched is the auxiliary camera image; when the reference camera identifier is the identifier of the auxiliary camera, the non-reference camera identifier is the identifier of the main camera, the non-reference camera is the main camera, and the image to be matched is the main camera image. No special restrictions are imposed here.

[0123] Please see Figure 3 This is a flowchart illustrating a method for obtaining a second timestamp of multiple images to be matched, provided in an embodiment of this application. Step 103 can be implemented by executing sub-steps 1031-1034:

[0124] Step 1031: In response to the first timestamp being later than the synchronization frame filtering start time, based on the established third correspondence between the non-reference camera identifier and the image identifier to be matched, determine multiple image identifiers to be matched corresponding to the non-reference camera identifier.

[0125] Step 1032: Based on the fourth correspondence between the image identifier to be matched and the timestamp storage address, the driver layer determines the second target timestamp storage address corresponding to each of the multiple image identifiers to be matched.

[0126] Step 1033: The driver layer sends a second query instruction to the memory in the hardware layer. The second query instruction carries the storage address of the second target timestamp.

[0127] Step 1034: The memory in the hardware layer responds to the second query instruction, finds and sends the second timestamp corresponding to the second target timestamp storage address to the driver layer.

[0128] In this embodiment, in addition to allocating storage addresses for the main camera image, main camera timestamp, auxiliary camera image, and auxiliary camera timestamp, the driver layer establishes a correspondence between the main camera identifier and the main camera image identifier (i.e., distinguishing which images are generated by the main camera) and a correspondence between the main camera image identifier and the main camera image storage address and the main camera image timestamp storage address (i.e., distinguishing the image storage address and timestamp storage address of the image generated by the main camera) to facilitate subsequent retrieval. The driver layer also establishes a correspondence between the auxiliary camera identifier and the auxiliary camera image identifier (i.e., distinguishing which images are generated by the auxiliary camera) and a correspondence between the auxiliary camera image identifier and the auxiliary camera image storage address and the auxiliary camera image timestamp storage address (i.e., distinguishing the image storage address and timestamp storage address of the image generated by the auxiliary camera).

[0129] Based on this, the driver layer can first determine multiple image identifiers to be matched corresponding to the non-reference camera identifier, and then determine the second target timestamp storage address corresponding to each of the multiple image identifiers to be matched, thereby obtaining the corresponding second timestamp from the memory of the hardware layer based on the second target timestamp storage address.

[0130] Please see Figure 4 This is a flowchart illustrating a method for searching a second timestamp in a specific cache queue, provided by an embodiment of this application. Step 1034 can be specifically implemented by executing sub-step 201:

[0131] Step 201: The memory in the hardware layer responds to the second query instruction, searches for the second timestamp corresponding to the second target timestamp storage address in the first cache queue, and sends it to the driver layer.

[0132] In this embodiment, when the driver layer allocates a storage address for the second timestamp of the image to be matched generated by a non-reference camera, it allocates at least two cache queues, such as a first cache queue and a second cache queue. The first cache queue stores a set number of second timestamps, and the second cache queue receives second timestamps that flow from the first cache queue after exceeding the set number. The set number can be set according to actual needs and is not particularly limited here. That is, the second timestamps stored in the first cache queue can be considered to be timestamps that are close to the first timestamp, while the second timestamps stored in the second cache queue can be considered to be timestamps that are far from the first timestamp. Therefore, the storage address of the second target timestamp carried in the second query instruction sent by the driver layer to the storage of the hardware layer can be considered to be the address located in the first cache queue. Therefore, obtaining the second timestamp only from the first cache queue can reduce the number of subsequent comparisons with the first timestamp, and more quickly filter out the target image to be matched that is closest to the target reference image in terms of generation time, thereby improving the filtering efficiency.

[0133] Step 104: The driving layer determines the maximum proximity between the target reference image and multiple images to be matched at the generation time based on the first timestamp and multiple second timestamps.

[0134] In this embodiment of the application, the condition for becoming a synchronization frame of the target reference image is that it is as close as possible to the generation time of the target reference image. After the driving layer obtains the first timestamp of the target reference image and the second timestamps of the multiple images to be matched, it can determine the maximum proximity between the target reference image and the multiple images to be matched at the generation time based on the first timestamp and the second timestamp. The maximum proximity indicates that the corresponding target reference image and the target images to be matched are most likely to be synchronization frames.

[0135] Step 105: In response to the maximum proximity exceeding a set level, the driving layer determines the target reference image and the target image to be matched corresponding to the maximum proximity exceeding the set level as synchronization frames.

[0136] In this embodiment of the application, after the driving layer determines that the maximum proximity between the target reference image and a target image to be matched among multiple images to be matched is the maximum proximity at the generation time, it needs to further determine whether the maximum proximity exceeds a set level. If it exceeds the set level, it indicates that the proximity between the target reference image and the target image to be matched at the generation time meets the requirements. At this time, the target reference image and the target image to be matched can be used as a synchronization frame.

[0137] Please see Figure 5 This is a flowchart illustrating a method for filtering synchronization frames based on a first timestamp and a second timestamp, provided in an embodiment of this application. Step 104 can be implemented by executing sub-steps 1041 and 1042:

[0138] Step 1041: The driver layer calculates the time difference between the first timestamp and multiple second timestamps respectively to obtain multiple time difference values.

[0139] Step 1042: Determine the minimum time difference from multiple time differences.

[0140] Step 105 can be achieved by executing sub-steps 1051 and 1052:

[0141] Step 1051: The driver layer determines whether the minimum time difference is less than half the duration of the interval between the second timestamps.

[0142] Step 1052: If yes, then determine that the target reference image corresponding to the minimum time difference and the target image to be matched are synchronous frames.

[0143] Step 1053: If not, the driving layer will use the target image to be matched, which is the first image to be matched after multiple image to be matched, as the synchronization frame with the target reference image.

[0144] In this embodiment, the time difference between the target reference image and multiple images to be matched at the generation time can be calculated first. These different time differences characterize the degree of closeness between the target reference image and different images to be matched at the generation time. Then, the minimum time difference is determined among the multiple time differences. The minimum time difference can be considered to indicate the maximum degree of closeness between the target reference image and the target image to be matched among the multiple images to be matched at the generation time.

[0145] If the minimum time difference is less than half of the generation time interval between the images to be matched, it can be considered that the target reference image is closer to the target image to be matched at the time of generation, and further away from other images to be matched. In this case, it can be determined more accurately that the target reference image and the target image to be matched are synchronous frames.

[0146] If the minimum time difference is not less than half of the generation time interval between the images to be matched, it can be considered that the current multiple images to be matched are significantly different from the target reference image in terms of generation time. That is, if the current multiple images to be matched cannot be used as the synchronization frame of the target reference image, then the first image to be matched generated later than the above multiple images to be matched will be used as the synchronization frame of the target reference image.

[0147] It should be understood that the size of the image identifier to be matched is positively correlated with the generation time of the image to be matched. That is, the earlier the generation time of the image to be matched, the smaller the image identifier; conversely, the later the generation time of the image to be matched, the larger the image identifier. When filtering the synchronization frames of the target reference image, the filtering is usually carried out in ascending order of the image identifiers to be matched. Therefore, for the first image identifier to be matched after multiple image identifiers, the size of the first image identifier to be matched is greater than the size of the multiple image identifiers to be matched. In other words, the target image to be matched corresponding to the first image identifier to be matched is generated later than the images to be matched corresponding to each of the multiple image identifiers.

[0148] For example, please refer to Table 1. The timestamp of the target reference image is 12:30:15, and the timestamps of the five images to be matched are [12:30:04, 12:30:09, 12:30:14, 12:30:19, 12:30:24]. The minimum time difference between the timestamp of the target reference image and the timestamps of the five images to be matched is 1. Half of the time interval between the timestamps of the images to be matched is 2.5. Since the minimum time difference of 1 is less than 2.5, the target reference image and the image to be matched 3 (timestamp 12:30:14) can be used as a synchronization frame.

[0149] Table 1

[0150]

[0151] For example, please refer to Table 2. The timestamp of the target reference image is 12:30:15, and the timestamps of the five images to be matched are [12:29:51, 12:29:56, 12:30:01, 12:30:06, 12:30:11]. The minimum time difference between the timestamp of the target reference image and the timestamps of the five images to be matched is 4. Half of the time interval between the timestamps of the images to be matched is 2.5. Since the minimum time difference of 4 is greater than 2.5, the images to be matched 1-5 cannot be used as the synchronization frames of the target reference image. Therefore, the first image to be matched that is generated later than the images to be matched 1-5, namely the image to be matched 6, will be used as the synchronization frame of the target reference image.

[0152] Table 2

[0153]

[0154] Please see Figure 6 This is a flowchart illustrating a method for locking a target image to be matched, provided in an embodiment of this application. Before step 102, step 301 can also be performed:

[0155] Step 301: The user layer sends a second photo capture command for the non-reference camera to the driver layer.

[0156] After step 105, steps 302-304 can be performed:

[0157] Step 302: The driver layer determines that no second photo capture command has been received. Based on the established correspondence between the image identifier to be matched and the storage address of the image to be matched, it determines the storage address of the target image to be matched corresponding to the target image identifier.

[0158] Step 303: The driver layer sends a lock command to the memory of the hardware layer, and the lock command carries the storage address of the target image to be matched.

[0159] Step 304: The hardware layer memory responds to the lock command and locks the target image to be matched corresponding to the storage address of the target image to be matched.

[0160] In this embodiment, in addition to sending a first image capture command for the reference camera to the driver layer, the user layer also sends a second image capture command for the non-reference camera to the driver layer. The second image capture command is used to instruct the image to be matched captured by the non-reference camera to be input into the image processor of the hardware layer for corresponding image processing. So, after the driver layer matches the target image to be matched with the target reference image, if it has not yet received the second image capture command, it cannot determine whether the target image to be matched can be input into the image processor of the hardware layer. At this time, the target image to be matched can be locked to prevent the target image to be matched from being covered by other images to be matched, thereby ensuring that the target image to be matched is in an available state after receiving the second image capture command.

[0161] Please see Figure 7 This is a flowchart illustrating a method for inputting a synchronization frame to an image processor according to an embodiment of this application. After step 304, steps 305-307 can be executed further.

[0162] Step 305: In response to the second photo capture command, the driver layer determines whether the non-reference camera identifier carried in the second photo capture command matches the non-reference camera identifier corresponding to the non-reference camera; in response to a match, based on the established correspondence between the reference image identifier and the reference image storage address, the target reference image storage address corresponding to the target reference image identifier is determined, and based on the established correspondence between the image identifier to be matched and the image storage address to be matched, the target image storage address to be matched is determined.

[0163] Step 306: The driver layer sends an image processing command to the memory of the hardware layer. The image processing command carries the storage address of the target reference image and the storage address of the target image to be matched.

[0164] Step 307: The hardware layer's memory responds to the image processing command and synchronously inputs the target reference image corresponding to the target reference image storage address and the target matching image corresponding to the target matching image storage address into the hardware layer's image processor.

[0165] In this embodiment, if the non-reference camera identifier carried in the second photo-taking command matches the non-reference camera identifier of the non-reference camera managed by the driver layer, it indicates that the user needs to use the image generated by the non-reference camera, or in other words, needs to input the image generated by the non-reference camera into the image processor of the hardware layer. Then, when a corresponding target image to be matched is found for the target reference image, the driver layer can control the memory in the hardware layer to synchronously input the target reference image and the target image to be matched into the image processor of the hardware layer for image processing, thereby obtaining an image with a specific effect for the user.

[0166] Furthermore, after step 307, the user layer can also send a first stop shooting command and a second stop shooting command to the driver layer. The first stop shooting command carries a reference camera identifier, and the second stop shooting command carries a non-reference camera identifier. After receiving the first stop shooting command and the second stop shooting command, the driver layer will stop the relevant process of synchronous frame filtering and stop inputting the images generated by the reference camera and the non-reference camera to the image processor of the hardware layer.

[0167] Please see Figure 8 Based on the same inventive concept, embodiments of this application provide a synchronization frame filtering device, which includes a user layer 401, a driver layer 402, and a hardware layer 403; wherein,

[0168] User layer 401 is used to send a first photo capture command to driver layer 402, wherein the first photo capture command carries a reference camera identifier and a synchronization frame filtering start time.

[0169] The driver layer 402 is used to respond to the first photo capture command and obtain the first timestamp of the reference camera corresponding to the reference camera identifier when generating the target reference image corresponding to the target reference image identifier from the memory of the hardware layer 403.

[0170] The driver layer 402 is also used to, in response to the first timestamp being later than the synchronization frame filtering start time, retrieve from the memory of the hardware layer the second timestamp of each non-reference camera corresponding to the non-reference camera identifier when generating the matching images corresponding to multiple matching image identifiers.

[0171] The driving layer 402 is also used to determine the maximum proximity between the target reference image and multiple images to be matched at the generation time based on the first timestamp and multiple second timestamps;

[0172] The driving layer 402 is also used to determine, in response to the maximum proximity exceeding a set level, the target reference image and the target image to be matched corresponding to the maximum proximity exceeding the set level as a synchronization frame.

[0173] Optionally, driver layer 402 is specifically used for:

[0174] Calculate the time difference between the first timestamp and multiple second timestamps to obtain multiple time differences;

[0175] Determine the minimum time difference from multiple time differences;

[0176] If the minimum time difference is less than half the time interval between the second timestamps, then the target reference image and the target image to be matched corresponding to the minimum time difference are determined to be a synchronization frame.

[0177] Optionally, driver layer 402 is also used for:

[0178] If the minimum time difference is not less than half the time interval between the second timestamps, the image to be matched corresponding to the first image to be matched after the multiple image to be matched images is taken as the synchronization frame with the target reference image.

[0179] Optionally, user layer 401 is also used for:

[0180] Send a second image capture command to the driver layer for the non-reference camera;

[0181] Driver layer 402 is also used for:

[0182] If it is determined that no second photo-taking command has been received, the target image storage address corresponding to the target image identifier is determined based on the established correspondence between the image identifier to be matched and the image storage address to be matched.

[0183] A lock command is sent to the memory of the hardware layer, and the lock command carries the storage address of the target image to be matched;

[0184] The memory in hardware layer 403 is also used for:

[0185] In response to the lock command, the target image to be matched corresponding to the storage address of the target image to be matched is locked.

[0186] Optionally, driver layer 402 is also used for:

[0187] In response to the second photo capture command, determine whether the non-reference camera identifier carried in the second photo capture command matches the non-reference camera identifier corresponding to the non-reference camera; in response to a match, determine the target reference image storage address corresponding to the target reference image identifier based on the established correspondence between the reference image identifier and the reference image storage address, and determine the target image storage address corresponding to the target image identifier to be matched based on the established correspondence between the image identifier to be matched and the image storage address to be matched.

[0188] An image processing command is sent to the memory of hardware layer 403. The image processing command carries the storage address of the target reference image and the storage address of the target image to be matched.

[0189] The memory in hardware layer 403 is also used for:

[0190] In response to an image processing command, the target reference image corresponding to the target reference image storage address and the target matching image corresponding to the target matching image storage address are synchronously input into the image processor of the hardware layer.

[0191] Optionally, driver layer 402 is specifically used for:

[0192] In response to the first photo capture command, based on the established first correspondence between the reference camera identifier and the reference image identifier, multiple reference image identifiers corresponding to the reference camera identifier are determined;

[0193] Based on the second correspondence between the reference image identifier and the timestamp storage address, the first target timestamp storage address corresponding to the target reference image identifier among multiple reference image identifiers is determined.

[0194] Send a first query instruction to the memory in hardware layer 403. The query instruction carries the target timestamp storage address.

[0195] The memory in hardware layer 403 is specifically used for:

[0196] In response to the first query command, locate and send the first timestamp corresponding to the first target timestamp storage address to the driver layer.

[0197] Optionally, driver layer 402 is specifically used for:

[0198] In response to the first timestamp being later than the start time of the synchronization frame filtering, multiple image identifiers corresponding to the non-reference camera identifier are determined based on the established third correspondence between the non-reference camera identifier and the image identifier to be matched.

[0199] Based on the fourth correspondence between the image identifier to be matched and the timestamp storage address, the second target timestamp storage address corresponding to each of the multiple image identifiers to be matched is determined;

[0200] Send a second query instruction to the memory in hardware layer 403, the query instruction carrying the storage address of the second target timestamp;

[0201] The memory in hardware layer 403 is specifically used for:

[0202] In response to the second query command, locate and send the second timestamp corresponding to the second target timestamp storage address to the driver layer.

[0203] Optionally, the memory of hardware layer 403 includes at least a first cache queue and a second cache queue. The first cache queue is used to store a set number of second timestamps, and the second cache queue is used to receive second timestamps that flow from the first cache queue after exceeding the set number. Specifically, the memory of hardware layer 403 is used for:

[0204] In response to the second query command, the system searches for and sends the second timestamp corresponding to the second target timestamp storage address in the first cache queue to the driver layer.

[0205] Please see Figure 9This application also provides an electronic device, which includes at least one processor 501. The processor 501 is used to execute a computer program stored in a memory to implement the functions provided in this application embodiment. Figure 1-7 The flowchart illustrates the steps of the synchronization frame filtering method.

[0206] Optionally, the processor 501 may be a central processing unit, a specific ASIC, or one or more integrated circuits used to control program execution.

[0207] Optionally, the electronic device may further include a memory 502 connected to at least one processor 501. The memory 502 may include ROM, RAM, and disk storage. The memory 502 stores data required for the processor 501 to run, i.e., it stores instructions executable by at least one processor 501. The at least one processor 501 executes instructions stored in the memory 502 to perform tasks such as... Figure 1-7 The method is shown. The number of memories 502 is one or more.

[0208] This application embodiment also provides a computer storage medium, wherein the computer storage medium stores computer instructions, which, when executed on a computer, cause the computer to perform actions such as... Figure 1-7 The method.

[0209] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.

Claims

1. A method for selecting synchronization frames, characterized in that, Applicable to a terminal, wherein the terminal includes a user layer, a driver layer, and a hardware layer, the method includes: The user layer sends a first photo capture command to the driver layer, wherein the first photo capture command carries a reference camera identifier and a synchronization frame filtering start time; In response to the first photo capture command, the driver layer retrieves the first timestamp from the memory of the hardware layer when the reference camera corresponding to the reference camera identifier generates the target reference image corresponding to the target reference image identifier. In response to the first timestamp being later than the synchronization frame filtering start time, the driver layer obtains the second timestamp of each non-reference camera corresponding to the non-reference camera identifier when generating the matching images corresponding to multiple matching image identifiers from the memory of the hardware layer. The driving layer determines the maximum proximity between the target reference image and the multiple images to be matched at the generation time based on the first timestamp and multiple second timestamps. In response to the maximum proximity exceeding a set level, the driving layer determines the target reference image and the target image to be matched corresponding to the maximum proximity exceeding the set level as synchronization frames; The method further includes, before the driver layer responds to the first image capture command and retrieves the first timestamp from the memory of the hardware layer when the reference camera corresponding to the reference camera identifier generates the target reference image corresponding to the target reference image identifier: The user layer sends a second photo-taking command to the driver layer for the non-reference camera; After the driving layer determines the target reference image and the target image to be matched corresponding to the maximum proximity as synchronization frames in response to the maximum proximity exceeding a set level, the method further includes: The driver layer determines that the second photo-taking instruction has not been received, and determines the target image storage address corresponding to the target image identifier based on the established correspondence between the image identifier to be matched and the image storage address to be matched. The driver layer sends a lock command to the memory of the hardware layer, and the lock command carries the storage address of the target image to be matched; The memory of the hardware layer responds to the locking command and locks the target image to be matched corresponding to the storage address of the target image to be matched.

2. The method according to claim 1, characterized in that, The driving layer determines the maximum proximity between the target reference image and the multiple images to be matched at the generation time based on the first timestamp and multiple second timestamps, including: The driving layer calculates the time difference between the first timestamp and multiple second timestamps respectively to obtain multiple time difference values; The minimum time difference is determined from the plurality of time differences; In response to the maximum proximity exceeding a set level, the driving layer determines the target reference image and the target image to be matched corresponding to the maximum proximity as synchronization frames, including: The driving layer determines that the minimum time difference is less than half the time interval between the second timestamps; if so, it determines that the target reference image corresponding to the minimum time difference and the target image to be matched are synchronous frames.

3. The method according to claim 2, characterized in that, After the driving layer determines that the minimum time difference is less than half the duration of the interval between the second timestamps, the method further includes: If not, the driving layer will use the target image to be matched corresponding to the first image identifier after the plurality of image identifiers to be matched as the synchronization frame with the target reference image.

4. The method according to claim 1, characterized in that, The second image capture command carries a non-reference camera identifier. After the driver layer determines that the second image capture command has not been received and sends a lock command to the memory of the hardware layer, the method further includes: In response to the second photo capture command, the driving layer determines whether the non-reference camera identifier carried in the second photo capture command matches the non-reference camera identifier corresponding to the non-reference camera; in response to a match, based on the established correspondence between reference image identifiers and reference image storage addresses, the target reference image storage address corresponding to the target reference image identifier is determined, and based on the established correspondence between image identifiers to be matched and image storage addresses to be matched, the target image storage address corresponding to the target image identifier to be matched is determined. The driver layer sends an image processing command to the memory of the hardware layer. The image processing command carries the storage address of the target reference image and the storage address of the target image to be matched. In response to the image processing command, the memory of the hardware layer synchronously inputs the target reference image corresponding to the target reference image storage address and the target matching image corresponding to the target matching image storage address into the image processor of the hardware layer.

5. The method according to claim 1, characterized in that, In response to the first image capture command, the driver layer retrieves from the hardware layer's memory the first timestamp of the reference camera corresponding to the reference camera identifier when generating the target reference image corresponding to the target reference image identifier, including: The driving layer responds to the first photo capture command and determines multiple reference image identifiers corresponding to the reference camera identifier based on the established first correspondence between the reference camera identifier and the reference image identifier. The driving layer determines the first target timestamp storage address corresponding to the target reference image identifier among the plurality of reference image identifiers based on the second correspondence between the reference image identifier and the timestamp storage address; The driver layer sends a first query instruction to the memory in the hardware layer, the first query instruction carrying the target timestamp storage address; In response to the first query instruction, the memory in the driver layer searches for and sends the first timestamp corresponding to the first target timestamp storage address to the driver layer.

6. The method according to claim 1, characterized in that, In response to the first timestamp being later than the synchronization frame filtering start time, the driver layer retrieves from the hardware layer's memory the second timestamps of each non-reference camera corresponding to the non-reference camera identifier when generating multiple images to be matched corresponding to the images to be matched identifiers, including: In response to the first timestamp being later than the synchronization frame filtering start time, based on the established third correspondence between the non-reference camera identifier and the image identifier to be matched, a plurality of image identifiers to be matched corresponding to the non-reference camera identifier are determined; The driving layer determines the second target timestamp storage address corresponding to each of the plurality of image identifiers to be matched based on the fourth correspondence between the image identifier to be matched and the timestamp storage address. The driver layer sends a second query instruction to the memory in the hardware layer, the second query instruction carrying the storage address of the second target timestamp; The memory in the hardware layer responds to the second query instruction, searches for and sends the second timestamp corresponding to the second target timestamp storage address to the driver layer.

7. The method according to claim 6, characterized in that, The memory in the hardware layer includes at least a first cache queue and a second cache queue. The first cache queue stores a predetermined number of second timestamps, and the second cache queue is used to receive second timestamps that flow from the first cache queue after exceeding the predetermined number. The memory in the driver layer responds to the second query instruction, searches for and sends the second timestamp corresponding to the storage address of the second target timestamp to the driver layer, including: In response to the second query instruction, the memory in the driver layer searches for and sends the second timestamp corresponding to the second target timestamp storage address in the first cache queue to the driver layer.

8. A device for filtering synchronization frames, characterized in that, The device includes: a user layer, a driver layer, and a hardware layer, wherein, The user layer is used to send a first photo capture command to the driver layer, wherein the first photo capture command carries a reference camera identifier and a synchronization frame filtering start time; The driving layer is used to respond to the first shooting command and obtain from the memory of the hardware layer the first timestamp of the reference camera corresponding to the reference camera identifier when generating the target reference image corresponding to the target reference image identifier; The driving layer is further configured to, in response to the first timestamp being later than the synchronization frame filtering start time, obtain from the memory of the hardware layer the second timestamp of each non-reference camera corresponding to the non-reference camera identifier when generating the matching images corresponding to multiple matching image identifiers. The driving layer is further configured to determine the maximum proximity between the target reference image and the multiple images to be matched at the generation time based on the first timestamp and multiple second timestamps; The driving layer is also configured to, in response to the maximum proximity exceeding a set level, determine the target reference image and the target image to be matched corresponding to the maximum proximity exceeding the set level as a synchronization frame; The user layer is also used to send a second photo-taking command for the non-reference camera to the driver layer; The driving layer is also used to determine that the second photo-taking instruction has not been received, and to determine the target image storage address corresponding to the target image identifier based on the established correspondence between the image identifier to be matched and the image storage address to be matched. Send a lock command to the memory of the hardware layer, the lock command carrying the storage address of the target image to be matched; The memory of the hardware layer is also used to lock the target image to be matched corresponding to the storage address of the target image to be matched in response to the locking command.

9. An electronic device, characterized in that, The electronic device includes at least one processor and a memory connected to the at least one processor, the at least one processor being configured to implement the steps of the method as described in any one of claims 1-7 when executing a computer program stored in the memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method and device for synchronizing data frames of double cameras

    CN107404362A

  • Image processing method and apparatus, electronic device, and computer-readable storage medium

    CN108989606A