A parallax stereoscopic imaging method and device
By splitting and identifying 3D film and television images and refreshing with vertical synchronization signals, the problem that ordinary display devices cannot achieve 3D stereoscopic imaging is solved, and the 3D stereoscopic imaging effect on ordinary display devices is achieved.
Patent Information
- Application Number
- CN202411159349.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2044-08-22
AI Technical Summary
The prior art is difficult to realize 3D stereoscopic imaging on ordinary display devices, and special 3D display functions are required.
By obtaining the target 3D film and television image set, split it into two film and television images in the left and right format or upper and lower formats, and adding different identifiers, these identification image groups are refreshed using vertical synchronization signals to form a parallax effect to achieve 3D stereo imaging.
It realizes displaying 3D stereoscopic imaging on display devices without 3D display function, which improves the possibility of ordinary families experiencing 3D videos.
Smart Images

Figure CN119094718B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D stereoscopic imaging, and particularly to a parallax stereoscopic imaging method and device. Background Art
[0002] Currently, the playback principle of 3D stereoscopic movies in cinemas is as follows: during playback, two images are overlapped on the screen by using the vibration direction of light for projection. Through a special polarized 3D glasses, the left and right eyes of a person receive different images, forming a parallax effect, and thus achieving the 3D effect. However, the above-mentioned polarized 3D cannot be realized on ordinary computers or televisions. For ordinary families to experience the rich feelings brought by 3D videos, they must pay more costs to purchase devices such as televisions, projectors, or VR glasses with their own 3D display functions. Due to cost and other reasons, products in the field of stereoscopic videos for families and individuals have not been vigorously developed. In other words, there is currently no 3D stereoscopic imaging technology applied to ordinary display devices (display devices without 3D functions). Summary of the Invention
[0003] The purpose of this application is to provide a parallax stereoscopic imaging method and device that can achieve parallax stereoscopic imaging and can be applied to display devices without 3D functions.
[0004] To achieve the above purpose, this application provides the following solutions:
[0005] In the first aspect, this application provides a parallax stereoscopic imaging method, including:
[0006] Obtain a target 3D video image set;
[0007] For any 3D video image in the target 3D video image set, split the 3D video image into two video images in a left-right format or an up-down format;
[0008] Add different identifiers to the two video images to obtain an identifier image group;
[0009] Obtain the vertical synchronization signal of the screen of the display device;
[0010] Based on the vertical synchronization signal, refresh the identifier image groups corresponding to each 3D video image in the target 3D video image set at a preset frequency and display them on the screen of the display device at the same time; the two identifier-added video images in the same identifier image group form a parallax effect on the screen of the display device, achieving 3D stereoscopic imaging.
[0011] In a second aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the parallax stereoscopic imaging method described above.
[0012] According to the specific embodiments provided by the present application, the following technical effects are disclosed in the present application:
[0013] The present application provides a parallax stereoscopic imaging method and device. The 3D video images in the target 3D video image set are split into two video images in a left - right format or an up - down format, and then different identifiers are added to obtain an identifier image group. Thus, the video images that originally required 3D display function support for display are split, so that even a display device without 3D display function can display them, and the two split images are distinguished by adding identifiers, which is convenient for subsequent calling during display. When the display device displays, according to the vertical synchronization signal of the screen of the display device, the identifier image groups corresponding to each 3D video image in the target 3D video image set are refreshed at a preset frequency and simultaneously displayed on the screen. Since the two identifier - added video images in the same identifier image group form a parallax effect on the screen, 3D stereoscopic imaging is achieved. In short, the method of the present application splits and processes each frame of video (left - right format or up - down format) into two frames of images with identifiers, and displays them on a common display screen at a fixed frequency in a certain order to achieve the effect of parallax stereoscopic imaging. Description of the Drawings
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required to be used in the embodiments. Obviously, the following - described drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0015] Figure 1 It is an application environment diagram of a parallax stereoscopic imaging method in an embodiment of the present application;
[0016] Figure 2 It is a flowchart of a parallax stereoscopic imaging method provided by an embodiment of the present application;
[0017] FIG. 3 is a flowchart of a multi - thread parallax stereoscopic imaging method provided by an embodiment of the present application; among them, FIG. 3(a) is a flowchart of an image decoding thread, FIG. 3(b) is a flowchart of an image processing thread, and FIG. 3(c) is a flowchart of an image display thread;
[0018] Figure 4Schematic diagram of the structure of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0019] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0020] There are two storage methods for the video images used in 3D stereoscopic movies: the side-by-side format and the top-bottom format. In the side-by-side format, when played on a playback device without 3D stereoscopic function, a single image is played, which is vertically divided into two halves in the middle. It appears to be composed of two almost identical side-by-side images on the left and right. In the top-bottom format, when played on a playback device without 3D stereoscopic function, a single image is played, which is horizontally divided into two halves in the middle. It appears to be composed of two almost identical side-by-side images on the top and bottom. People can achieve the effect of 3D movies by wearing a device that can recognize left and right images or top and bottom images and using the parallax principle.
[0021] Based on this principle, the present application provides a parallax stereoscopic imaging method and device, which can achieve the same stereoscopic effect as a 3D-enabled TV, projector, or VR glasses on a common screen with a screen refresh rate of 120 Hz or higher, allowing more people to experience the richness brought by 3D videos.
[0022] To make the above objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below with reference to the accompanying drawings and specific implementation manners.
[0023] The parallax stereoscopic imaging method provided by the embodiments of the present application can be applied, for example, to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, integrated on the server 104, placed on the cloud or other servers. The terminal 102 can send the target 3D video image set to the server 104. The server 104 splits the 3D video images in the target 3D video image set into two video images in the left-right format or the up-down format, and then adds different identifiers; the server 104 obtains the vertical synchronization signal of the screen of the display device in real time, and refreshes the identifier image group corresponding to each 3D video image at a preset frequency based on the monitored signal, and at the same time displays a parallax effect on the screen to achieve 3D stereoscopic imaging. In addition, in some embodiments, the parallax stereoscopic imaging method can be implemented separately by the server 104 or the terminal 102, or the server 104 can obtain the target 3D video image set from the data storage system and perform corresponding processing.
[0024] Among them, the terminal 102 can be, but is not limited to, various ordinary display devices without 3D functions such as desktop computers, laptop computers, tablet computers, and televisions. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers, and can also be a cloud server.
[0025] In an exemplary embodiment, as Figure 2 shown, a parallax stereoscopic imaging method is provided. This method is executed by a computer device, and can be specifically executed alone by a computer device such as a terminal or a server, or jointly executed by a terminal and a server. In the embodiments of the present application, taking this method applied to Figure 1 the server 104 in as an example for illustration, it includes the following steps 201 to step 205.
[0026] Step 201, obtain a target 3D video image set.
[0027] In a practical application, step 201 includes: 1) obtaining a target video; 2) unpacking the target video using a decoder to obtain a target encoded video; 3) decompressing the target encoded video to obtain a target 3D video image set.
[0028] Among them, a decoder is a program or device that can compress or decompress digital video. Video file formats include, but are not limited to, MP4 (MPEG-4 Part 14), MKV (the file extension of MKV is Matroska), FLV (FLV is short for FLASH VIDEO), AVI (Audio Video Interleave), etc. These are all containers for storing encoded data. The de-encapsulation method used is to extract the compressed data from these containers. To reduce the capacity of the video file, it is necessary to encode the original data (RGB data, PCM data, etc.) through encoding technologies such as H264 and AAC and then put the audio and image data into a storage container (such as MP4, AVI, etc.). Therefore, decompression, also called decoding, is required. The main operation is to decode the encoded data into the original data RGB, PCM, etc.
[0029] The 3D movie images in the target 3D movie image set obtained after decompression can be image data in ARGB_8888 format, ARGB_4444 format or RGB_565 format. In the specific application of this application, in order to be more widely applicable to ordinary display devices such as televisions in existing families, so that the final presented image has a larger amount of information and a better image effect, image data in ARGB_8888 format is adopted. That is, the image data forms image data in ARGB_8888 format after decoding.
[0030] The image data in ARGB_8888 format is provided for program calls in the form of a byte array in memory. It should be noted that image data is formed by pixel points, and each pixel point is composed of four channel values of ARGB. That is to say, for image data in ARGB_8888 format, each pixel point is composed of 4 bytes for a total of 32 bits. Among them, 8 bits are used to represent the Alpha channel (transparency), 8 bits are used to represent the red channel, 8 bits are used to represent the green channel, and 8 bits are used to represent the blue channel. In memory, the pixel storage order of the ARGB_8888 bitmap is Alpha, red, green, blue from high to low, that is, ARGB_8888. Each of the A, R, G, and B channels occupies one byte in memory. Then the number of bytes occupied by each row of pixels is equal to the width of the image multiplied by 4, and the number of bytes occupied by the entire image in memory is equal to the number of bytes occupied by each row of pixels multiplied by the height of the image.
[0031] Step 202, for any 3D movie image in the target 3D movie image set, split the 3D movie image into two movie images in left-right format or up-down format.
[0032] Among them, the step of splitting the 3D movie image into two movie images in left-right format includes:
[0033] 11) For any row of pixel data in the 3D video image, obtain the storage address of the pixel in the first column in memory and use it as the starting address of the row. Note that this address is allocated by the system when creating the storage array in memory.
[0034] 12) Starting from the pixel byte data at the starting address of the row, store the first quantity of pixel byte data into the left frame array. The first quantity = (width of the 3D video image / 2) × 4.
[0035] 13) Determine the starting address of the right frame pixels based on the starting address of the row and the first quantity; specifically, (starting address of the row + width of the 3D video image / 2) × 4 can obtain the starting address of the right frame pixels.
[0036] 14) Starting from the pixel byte data at the starting address of the right frame pixels, store the first quantity of pixel byte data into the right frame array.
[0037] 15) The left frame arrays corresponding to multiple rows of pixel data in the 3D video image constitute the left frame video image, and the right frame arrays corresponding to multiple rows of pixel data constitute the right frame video image. Specifically, through the recursive processing of steps 11) - 14) above, the left frame arrays and right frame arrays corresponding to the second row, the third row,..., the Nth row (N represents the pixel value of the height of the image) are obtained, and then placed into the corresponding storage arrays respectively, realizing the separation operation of the left - right format image.
[0038] Among them, the steps of splitting the 3D video image into two video images in the up - down format include:
[0039] 21) Obtain the storage address of the pixel in the first row and first column in the 3D video image in memory and use it as the starting address of the pixel.
[0040] 22) Starting from the pixel byte data at the starting address of the pixel, store the second quantity of pixel byte data into the upper frame array; among them, the second quantity = width of the 3D video image × 4 × (height of the 3D video image / 2).
[0041] 23) Determine the starting address of the lower frame pixels based on the starting address of the pixel and the second quantity.
[0042] 24) Starting from the pixel byte data at the starting address of the lower frame pixels, store the second quantity of pixel byte data into the lower frame array; the upper frame array constitutes the upper frame video image, and the lower frame array constitutes the lower frame video image.
[0043] Step 203: Add different identifiers to the two video images to obtain an identifier image group. Among them, the identifier is generally a watermark image, and its size and shape can be set according to needs. In order to efficiently add the identifier to the image, the background color of the identifier must be transparent.
[0044] In an application example, step 203 includes:
[0045] 31) For any video image, obtain the corresponding identifier.
[0046] 32) Traverse the pixels in the identifier in a loop to obtain the transparency channel value, red channel value, green channel value, and blue channel value of each pixel.
[0047] 33) Normalize the transparency channel values of all pixels in the identifier.
[0048] 34) Determine the starting position of the identifier on the video image; specifically, first obtain the starting address of the identifier in memory and the starting address of the video image in memory, and then superimpose the identifier and the video image. During this process, the superimposition rules can be set according to needs, such as: aligning the bottom end of the identifier with the video image, aligning the left end of the identifier with the video image, etc. Based on the superimposition position of the two, determine the starting position of the identifier on the video image. In a specific application, generally, the starting position is defaulted to the upper right corner of the video image.
[0049] 35) Based on the starting position, according to the red channel value, green channel value, blue channel value, and the normalized transparency channel value of each pixel in the identifier, synthesize all the pixels in the identifier with the corresponding pixels in the video image one by one to obtain multiple synthesized pixels.
[0050] Among them, the synthesis calculation formula for the RGB value of the synthesized pixel is: new RGB component = (1 - alpha_normal) * picture component (R / G / B) + alpha_normal * identifier component (R / G / B); where alpha_normal is the transparency channel value of any pixel in the identifier after normalization; identifier component (R / G / B) represents the red channel value or green channel value or blue channel value of the pixel in the identifier; picture component (R / G / B) represents the red channel value or green channel value or blue channel value of the corresponding pixel in the video image; new RGB component represents the red channel value or green channel value or blue channel value of the synthesized pixel.
[0051] 36) After the synthesized pixel passes the boundary detection, update the pixel at the corresponding position in the video image to the synthesized pixel to obtain the video image with the identifier; the video images with identifiers corresponding to the two video images form an identifier image group.
[0052] Among them, the passing condition for boundary detection is: 0 < each channel value of R / G / B < 255.
[0053] Step 204, obtain the vertical synchronization signal of the screen of the display device. It should be noted that in order to ensure that the image is not torn when displayed on the screen, only when the screen sends the VSync signal can rendering start, so as to achieve a better display effect. Since the operation of setting the picture is performed on the main thread, and the operation of providing image data runs on a worker thread, to ensure synchronization between the two threads, a synchronization lock must be added to the object corresponding to the memory area of the operation. In order to ensure that the image can be refreshed at a certain order and frequency, the present application provides two implementation methods.
[0054] Step 205, based on the vertical synchronization signal, refresh each group of identification images corresponding to the target 3D movie images in the target 3D movie image set at a preset frequency, and simultaneously display them on the screen of the display device; two identified movie images in the same group of identification images form a parallax effect on the screen of the display device, realizing 3D stereoscopic imaging.
[0055] Corresponding to the two implementation methods mentioned in step 204 above, in one of the present applications, the update operation of image data is directly achieved by listening to the VSync signal; in another of the present applications, the update operation of image data is achieved by registering a frame animation effect. It should be noted that the underlying principle of registering a frame animation effect is also to listen to the VSync signal, that is, register a frame animation based on the vertical synchronization signal. However, many operations in registering a frame animation are completed by the system, and developers only need to agree on the rules; while the method of directly listening to the VSync signal requires developers to determine the logic.
[0056] In addition, it should be noted that a frame animation is a relatively traditional animation, which is created by a series of different images and played in sequence. A frame animation can be agreed with the system: loop playback or single playback, and the display time of each frame image. The vertical synchronization signal is a signal provided externally before the screen is refreshed. The host side selects an appropriate strategy based on this signal to complete the screen refresh, avoiding the situation of data refresh not matching the screen scan (tearing).
[0057] Specifically, directly achieving the update operation of image data by listening to the VSync signal includes:
[0058] 51) Initialize the memory array; the memory array is used to store two identified movie images in the same group of identification images, and assign different index values to the two identified movie images.
[0059] In an application example, a memory array with an initial capacity of 2 is initialized to store two split and labeled video images, and an index of the currently refreshed image is defined, with a default value of 0, that is, the first element of the memory array.
[0060] 52) Register the VSync signal listening callback interface; when a signal arrives, the server will call this interface.
[0061] 53) When the VSync signal listening callback interface detects the arrival of a vertical synchronization signal, if the current refresh image index of the display device is 0, obtain the labeled video image with an index value of 0 from the memory array and display it on the screen of the display device, and at the same time increment the current refresh image index by 1; if the current refresh image index of the display device is 1, obtain the labeled video image with an index value of 1 from the memory array and display it on the screen of the display device, and at the same time reset the current refresh image index to 0.
[0062] Among them, the labeled image groups corresponding to the respective 3D video images in the target 3D video image set continuously enter the memory array in the form of a blocking queue, and different images are displayed and refreshed along with the vertical synchronization signal; when the labeled image groups corresponding to all 3D video images in the target 3D video image set have been displayed, unregister the VSync signal listening callback interface.
[0063] Register a frame animation to implement the update operation of image data (that is, based on the frame animation, the labeled image groups corresponding to the respective 3D video images in the target 3D video image set are refreshed at a preset frequency and simultaneously displayed on the screen of the display device), including:
[0064] 61) Initialize the frame animation API, determine the display time (unit: milliseconds) of each video image and the number of display frames required for one cycle (when there is no data, two black background frames can be initialized), and set whether infinite looping is required. In this application, it is set to require infinite looping and start the animation; only when the stop animation is called can the loop be exited, and then the animation is registered to the UI component of the server.
[0065] 62) Since data update and data display are completed in different threads, generally data synchronization needs to be ensured. However, in the application of this frame animation, data synchronization has been completed by the system underlying layer. In actual applications, only the first element of the corresponding frame animation needs to be obtained, and then the left (upper) image is put in; then the second element of the corresponding frame animation is obtained, and then the right (lower) image is put in, so as to achieve data update.
[0066] 63) When it is necessary to exit the playback interface, stop the frame animation and the data update thread.
[0067] To describe the threads mentioned above in more detail, in another exemplary embodiment of the present application, different from the existing scene swapping (shutter glasses) method for playing left - right format stereoscopic videos, and in order to achieve faster implementation, provide a more seamless 3D experience for users, and optimize functions, as shown in Figure 3, the present application also implements parallax stereoscopic imaging in a multi - thread manner, specifically as follows:
[0068] (1) Image decoding thread: As shown in Figure 3(a), after the movie (left - right format or up - down format) is unpacked and decompressed by the decoder, the original data (i.e., the target 3D video image set) is obtained and put into the blocking queue A.
[0069] (2) Image processing thread: As shown in Figure 3(b), obtain the original data in the blocking queue A; determine whether there is data in the blocking queue A; when there is data in the blocking queue A, split the original data horizontally or vertically into two frames of images according to the movie format, add different identifiers to the two split frames of images to distinguish the order, and then put them into the blocking queue B.
[0070] (3) Image display thread: As shown in Figure 3(c), this stage mainly ensures the timely update of the image and, when there is no image update, displays the previous left - eye image and right - eye image in a fixed order and at a fixed frequency to form a parallax effect, which is convenient for the recognition of wearable devices, thereby achieving the 3D stereoscopic imaging effect.
[0071] Specifically, obtain the original data in the blocking queue B; determine whether there is data in the blocking queue B; when there is data in the blocking queue B, take out the image data from the blocking queue B, and then call the image update interface to save the data in the memory cache for the display system to use. If there is content in the cache, it will be directly replaced. The operating system will listen for signals: register the VSync signal listening callback interface or initialize the frame animation properties (loop playback, single - frame display time). When the VSync signal is detected or the single - frame display time of the frame animation arrives, obtain the image data from the memory cache, encapsulate it into the encapsulation format required for display, assign values, and refresh.
[0072] Furthermore, when a signal arrives, it is determined whether there is data in the memory array. If there is no data, no operation is performed. If there is data, the index of the currently refreshed image is determined. If it is 0, the first element in the array is directly obtained, the first element is set as the displayed background, and the index is incremented by 1. If it is 1, the second element in the array is directly obtained, the second element is set as the displayed background, and the index is reset to 0. By looping in this way, the display refresh in a fixed order and at a fixed frequency can be achieved.
[0073] Since image processing and image display run in different threads, association and thread synchronization are required. The identification image group is placed in the memory array. When the memory array is not in use, the left (upper) image in the identification image group is directly placed in the first element of the memory array, and the right (lower) image is placed in the second element of the memory array. If the image display thread is using a certain element of the memory array, it is necessary to wait until the thread has finished using it before updating the new image data (i.e., the next identification image group). When it is necessary to exit the playback interface, the VSync signal callback interface is deregistered and the data update thread is stopped.
[0074] This application also provides an application scenario. This application scenario applies the above-mentioned parallax stereoscopic imaging method and also requires a pair of corresponding glasses. That is, this application can achieve the display and refresh of the left and right eye images saved in the memory cache in a fixed order and at a fixed frequency by listening to the vertical synchronization signal VSync of the screen or setting a frame animation, and then the person wearing a device capable of recognizing the image identification (such as liquid crystal glasses, etc.) can see or receive the final effect of the parallax stereoscopic imaging. This application enables ordinary display devices without 3D functions to also play stereoscopic images. Even for display devices with 3D functions, another way of stereoscopic imaging can be achieved through the method of this application.
[0075] In an exemplary embodiment, a computer device is provided. The computer device can be a server or a terminal, and its internal structure diagram can be as Figure 4As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a parallax stereoscopic imaging method.
[0076] Those skilled in the art can understand that Figure 4 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0077] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0078] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0079] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0080] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the various embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include Read-Only Memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0081] The databases involved in the various embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the various embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0082] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0083] Specific examples are used in this article to elaborate on the principles and implementation manners of the present application. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A parallax stereoscopic imaging method, characterized in that: The parallax stereoscopic imaging method comprises: Obtain target 3D video image set; For any 3D video image in the target 3D video image set, split the 3D video image into two video images in a left-right format or a top-bottom format; Adding different marks to the two video images to obtain a marked image group; adding different marks to the two video images to obtain a marked image group comprises: For any film and television image, obtain the corresponding identifier; loop through the pixels in the identifier to obtain the transparent channel value, red channel value, green channel value and blue channel value of each pixel; normalize the transparent channel values of all pixels in the identifier; determine the starting position of the identifier on the film and television image; based on the starting position, according to the red channel value, green channel value, blue channel value and normalized transparent channel value of each pixel in the identifier, synthesize all pixels in the identifier with the corresponding pixels in the film and television image one by one to obtain multiple synthesized pixels; after the synthesized pixels pass the boundary detection, update the pixels at the corresponding positions in the film and television image to the synthesized pixels to obtain the identified film and television image; the identified film and television images corresponding to the two film and television images constitute an identified image group; Get the vertical synchronization signal of the screen of the display device; Based on the vertical synchronization signal, the identification image group corresponding to each 3D video image in the target 3D video image set is refreshed at a preset frequency and displayed on the screen of the display device at the same time; two identified video images in the same identification image group form a parallax effect on the screen of the display device to achieve 3D stereoscopic imaging.
2. The parallax stereoscopic imaging method according to claim 1, characterized in that: The steps of obtaining a target 3D video image set include: Get the target video; Decapsulating the target video using a decoder to obtain the target encoded video; The target encoded video is decompressed to obtain a target 3D video image set.
3. The parallax stereoscopic imaging method according to claim 1, characterized in that: The 3D video images in the target 3D video image set are all image data in ARGB_8888 format.
4. The parallax stereoscopic imaging method according to claim 3, characterized in that: The step of splitting the 3D video image into two video images in a left-right format comprises: For any row of pixel data in the 3D video image, obtain the storage address of the pixel in the first column in the memory and use it as the row start address; Taking the pixel byte data at the row head address as the starting point, storing a first number of pixel byte data into the left frame array; Determine a right frame pixel start address based on the row start address and the first number; Taking the pixel byte data at the first address of the right frame pixel as the starting point, storing a first number of pixel byte data into the right frame array; wherein the first number=(width of the 3D video image / 2)×4; A left frame array corresponding to a plurality of rows of pixel data in the 3D video image constitutes a left frame video image, and a right frame array corresponding to a plurality of rows of pixel data constitutes a right frame video image.
5. The parallax stereoscopic imaging method according to claim 3, characterized in that: The step of splitting the 3D video image into two video images in an up-and-down format comprises: Obtaining the storage address of the pixel in the first row and first column of the 3D video image in the memory as the pixel first address; Taking the pixel byte data at the pixel first address as the starting point, storing the second amount of pixel byte data into the upper frame array; Determine a pixel first address of a next frame based on the pixel first address and the second number; Taking the pixel byte data at the first address of the lower frame pixel as the starting point, a second number of pixel byte data is stored in the lower frame array; wherein the second number = the width of the 3D video image × 4 × (the height of the 3D video image / 2); the upper frame array constitutes the upper frame video image, and the lower frame array constitutes the lower frame video image.
6. The parallax stereoscopic imaging method according to claim 1, characterized in that: The synthesis calculation formula of the RGB value of the synthesized pixel is: New RGB component = (1-alpha_normal)*picture component (R / G / B)+alpha_normal*identification component (R / G / B); Among them, alpha_normal is the normalized transparent channel value of any pixel in the logo; the logo component (R / G / B) represents the red channel value, green channel value, or blue channel value of the pixel in the logo; the picture component (R / G / B) represents the red channel value, green channel value, or blue channel value of the corresponding pixel in the film and television image; the new RGB component represents the red channel value, green channel value, or blue channel value of the synthesized pixel.
7. The parallax stereoscopic imaging method according to claim 1, characterized in that: Based on the vertical synchronization signal, the steps of refreshing the identification image groups corresponding to the respective 3D video images in the target 3D video image set at a preset frequency and displaying them on the screen of the display device at the same time include: Initialize a memory array; the memory array is used to store two marked video images in the same marked image group, and assign different index values to the two marked video images; Register VSync signal monitoring callback interface; When the VSync signal monitoring callback interface monitors the arrival of the vertical synchronization signal, the current refresh image index of the display device is 0, then the marked video image with an index value of 0 is obtained from the memory array and displayed on the screen of the display device, and the current refresh image index is increased by one; if the current refresh image index of the display device is 1, the marked video image with an index value of 1 is obtained from the memory array and displayed on the screen of the display device, and the current refresh image index is reset to 0; Among them, the identification image groups corresponding to each 3D video image in the target 3D video image set continuously enter the memory array in the form of a blocking queue, and the display of different images is refreshed accompanied by the vertical synchronization signal; when the identification image groups corresponding to all 3D video images in the target 3D video image set are displayed, the VSync signal monitoring callback interface is deregistered.
8. The parallax stereoscopic imaging method according to claim 1, characterized in that: Based on the vertical synchronization signal, the steps of refreshing the identification image groups corresponding to the respective 3D video images in the target 3D video image set at a preset frequency and displaying them on the screen of the display device at the same time include: Registering frame animation based on the vertical synchronization signal; Based on the frame animation, the identification image groups corresponding to the respective 3D video images in the target 3D video image set are refreshed at a preset frequency and displayed on the screen of the display device at the same time.
9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the parallax stereoscopic imaging method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Display method and display device
CN102685521A
Method for executing drawing operation by application and electronic equipment
CN113553130A
Sending card and receiving card for display system, display control method, and storage medium
WO2023138226A1