Processing method and related device for board writing display

By using a multi-threaded processing method, the problem of incomplete presentation of blackboard data in teaching videos is solved by utilizing the collaborative work of the first and second threads, thus achieving real-time video processing and smooth playback.

CN114942738BActive Publication Date: 2026-01-23BEIJING ESWIN COMPUTING TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210471899.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2026-01-23
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

In teaching videos, the blackboard data cannot be fully displayed due to the teacher obscuring the blackboard, and the existing processing methods result in poor real-time video processing and playback stuttering issues.

Method used

A multi-threaded processing method is adopted. The first thread sends the current frame and the most recently output complete whiteboard image from the extraction module to the compositing module. The second thread sends the current frame and the previous frame when the extraction module is idle, and outputs the complete whiteboard image in a frame skipping manner. The compositing module outputs the composite image frame.

Benefits of technology

It effectively solves the problem of poor real-time performance in video processing, avoids playback stuttering, and ensures that users do not miss whiteboard data while processing and playing simultaneously.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114942738B_ABST
    Figure CN114942738B_ABST
Patent Text Reader

Abstract

The present disclosure provides a processing method and related device for board display, which comprises: sending, by a first thread, a current frame in a video and a complete board image recently output by an extraction module to a synthesis module, so as to output a synthesized image frame of the current frame by the synthesis module; in a case where the extraction module is in an idle state, sending, by a second thread, the current frame and a previous frame in the video to the extraction module, so as to output the complete board image again by the extraction module; in a case where the current frame is not the last frame in the video, determining, by the first thread, a next frame of the current frame in the video as a next current frame, and returning to execute the step of sending the current frame in the video and the complete board image recently output by the extraction module to the synthesis module. The present disclosure can solve the technical problem of poor real-time performance of video processing, thereby effectively avoiding the phenomenon of playing lag in the application of processing and playing video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the technical field of video processing, and specifically to a processing method and related apparatus for whiteboard display. Background Technology

[0002] With the popularity and widespread adoption of online classes, instructional videos have become an indispensable educational resource. Instructional videos are videos captured by a webcam during a teaching session. However, in these sessions, teachers may obscure the blackboard writing due to lecturing needs, resulting in the video frames not fully displaying the blackboard data. To ensure students don't miss any blackboard data while watching the video, it's necessary to process the video. This includes not only the extraction module's process of extracting the complete blackboard image but also the compositing module's process of combining the complete blackboard image with the video's frame images. Because the entire video processing process involves numerous complex calculations, its real-time performance is poor, leading to playback stuttering issues in applications where video processing occurs simultaneously. Summary of the Invention

[0003] To address the aforementioned technical problems, this disclosure provides a processing method and related apparatus for displaying whiteboard text on video.

[0004] According to a first aspect of this disclosure, a processing method for displaying whiteboard text is provided, comprising:

[0005] The first thread sends the current frame in the video and the most recently output complete whiteboard image from the extraction module to the synthesis module, so that the synthesis module outputs a synthesized image frame of the current frame.

[0006] When the extraction module is idle, the current frame and the previous frame in the video are sent to the extraction module through the second thread so that the extraction module can output the complete whiteboard image again.

[0007] If the current frame is not the last frame of the video, the first thread determines the frame following the current frame in the video as the next current frame, and returns to the step of sending the current frame in the video and the most recently output complete whiteboard image from the extraction module to the compositing module.

[0008] Optionally, the processing method further includes:

[0009] Each time the extraction module outputs a complete whiteboard image, the second thread stores the complete whiteboard image extracted by the extraction module in a first memory variable;

[0010] The first thread obtains the most recently output complete whiteboard image from the extraction module by reading the first memory variable;

[0011] Furthermore, the first thread and the second thread execute in parallel.

[0012] Optionally, the processing method further includes:

[0013] The first thread stores the previous frame of the current frame in the video in a second memory variable and stores the current frame in a third memory variable;

[0014] The first thread obtains the current frame by reading the third memory variable, and the second thread obtains the previous frame of the current frame in the video by reading the second memory variable and obtains the current frame by reading the third memory variable.

[0015] In addition, determining the next frame after the current frame in the video as the next current frame through the first thread includes: storing the current frame in the second memory variable by the first thread, and storing the next frame after the current frame in the video in the third memory variable.

[0016] Optionally, the processing method further includes:

[0017] The first thread generates a write completion signal while reading the third memory variable;

[0018] The second thread reads the second memory variable and the third memory variable based on the write completion signal.

[0019] Optionally, the processing method further includes:

[0020] After the second thread reads the second memory variable and the third memory variable, the second thread generates a read completion signal;

[0021] Specifically, the first thread stores the current frame in the second memory variable based on the read-complete signal, and stores the next frame of the current frame in the video in the third memory variable.

[0022] Optionally, the first memory variable, the second memory variable, and the third memory variable are defined and initialized by the first thread before sending the current frame in the video and the most recently output complete whiteboard image from the extraction module to the compositing module.

[0023] Optionally, the most recently output complete whiteboard image of the extraction module is achieved by the second thread sending the target frame and the previous frame in the video to the extraction module;

[0024] When the interval between the current frame and the target frame is a preset value, the extraction module is in an idle state.

[0025] Optionally, the preset value is determined by the time taken by the extraction module to output a complete whiteboard image and the time taken by the synthesis module to output a synthesized image frame.

[0026] According to a second aspect of this disclosure, an electronic device is provided, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of any of the methods described in the first aspect.

[0027] According to a third aspect of this disclosure, a computer-readable storage medium is provided, on which a computer program or instructions are stored, which, when executed by a processor, implement the steps of any of the methods described in the first aspect.

[0028] The beneficial effects of this disclosure are:

[0029] In the whiteboard display processing method provided in this embodiment, a first thread sends the current frame of the video and the most recently output complete whiteboard image from the extraction module to the compositing module, so that the compositing module outputs a composite image frame of the current frame. When the extraction module is idle, a second thread sends the current frame and the previous frame of the video to the extraction module, so that the extraction module outputs a complete whiteboard image again. Furthermore, the first thread also determines the frame following the current frame in the video as the next current frame and returns to execute the step of sending the current frame of the video and the most recently output complete whiteboard image from the extraction module to the compositing module. Therefore, the compositing module outputs composite image frames of each frame in the video, but the extraction module outputs the complete whiteboard image in a frame-skipping manner.

[0030] Since whiteboard updates are infrequent in real-world scenarios, the complete whiteboard image obtained through frame skipping, when synthesized into multiple frames of video using the aforementioned method, can still meet the user's need to ensure no whiteboard data is missed. Considering the lengthy extraction time required for the extraction module to capture a complete whiteboard image during video processing, frame skipping effectively solves the technical problem of poor real-time video processing caused by the extraction module's time consumption, thus avoiding playback stuttering in applications that process and play video simultaneously.

[0031] It should be noted that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this disclosure. Attached Figure Description

[0032] Figure 1 A flowchart illustrating a processing method for displaying whiteboard text provided in an embodiment of this disclosure is shown.

[0033] Figure 2This diagram illustrates the execution of a processing method for displaying whiteboard text according to an embodiment of this disclosure.

[0034] Figure 3 An exemplary flowchart is shown for processing a video according to the processing method provided in embodiments of this disclosure;

[0035] Figure 4 This diagram illustrates the structure of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation

[0036] To facilitate understanding of this disclosure, a more complete description will now be given with reference to the accompanying drawings, which illustrate preferred embodiments of the present disclosure. However, this disclosure may be implemented in various forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure.

[0037] To ensure students don't miss the blackboard data while watching instructional videos, it's necessary to process instructional videos that are partially obscured by the teacher. This includes not only the extraction module's process of extracting the complete blackboard image, but also the synthesis module's process of combining the complete blackboard image with image frames from the video.

[0038] Specifically, the extraction module extracts the complete whiteboard image of an image frame from the video. First, it segments the human figure using the current image frame and the previous frame. Then, based on the segmented human figure, it extracts the whiteboard image that needs to be completed due to teacher occlusion. Next, it uses the complete whiteboard images from other previously extracted image frames to complete the whiteboard image of the current image frame that needs completion, thus obtaining the complete whiteboard image of the current image frame. After the extraction module extracts the complete whiteboard image of the current image frame, the compositing module combines the complete whiteboard image of the current image frame with the current image frame to obtain a composite image frame that presents the complete whiteboard data.

[0039] In practical applications, it is essential to output composite image frames from individual image frames in a video in real time. However, the aforementioned video processing involves numerous complex calculations, resulting in poor real-time performance and playback stuttering issues in scenarios where video is processed and played simultaneously. Therefore, this disclosure provides a processing method for whiteboard display.

[0040] The video processed by this method is a video containing a writing board, where the writing board may be obscured by an object, preventing the display of a complete image of the writing. The video can be an instructional video, but it can also be any other video containing a writing board. In the following description, unless otherwise specified, each frame in the video is an original image frame, and the synthesis module outputs a synthesized image frame corresponding to each original image frame; one original image frame corresponds to one synthesized image frame. After the video is processed by the method provided in this embodiment, the synthesized image frame obtained from the processing is played during playback.

[0041] Figure 1 The illustration shows a method for displaying whiteboard text according to an embodiment of this disclosure. Before execution, this method initializes and starts two threads: a first thread and a second thread. (Refer to...) Figure 1 The execution process of this processing method includes:

[0042] In step S110, the current frame in the video and the most recently output complete whiteboard image from the extraction module are sent to the synthesis module through the first thread, so that the synthesis module outputs the synthesized image frame of the current frame.

[0043] Specifically, when the processing method begins execution, the current frame is the second frame of the video. For the first frame of the video, it can be sent to the extraction module via a first thread. The extraction module uses a neural network to segment the target object from the first frame and extracts the whiteboard image based on the segmented target object. Then, the first thread sends the extracted whiteboard image from the first frame and the first frame itself to the synthesis module, which outputs a synthesized image frame of the first frame. It should be understood that the first frame is used as the initial frame, and the whiteboard image extracted from the first frame is directly considered a complete whiteboard image. Furthermore, when the processing method begins execution, the first thread sends the second frame of the video and the whiteboard image extracted from the first frame (i.e., the most recently output complete whiteboard image from the extraction module) to the synthesis module.

[0044] In step S120, when the extraction module is in an idle state, the current frame and the previous frame in the video are sent to the extraction module through the second thread so that the extraction module can output the complete whiteboard image again.

[0045] Specifically, when the processing method begins execution, the extraction module is in an idle state, so the second and first frames of the video are sent to the extraction module via the second thread. During subsequent execution, i.e., when the current frame is any frame after the second frame in the video, it is uncertain whether the extraction module is idle. In this case, the second thread can determine whether the extraction module is idle before executing step S120. If the extraction module is idle, then step S120 is executed; if the extraction module is busy extracting the complete whiteboard image, then the second thread does not send the current and previous frames of the video to the extraction module. In this way, the extraction module will output a complete whiteboard image every few frames, and there is no task backlog in the extraction module.

[0046] In step S130, if the current frame is not the last frame of the video, the next frame after the current frame in the video is determined by the first thread and the process returns to step S110.

[0047] Specifically, before executing step S130, it can be determined whether the current frame is the last frame of the video. If it is not the last frame of the video, the next frame after the current frame in the video is determined by the thread as the next current frame, and then the process returns to step S110, so that the synthesis module outputs the synthesized image frame of the next current frame; if it is the last frame of the video, the process ends.

[0048] It should be noted that the time taken for the compositing module to output a compositing image frame is less than the time taken for the extraction module to output a complete whiteboard image. The above steps S110, S120 and S130 are executed sequentially and the execution rate must ensure that the compositing module is in an idle state each time step S110 is called.

[0049] In this embodiment, the extraction module outputs a complete whiteboard image every few frames, and the synthesis module combines each frame in the video with the most recently output complete whiteboard image from the extraction module. For scenarios where the whiteboard update frequency is low, this method fully meets the user's need to avoid missing whiteboard data. The extraction module's frame-skipping output of complete whiteboard images allows for timely processing of received tasks, effectively solving the technical problem of poor real-time video processing and avoiding playback stuttering in applications that process and play video simultaneously.

[0050] In an optional embodiment, the processing method for displaying whiteboard writing further includes: each time the extraction module outputs a complete whiteboard writing image, a second thread stores the complete whiteboard writing image extracted by the extraction module in a first memory variable. In this case, in step S110, the first thread sends the most recently output complete whiteboard writing image from the extraction module to the synthesis module, and must first obtain the most recently output complete whiteboard writing image from the extraction module by reading the first memory variable.

[0051] Specifically, the first thread and the second thread execute in parallel. The second thread is used to send the current frame and the previous frame in the video to the extraction module, and is also used to monitor the extraction module and store the complete whiteboard image output by the extraction module in the first memory variable when the extraction module outputs a complete whiteboard image. The first thread is used to read the first memory variable to obtain the most recently output complete whiteboard image of the extraction module, and is used to send the most recently output complete whiteboard image and the current image frame of the extraction module to the synthesis module.

[0052] In this embodiment, the first thread is configured for the compositing module, and the second thread is configured for the extraction module. The first and second threads execute in parallel, ensuring that the complete whiteboard image output by the extraction module is promptly stored in a first memory variable via the second thread, and that the compositing module can accurately obtain the most recently output complete whiteboard image from the extraction module via the first thread.

[0053] Figure 2 The diagram illustrates the execution of a whiteboard display processing method according to an embodiment of this disclosure. (Refer to...) Figure 2 The processing method may further include: a first thread storing the previous frame of the current frame in the video in a second memory variable and storing the current frame in a third memory variable. In this case, in step S110, the first thread sends the current frame in the video to the compositing module, first obtaining the current frame by reading the third memory variable; in step S120, the second thread sends the current frame and the previous frame in the video to the extraction module, first obtaining the previous frame of the current frame in the video by reading the second memory variable and obtaining the current frame by reading the third memory variable; and in step S130, the first thread determines the next frame of the current frame in the video as the next current frame, including: the first thread storing the current frame in the second memory variable and storing the next frame of the current frame in the third memory variable.

[0054] Furthermore, in step S110, the first thread can generate a write completion signal while reading the third memory variable; then, in step S120, the second thread reads the second and third memory variables based on the write completion signal. The write completion signal here serves to instruct the second thread to read data.

[0055] Furthermore, in step S120, the second thread can generate a read-complete signal after reading the second and third memory variables; then, in step S130, the first thread stores the current frame in the second memory variable and the next frame in the video in the third memory variable based on the read-complete signal. The read-complete signal here serves to instruct the first thread to update the second and third memory variables.

[0056] It should be noted that in step S120, regardless of whether the extraction module is idle, the second thread will read the second and third memory variables upon receiving the write completion signal and then generate a read completion signal. However, if the extraction module is busy, the second thread will no longer send the current and previous frames of the video to the extraction module. But in step S130, if the current frame is the last frame of the video, the first thread will not update the second and third memory variables upon receiving the read completion signal.

[0057] The first, second, and third memory variables mentioned above are all global variables, meaning they exist throughout the execution of the processing method. These three memory variables can be defined and initialized by the first thread before step S110. Defining means determining the storage location identified by each memory variable, and initialization means clearing the storage location identified by the memory variables so that data can be stored in the manner described above.

[0058] In an optional embodiment, the most recently output complete whiteboard image of the extraction module involved in step S110 of the above processing method is obtained after the second thread sends the target frame and the previous frame in the video to the extraction module. If the interval between the current frame and the target frame in step S110 is a preset value m, then the extraction module is determined to be in an idle state before step S120 is executed, so that it is not necessary to determine the running status of the extraction module before each execution of step S120.

[0059] The preset value m can be determined by the time t1 taken by the extraction module to output a complete whiteboard image and the time t2 taken by the compositing module to output a composite image frame. Specifically, the preset value m can be set to the smallest integer not less than t1 / t2. Since the time t1 taken by the extraction module to output a complete whiteboard image will vary, and the time t2 taken by the compositing module to output a composite image frame will also vary, the preset value m can be calculated every once in a while using t1 and t2. Then, based on the latest calculated preset value m, it can be determined whether the extraction module is in an idle state before step S120 is executed. This helps to ensure the timeliness of the extraction module's task processing.

[0060] For example, in the processing of the first 5 frames of the video, the preset value m=3. Before the above-mentioned processing method for whiteboard display begins, the first thread sends the first frame to the extraction module and stores the output of the extraction module in the first memory variable. Then, the first memory variable and the first frame are sent to the compositing module, which outputs the composite image frame of the first frame. (Refer to...) Figure 3 The above-described processing method for displaying whiteboard text, starting from the second frame, may include the following steps:

[0061] a) Before step S110 is executed for the first time, the first thread stores the first frame of the video in the second memory variable and stores the second frame in the third memory variable, where the second frame is the current frame.

[0062] b) During the first execution of step S110, the first thread reads the first memory variable and the third memory variable and generates a write completion signal at the same time. Then, the read second frame and the complete whiteboard image extracted from the first frame by the extraction module are sent to the synthesis module so that the synthesis module can output the synthesized image frame of the second frame.

[0063] c) In step S120, the second thread reads the second memory variable and the third memory variable based on the write completion signal. After reading, a read completion signal is generated. Since the extraction module is in an idle state at this time, the first and second frames read are sent to the extraction module so that the extraction module can output the complete whiteboard image of the second frame.

[0064] d) Since the second frame is not the last frame of the video, step S130 is executed based on the read-complete signal, that is, the first thread updates the second memory variable and the third memory variable based on the read-complete signal. Specifically, the second frame is stored in the second memory variable and the third frame is stored in the third memory variable, and then the process returns to step S110, where the third frame is used as the current frame.

[0065] e) During the second execution of step S110, the first thread reads the first memory variable and the third memory variable and generates a write completion signal at the same time. Then, the read third frame and the complete whiteboard image extracted from the first frame by the extraction module are sent to the synthesis module so that the synthesis module can output the synthesized image frame of the third frame.

[0066] f) In step S120, the second thread reads the second memory variable and the third memory variable based on the write completion signal. After reading, a read completion signal is generated. Since the interval between the third frame and the first frame is not the preset value m, the read second and third frames are not sent to the extraction module.

[0067] g) Since the 3rd frame is not the last frame of the video, step S130 is executed based on the read-complete signal, that is, the first thread updates the second memory variable and the third memory variable based on the read-complete signal. Specifically, the 3rd frame is stored in the second memory variable and the 4th frame is stored in the third memory variable, and then the process returns to step S110, where the 4th frame is the current frame.

[0068] h) During the third execution of step S110, the first thread reads the first memory variable and the third memory variable and generates a write completion signal at the same time. Then, the read fourth frame and the complete whiteboard image extracted from the first frame by the extraction module are sent to the synthesis module so that the synthesis module can output the synthesized image frame of the fourth frame.

[0069] i) In step S120, the second thread reads the second and third memory variables based on the write completion signal. After reading, a read-complete signal is generated. Since the interval between the fourth frame and the first frame is a preset value m, the read third and fourth frames are sent to the extraction module so that the extraction module can output the complete whiteboard image of the fourth frame. When the extraction module outputs the complete whiteboard image of the second frame, the second thread stores the complete whiteboard image of the second frame in the first memory variable, i.e., the first memory variable is updated.

[0070] j) Since the 4th frame is not the last frame of the video, step S130 is executed based on the read-through signal, that is, the first thread updates the second memory variable and the third memory variable based on the read-through signal. Specifically, the 4th frame is stored in the second memory variable and the 5th frame is stored in the third memory variable, and then the process returns to step S110, where the 5th frame is the current frame.

[0071] k) During the fourth execution of step S110, the first thread reads the first memory variable and the third memory variable and generates a write completion signal at the same time. Then, it sends the read fifth frame and the complete whiteboard image extracted from the second frame by the extraction module to the synthesis module so that the synthesis module can output the synthesized image frame of the fifth frame.

[0072] It should be noted that for frames after the 5th frame in the video, the processing can be carried out by referring to steps e) to k) above. The second and third memory variables will no longer be updated through step S130 when the last frame of the video is processed, that is, the processing ends.

[0073] During the processing of frames from frame 5 onwards in the video, if the preset value m remains unchanged, the extraction module will sequentially output the complete whiteboard image of frame 7, frame 10, frame 13, etc. Here, the frame interval between two adjacent complete whiteboard images output by the extraction module is the preset value m; if the preset value m changes, the frame interval between two adjacent complete whiteboard images output by the extraction module is still the preset value m, but the complete whiteboard image of frame 7 will no longer be output after the complete whiteboard image of frame 4.

[0074] In the example above, after the extraction module outputs two frames of complete whiteboard images, it needs to extract the fourth frame of complete whiteboard images. This is because the processing method uses the whiteboard image extracted from the first frame when it starts executing. To ensure that there is no task backlog in the extraction module, the preset value m can be set to the smallest integer not less than (t1 / t2+1).

[0075] This disclosure also provides an electronic device 1300, such as... Figure 4As shown, it includes a memory 1310 and a processor 1320, as well as a program stored on the memory 1310 and executable on the processor 1320. When the program is executed by the processor 1320, it can implement the various processes of the above-described processing methods and achieve the same technical effects. To avoid repetition, it will not be described again here.

[0076] It should be noted that the first and second threads used during the execution of the processing method are run by different cores within the processor 1320, allowing them to execute in parallel. The extraction module and synthesis module used during the execution of the processing method can also each be a core within the processor, and different from the core running the first and second threads. This allows the extraction module, synthesis module, first thread, and second thread to run simultaneously to handle their respective tasks. The extraction module and synthesis module can also be processing devices located outside the processor 1320 but capable of communicating with the processor 1320, located within the electronic device 1300.

[0077] Of course, the electronic device 1300 may also include auxiliary sub-devices such as a power supply component 1330, a network interface 1340, and an input / output interface 1350.

[0078] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. Therefore, this disclosure also provides a computer-readable storage medium storing a computer program or instructions. When executed by a processor, the computer program or instructions can implement the various processes of the embodiments of the above processing methods. The computer-readable storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0079] Since the instructions stored in the readable storage medium can execute the steps of any of the processing methods provided in the embodiments of this disclosure, the beneficial effects achievable by any of the processing methods provided in the embodiments of this disclosure can be realized, as detailed in the preceding embodiments, and will not be repeated here. The specific implementation of each of the above operations can be found in the preceding embodiments, and will not be repeated here.

[0080] It should be noted that in describing the various embodiments in this specification, the focus is on the differences from other embodiments, while the same or similar parts between the various embodiments can be understood by referring to each other. For the system embodiments, since they are basically similar to the method embodiments, the relevant parts can be referred to the description of the method embodiments.

[0081] Furthermore, it should be noted that in the apparatus and method of this disclosure, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent solutions of this disclosure. Moreover, the steps performing the above series of processes can naturally be executed in the order described, but are not necessarily required to be executed in chronological order; some steps can be executed in parallel or independently of each other. Those skilled in the art will understand that all or any step or component of the method and apparatus of this disclosure can be implemented in any computing device (including processors, storage media, etc.) or network of computing devices, in hardware, firmware, software, or a combination thereof, which can be achieved by those skilled in the art using their basic programming skills after reading the description of this disclosure.

[0082] Finally, it should be noted that the above embodiments are merely examples for clearly illustrating this disclosure and are not intended to limit the implementation. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of this disclosure.

Claims

1. A processing method for displaying blackboard writing, characterized in that, include: The first thread sends the current frame of the video and the most recently output complete whiteboard image from the extraction module to the synthesis module, so that the synthesis module outputs a synthesized image frame of the current frame. The most recently output complete whiteboard image from the extraction module is achieved by the second thread sending the target frame and the frame before the target frame from the video to the extraction module. When the interval between the current frame and the target frame is a preset value and the extraction module is determined to be in an idle state, the current frame and the previous frame in the video are sent to the extraction module through the second thread so that the extraction module can output the complete whiteboard image again. If the current frame is not the last frame of the video, the first thread determines the frame following the current frame in the video as the next current frame, and then returns to the step of sending the current frame in the video and the most recently output complete whiteboard image from the extraction module to the compositing module. Specifically, each time the extraction module outputs a complete whiteboard image, the second thread stores the complete whiteboard image extracted by the extraction module in a first memory variable. Then, the first thread obtains the most recently output complete whiteboard image by reading the first memory variable, and the first thread and the second thread execute in parallel.

2. The processing method according to claim 1, characterized in that, Also includes: The first thread stores the previous frame of the current frame in the video in a second memory variable and stores the current frame in a third memory variable; The first thread obtains the current frame by reading the third memory variable, and the second thread obtains the previous frame of the current frame in the video by reading the second memory variable and obtains the current frame by reading the third memory variable. In addition, determining the next frame after the current frame in the video as the next current frame through the first thread includes: storing the current frame in the second memory variable by the first thread, and storing the next frame after the current frame in the video in the third memory variable.

3. The processing method according to claim 2, characterized in that, Also includes: The first thread generates a write completion signal while reading the third memory variable; The second thread reads the second memory variable and the third memory variable based on the write completion signal.

4. The processing method according to claim 3, characterized in that, Also includes: After the second thread reads the second memory variable and the third memory variable, the second thread generates a read completion signal; Specifically, the first thread stores the current frame in the second memory variable based on the read-complete signal, and stores the next frame of the current frame in the video in the third memory variable.

5. The processing method according to claim 2, characterized in that, The first memory variable, the second memory variable, and the third memory variable are defined and initialized by the first thread before sending the current frame in the video and the most recently output complete whiteboard image from the extraction module to the compositing module.

6. The processing method according to claim 1, characterized in that, The preset value is determined by the time taken by the extraction module to output a complete whiteboard image and the time taken by the synthesis module to output a synthesized image frame.

7. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the processing method as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions that, when executed by a processor, implement the steps of the processing method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Video playing method and device, electronic equipment and storage medium

    CN108156520A

  • Detection tracking method and device, equipment and medium

    CN113706576A

  • Video frame processing method and device, related equipment and storage medium

    CN114120163A