Three-dimensional display method and device, electronic equipment and storage medium
Through matrix transformation technology, the binocular parallax is aligned with view matrix, model matrix and projection matrix, the problem of poor stereoscopic effect in the existing three-dimensional display technology is solved, and a better user experience is achieved.
Patent Information
- Application Number
- CN202310672144.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2043-06-07
AI Technical Summary
The existing three-dimensional display technology based on binocular parallax cannot accurately align binocular parallax, resulting in poor stereoscopic effects and poor user experience.
By using the first view matrix and the second view matrix, as well as the model matrix and projection matrix associated with the target object, matrix transformation is performed on the three-dimensional position information of the target object, accurately obtain the projection position of the target object and display it on the corresponding screen , thereby achieving aligned binocular parallax.
It significantly improves the three-dimensional effect of the three-dimensional display and provides a more realistic three-dimensional experience.
Smart Images

Figure CN119110051A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of three-dimensional display technology, and in particular to a three-dimensional display method, device, electronic equipment and storage medium. Background Art
[0002] The real world is a three-dimensional world. With the development of society, the current common two-dimensional plane display can no longer meet human needs in some aspects. People hope that the display can truly restore and display the three-dimensional information of the space. Therefore, three-dimensional display came into being and has been continuously developed, becoming a research hotspot in the current display field. At present, three-dimensional display is mainly based on binocular parallax. In related technologies, three-dimensional display based on binocular parallax generally directly shifts the image data by pixels to align the binocular parallax, but directly shifting the image data by pixels cannot accurately align the binocular parallax, resulting in poor stereoscopic effect of three-dimensional display and poor user experience. Summary of the invention
[0003] The embodiments of the present invention provide a three-dimensional display method, device, electronic device and storage medium, aiming to improve the stereoscopic effect of three-dimensional display.
[0004] In a first aspect, an embodiment of the present invention provides a three-dimensional display method, which is applied to an electronic device, wherein the electronic device includes a first screen and a second screen, and the method includes:
[0005] Acquire three-dimensional position data of the target object;
[0006] Acquire a model matrix and a projection matrix associated with the target object, and acquire a preset first view matrix and a second view matrix;
[0007] Performing matrix transformation on the three-dimensional position data according to the first view matrix, the model matrix and the projection matrix to obtain a first projection position of the target object;
[0008] Performing matrix transformation on the three-dimensional position data according to the second view matrix, the model matrix and the projection matrix to obtain a second projection position of the target object;
[0009] The target object is displayed in the first screen according to the first projection position, and the target object is displayed in the second screen according to the second projection position.
[0010] In a second aspect, an embodiment of the present invention further provides a three-dimensional display device, the three-dimensional display device comprising:
[0011] An acquisition module, configured to acquire three-dimensional position data of a target object;
[0012] The acquisition module is further configured to acquire a model matrix and a projection matrix associated with the target object, and acquire a preset first view matrix and a second view matrix;
[0013] a matrix transformation module, configured to perform a matrix transformation on the three-dimensional position data according to the first view matrix, the model matrix and the projection matrix to obtain a first projection position of the target object;
[0014] The matrix transformation module is further configured to perform a matrix transformation on the three-dimensional position data according to the second view matrix, the model matrix and the projection matrix to obtain a second projection position of the target object;
[0015] The display module is configured to display the target object in a first screen according to the first projection position, and to display the target object in a second screen according to the second projection position.
[0016] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the three-dimensional display method as described in the first aspect is realized.
[0017] In a fourth aspect, an embodiment of the present invention further provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the three-dimensional display method as described in the first aspect.
[0018] The embodiments of the present invention provide a three-dimensional display method, device, electronic device and storage medium. The three-dimensional display method can accurately obtain the first projection position of the target object by performing matrix transformation on the three-dimensional position information of the target object using a first view matrix and a model matrix and a projection matrix associated with the target object. At the same time, by using a second view matrix and a model matrix and a projection matrix associated with the target object, the three-dimensional position information of the target object can be transformed to accurately obtain the second projection position of the target object. Then, the target object is displayed on a first screen according to the first projection position, and at the same time, the target object is displayed on a second screen according to the second projection position, so that the binocular parallax can be accurately aligned, which greatly improves the stereoscopic effect of the three-dimensional display. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 is a schematic block diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0021] Figure 2 is a flow chart of a three-dimensional display method provided by an embodiment of the present invention;
[0022] Figure 3 yes Figure 2 A schematic flow chart of sub-steps of a three-dimensional display method;
[0023] Figure 4 is a flow chart of another three-dimensional display method provided by an embodiment of the present invention;
[0024] Figure 5 is an example diagram of a preset gesture in an embodiment of the present invention;
[0025] Figure 6 It is a schematic block diagram of the structure of a three-dimensional display device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0028] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0029] The real world is a three-dimensional world. With the development of society, the current common two-dimensional plane display can no longer meet human needs in some aspects. People hope that the display can truly restore and display the three-dimensional information of the space. Therefore, three-dimensional display came into being and has been continuously developed, becoming a research hotspot in the current display field. At present, three-dimensional display is mainly based on binocular parallax. In related technologies, three-dimensional display based on binocular parallax generally directly shifts the image data by pixels to align the binocular parallax, but directly shifting the image data by pixels cannot accurately align the binocular parallax, resulting in poor stereoscopic effect of three-dimensional display and poor user experience.
[0030] The embodiment of the present invention provides a three-dimensional display method, device, electronic device and storage medium. The three-dimensional display method can accurately obtain the first projection position of the target object by performing matrix transformation on the three-dimensional position information of the target object using a first view matrix and a model matrix and a projection matrix associated with the target object, and can accurately obtain the second projection position of the target object by performing matrix transformation on the three-dimensional position information of the target object using a second view matrix and a model matrix and a projection matrix associated with the target object, and then display the target object in the first screen according to the first projection position, and display the target object in the second screen according to the second projection position, so that the binocular parallax can be accurately aligned, greatly improving the stereoscopic effect of the three-dimensional display.
[0031] In the embodiment of the present invention, the electronic device includes but is not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and a wearable device, etc. The wearable device may be a smart watch, a smart bracelet, an augmented reality (AR) device, or a virtual reality (VR) device, etc. The AR device may be an AR glasses, and the VR device may be a VR glasses.
[0032] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0033] Figure 1 It is a schematic block diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0034] like Figure 1 As shown, the electronic device 100 includes a processor 101 and a memory 102, and the processor 101 and the memory 102 are connected via a bus 103, such as an I2C (Inter-integrated Circuit) bus.
[0035] Specifically, the processor 101 is used to provide computing and control capabilities to support the operation of the entire electronic device 100. The processor 101 can be a central processing unit (CPU) or a graphics processing unit (GPU). The processor 101 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0036] Specifically, the memory 102 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.
[0037] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a partial structure related to the embodiment of the present invention, and does not constitute a limitation on the electronic device to which the embodiment of the present invention is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0038] The processor 101 is used to run the computer program stored in the memory 102, and implement any one of the optical flow calculation methods provided by the embodiments of the present invention when executing the computer program.
[0039] In one embodiment, the processor 101 is used to run a computer program stored in the memory 102, and implement the following steps when executing the computer program:
[0040] Acquire three-dimensional position data of the target object;
[0041] Acquire a model matrix and a projection matrix associated with the target object, and acquire a preset first view matrix and a second view matrix;
[0042] Performing matrix transformation on the three-dimensional position data according to the first view matrix, the model matrix and the projection matrix to obtain a first projection position of the target object;
[0043] Performing matrix transformation on the three-dimensional position data according to the second view matrix, the model matrix and the projection matrix to obtain a second projection position of the target object;
[0044] The target object is displayed in the first screen according to the first projection position, and the target object is displayed in the second screen according to the second projection position.
[0045] In some embodiments, when acquiring the model matrix and the projection matrix associated with the target object, the processor 101 is configured to implement:
[0046] Acquire a geometric relationship between the target object and the origin and coordinate axes of the world coordinate system, and construct a first translation matrix and a first rotation matrix according to the geometric relationship;
[0047] generating a model matrix associated with the target object according to the first translation matrix and the first rotation matrix;
[0048] According to the size of the first screen or the second screen, the spatial parameters of the camera coordinate system are determined, and according to the spatial parameters, a projection matrix associated with the target object is constructed.
[0049] In some embodiments, when the processor 101 obtains the preset first view matrix and the second view matrix, it is used to implement:
[0050] Obtaining identity information of a user currently using the electronic device;
[0051] Obtain a first view matrix and a second view matrix corresponding to the identity identification information.
[0052] In some embodiments, the identity information includes at least one of the following: iris information, fingerprint information, and gesture information.
[0053] In some embodiments, the processor 101 is configured to implement the following steps:
[0054] When the matrix calibration instruction is obtained, the preset object is displayed in the first screen according to the first view matrix, and the preset object is displayed in the second screen according to the second view matrix;
[0055] In response to a matrix calibration operation triggered by a user, calibrating the first view matrix and / or the second view matrix;
[0056] Adjusting the position and / or posture of the preset object in the first screen according to the calibrated first view matrix;
[0057] and / or, adjusting the position and / or posture of the preset object in the second screen according to the calibrated second view matrix;
[0058] In response to a calibration confirmation operation triggered by a user, the calibrated first view matrix and / or the calibrated second view matrix are stored.
[0059] In some embodiments, when implementing the matrix calibration operation triggered by the user and calibrating the first view matrix and / or the second view matrix, the processor 101 is configured to implement:
[0060] In response to a movement operation of a first hand of a user, calibrating the first view matrix;
[0061] And / or in response to a movement operation of a second hand of the user, calibrating the second view matrix.
[0062] In some embodiments, when the processor 101 adjusts the position and / or posture of the preset object in the first screen according to the calibrated first view matrix, it is configured to implement:
[0063] Performing matrix transformation on the preset three-dimensional position data according to the preset model matrix, the preset projection matrix and the calibrated first view matrix to obtain a third projection position of the preset object;
[0064] The preset object is displayed in the first screen according to the third projection position to adjust the position and / or posture of the preset object in the first screen.
[0065] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic device described above can refer to the corresponding process in the aforementioned three-dimensional display method embodiment, and will not be repeated here.
[0066] The following will be combined Figure 1 The electronic device in the embodiment of the present invention will introduce the three-dimensional display method provided by the embodiment of the present invention in detail. It should be noted that Figure 1 The electronic device is only used to explain the three-dimensional display method provided by the embodiment of the present invention, but does not constitute a limitation on the application scenario of the three-dimensional display method provided by the embodiment of the present invention.
[0067] See also Figure 2 , Figure 2 It is a flowchart of a three-dimensional display method provided by an embodiment of the present invention.
[0068] like Figure 2 As shown, the three-dimensional display method includes steps S101 to S104.
[0069] Step S101: Acquire the three-dimensional position data of the target object.
[0070] In this embodiment, the three-dimensional position data of the target object may include the vertex spatial coordinates and rotation angle of the target object, and the three-dimensional position data of the target object is determined based on the local coordinate system (also referred to as the model coordinate system) of the target object. Among them, the local coordinate system of the target object is a spatial coordinate system based on the center of the target object. It can be understood that the target object is the object currently being viewed by the electronic device, such as a tree, a commodity, etc. The target object can be one or more, and the embodiment of the present invention does not specifically limit this.
[0071] In some embodiments, the method of obtaining the three-dimensional position data of the target object may be: obtaining the three-dimensional position data of the target object sent by the server. Or obtaining the three-dimensional position information of the target object sent by the user terminal. The server may be an independent server, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The user terminal may be a smart phone, a tablet computer, a laptop, or a personal computer.
[0072] Step S102: Acquire a model matrix and a projection matrix associated with the target object, and acquire a preset first view matrix and a second view matrix.
[0073] In this embodiment, the model matrix (Model matrix) associated with the target object is used to define the conversion relationship between the local space (Local Space) of the target object itself and the world space (World Space). The view matrix (View matrix) is used to define the conversion relationship between the world space (World Space) and the visual space. The projection matrix (Projection matrix) associated with the target object is used to define the conversion relationship between the visual space and the clip space (Clip Space). Among them, the preset first view matrix is used to define the first conversion relationship between the world space and the visual space, and the preset second view matrix is used to define the second conversion relationship between the world space and the visual space. The first conversion relationship is different from the second conversion relationship. The first view matrix and the second view matrix are pre-constructed view matrices.
[0074] In some embodiments, the method of obtaining the model matrix and the projection matrix associated with the target object can be: obtaining the geometric relationship between the target object and the origin and the coordinate axis of the world coordinate system, and constructing a first translation matrix and a first rotation matrix according to the geometric relationship; generating a model matrix associated with the target object according to the first translation matrix and the first rotation matrix; determining the spatial parameters of the camera coordinate system according to the size of the first screen or the second screen, and constructing a projection matrix associated with the target object according to the spatial parameters. The first screen and the second screen have the same size. For example, the sizes of the first screen and the second screen are both (w, h), w is the width, and h is the height. It can be understood that when the electronic device is AR glasses, the first screen may be a virtual screen corresponding to one of the frames of the AR glasses, and the second screen may be a virtual screen corresponding to another frame of the AR glasses.
[0075] In some embodiments, Figure 3 As shown, step S102 includes: sub-step S1021 to sub-step S1022.
[0076] Sub-step S1021, obtaining the identity information of the user currently using the electronic device.
[0077] In this embodiment, the identity information includes at least one of the following: iris information, fingerprint information, and gesture information. The electronic device may include a first camera, a second camera, and / or a fingerprint sensor, the first camera is used to collect a user's pupil image, the second camera is used to collect a user's hand image, and the fingerprint sensor is used to collect the user's fingerprint features.
[0078] In some embodiments, the method of obtaining the identity information of the user currently using the electronic device may be: obtaining the pupil image captured by the first camera, and analyzing the pupil image to obtain the iris information of the user currently using the electronic device. Alternatively, the pupil image captured by the first camera is obtained, and the pupil image is sent to the server; when the server receives the pupil image, it analyzes the pupil image to obtain the iris information, and sends the iris information to the electronic device; the electronic device receives the iris information sent by the server, thereby obtaining the iris information of the user currently using the electronic device.
[0079] In some embodiments, the method for obtaining the identity information of the user currently using the electronic device may be: obtaining multiple frames of hand images collected by the second camera; performing gesture recognition on each frame of the hand image to obtain multiple gesture actions, and determining the multiple gesture actions as gesture information of the user currently using the electronic device. Alternatively, obtaining multiple frames of hand images collected by the second camera and sending the multiple frames of hand images to the server; when the server receives the multiple frames of hand images, performing gesture recognition on each frame of the hand image to obtain multiple gesture actions, and sending the multiple gesture actions to the electronic device; the electronic device receives the multiple gesture actions sent by the server, and determines the multiple gesture actions as gesture information of the user currently using the electronic device.
[0080] Sub-step S1022: Acquire a first view matrix and a second view matrix corresponding to the identity identification information.
[0081] In this embodiment, the spatial distance between the first view matrix and the second view matrix can represent the user's interpupillary distance. In this way, by obtaining the identity information of the user currently using the electronic device and obtaining the first view matrix and the second view matrix corresponding to the identity information, the problem of poor three-dimensional display effect caused by differences in interpupillary distances of different users can be solved.
[0082] In some embodiments, the first view matrix and the second view matrix corresponding to the identity information are obtained from a pre-established identity-view relationship table. In the process of using the electronic device, the identity information of different users and the first view matrix and the second view matrix configured by different users can be collected, and then the identity-view relationship table can be established according to the identity information of different users and the first view matrix and the second view matrix configured by different users, and the identity-view relationship table is used to describe the corresponding relationship between the identity information, the first view matrix and the second view matrix.
[0083] For example, the pre-established identity-view relationship table is shown in Table 1. It can be seen from Table 1 that the first view matrix and the second view matrix corresponding to the iris information A are View matrix A and View matrix D respectively, the first view matrix and the second view matrix corresponding to the iris information B are View matrix B and View matrix E respectively, and the first view matrix and the second view matrix corresponding to the iris information C are View matrix C and View matrix F respectively.
[0084] Table 1
[0085] Identification information First View Matrix Second view matrix Iris Information A View Matrix A View matrix D Iris information B View Matrix B View Matrix E Iris Information C View Matrix C View matrix F
[0086] For example, if the identity information of the user currently using the electronic device is iris information B, then the View matrix B and the View matrix E corresponding to the iris information B can be obtained from Table 1 as the first view matrix and the second view matrix respectively.
[0087] Step S103: performing matrix transformation on the three-dimensional position data according to the first view matrix, the model matrix and the projection matrix to obtain a first projection position of the target object.
[0088] In this embodiment, the three-dimensional position data of the target object can be multiplied by the model matrix to obtain the three-dimensional position data of the target object in the world space, and then the three-dimensional position data of the target object in the world space can be multiplied by the first view matrix to obtain the first position information of the target object in the visual space. Finally, the first position information of the target object in the visual space can be multiplied by the projection matrix to obtain the first projection position of the target object (the position information of the target object in the clipping space). In this way, the process of converting the three-dimensional position data in the local coordinate system into the position information in the clipping space is realized. This process can be called MVP (Model, View, Projection) matrix transformation, and the transformation can adopt the knowledge of geometric transformation translation, rotation, scaling, etc. in graphics.
[0089] Step S104: performing matrix transformation on the three-dimensional position data according to the second view matrix, the model matrix and the projection matrix to obtain a second projection position of the target object.
[0090] In this embodiment, the three-dimensional position data of the target object can be multiplied by the model matrix to obtain the three-dimensional position data of the target object in the world space, and then the three-dimensional position data of the target object in the world space can be multiplied by the second view matrix to obtain the second position information of the target object in the visual space. Finally, the second position information of the target object in the visual space can be multiplied by the projection matrix to obtain the second projection position of the target object (the position information of the target object in the clipping space).
[0091] Step S105: displaying the target object on the first screen according to the first projection position, and displaying the target object on the second screen according to the second projection position.
[0092] In this embodiment, the first projection position is converted into a first coordinate in the screen space corresponding to the first screen, and the target object is displayed at the position corresponding to the first coordinate in the first screen. At the same time, the second projection position is converted into a second coordinate in the screen space corresponding to the second screen, and the target object is displayed at the position corresponding to the second coordinate in the second screen.
[0093] The first projection position and the second projection position are positions of the target object in the clipping space. The first projection position may be processed by perspective division to obtain first NDC (Normalized Device Coordinates) coordinates, and then the first NDC coordinates may be converted to first coordinates in the screen space corresponding to the first screen. Similarly, the second projection position may be processed by perspective division to obtain second NDC coordinates, and then the second NDC coordinates may be converted to second coordinates in the screen space corresponding to the second screen.
[0094] In some embodiments, the electronic device includes a central processing unit (CPU) and a graphics processing unit (GPU). The three-dimensional display method provided in the embodiment of the present invention can be executed by the central processing unit of the electronic device, or by the graphics processing unit of the electronic device, and the embodiment of the present invention does not specifically limit this. By executing the three-dimensional display method provided in the embodiment of the present invention by the graphics processor of the electronic device, the main control computing power resources can be saved.
[0095] The three-dimensional display method provided in the above embodiment can accurately obtain the first projection position of the target object by performing matrix transformation on the three-dimensional position information of the target object using the first view matrix and the model matrix and projection matrix associated with the target object. At the same time, the second projection position of the target object can be accurately obtained by performing matrix transformation on the three-dimensional position information of the target object using the second view matrix and the model matrix and projection matrix associated with the target object. Then, the target object is displayed on the first screen according to the first projection position, and the target object is displayed on the second screen according to the second projection position. Therefore, the binocular parallax can be accurately aligned, which greatly improves the stereoscopic effect of the three-dimensional display.
[0096] See also Figure 4 , Figure 4 It is a flowchart of another three-dimensional display method provided by an embodiment of the present invention.
[0097] like Figure 4 As shown, the three-dimensional display method includes steps S201 to S205.
[0098] Step S201: when a matrix calibration instruction is obtained, a preset object is displayed on a first screen according to a first view matrix, and a preset object is displayed on a second screen according to a second view matrix.
[0099] In this embodiment, the user can control the electronic device to enter the matrix calibration process when using the electronic device for three-dimensional display for the first time, or control the electronic device to enter the matrix calibration process when it is found that the target object displayed by the electronic device is not consistent with the image. It is understandable that the user can also control the electronic device to enter the matrix calibration process at any time, and the embodiment of the present invention does not make specific limitations on this. The preset object can be set by the user based on actual conditions, and the embodiment of the present invention does not make specific limitations on this. For example, the preset object is a cross cursor, a four-pointed star, a five-pointed star, or a six-pointed star.
[0100] In some embodiments, the preset object is displayed in the first screen according to the first view matrix, and the preset object is displayed in the second screen according to the second view matrix in a manner that: according to the preset model matrix, the preset projection matrix and the first view matrix, the preset three-dimensional position data is matrix transformed to obtain the first vertex position coordinates of the preset object, and the preset object is displayed in the first screen according to the first vertex position coordinates; at the same time, according to the preset model matrix, the preset projection matrix and the second view matrix, the preset three-dimensional position data is matrix transformed to obtain the second vertex position coordinates of the preset object, and the preset object is displayed in the second screen according to the second vertex position coordinates. Wherein, the preset three-dimensional position data is the spatial coordinates and rotation angle of the preset object in the local coordinate system, and the first vertex position coordinates and the second vertex position coordinates are the position coordinates of the preset object in the clipping space.
[0101] Step S202: In response to a matrix calibration operation triggered by a user, calibrate the first view matrix and / or the second view matrix.
[0102] In this embodiment, the electronic device may recognize the motion operation of the user's hand through a camera, and then calibrate the first view matrix and / or the second view matrix according to the motion operation of the user's hand. Alternatively, the user may also trigger a matrix calibration operation through a user terminal that is communicatively connected to the electronic device, thereby calibrating the first view matrix and / or the second view matrix.
[0103] In some embodiments, in response to the matrix calibration operation triggered by the user, the first view matrix and / or the second view matrix may be calibrated in the following manner: in response to the motion operation of the first hand of the user, the first view matrix is calibrated; and / or in response to the motion operation of the second hand of the user, the second view matrix is calibrated. The first hand is the left hand of the user, the second hand is the right hand of the user, or the first hand is the right hand of the user, and the second hand is the left hand of the user. The motion operation of the first hand may be a sliding operation or a rotating operation, and the motion operation of the second hand may be a sliding operation or a selecting operation.
[0104] In some embodiments, in response to the motion operation of the user's first hand, the first view matrix may be calibrated in a manner that: in response to the sliding operation of the user's first hand, the position information in the first view matrix is adjusted; or in response to the rotation operation of the user's first hand, the yaw angle, pitch angle, or rotation angle in the first view matrix is adjusted. In response to the motion operation of the user's second hand, the second view matrix may be calibrated in a manner that: in response to the sliding operation of the user's second hand, the position information in the second view matrix is adjusted; or in response to the rotation operation of the user's second hand, the yaw angle, pitch angle, or rotation angle in the second view matrix is adjusted.
[0105] In some embodiments, in response to a sliding operation of a user's first hand, the manner of adjusting the position information in the first view matrix includes at least one of the following: in response to a sliding operation of the user's first hand in a first direction, increasing the horizontal coordinate of the position information in the first view matrix by a preset value; in response to a sliding operation of the user's first hand in a second direction, decreasing the horizontal coordinate of the position information in the first view matrix by a preset value; or in response to a sliding operation of the user's first hand in a third direction, increasing the vertical coordinate of the position information in the first view matrix by a preset value; in response to a sliding operation of the user's first hand in a fourth direction, decreasing the vertical coordinate of the position information in the first view matrix by a preset value; in response to a sliding operation of the user's first hand in a fifth direction, increasing the vertical coordinate of the position information in the first view matrix by a preset value; in response to a sliding operation of the user's first hand in a sixth direction, decreasing the vertical coordinate of the position information in the first view matrix by a preset value.
[0106] Among them, the first direction, the second direction, the third direction, the fourth direction, the fifth direction and the sixth direction are different, and the first direction is opposite to the second direction, the third direction is opposite to the fourth direction, and the fifth direction is opposite to the sixth direction. For example, the sliding operation of the first hand in the first direction is that the first hand slides to the right, and the sliding operation of the first hand in the second direction is that the first hand slides to the left. The sliding operation of the first hand in the third direction is that the first hand slides forward, and the sliding operation of the first hand in the fourth direction is that the first hand slides backward. The sliding operation of the first hand in the fifth direction is that the first hand slides upward, and the sliding operation of the first hand in the sixth direction is that the first hand slides downward.
[0107] In some embodiments, in response to the rotation operation of the user's first hand, the yaw angle, pitch angle or rotation angle in the first view matrix is adjusted in the following manner: in response to the rotation operation of the user's first hand around the seventh direction of the vertical axis, the yaw angle in the first view matrix is increased by a preset angle; or in response to the rotation operation of the user's first hand around the eighth direction of the vertical axis, the yaw angle in the first view matrix is reduced by a preset angle; or in response to the rotation operation of the user's first hand around the ninth direction of the horizontal axis, the pitch angle in the first view matrix is increased by a preset angle; or in response to the rotation operation of the user's first hand around the tenth direction of the horizontal axis, the pitch angle in the first view matrix is reduced by a preset angle; or in response to the rotation operation of the user's first hand around the eleventh direction of the longitudinal axis, the rotation angle in the first view matrix is increased by a preset angle; or in response to the rotation operation of the user's first hand around the twelfth direction of the longitudinal axis, the rotation angle in the first view matrix is reduced by a preset angle.
[0108] Among them, the seventh direction, the eighth direction, the ninth direction, the tenth direction, the eleventh direction and the twelfth direction are different, and the seventh direction is opposite to the eighth direction, the ninth direction is opposite to the tenth direction, and the eleventh direction is opposite to the twelfth direction. For example, the rotation operation of the first hand around the vertical axis in the seventh direction is the right rotation of the first hand around the vertical axis, and the rotation operation of the first hand around the vertical axis in the eighth direction is the left rotation of the first hand around the vertical axis. The rotation operation of the first hand around the horizontal axis in the ninth direction is the backward rotation of the first hand around the horizontal axis, and the rotation operation of the first hand around the horizontal axis in the tenth direction is the forward rotation of the first hand around the vertical axis. The rotation operation of the first hand around the horizontal axis in the eleventh direction is the upward rotation of the first hand around the vertical axis, and the rotation operation of the first hand around the horizontal axis in the twelfth direction is the downward rotation of the first hand around the vertical axis.
[0109] In some embodiments, in response to a sliding operation of the user's second hand, the manner of adjusting the position information in the second view matrix may include at least one of the following: in response to a sliding operation of the user's second hand in a first direction, increasing the horizontal coordinate of the position information in the second view matrix by a preset value; in response to a sliding operation of the user's second hand in a second direction, decreasing the horizontal coordinate of the position information in the second view matrix by a preset value; or in response to a sliding operation of the user's second hand in a third direction, increasing the vertical coordinate of the position information in the second view matrix by a preset value; in response to a sliding operation of the user's second hand in a fourth direction, decreasing the vertical coordinate of the position information in the second view matrix by a preset value; in response to a sliding operation of the user's second hand in a fifth direction, increasing the vertical coordinate of the position information in the second view matrix by a preset value; in response to a sliding operation of the user's second hand in a sixth direction, decreasing the vertical coordinate of the position information in the second view matrix by a preset value.
[0110] For example, the sliding operation of the second hand in the first direction is the sliding of the second hand to the right, and the sliding operation of the second hand in the second direction is the sliding of the second hand to the left. The sliding operation of the second hand in the third direction is the sliding of the second hand forward, and the sliding operation of the second hand in the fourth direction is the sliding of the second hand backward. The sliding operation of the second hand in the fifth direction is the sliding of the second hand upward, and the sliding operation of the second hand in the sixth direction is the sliding of the second hand downward.
[0111] In some embodiments, in response to the rotation operation of the user's second hand, the yaw angle, pitch angle or rotation angle in the second view matrix is adjusted in the following manner: in response to the rotation operation of the user's second hand around the seventh direction of the vertical axis, the yaw angle in the second view matrix is increased by a preset angle; or in response to the rotation operation of the user's second hand around the eighth direction of the vertical axis, the yaw angle in the second view matrix is reduced by a preset angle; or in response to the rotation operation of the user's second hand around the ninth direction of the horizontal axis, the pitch angle in the second view matrix is increased by a preset angle; or in response to the rotation operation of the user's second hand around the tenth direction of the horizontal axis, the pitch angle in the second view matrix is reduced by a preset angle; or in response to the rotation operation of the user's second hand around the eleventh direction of the longitudinal axis, the rotation angle in the second view matrix is increased by a preset angle; or in response to the rotation operation of the user's second hand around the twelfth direction of the longitudinal axis, the rotation angle in the second view matrix is reduced by a preset angle.
[0112] For example, the rotation operation of the second hand in the seventh direction around the vertical axis is the right rotation of the second hand around the vertical axis, and the rotation operation of the second hand in the eighth direction around the vertical axis is the left rotation of the second hand around the vertical axis. The rotation operation of the second hand in the ninth direction around the horizontal axis is the backward rotation of the second hand around the horizontal axis, and the rotation operation of the second hand in the tenth direction around the horizontal axis is the forward rotation of the second hand around the vertical axis. The rotation operation of the second hand in the eleventh direction around the horizontal axis is the upward rotation of the second hand around the vertical axis, and the rotation operation of the second hand in the twelfth direction around the horizontal axis is the downward rotation of the second hand around the vertical axis.
[0113] In some embodiments, a user terminal connected to the electronic device for communication displays a matrix calibration page, the matrix calibration page includes a first touch area and a second touch area, the first touch area is used to calibrate the first view matrix, and the second touch area is used to calibrate the second view matrix; the user terminal responds to the user's touch operation on the position calibration button in the first touch area, sends a corresponding first position update instruction to the electronic device; when the electronic device receives the first position update instruction sent by the electronic device, the position information in the first view matrix is updated according to the first position update instruction. Or the user terminal responds to the user's touch operation on the yaw angle calibration button in the first touch area, sends a corresponding first yaw angle update instruction to the electronic device; when the electronic device receives the first yaw angle update instruction sent by the electronic device, the yaw angle in the first view matrix is updated according to the first yaw angle update instruction. Or the user terminal responds to the user's touch operation on the pitch angle calibration button in the first touch area, sends a corresponding first pitch angle update instruction to the electronic device; when the electronic device receives the first pitch angle update instruction sent by the electronic device, the pitch angle in the first view matrix is updated according to the first pitch angle update instruction. Alternatively, the user terminal sends a corresponding first rotation angle update instruction to the electronic device in response to the user's touch operation on the rotation angle calibration button in the first touch area; when the electronic device receives the first rotation angle update instruction sent by the electronic device, it updates the rotation angle in the first view matrix according to the first rotation angle update instruction.
[0114] In some embodiments, the user terminal sends a corresponding second position update instruction to the electronic device in response to the user's touch operation on the position calibration button in the second touch area; when the electronic device receives the second position update instruction sent by the electronic device, the position information in the second view matrix is updated according to the second position update instruction. Or the user terminal sends a corresponding second yaw angle update instruction to the electronic device in response to the user's touch operation on the yaw angle calibration button in the second touch area; when the electronic device receives the second yaw angle update instruction sent by the electronic device, the yaw angle in the second view matrix is updated according to the second yaw angle update instruction. Or the user terminal sends a corresponding second pitch angle update instruction to the electronic device in response to the user's touch operation on the pitch angle calibration button in the second touch area; when the electronic device receives the second pitch angle update instruction sent by the electronic device, the pitch angle in the second view matrix is updated according to the second pitch angle update instruction. Alternatively, the user terminal sends a corresponding second rotation angle update instruction to the electronic device in response to the user's touch operation on the rotation angle calibration button in the second touch area; when the electronic device receives the second rotation angle update instruction sent by the electronic device, it updates the rotation angle in the second view matrix according to the second rotation angle update instruction.
[0115] Step S203: adjusting the position and / or posture of the preset object in the first screen according to the calibrated first view matrix.
[0116] In this embodiment, after calibrating the first view matrix, the electronic device can perform matrix transformation on the preset three-dimensional position data according to the preset model matrix, the preset projection matrix and the calibrated first view matrix to obtain the third projection position of the preset object, and display the preset object in the first screen according to the third projection position to adjust the position and / or posture of the preset object in the first screen.
[0117] Step S204: adjusting the position and / or posture of the preset object in the second screen according to the calibrated second viewing matrix.
[0118] In this embodiment, after calibrating the second view matrix, the electronic device can perform matrix transformation on the preset three-dimensional position data according to the preset model matrix, the preset projection matrix and the calibrated second view matrix to obtain a fourth projection position of the preset object, and display the preset object on the second screen according to the fourth projection position to adjust the position and / or posture of the preset object on the second screen.
[0119] Step S205: In response to a calibration confirmation operation triggered by the user, the calibrated first view matrix and / or the calibrated second view matrix is stored.
[0120] In this embodiment, after adjusting the position and / or posture of the preset object in at least one of the first screen and the second screen, the user can observe whether the preset object is in the image. When the user observes that the preset object is in the image, the user can trigger a calibration confirmation operation to instruct the electronic device to end the matrix calibration and instruct the electronic device to store the calibrated first view matrix and / or the calibrated second view matrix.
[0121] In some embodiments, in response to a calibration confirmation operation triggered by a user, the calibrated first view matrix and / or the calibrated second view matrix may be stored in a manner as follows: obtaining a gesture recognized by the second camera, and when the gesture is a preset gesture, determining that the user has triggered the calibration confirmation operation, and storing the calibrated first view matrix and / or the calibrated second view matrix. The preset gesture may be set based on actual conditions, and the embodiments of the present invention do not specifically limit this. For example, the preset gesture is as follows: Figure 5 OK gesture shown.
[0122] In some embodiments, steps S201 to S205 may be performed after step S105. For example, after the electronic device displays the target object on the first screen and the second screen, when the user observes that the target object is not in the same image, the user may control the electronic device to enter the matrix calibration process, and the electronic device performs steps S201 to S205. Or the electronic device performs the following steps: in response to the matrix calibration operation triggered by the user, calibrate the first view matrix and / or the second view matrix; adjust the position and / or posture of the target object in the first screen according to the calibrated first view matrix; and / or, adjust the position and / or posture of the target object in the second screen according to the calibrated second view matrix; in response to the calibration confirmation operation triggered by the user, store the calibrated first view matrix and / or the calibrated second view matrix.
[0123] The three-dimensional display method provided in the above embodiment calibrates the first view matrix and / or the second view matrix so that the first view matrix and the second view matrix can meet the differentiated requirements of the interpupillary distance of the eyes of different users, and can also avoid the problem of poor stereoscopic effect of the three-dimensional display due to the offset and deformation of the positions of the first screen and the second screen, thereby greatly improving the stereoscopic effect of the three-dimensional display.
[0124] See also Figure 6 , Figure 6 It is a schematic block diagram of the structure of a three-dimensional display device provided by an embodiment of the present invention.
[0125] like Figure 6 As shown, the three-dimensional display device 200 includes:
[0126] An acquisition module 210 is configured to acquire three-dimensional position data of a target object;
[0127] The acquisition module 210 is further configured to acquire a model matrix and a projection matrix associated with the target object, and acquire a preset first view matrix and a second view matrix;
[0128] A matrix transformation module 220 is configured to perform a matrix transformation on the three-dimensional position data according to the first view matrix, the model matrix and the projection matrix to obtain a first projection position of the target object;
[0129] The matrix transformation module 220 is further configured to perform a matrix transformation on the three-dimensional position data according to the second view matrix, the model matrix and the projection matrix to obtain a second projection position of the target object;
[0130] The display module 230 is configured to display the target object in a first screen according to the first projection position, and simultaneously display the target object in a second screen according to the second projection position.
[0131] In some embodiments, the acquisition module 210 is further configured to:
[0132] Acquire a geometric relationship between the target object and the origin and coordinate axes of the world coordinate system, and construct a first translation matrix and a first rotation matrix according to the geometric relationship;
[0133] generating a model matrix associated with the target object according to the first translation matrix and the first rotation matrix;
[0134] According to the size of the first screen or the second screen, the spatial parameters of the camera coordinate system are determined, and according to the spatial parameters, a projection matrix associated with the target object is constructed.
[0135] In some embodiments, the acquisition module 210 is further configured to:
[0136] Obtaining identity information of a user currently using the electronic device;
[0137] Obtain a first view matrix and a second view matrix corresponding to the identity identification information.
[0138] In some embodiments, the identity information includes at least one of the following: iris information, fingerprint information, and gesture information.
[0139] In some embodiments, the three-dimensional display device 200 further includes a matrix calibration module, and the matrix calibration module is configured to:
[0140] When the matrix calibration instruction is obtained, the preset object is displayed in the first screen according to the first view matrix, and the preset object is displayed in the second screen according to the second view matrix;
[0141] In response to a matrix calibration operation triggered by a user, calibrating the first view matrix and / or the second view matrix;
[0142] Adjusting the position and / or posture of the preset object in the first screen according to the calibrated first view matrix;
[0143] and / or, adjusting the position and / or posture of the preset object in the second screen according to the calibrated second view matrix;
[0144] In response to a calibration confirmation operation triggered by a user, the calibrated first view matrix and / or the calibrated second view matrix are stored.
[0145] In some embodiments, the matrix calibration module is further configured to:
[0146] In response to a movement operation of a first hand of a user, calibrating the first view matrix;
[0147] And / or in response to a movement operation of a second hand of the user, calibrating the second view matrix.
[0148] In some embodiments, the matrix calibration module is further configured to:
[0149] Performing matrix transformation on the preset three-dimensional position data according to the preset model matrix, the preset projection matrix and the calibrated first view matrix to obtain a third projection position of the preset object;
[0150] The preset object is displayed in the first screen according to the third projection position to adjust the position and / or posture of the preset object in the first screen.
[0151] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the three-dimensional display device described above can refer to the corresponding process in the aforementioned three-dimensional display method embodiment, and will not be repeated here.
[0152] An embodiment of the present invention further provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement any three-dimensional display method provided in the description of the embodiment of the present invention.
[0153] The storage medium may be an internal storage unit of the electronic device described in the above embodiment, such as a hard disk or memory of the electronic device. The storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device.
[0154] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0155] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0156] The serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A three-dimensional display method, characterized in that: Applied to an electronic device, the electronic device includes a first screen and a second screen, and the method includes: Acquire three-dimensional position data of the target object; Acquire a model matrix and a projection matrix associated with the target object, and acquire a preset first view matrix and a second view matrix; Performing matrix transformation on the three-dimensional position data according to the first view matrix, the model matrix and the projection matrix to obtain a first projection position of the target object; Performing matrix transformation on the three-dimensional position data according to the second view matrix, the model matrix and the projection matrix to obtain a second projection position of the target object; The target object is displayed in the first screen according to the first projection position, and the target object is displayed in the second screen according to the second projection position.
2. The three-dimensional display method according to claim 1, characterized in that: The acquiring of a model matrix and a projection matrix associated with the target object comprises: Acquire a geometric relationship between the target object and the origin and coordinate axes of the world coordinate system, and construct a first translation matrix and a first rotation matrix according to the geometric relationship; generating a model matrix associated with the target object according to the first translation matrix and the first rotation matrix; According to the size of the first screen or the second screen, the spatial parameters of the camera coordinate system are determined, and according to the spatial parameters, a projection matrix associated with the target object is constructed.
3. The three-dimensional display method according to claim 1, characterized in that: The obtaining of the preset first view matrix and the second view matrix comprises: Obtaining identity information of a user currently using the electronic device; Obtain a first view matrix and a second view matrix corresponding to the identity identification information.
4. The three-dimensional display method according to claim 3, characterized in that: The identity identification information includes at least one of the following: iris information, fingerprint information and gesture information.
5. The three-dimensional display method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the matrix calibration instruction is obtained, the preset object is displayed in the first screen according to the first view matrix, and the preset object is displayed in the second screen according to the second view matrix; In response to a matrix calibration operation triggered by a user, calibrating the first view matrix and / or the second view matrix; Adjusting the position and / or posture of the preset object in the first screen according to the calibrated first view matrix; and / or, adjusting the position and / or posture of the preset object in the second screen according to the calibrated second view matrix; In response to a calibration confirmation operation triggered by a user, the calibrated first view matrix and / or the calibrated second view matrix are stored.
6. The three-dimensional display method according to claim 5, characterized in that: The step of calibrating the first view matrix and / or the second view matrix in response to the matrix calibration operation triggered by the user includes: In response to a movement operation of a first hand of a user, calibrating the first view matrix; And / or in response to a movement operation of a second hand of the user, calibrating the second view matrix.
7. The three-dimensional display method according to claim 5, characterized in that: The adjusting the position and / or posture of the preset object in the first screen according to the calibrated first view matrix includes: Performing matrix transformation on the preset three-dimensional position data according to the preset model matrix, the preset projection matrix and the calibrated first view matrix to obtain a third projection position of the preset object; The preset object is displayed in the first screen according to the third projection position to adjust the position and / or posture of the preset object in the first screen.
8. A three-dimensional display device, characterized in that: The three-dimensional display device comprises: An acquisition module, configured to acquire three-dimensional position data of a target object; The acquisition module is further configured to acquire a model matrix and a projection matrix associated with the target object, and acquire a preset first view matrix and a second view matrix; a matrix transformation module, configured to perform a matrix transformation on the three-dimensional position data according to the first view matrix, the model matrix and the projection matrix to obtain a first projection position of the target object; The matrix transformation module is further configured to perform a matrix transformation on the three-dimensional position data according to the second view matrix, the model matrix and the projection matrix to obtain a second projection position of the target object; The display module is configured to display the target object in a first screen according to the first projection position, and to display the target object in a second screen according to the second projection position.
9. An electronic device, characterized in that: The electronic device includes a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the three-dimensional display method as described in any one of claims 1 to 7 is realized.
10. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the three-dimensional display method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image processing method and device applied to VR scene and electronic equipment
CN109656367A
Three-dimensional scene presentation method, device and equipment and storage medium
CN109829981A
Calibration method of three-dimensional display system projector
CN111479100A
Desktop true three-dimensional light field display method based on OpenGL
CN112950768A
Three-dimensional data enhancement method and device, model training detection method and device and automatic driving vehicle
CN114266879A
