Reversing image display method, device and equipment based on three caches and storage medium

By using the three cache method in the reverse image display, dynamically specifying the cache address of the collected and displayed data, the screen tear and lag caused by double cache is solved, and the smoothness of acquisition and display and the consistency of video are achieved.

CN118953230APending Publication Date: 2024-11-15XCMG HANYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411036996.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing double-cache reversing image display method may cause screen tear or screen loss at high refresh rate, while the low refresh rate will cause lag and hysteresis, which cannot ensure smooth and smooth collection and display.

Method used

Adopt the three cache method, specifying one cache for collection, one cache for display, and the other cache as a relay, dynamically specifying the cache address for collecting and displaying data, and the three caches are used in a loop to ensure that the collection and display are completely isolated and avoiding Incomplete display caused by out-of-sync.

Benefits of technology

Through the three cache method, the acquisition rate and display are ensured smoothly and smoothly, providing sufficient redundant space, ensuring the consistency and smoothness of the video, and reducing the occurrence of tearing and lags.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118953230A_ABST
    Figure CN118953230A_ABST
Patent Text Reader

Abstract

The invention discloses a three-cache-based reversing image display method, device and equipment and a storage medium. The display method comprises the following steps: acquiring image data to be cached to a memory; when an acquisition interrupt signal is generated, determining a current cache for acquiring an image, judging whether image data of a next cache of the current cache is displayed or not, and if so, setting the current cache to be used for displaying the image data and the next cache of the current cache to be used for receiving the image data acquired next time; when a display refresh interrupt signal is generated, judging whether the current cache can be used for displaying, and if so, setting the current cache to be used for displaying image data; and the last cache is set to be used for receiving newly acquired image data. And the acquisition cache and the display cache do not interfere with each other, so that the coherence and fluency of image data are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image display, and in particular, relates to a method, device, equipment and storage medium for reversing image display based on three buffers. Background Art

[0002] With the popularization of reversing image technology, various vehicles are equipped with reversing cameras and other sensor devices, using embedded systems to collect and display image data. The existing reversing image display method mainly adopts a double buffer mechanism, one buffer is used for collecting data, and the other buffer is used for displaying data, which are used alternately. However, with the double buffer mechanism, since the acquisition thread and the display refresh thread may not be synchronized, if the refresh rate is high, the display cache data may not be fully displayed before it is used as a new acquisition cache to collect new data, resulting in incomplete current display data, causing tearing or screen distortion on the screen; if the refresh rate is low, although the tearing phenomenon can be reduced, the screen will be stuck and lagging. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method, device, equipment and storage medium for reversing image display based on three buffers, which adopts a three-buffer method, where one buffer is designated for acquisition, one buffer is designated for display, and the other buffer is used for relay. By dynamically specifying the buffer addresses of the acquired image data and the displayed image data, the three buffers are used cyclically, so that the acquired and displayed data are completely isolated, ensuring the acquisition rate and the smooth display.

[0004] In order to solve the above technical problems, the present invention is implemented by adopting the following technical solutions:

[0005] In a first aspect, the present invention provides a method for displaying a reversing image based on three buffers, comprising:

[0006] Acquire image data to be cached in a memory, wherein the memory acquires and displays the image data according to an acquisition interrupt signal and a display refresh interrupt signal, and the memory includes a first cache layer, a second cache, and a third cache;

[0007] When the capture interrupt signal is generated, the current buffer used for capturing images is confirmed, and it is determined whether the image data of the next buffer of the current buffer has been displayed. If so, the current buffer is set to display the image data, and the next buffer of the current buffer is used to receive the next captured image data;

[0008] When a display refresh interrupt signal is generated, it is determined whether the current buffer can be used for display. If so, the current buffer is set to display image data; and the previous buffer is set to receive newly acquired image data.

[0009] Furthermore, the method for determining whether the image data of the next buffer of the current buffer has been displayed completely includes: when the display refresh interrupt signal is generated, it indicates that the image data of the next buffer of the current buffer has been displayed completely.

[0010] Furthermore, the method for determining whether the current cache can be used for display includes: when an acquisition interrupt signal is generated, it indicates that the newly acquired data has been put into the current cache and can be used for display.

[0011] Furthermore, the image data is acquired through a camera sensor.

[0012] Furthermore, when the capture interrupt signal is generated, the current cache used for capturing images is confirmed, and it is determined whether the image data of the next cache of the current cache has been displayed. If so, the current cache is set to display the image data, and the next cache of the current cache is set to receive the next captured image data, including:

[0013] When the capture interrupt signal is generated, if the buffer currently used for capturing images is the first buffer, it means that the first buffer has stored image data and can be used for display; then it is determined whether the image data of the second buffer has been displayed, and if so, the second buffer is set to receive the next capture data;

[0014] If the buffer currently used for collecting images is the second buffer, it means that the second buffer has stored image data and can be used for display; then determine whether the image data of the third buffer has been displayed, if so, set the third buffer to receive the next collection data;

[0015] If the cache currently used to collect images is the third cache, it means that the third cache has stored image data and can be used for display; then determine whether the image data in the first cache has been displayed. If so, set the first cache to receive the next collection data.

[0016] Furthermore, when the display refresh interrupt signal is generated, it is determined whether the current buffer can be used for display, and if so, the current buffer is set to be used for displaying image data; and the previous buffer is set to be used for receiving newly acquired image data, including:

[0017] When the display refresh interrupt signal is generated, if the first buffer can be used for display, the first buffer is set for display; because the three buffers are used cyclically, this also means that the third buffer has been displayed and can be used to receive new collected data.

[0018] If the second buffer can be used for display, the second buffer is set for display; because the three buffers are used cyclically, this also means that the first buffer has been displayed and can be used to receive new collected data.

[0019] If the third buffer can be used for display, the third buffer is set for display; because the three buffers are used cyclically, this also means that the second buffer has been displayed and can be used to receive new collected data.

[0020] In a second aspect, the present invention provides a three-buffer based reversing image display device, comprising:

[0021] An acquisition module, used for acquiring image data to be cached in a memory, wherein the memory acquires and displays the image data according to an acquisition interrupt signal and a display refresh interrupt signal, and the memory includes a first cache layer, a second cache layer, and a third cache layer;

[0022] The acquisition interrupt signal processing module is used to confirm the current buffer used for acquiring images when the acquisition interrupt signal is generated, and determine whether the image data of the next buffer of the current buffer has been displayed. If so, the current buffer is set to display the image data, and the next buffer of the current buffer is used to receive the next acquisition image data;

[0023] The display refresh interrupt signal processing module is used to determine whether the current buffer can be used for display when the display refresh interrupt signal is generated. If yes, the current buffer is set to display image data; and the previous buffer is set to receive newly collected image data.

[0024] In a third aspect, the present invention provides a computer device, including a processor and a storage medium;

[0025] The storage medium is used to store instructions;

[0026] The processor is used to operate according to the instruction to implement the steps of the reversing image display method based on three buffers as described in the first aspect.

[0027] In a fourth aspect, the present invention provides 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 three-buffer based reversing image display method as described in the first aspect.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] The present invention adopts a three-buffer mode, where one buffer is designated for acquisition, one buffer is designated for display, and the other buffer is used for relaying. The acquisition buffer and the display buffer do not interfere with each other, thereby ensuring data reliability. By dynamically specifying the buffer addresses of the acquisition image data and the display image data, the three buffers are used cyclically, so that the acquisition and display data are completely isolated, ensuring the acquisition rate and the smoothness of the display. The three buffers are used to ensure that when the acquisition and display are not synchronized, there is enough redundant space to ensure the continuity and fluency of the video. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 FIG. 1 is a flow chart of a method for displaying a reversing image based on three buffers provided in an embodiment of the present invention;

[0031] Figure 2 FIG. 1 is a schematic diagram of a system framework of a three-buffer based reversing image display method provided by an embodiment of the present invention;

[0032] Figure 3 The figure is an original schematic diagram of a verification example provided by an embodiment of the present invention;

[0033] Figure 4 FIG. 1 is a display schematic diagram of a reversing image display method based on three buffers provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The technical concept of the present invention is: adopting a three-buffer mode, specifying one buffer for acquisition, specifying one buffer for display, and another buffer for relaying, the acquisition buffer and the display buffer do not interfere with each other, and the reliability of data is guaranteed. By dynamically specifying the buffer addresses of the acquisition image data and the display image data, the three buffers are used cyclically, so that the acquisition and display data are completely isolated, and the acquisition rate and the display are smooth. The three buffers are used to ensure that when the acquisition and display are not synchronized, there is enough redundant space to ensure the continuity and fluency of the video.

[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present application and its application or use.

[0036] Example 1

[0037] This embodiment provides a method for displaying a reversing image based on three buffers, including:

[0038] Acquire image data to be cached in a memory, wherein the memory acquires and displays the image data according to an acquisition interrupt signal and a display refresh interrupt signal, and the memory includes a first cache layer, a second cache, and a third cache;

[0039] When the capture interrupt signal is generated, the current buffer used for capturing images is confirmed, and it is determined whether the image data of the next buffer of the current buffer has been displayed. If so, the current buffer is set to display the image data, and the next buffer of the current buffer is used to receive the next captured image data;

[0040] When a display refresh interrupt signal is generated, it is determined whether the current buffer can be used for display. If so, the current buffer is set to display image data; and the previous buffer is set to receive newly acquired image data.

[0041] The method for determining whether the image data of the next buffer of the current buffer has been displayed completely comprises: when a display refresh interrupt signal is generated, it indicates that the image data of the next buffer of the current buffer has been displayed completely.

[0042] The method for determining whether the current buffer can be used for display includes: when an acquisition interrupt signal is generated, it indicates that the newly acquired data has been put into the current buffer and can be used for display.

[0043] The image data is acquired through a camera sensor.

[0044] The system framework of this embodiment is as follows Figure 2 The system comprises: a camera sensor, a collection module and a display module.

[0045] The system collects image data from the reversing camera and displays it through the Image control of the LVGL graphics library.

[0046] After the reversing image system is started, three blocks of memory are dynamically applied from the heap area as cache for data collection and display refresh data, and two threads are created for data collection and display processing respectively.

[0047] Among them, the interrupt is automatically generated by the hardware. When the module parameters are configured during system initialization, the underlying driver will automatically generate an interrupt signal after completing the corresponding function.

[0048] Processing is done in the interrupt entry (i.e. the receiving module), which can be understood as the acquisition and display refresh are performed periodically and automatically.

[0049] After a frame of image data is collected, the bottom layer sends out an acquisition interrupt signal, which is then processed by the "acquisition interrupt thread" module.

[0050] After displaying a frame of image data, the bottom layer sends a display interrupt signal, which is then processed by the "display refresh interrupt thread" module.

[0051] The application of this embodiment is, for example, Figure 1 As shown, the following steps are included:

[0052] When the acquisition interrupt signal is generated, it means that the sensor data has been put into the specified acquisition buffer; when the display refresh interrupt signal is generated, it means that the data in the display buffer has been completely refreshed to the interface. The acquisition buffer and display buffer are used cyclically and isolated from each other.

[0053] When the collection thread is interrupted, the following steps are performed:

[0054] If the cache currently used to collect images is the first cache, it means that the first cache has stored image data and can be used for display; then determine whether the image data of the second cache has been displayed (a flag will be given when the display thread is interrupted, indicating that it has been displayed). If so, set the second cache to receive the next collection data;

[0055] If the cache currently used to collect images is the second cache, it means that the second cache has stored image data and can be used for display; then determine whether the image data in the third cache has been displayed (a flag will be given when the display thread is interrupted, indicating that it has been displayed). If so, set the third cache to receive the next collection data;

[0056] If the cache currently used to collect images is the third cache, it means that the third cache has stored image data and can be used for display; then determine whether the image data of the first cache has been displayed (a flag will be given when the display thread is interrupted, indicating that it has been displayed). If so, set the first cache to receive the next collection data;

[0057] And so on, three cache cycles store the collected data.

[0058] When the display thread is interrupted, it means that the previous cache data has been refreshed. Next, set the next cache for display and perform the following steps:

[0059] If the first cache can be used for display (a flag will be given when the acquisition thread is interrupted, indicating that the newly acquired data has been put into the cache and can be used for display), then the first cache is set for display; because the three caches are used in a cycle, this also means that the third cache has been displayed and can be used to receive new acquired data.

[0060] If the second cache can be used for display (a flag will be given when the acquisition thread is interrupted, indicating that the newly acquired data has been put into the cache and can be used for display), then the second cache is set for display; because the three caches are used in a cycle, this also means that the first cache has been displayed and can be used to receive new acquired data.

[0061] If the third cache can be used for display (a flag will be given when the acquisition thread is interrupted, indicating that the newly acquired data has been put into the cache and can be used for display), then the third cache is set for display; because the three caches are used in a cycle, this also means that the second cache has been displayed and can be used to receive new acquired data.

[0062] And so on, three cache cycles are used for display.

[0063] During the test, take a pen and shake it in front of the camera sensor. Using the normal display method, sometimes tearing occurs and the residual image is quite serious, such as Figure 3The three-buffered reversing image display method of this embodiment can solve this problem, such as Figure 4 shown.

[0064] Example 2

[0065] This embodiment provides a three-buffer based reversing image display device, comprising:

[0066] An acquisition module, used for acquiring image data to be cached in a memory, wherein the memory acquires and displays the image data according to an acquisition interrupt signal and a display refresh interrupt signal, and the memory includes a first cache layer, a second cache layer, and a third cache layer;

[0067] The acquisition interrupt signal processing module is used to confirm the current buffer used for acquiring images when the acquisition interrupt signal is generated, and determine whether the image data of the next buffer of the current buffer has been displayed. If so, the current buffer is set to display the image data, and the next buffer of the current buffer is used to receive the next acquisition image data;

[0068] The display refresh interrupt signal processing module is used to determine whether the current buffer can be used for display when the display refresh interrupt signal is generated. If yes, the current buffer is set to display image data; and the previous buffer is set to receive newly collected image data.

[0069] Example 3

[0070] This embodiment provides a computer device, including a processor and a storage medium;

[0071] The storage medium is used to store instructions;

[0072] The processor is used to operate according to the instruction to implement the steps of the reversing image display method based on three buffers as described in Example 1.

[0073] Example 4

[0074] This embodiment 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 reversing image display method based on three buffers as described in Embodiment 1 are implemented.

[0075] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0076] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0077] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0078] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0079] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for displaying a reversing image based on three buffers, characterized in that: include: Acquire image data to be cached in a memory, the memory acquires and displays the image data according to an acquisition interrupt signal and a display refresh interrupt signal, the memory comprising a first cache, a second cache and a third cache; When the capture interrupt signal is generated, the current buffer used for capturing images is confirmed, and it is determined whether the image data of the next buffer of the current buffer has been displayed. If so, the current buffer is set to display the image data, and the next buffer of the current buffer is used to receive the next captured image data; When a display refresh interrupt signal is generated, it is determined whether the current buffer can be used for display. If so, the current buffer is set to display image data; and the previous buffer is set to receive newly acquired image data.

2. The method for displaying a reversing image based on three buffers according to claim 1, characterized in that: The method for determining whether the image data of the next buffer of the current buffer has been displayed completely comprises: when a display refresh interrupt signal is generated, it indicates that the image data of the next buffer of the current buffer has been displayed completely.

3. The method for displaying a reversing image based on three buffers according to claim 1, characterized in that: The method for determining whether the current buffer can be used for display includes: when an acquisition interrupt signal is generated, it indicates that the newly acquired data has been put into the current buffer and can be used for display.

4. The method for displaying a reverse image based on three buffers according to claim 1, characterized in that: The image data is acquired through a camera sensor.

5. The method for displaying a reverse image based on three buffers according to claim 1, characterized in that: When the capture interrupt signal is generated, the current cache used for capturing images is confirmed, and it is determined whether the image data of the next cache of the current cache has been displayed. If so, the current cache is set to display the image data, and the next cache of the current cache is set to receive the next captured image data, including: When the capture interrupt signal is generated, if the buffer currently used for capturing images is the first buffer, it means that the first buffer has stored image data and can be used for display; then it is determined whether the image data of the second buffer has been displayed, and if so, the second buffer is set to receive the next capture data; If the buffer currently used for collecting images is the second buffer, it means that the second buffer has stored image data and can be used for display; then determine whether the image data in the third buffer has been displayed, if so, set the third buffer to receive the next collection data; If the cache currently used to collect images is the third cache, it means that the third cache has stored image data and can be used for display; then determine whether the image data in the first cache has been displayed. If so, set the first cache to receive the next collection data.

6. The method for displaying a reverse image based on three buffers according to claim 1, characterized in that: When the display refresh interrupt signal is generated, determining whether the current buffer can be used for display, and if so, setting the current buffer to display image data; Set the previous buffer to receive the newly acquired image data, including: When a display refresh interrupt signal is generated, if the first buffer can be used for display, the first buffer is set for display; Because the three buffers are used cyclically, this also indicates that the third buffer has been fully displayed and can be used to receive new collected data. If the second buffer can be used for display, the second buffer is set for display; because the three buffers are used cyclically, this also means that the first buffer has been displayed and can be used to receive new collected data. If the third buffer can be used for display, the third buffer is set for display; because the three buffers are used cyclically, this also means that the second buffer has been displayed and can be used to receive new collected data.

7. A three-buffer based reversing image display device, characterized in that: include: An acquisition module, used for acquiring image data to be cached in a memory, wherein the memory acquires and displays the image data according to an acquisition interrupt signal and a display refresh interrupt signal, and the memory includes a first cache layer, a second cache layer, and a third cache layer; The acquisition interrupt signal processing module is used to confirm the current buffer used for acquiring images when the acquisition interrupt signal is generated, and determine whether the image data of the next buffer of the current buffer has been displayed. If so, the current buffer is set to display the image data, and the next buffer of the current buffer is used to receive the next acquisition image data; The display refresh interrupt signal processing module is used to determine whether the current buffer can be used for display when the display refresh interrupt signal is generated. If so, the current buffer is set to display image data; and the previous buffer is set to receive newly collected image data.

8. A computer device, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is used to operate according to the instruction to implement the steps of the three-buffer based reversing image display method as described in any one of claims 1 to 6.

9. 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 three-buffer based reversing image display method as described in any one of claims 1 to 6 are implemented.