Image rendering method, device, equipment and computer-readable storage medium

Through asynchronous logical separation algorithm inference and image rendering, parallel processing and cache queue technology are adopted to solve the problem of image display out-of-synchronization, and the image rendering efficiency is improved and synchronous display is achieved.

CN115018970BActive Publication Date: 2025-08-12SHENZHEN ORBBEC CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210232712.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-09
Publication Date
2025-08-12
Estimated Expiration
2042-03-09

AI Technical Summary

Technical Problem

In the prior art, the image rendering scheme leads to the problem of image display being out of synchronization, especially in the mobile scene, the top layer update delay is large, resulting in the image display being out of synchronization.

Method used

The asynchronous logic separation algorithm inference and image rendering process is used to perform algorithmic inference on the original image data through the inference thread, image synthesis is performed through the rendering thread, multiple inference tasks and image synthesis are performed in parallel, data transmission is stabilized using the cache queue, and the original image and algorithm inference results are finally superimposed on the top layer.

Benefits of technology

It effectively improves image rendering efficiency and ensures the synchronization of image display, especially the synchronization updates between the top layer and the bottom layer in the mobile scene.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115018970B_ABST
    Figure CN115018970B_ABST
Patent Text Reader

Abstract

The present application provides an image rendering method, apparatus, device, and computer-readable storage medium. The image rendering method includes: performing algorithmic reasoning on original image data through an inference thread; performing image synthesis on the original image data and the inference result data through a rendering thread to obtain synthesized image data; and performing image rendering processing based on the synthesized image data. Through the implementation of the present application solution, asynchronous logic is used to perform algorithmic reasoning and rendering separately, which can effectively improve rendering efficiency. In addition, the top layer is synthesized by the original image and the algorithmic reasoning result, ensuring the synchronization of image display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image rendering method, apparatus, device, and computer-readable storage medium. Background Art

[0002] During the design process of financial payment and AI skeleton recognition products, it is usually necessary to display a real-time face tracking frame or real-time skeleton on the preview. If the native Android camera is used as the data stream provider, the native camera preview Surface cannot directly draw the data to be displayed on the layer.

[0003] Related technologies employ a dual-layer design, with the bottom layer used to preview the original image data and the top layer using a transparent mask to overlay the data to be rendered. However, in practice, object detection algorithms are time-consuming to execute. When the object to be detected is in motion, the top layer experiences update delays, and the frame rates of the top and bottom layers differ significantly, leading to image display asynchrony. Summary of the Invention

[0004] The embodiments of the present application provide an image rendering method, apparatus, device, and computer-readable storage medium, which can at least solve the problem that the image rendering solutions provided in the related art easily lead to asynchronous image display.

[0005] A first aspect of an embodiment of the present application provides an image rendering method, including:

[0006] Perform algorithmic reasoning on the original image data through the inference thread to obtain the inference result data;

[0007] Performing image synthesis on the original image data and the inference result data through a rendering thread to obtain synthesized image data;

[0008] Image rendering is performed based on the synthesized image data.

[0009] A second aspect of an embodiment of the present application provides an image rendering device, including:

[0010] The inference module performs algorithmic inference on the original image data through the inference thread to obtain the inference result data;

[0011] A synthesis module, configured to perform image synthesis on the original image data and the inference result data through a rendering thread to obtain synthesized image data;

[0012] A rendering module is used to perform image rendering based on the synthesized image data.

[0013] A third aspect of an embodiment of the present application provides an electronic device, comprising: a memory and a processor, wherein the processor is used to execute a computer program stored in the memory. When the processor executes the computer program, it implements the steps of the image rendering method provided in the first aspect of the embodiment of the present application.

[0014] The fourth aspect of the embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the image rendering method provided in the first aspect of the embodiment of the present application are implemented.

[0015] As can be seen from the above, according to the image rendering method, apparatus, device, and computer-readable storage medium provided by the present application, algorithmic reasoning is performed on the original image data through an inference thread; image synthesis is performed on the original image data and the inference result data through a rendering thread to obtain synthetic image data; and image rendering processing is performed based on the synthetic image data. Through the implementation of the present application, asynchronous logic is used to perform algorithmic reasoning and image rendering separately, which can effectively improve rendering efficiency. In addition, the top layer is synthesized by the original image and the algorithmic reasoning result, ensuring the synchronization of image display. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of the basic flow of the image rendering method provided in the first embodiment of the present application;

[0017] Figure 2 A schematic diagram of the structure of a cache queue provided in the first embodiment of the present application;

[0018] Figure 3 A schematic diagram of a detailed flow chart of the image rendering method provided in the second embodiment of the present application;

[0019] Figure 4 A schematic diagram of program modules of an image rendering device provided in the third embodiment of the present application;

[0020] Figure 5 This is a schematic structural diagram of an electronic device provided in the fourth embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.

[0022] When rendering an image in related technologies, a transparent mask (also known as a mask) is usually superimposed on the original image data of the bottom layer, and then the data to be rendered (such as a face frame, etc.) is drawn on top of the transparent mask. That is, the transparent mask superimposed on the data to be rendered is placed on the top layer, and the original image data is placed on the bottom layer. However, when the object to be measured is in a moving scene, especially when it moves quickly, the face frame and other data on the top layer will be updated slowly and the object to be measured on the bottom layer will not be tracked.

[0023] In order to solve the problem that the image rendering solution provided in the related art easily causes image display to be out of sync, the first embodiment of the present application provides an image rendering method, such as Figure 1 This is a basic flow chart of the image rendering method provided in this embodiment. The image rendering method includes the following steps:

[0024] Step 101: Perform algorithmic reasoning on the original image data through the reasoning thread to obtain reasoning result data.

[0025] Specifically, in this embodiment, the inferenced object for algorithmic reasoning can be a face, human skeleton, or the like in the original image data. Accordingly, the inference result data includes at least one of the following: a face tracking frame or a human skeleton frame. In actual applications, depending on the application scenario, the inference result data can also include a vehicle tracking frame, an obstacle tracking frame, or the like, although this embodiment does not impose a sole limitation on this. In this embodiment, the inference thread is used to execute a face detection algorithm or a skeleton detection algorithm to infer the face frame or the human skeleton frame.

[0026] In some implementations of this embodiment, the step of performing algorithmic reasoning on the original image data through the inference thread includes: performing algorithmic reasoning on multiple objects to be inferred in the original image data through multiple parallel inference threads.

[0027] Specifically, in this embodiment, the original image data can be divided into different image regions, and then the different image regions can be assigned to different inference threads for algorithm reasoning. In actual applications, there may be multiple tracking targets in the image shooting scene, and thus there may be multiple objects to be inferred. If a single inference thread is used, executing global target reasoning will result in a long total time consumption, which in turn leads to a large delay in updating the top layer. Therefore, this embodiment can use multiple parallel inference threads to execute the inference algorithm in parallel, that is, the inference of multiple objects to be inferred can be completed within a unit time, effectively reducing the total time consumption of the inference algorithm and improving the update speed of the top layer. In addition, it should also be noted that in actual applications, there may also be a single tracking target but multiple types of objects to be inferred, such as the need to simultaneously infer the face tracking frame and the human skeleton frame of the same target. Similarly, this embodiment can use multiple inference threads to perform inference in parallel based on adaptability, thereby improving the update speed of the top layer.

[0028] In other implementations of this embodiment, the above-mentioned step of performing algorithmic reasoning on the original image data through the inference thread includes: obtaining the acquisition frame rate of the original image data of the bottom layer; selecting an inference thread corresponding to the acquisition frame rate from multiple available inference threads with different algorithmic complexities; and performing algorithmic reasoning on the original image data through the selected inference thread.

[0029] Specifically, in practical applications, the complexity of the inference algorithm is usually positively correlated with the accuracy of the inference result, and negatively correlated with the algorithm execution efficiency. In this embodiment, considering that the display asynchrony problem caused by the untimely update of the top layer is worse than the user experience with limited accuracy of the inference result, this embodiment can select an inference thread with corresponding algorithm complexity based on the adaptability to the acquisition frame rate of the underlying original image, thereby ensuring that the top layer is updated at the corresponding frame rate and ensuring the synchronization of the top layer and the bottom layer.

[0030] Step 102: Perform image synthesis on the original image data and the inference result data through a rendering thread to obtain synthesized image data.

[0031] Specifically, this embodiment separates image rendering from algorithmic reasoning to improve rendering efficiency. In this embodiment, while the reasoning result data is being fed into the rendering thread, the original image data is also fed into the rendering thread to combine the original image data and the algorithmic reasoning result into a single image.

[0032] In some implementations of this embodiment, before performing image synthesis on the raw image data and the inference result data via the rendering thread, the method further includes: storing the raw image data and the inference result data in a preset cache queue. Correspondingly, performing image synthesis on the raw image data and the inference result data via the rendering thread includes: continuously polling the cache queue via the rendering thread; and when a queue length parameter of the cache queue reaches a non-zero target value, obtaining the raw image data and the inference result data stored in the target queue unit for image synthesis.

[0033] Specifically, in actual applications, the data of the reasoning thread can be directly sent to the rendering thread, and in order to ensure the stability of data transmission, this embodiment can be provided with a specific cache queue, which is composed of multiple queue units. The output data of the reasoning thread is first cached in the cache queue, and when the rendering thread triggers the working state, the data is taken out from the cache queue and sent to the rendering thread. In actual applications, the rendering thread can continuously poll the data cache status of the cache queue in an infinite loop, wherein when the data cache status of the cache queue is empty, the queue length is zero, otherwise, the queue length is non-zero. This embodiment can trigger the data in the cache queue to be sent to the rendering thread when a specific cache behavior is completed in the cache queue. It should be noted that in actual applications, the original image data and the reasoning result data can be cached in the same queue unit at the same time, or can be cached in two adjacent queue units respectively. This embodiment does not make a unique limitation to this.

[0034] Furthermore, in some implementations of this embodiment, if the number of objects to be inferred in the original image data is multiple, the above-mentioned step of storing the original image data and the inference result data into a preset cache queue includes: sequentially storing the original image data and multiple inference result data corresponding to different objects to be inferred into different queue units of the preset cache queue; correspondingly, the above-mentioned step of obtaining the original image data and the inference result data stored in the target queue unit for image synthesis when the queue length parameter of the cache queue is a non-zero target value includes: when the value of the queue length parameter of the cache queue is greater than or equal to N, selecting N queue units starting from the head of the cache queue as target queue units; wherein N=M+1, M represents the number of objects to be inferred; obtaining the original image data and the inference result data stored in all selected target queue units for image synthesis.

[0035] Specifically, in this embodiment, if there are multiple objects to be inferred, there will be multiple inference result data. In this embodiment, different inference result data and original image data can be stored in different queue units of the cache queue, such as Figure 2 FIG. 1 is a schematic diagram of a structure of a cache queue provided by this embodiment. Figure 2In the example, A represents the original image data, and B1 to B4 represent multiple different inference result data. That is, in this embodiment, the original image data can be cached at the head of the queue, and different inference result data can be cached in sequence after the head of the queue. It should be understood that when the amount of data cached in the cache queue includes the amount of data required for this image rendering task, the original image data at the head of the queue and the inference result data corresponding to the M objects to be inferred are sent to the rendering process for image synthesis. In addition, it should be noted that Figure 2 This is only an example of a specific form of the cache queue in this embodiment. In actual applications, the cache queue may also be a ring cache queue, etc., and is not limited here.

[0036] Furthermore, in some implementations of this embodiment, the rendering thread includes multiple parallel first rendering threads and a single second rendering thread; correspondingly, the above-mentioned step of obtaining the original image data and inference result data stored in all selected target queue units for image synthesis includes: obtaining the original image data from the array unit arranged at the head of all target array units through multiple first rendering threads, and obtaining an equal amount of inference result data from the remaining target array units, and then performing image synthesis in parallel; sending the synthesized images of the multiple first rendering threads to the second rendering thread for image synthesis.

[0037] Specifically, in actual applications, it takes a certain amount of time for the rendering process to perform image synthesis. If the image synthesis takes too long, the update speed of the top layer will be slow, which will cause the top layer and the bottom layer to be out of sync. Based on this, when it is necessary to perform the synthesis of multiple inference result data and original image data in this embodiment, in the first stage, multiple first rendering threads respectively perform the synthesis of part of the inference result data and the original image data to obtain multiple intermediate synthetic images. When the amount of synthetic data is relatively large, by splitting the image synthesis task into multiple subtasks and executing them in parallel, higher synthesis efficiency can be achieved compared to serial execution. Furthermore, in the second stage, the multiple intermediate synthetic images are simply superimposed through the second rendering thread to obtain the final synthetic image.

[0038] Step 103: Perform image rendering based on the synthesized image data.

[0039] Specifically, this embodiment sends the synthesized image data to the top-level canvas for image rendering processing. It should be understood that the image rendering processing of this embodiment also adopts a dual-layer design. The difference is that the camera original image is superimposed on the inference result data to obtain the top-level synthesized data, and then this opaque synthesized image is superimposed with the bottom-level original image, thereby realizing a synchronous display based on asynchronous logic, and fundamentally solving the defect of display asynchrony in the existing technology.

[0040] Based on the technical solution of the above-mentioned embodiment of the present application, algorithmic reasoning is performed on the original image data through the inference thread; the original image data and the inference result data are synthesized by the rendering thread to obtain the synthesized image data; and image rendering processing is performed based on the synthesized image data. Through the implementation of the solution of the present application, the algorithmic reasoning and rendering are performed separately using asynchronous logic, which can effectively improve rendering efficiency. In addition, the top layer is synthesized by the original image and the algorithmic reasoning result, ensuring the synchronization of image display.

[0041] Figure 3 The method in is a refined image rendering method provided in the second embodiment of the present application, and the image rendering method includes:

[0042] Step 301: Determine multiple parallel reasoning threads according to the object types of multiple objects to be inferred.

[0043] Step 302: Perform algorithmic reasoning on multiple objects to be inferred in the original image data through multiple parallel reasoning threads.

[0044] Specifically, in this embodiment, the original image data can be divided into different image areas, and then the different image areas can be assigned to different inference threads for parallel inference. That is, the inference of multiple objects to be inferred can be completed in unit time, which effectively reduces the total time consumption of the inference algorithm and improves the update speed of the top layer.

[0045] Step 303: The original image data and a plurality of inference result data corresponding to different objects to be inferred are sequentially stored in different queue units of a preset cache queue.

[0046] Specifically, in this embodiment, if there are multiple objects to be inferred, there will be corresponding multiple inference result data. This embodiment can store different inference result data and original image data in different queue units of the cache queue respectively, that is, cache the original image data to the head of the queue, and cache different inference result data in sequence after the head of the queue.

[0047] Step 304: When the value of the queue length parameter of the cache queue is greater than or equal to N, select N queue units starting from the head of the cache queue as target queue units.

[0048] Wherein, N=M+1, M represents the number of objects to be inferred.

[0049] Step 305 : Multiple first rendering threads obtain original image data from the array unit at the head of all target array units, and obtain equal amounts of inference result data from the remaining target array units, and then perform image synthesis in parallel.

[0050] Specifically, in this embodiment, when it is necessary to perform the synthesis of multiple inference result data and original image data, in the first stage, multiple first rendering threads respectively perform the synthesis of part of the inference result data and the original image data to obtain multiple intermediate synthesized images. When the amount of synthesized data is relatively large, by splitting the image synthesis task into multiple subtasks and executing them in parallel, higher synthesis efficiency can be achieved compared to serial execution.

[0051] Step 306: Send the composite images of the multiple first rendering threads to the second rendering thread for image synthesis to obtain composite image data.

[0052] Furthermore, in the second stage, this embodiment simply superimposes the multiple intermediate composite images through the second rendering thread to obtain the final composite image.

[0053] Step 307: Send the synthesized image data to the top layer for image rendering processing.

[0054] Specifically, this embodiment adopts an image rendering and display mechanism with a dual-layer design, uses the camera original image to superimpose the inference result data to obtain the top-level synthetic data, and then superimposes this opaque synthetic image on the bottom-level original image, thereby realizing a synchronous display based on asynchronous logic.

[0055] It should be understood that the size of the serial numbers of the steps in this embodiment does not mean the order in which the steps are executed. The order in which the steps are executed should be determined by their functions and internal logic, and should not constitute a sole limitation on the implementation process of the embodiments of this application.

[0056] Based on the technical solution of the above-mentioned embodiment of the present application, algorithmic reasoning is performed on the original image data through the inference thread; image synthesis is performed on the original image data and the inference result data through the rendering thread to obtain synthetic image data; and image rendering processing is performed based on the synthetic image data. Through the implementation of the solution of the present application, asynchronous logic is used to perform algorithmic reasoning and rendering respectively, which can effectively improve rendering efficiency. In addition, the top layer is synthesized by the original image and the algorithmic reasoning result, ensuring the synchronization of image display. In addition, the use of parallel inference threads for multi-threaded synchronous reasoning and parallel rendering threads for multi-threaded synchronous synthesis can further improve the update speed of the top layer and ensure display synchronization.

[0057] Figure 4 The third embodiment of the present application provides an image rendering device. The image rendering device can be used to implement the image rendering method in the aforementioned embodiment, and the image rendering device mainly includes:

[0058] The inference module 401 performs algorithmic inference on the original image data through the inference thread to obtain inference result data;

[0059] A synthesis module 402 is configured to perform image synthesis on the original image data and the inference result data through a rendering thread to obtain synthesized image data;

[0060] The rendering module 403 is configured to perform image rendering based on the synthesized image data.

[0061] In some implementations of this embodiment, the inference result data includes at least one of the following: a face tracking frame, a human skeleton frame.

[0062] In some implementations of this embodiment, the reasoning module is specifically configured to perform algorithmic reasoning on multiple objects to be inferred in the original image data through multiple parallel reasoning threads.

[0063] In some other implementations of this embodiment, the inference module is specifically used to: obtain the acquisition frame rate of the original image data of the bottom layer; select an inference thread corresponding to the acquisition frame rate from multiple available inference threads with different algorithmic complexities; and perform algorithmic inference on the original image data through the selected inference thread.

[0064] In some implementations of this embodiment, the image rendering apparatus further includes a cache module configured to store raw image data and inference result data in a preset cache queue. Accordingly, the synthesis module is specifically configured to continuously poll the cache queue via a rendering thread; when a queue length parameter of the cache queue reaches a non-zero target value, obtain the raw image data and inference result data stored in the target queue unit for image synthesis.

[0065] Furthermore, in some implementations of this embodiment, there are multiple objects to be inferred; the cache module is specifically configured to sequentially store the original image data and multiple inference result data corresponding to different objects to be inferred into different queue units of a preset cache queue. Accordingly, when the synthesis module performs the above-mentioned function of obtaining the original image data and inference result data stored in the target queue unit for image synthesis when the queue length parameter of the cache queue is a non-zero target value, it is specifically configured to: when the queue length parameter of the cache queue is greater than or equal to N, select N queue units starting from the head of the cache queue as target queue units; where N = M + 1, and M represents the number of objects to be inferred; and obtain the original image data and inference result data stored in all selected target queue units for image synthesis.

[0066] Furthermore, in some implementations of this embodiment, the rendering thread includes multiple parallel first rendering threads and a single second rendering thread. Accordingly, when the synthesis module performs the above-mentioned function of obtaining the original image data and inference result data stored in all selected target queue units for image synthesis, it is specifically configured to: obtain the original image data from the array unit arranged at the head of all target array units through the multiple first rendering threads, and obtain equal amounts of inference result data from the remaining target array units, and then perform image synthesis in parallel; and send the synthesized images of the multiple first rendering threads to the second rendering thread for image synthesis.

[0067] It should be noted that the image rendering methods in the first and second embodiments can be implemented based on the image rendering device provided in this embodiment. Ordinary technicians in the relevant field can clearly understand that for the convenience and conciseness of description, the specific working process of the image rendering device described in this embodiment can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0068] According to the image rendering device provided by this embodiment, an inference thread performs algorithmic inference on the original image data to obtain inference result data; a rendering thread performs image synthesis on the original image data and the inference result data to obtain synthesized image data; and image rendering processing is performed based on the synthesized image data. Through the implementation of the solution of this application, the use of asynchronous logic to perform algorithmic inference and rendering separately can effectively improve rendering efficiency. In addition, the top layer is synthesized by the original image and the algorithmic inference result, ensuring the synchronization of image display.

[0069] Figure 5 The fourth embodiment of the present application provides an electronic device. This electronic device can be used to implement the image rendering method in the aforementioned embodiment, mainly comprising:

[0070] Memory 501, processor 502, and computer program 503 stored on memory 501 and executable on processor 502. Memory 501 and processor 502 are connected via communication. When processor 502 executes computer program 503, the image rendering method described in the aforementioned embodiment is implemented. The number of processors may be one or more.

[0071] The memory 501 can be a high-speed random access memory (RAM) memory or a non-volatile memory such as a disk memory. The memory 501 is used to store executable program codes. The processor 502 is coupled to the memory 501 .

[0072] Furthermore, the embodiment of the present application also provides a computer-readable storage medium, which can be provided in the electronic device in the above embodiments. The computer-readable storage medium can be the above Figure 5 Memory in the illustrated embodiment.

[0073] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the image rendering method of the aforementioned embodiment. Furthermore, the computer-readable storage medium may be a USB flash drive, a mobile hard drive, a read-only memory (ROM), RAM, a magnetic disk, or an optical disk, among other media capable of storing program code.

[0074] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0075] Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of these modules may be selected to achieve the purpose of this embodiment based on actual needs.

[0076] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.

[0077] If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a readable storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned readable storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

[0078] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0079] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0080] The above is a description of the image rendering method, apparatus, device, and computer-readable storage medium provided in this application. For those skilled in the art, based on the concepts of the embodiments of this application, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting this application.

Claims

1. An image rendering method, characterized in that: include: Perform algorithmic reasoning on the original image data through the inference thread to obtain the inference result data; Performing image synthesis on the original image data and the inference result data through a rendering thread to obtain synthesized image data; Image rendering is performed based on the composite image data; wherein the image rendering includes using the composite image data as a top canvas to overlay the original image data on the bottom canvas.

2. The image rendering method according to claim 1, wherein: The inference result data includes at least one of the following: a face tracking frame and a human skeleton frame.

3. The image rendering method according to claim 1, wherein: The step of performing algorithmic reasoning on the original image data through the reasoning thread includes: Algorithmic reasoning is performed on multiple objects to be inferred in the original image data through multiple parallel reasoning threads.

4. The image rendering method according to claim 1, wherein: The step of performing algorithmic reasoning on the original image data through the reasoning thread includes: Get the acquisition frame rate of the original image data; Selecting an inference thread corresponding to the acquisition frame rate from a plurality of available inference threads with different algorithmic complexities; Algorithmic reasoning is performed on the original image data through the selected reasoning thread.

5. The image rendering method according to any one of claims 1 to 4, characterized in that: Before the step of performing image synthesis on the original image data and the inference result data through the rendering thread, the method further includes: Storing the original image data and the inference result data in a preset cache queue; The step of performing image synthesis on the original image data and the inference result data through a rendering thread includes: Continuously polling the cache queue by the rendering thread; When the queue length parameter of the cache queue is a non-zero target value, the original image data and the inference result data stored in the target queue unit are obtained for image synthesis.

6. The image rendering method according to claim 5, characterized in that: There are multiple objects to be inferred in the original image data; The step of storing the original image data and the inference result data into a preset cache queue includes: Sequentially storing the original image data and a plurality of the inference result data corresponding to different objects to be inferred into different queue units of a preset cache queue; The step of obtaining the original image data and the inference result data stored in the target queue unit for image synthesis when the queue length parameter of the cache queue is a non-zero target value includes: When the value of the queue length parameter of the cache queue is greater than or equal to N, N queue units are selected from the head of the cache queue as target queue units; wherein N=M+1, M represents the number of objects to be inferred; The original image data and the inference result data stored in all the selected target queue units are obtained for image synthesis.

7. The image rendering method according to claim 6, characterized in that: The rendering threads include a plurality of parallel first rendering threads and a single second rendering thread; The step of obtaining the original image data and the inference result data stored in all the selected target queue units for image synthesis includes: Obtaining the original image data from the queue unit arranged at the head of all the target queue units by a plurality of first rendering threads, and obtaining an equal amount of the inference result data from the remaining target queue units, and then performing image synthesis in parallel; The composite images of the plurality of first rendering threads are sent to the second rendering thread for image synthesis.

8. An image rendering device, characterized in that: include: The inference module performs algorithmic inference on the original image data through the inference thread to obtain the inference result data; A synthesis module, configured to perform image synthesis on the original image data and the inference result data through a rendering thread to obtain synthesized image data; A rendering module is used to perform image rendering based on the composite image data; wherein the image rendering includes using the composite image data as a top canvas to overlay the original image data on the bottom layer.

9. An electronic device, characterized in that: Comprising a memory and a processor, wherein: The processor is configured to execute a computer program stored in the memory; When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Multi-thread parallel computing traffic video target detection method and device

    CN110188607A

  • Video playing method and system based on video detection

    CN112887510A