Nothing Special   »   [go: up one dir, main page]

CN113542328B - Virtual environment data synchronization method and device - Google Patents

Virtual environment data synchronization method and device Download PDF

Info

Publication number
CN113542328B
CN113542328B CN202010309515.5A CN202010309515A CN113542328B CN 113542328 B CN113542328 B CN 113542328B CN 202010309515 A CN202010309515 A CN 202010309515A CN 113542328 B CN113542328 B CN 113542328B
Authority
CN
China
Prior art keywords
anchor point
cloud
local
virtual environment
matrix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010309515.5A
Other languages
Chinese (zh)
Other versions
CN113542328A (en
Inventor
施波迪
罗勇
黄之昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202010309515.5A priority Critical patent/CN113542328B/en
Publication of CN113542328A publication Critical patent/CN113542328A/en
Application granted granted Critical
Publication of CN113542328B publication Critical patent/CN113542328B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/131Protocols for games, networked simulations or virtual reality
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Processing Or Creating Images (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a virtual environment data synchronization method, which comprises the following steps: acquiring a first characteristic picture; acquiring a second characteristic picture similar to the first characteristic picture in a cloud server, and acquiring a cloud anchor point corresponding to the second characteristic picture; establishing a local coordinate system, and setting a local anchor point for the first characteristic picture; correcting the local coordinate system according to the cloud anchor point and the local anchor point, so that the origin of the local coordinate system coincides with the origin of the coordinate system corresponding to the cloud anchor point; and constructing a virtual environment. The application also provides a virtual environment data synchronization device, a server and a computer readable storage medium. The cloud virtual environment loading method and the cloud virtual environment loading system can effectively achieve synchronism of loading of cloud virtual environment data to a local virtual environment.

Description

Virtual environment data synchronization method and device
Technical Field
The present application relates to the field of internet technologies, and in particular, to a virtual environment data synchronization method, a device, a computer device, and a computer readable storage medium.
Background
Augmented reality (Augmented Reality, AR), a technique that calculates the position and angle of a camera image in real time and adds a corresponding image, aims at putting a virtual world around the real world on a screen and interacting with it.
In the prior art, interaction of multiple persons in a virtual environment through an AR technology can be realized through cloud services. Generally, a user establishes a cloud anchor point, then uploads the cloud anchor point and virtual environment data corresponding to the cloud anchor point to a cloud end as a whole, and then other users connect and download the virtual environment data corresponding to the cloud anchor point, so that the virtual environment data is shared. Of course, the newly created environment data of any user in the virtual environment can also be associated to the cloud anchor point and uploaded to the cloud end, so that interaction among multiple users is achieved.
However, in the prior art, because the process of connecting different users to the cloud anchor point is to first establish a virtual environment and then scan the same or similar feature pictures, the virtual environment data of the cloud anchor point corresponding to the feature pictures is loaded to the virtual environment, so that in many cases, the virtual environment data corresponding to the cloud anchor point is not completely synchronized on space coordinates.
Disclosure of Invention
The application provides a virtual environment data synchronization method, a device, a server and a computer readable storage medium, which can solve the problem that virtual environment data corresponding to a loading cloud anchor point is not synchronous in the prior art.
First, to achieve the above object, the present application provides a virtual environment data synchronization method, including:
acquiring a first characteristic picture; acquiring a second characteristic picture similar to the first characteristic picture in a cloud server, and acquiring a cloud anchor point corresponding to the second characteristic picture; establishing a local coordinate system, and setting a local anchor point for the first characteristic picture; correcting the local coordinate system according to the cloud anchor point and the local anchor point, so that the origin of the local coordinate system coincides with the origin of the coordinate system corresponding to the cloud anchor point; and constructing a virtual environment.
In one example, the setting a local anchor point for the first feature picture includes: acquiring an anchor point creation rule of the cloud anchor point, and setting a local anchor point for the first characteristic picture according to the anchor point creation rule; wherein the anchor point creation rule includes: establishing an anchor point according to the position relation between the anchor point and the characteristic picture and the geometric information of the characteristic picture; the geometric information includes position, angle and direction.
In one example, the correcting the local coordinate system includes: calculating quaternion and translation vector between the local anchor point and the cloud anchor point; and correcting the origin of coordinates of the local coordinate system according to the quaternion and the translation vector.
In one example, the computing the quaternion and translation vector between the local anchor and the cloud anchor includes: respectively extracting rotation matrixes and translation matrixes in anchor matrixes corresponding to the cloud anchor points and the local anchor points to obtain a first rotation matrix and a first translation matrix and a second rotation matrix and a second translation matrix; a quaternion is calculated from the first rotation matrix and the second rotation matrix, and a translation vector is calculated from the first translation matrix and the second translation matrix.
In one example, the following formula is used to extract the rotation matrix and the translation matrix in the anchor matrix corresponding to the cloud anchor point and the local anchor point, respectively, where the formula includes:
wherein M is an anchor matrix, l1, l2, l3 are the lengths of vectors formed by the 0 th column, the 1 st column and the 2 nd column of the anchor matrix M respectively, T is a translation matrix, and R is a rotation matrix.
In one example, the computing the quaternion from the first rotation matrix and the second rotation matrix includes: respectively calculating Euler angles of the first rotation matrix and the second rotation matrix according to Euler angle calculation formulas; calculating quaternion according to a quaternion calculation formula and Euler angle difference values of the first rotation matrix and the second rotation matrix; wherein the euler angle calculation formula includes:
wherein R is a rotation matrix, euler angle +.>
The quaternion calculation formula comprises:
wherein,,and the Euler angle difference value is the Euler angle difference value of the first rotation matrix and the second rotation matrix.
In one example, said calculating a translation vector from said first translation matrix and said second translation matrix comprises: according to the formula Δp= (m 30 -m' 30 ,m 31 -m' 31 ,m 32 -m' 32 ) The translation vector Δp is calculated, where m30, m31, m32 are the values of 0 to 2 rows of column 3 of the first translation matrix, and m30', m31', m32' are the values of 0 to 2 rows of column 3 of the second translation matrix.
In addition, to achieve the above object, the present application further provides a virtual environment data synchronization apparatus, including:
the first acquisition module is used for acquiring a first characteristic picture; the second acquisition module is used for acquiring a second characteristic picture similar to the first characteristic picture in the cloud server and acquiring a cloud anchor point corresponding to the second characteristic picture; the building module is used for building a local coordinate system and setting a local anchor point for the first feature picture; the correction module is used for correcting the local coordinate system according to the cloud anchor point and the local anchor point, so that the origin of the local coordinate system coincides with the origin of the coordinate system corresponding to the cloud anchor point; and the loading module is used for constructing a virtual environment.
Furthermore, the application also provides a computer device, which comprises a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and the computer program realizes the steps of the virtual environment data synchronization method when being executed by the processor.
Further, to achieve the above object, the present application also provides a computer-readable storage medium storing a computer program executable by at least one processor to cause the at least one processor to perform the steps of the virtual environment data synchronization method as described above.
Compared with the prior art, the virtual environment data synchronization method, the device, the server and the computer readable storage medium can acquire a first characteristic picture, then acquire a second characteristic picture similar to the first characteristic picture in a cloud server, and acquire a cloud anchor point corresponding to the second characteristic picture; then, a local coordinate system is established, and a local anchor point is set for the first characteristic picture; correcting the local coordinate system according to the cloud anchor point and the local anchor point, so that the origin of the local coordinate system coincides with the origin of the coordinate system corresponding to the cloud anchor point; and finally, constructing a virtual environment. Therefore, the synchronism of loading the cloud virtual environment data to the local virtual environment is realized.
Drawings
FIG. 1 is a schematic view of an application environment according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for synchronizing virtual environment data according to an embodiment of the present application;
FIG. 3 is a flowchart of an embodiment of correcting the local coordinate system according to the cloud anchor and the local anchor in the step S206 of FIG. 2;
FIG. 4 is a flow chart of an exemplary embodiment of step S302 of FIG. 3;
FIG. 5 is a flow diagram of an exemplary embodiment of computing quaternions from the first rotation matrix and the second rotation matrix in step S402 of FIG. 4;
FIG. 6 is a flowchart illustrating an embodiment of the present application;
FIG. 7 is a schematic diagram illustrating a program module of an embodiment of a virtual environment data synchronization apparatus according to the present application;
FIG. 8 is a schematic diagram of an alternative hardware architecture of the computer device of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that the description of "first", "second", etc. in this disclosure is for descriptive purposes only and is not to be construed as indicating or implying a relative importance or implying an indication of the number of technical features being indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present application.
FIG. 1 is a schematic view of an application environment according to an embodiment of the present application. Referring to fig. 1, the computer device 1 is connected to a cloud server 2 through a network, and the computer device 1 includes a capturing unit for capturing a captured first feature image. When the computer equipment 1 acquires a first characteristic picture, acquiring a second characteristic picture similar to the first characteristic picture in a cloud server, and acquiring a cloud anchor point corresponding to the second characteristic picture; and then establishing a local coordinate system and setting a local anchor point for the first characteristic picture. And then, the computer equipment 1 corrects the local coordinate system according to the cloud anchor point and the local anchor point, so that the origin of the local coordinate system coincides with the origin of the coordinate system corresponding to the cloud anchor point, and finally a virtual environment is constructed. In this embodiment, the computer device 1 may be used as a terminal device such as a mobile terminal, for example, an AR device, a mobile phone, a tablet, a projector, etc.
Example 1
FIG. 2 is a flow chart of a method for synchronizing virtual environment data according to an embodiment of the application. It will be appreciated that the flow charts in the method embodiments are not intended to limit the order in which the steps are performed. An exemplary description will be made below with the computer apparatus 1 as an execution subject.
As shown in fig. 2, the virtual environment data synchronization method may include steps S200 to S208, wherein:
step S200, a first feature picture is acquired.
Step S202, a second feature picture similar to the first feature picture is obtained in a cloud server, and a cloud anchor point corresponding to the second feature picture is obtained.
Step S204, a local coordinate system is established, and a local anchor point is set for the first feature picture.
Specifically, the computer device 1 obtains a first feature picture through a shooting unit, then obtains a feature picture set from a cloud server, compares the first feature picture with each feature picture in the feature picture set, and finds out a second feature picture with the similarity to the first feature picture being greater than a preset threshold, such as more than 98%. Then, the computer device 1 obtains cloud anchor point information on the second feature picture from a cloud server. In this embodiment, each feature picture of the feature picture set stored on the cloud server includes at least one cloud anchor point, for example, the cloud anchor point is set on a coordinate of a certain position of the feature picture; and the cloud anchor point is associated with virtual environment data corresponding to one scene. That is, each feature picture stored by the cloud server is associated with a piece of virtual environment data. In a specific embodiment, the establishing the cloud anchor may include the steps of: selecting any point in a physical environment as an origin to establish a coordinate system, such as a Cartesian coordinate system O-xyz; then, a plurality of feature pictures are randomly placed on a distance radius of 1-5 m around the origin of the coordinate system, for example, the feature pictures with the size of about A4 paper are placed, the included angle between the vector from the midpoint of the picture to the origin and the normal vector of the picture does not exceed 90 degrees, the more the feature pictures are, the larger the size is, the smaller the included angle is, the smaller the generated error is, the anchor points A, B, C and the number of the feature pictures are measured and calculated, and the anchor points are stored in a cloud server, so that the feature pictures and the corresponding cloud anchor point data are obtained.
When the computer equipment 1 compares the first characteristic picture with a second characteristic picture in the characteristic picture set to be similar, cloud anchor point information on the second characteristic picture is further acquired, wherein the cloud anchor point information comprises at least one cloud anchor point and a corresponding anchor point creation rule; and then, establishing a local anchor point in a local coordinate system according to the anchor point establishing rule and the geometric information of the first characteristic picture. In this embodiment, the setting, by the computer device 1, a local anchor point for the first feature picture specifically includes: and acquiring an anchor point creation rule of the cloud anchor point, and setting a local anchor point for the first characteristic picture according to the anchor point creation rule. Wherein the anchor point creation rule includes: establishing an anchor point according to the position relation between the anchor point and the characteristic picture and the geometric information of the characteristic picture; wherein the geometric information includes position, angle and direction. That is, the computer device 1 may acquire cloud anchor information on the second feature picture, and establish a local anchor corresponding to the cloud anchor information in a local coordinate system according to the cloud anchor information.
And step S206, correcting the local coordinate system according to the cloud anchor point and the local anchor point, so that the origin of the local coordinate system coincides with the origin of the coordinate system corresponding to the cloud anchor point.
As shown in fig. 3, in an exemplary embodiment, the correcting the local coordinate system according to the cloud anchor point and the local anchor point in step S206 includes steps S300 to 302:
step S300, calculating quaternion and translation vector between the local anchor point and the cloud anchor point;
and step S302, correcting the origin of coordinates of the local coordinate system according to the quaternion and the translation vector.
As shown in fig. 4, in an exemplary embodiment, step S302 includes steps S400-S402.
And step S400, respectively extracting a rotation matrix and a translation matrix in anchor matrix corresponding to the cloud anchor point and the local anchor point to obtain a first rotation matrix and a first translation matrix and a second rotation matrix and a second translation matrix.
Step S402, calculating quaternion according to the first rotation matrix and the second rotation matrix, and calculating translation vector according to the first translation matrix and the second translation matrix.
Specifically, for anchor points in the coordinate system, the representation is generally performed in a matrix sampling manner. Therefore, the computer device 1 may extract the corresponding rotation matrix and translation matrix by calculating the anchor matrix of the cloud anchor and the anchor matrix of the local anchor. In this embodiment, the computer device 1 is configured to extract a rotation matrix and a translation matrix in anchor matrices corresponding to the cloud anchor and the local anchor respectively by using the following formula, where the formula includes:
wherein M is an anchor matrix, l1, l2, l3 are the lengths of vectors formed by the 0 th column, the 1 st column and the 2 nd column of the anchor matrix M respectively, T is a translation matrix, and R is a rotation matrix. That is, the computer device 1 calculates the rotation matrix R and the translation matrix T of the cloud anchor and the rotation matrix R ' and the translation matrix T ' of the local anchor by calculating the anchor matrix M of the cloud anchor and the anchor matrix M ' of the local anchor, respectively.
Next, the computer apparatus 1 calculates a quaternion from the first rotation matrix and the second rotation matrix.
As shown in fig. 5, in an exemplary embodiment, the step S402 of calculating the quaternion according to the first rotation matrix and the second rotation matrix includes steps S500 to S502.
And S500, respectively calculating Euler angles of the first rotation matrix and the second rotation matrix according to Euler angle calculation formulas.
Step S502, a quaternion is calculated according to a quaternion calculation formula and Euler angle difference values of the first rotation matrix and the second rotation matrix.
The euler angle calculation formula includes:
wherein R is a rotation matrix, euler angle +.>
The quaternion calculation formula comprises:
wherein,,and the Euler angle difference value is the Euler angle difference value of the first rotation matrix and the second rotation matrix.
In this embodiment, the computer device 1 calculates the euler angles of the first rotation matrices, respectivelyAnd Euler angle of said second rotation matrix>Thereby obtaining Euler angle difference +.> And calculating to obtain a quaternion delta q through a quaternion calculation formula, wherein the quaternion represents a rotation degree.
Next, the computer device 1 calculates a translation vector from the first translation matrix and the second translation matrix, specifically, the computer device 1 calculates a translation vector Δp according to the following formula:
Δp=(m 30 -m' 30 ,m 31 -m' 31 ,m 32 -m' 32 ) The translation vector Δp is calculated, where m30, m31, m32 are the values of 0 to 2 rows of column 3 of the first translation matrix, and m30', m31', m32' are the values of 0 to 2 rows of column 3 of the second translation matrix.
After the computer device 1 calculates the quaternion Δq and the translation vector Δp, the local origin of coordinates of the local coordinate system is rotated according to the quaternion Δq, and the local origin of coordinates of the local coordinate system is translated according to the translation vector Δp, so as to obtain a new local origin of coordinates.
Of course, in an exemplary embodiment, referring to fig. 6, the method further includes: respectively extracting a first scaling matrix S and a second scaling matrix S ' in anchor matrixes corresponding to the cloud anchor points and the local anchor points, a first rotation matrix R and a second rotation matrix R ', and a first translation matrix T and a second translation matrix T ', and then comparing whether the difference value of the first scaling matrix and the second scaling matrix is larger than or equal to a preset threshold value; if the difference is greater than or equal to the threshold, the computer device 1 considers that the difference between the cloud anchor point and the local anchor point is too large, and cannot load the virtual environment data corresponding to the cloud anchor point into the local coordinate system, and then no further operation is performed. When the difference is smaller than the threshold, a quaternion Δq is calculated from the first rotation matrix R and the second rotation matrix R ', and a translation vector Δp is calculated from the first translation matrix T and the second translation matrix T'. Finally, the computer device 1 transforms the local origin O according to the quaternion Δq and the translation vector Δp to obtain a new local origin O'.
Step S208, constructing a virtual environment.
In summary, the virtual environment data synchronization method provided by the embodiment can find out the second feature picture consistent with the first feature picture obtained by the first process from the cloud through the comparison method, and obtain the corresponding cloud anchor point information; then creating a local anchor point; then, four elements and translation vectors between the local anchor point and the cloud anchor point are calculated according to the local anchor point and the cloud anchor point; correcting the origin of the local coordinate system according to the four elements and the translation vector to obtain a new local origin; and finally, loading the virtual environment data where the cloud anchor point is positioned into a local virtual environment corresponding to the new local coordinate origin, thereby constructing the virtual environment with high accuracy. Then, the shooting unit of the computer device 1 continues to obtain other feature pictures, such as a third feature picture, and sequentially compares the feature pictures with the feature picture set stored in the cloud, and when a fourth feature picture similar to the third feature picture exists in the cloud, a cloud anchor point corresponding to the fourth feature picture is obtained, and the steps of correcting the origin of the local coordinate system and constructing the virtual environment are re-executed. According to the embodiment, the AR scene can be restored by calculating only a few features, the time consumption of a link is shortened, the function stability is ensured, and the synchronism of loading the cloud virtual environment data to the local virtual environment can be better realized.
Of course, the computer device 1 may load the virtual environment corresponding to the cloud anchor point according to the identified feature picture; local anchor points can be added in the constructed virtual environment and then uploaded to the cloud end for other user ends to share virtual environment data.
Example two
Fig. 7 schematically shows a block diagram of a virtual environment data synchronization apparatus according to a second embodiment of the present application, which may be divided into one or more program modules, which are stored in a storage medium and executed by one or more processors, to complete the embodiment of the present application. Program modules in accordance with the embodiments of the present application are directed to a series of computer program instruction segments capable of performing the specified functions, and the following description describes each program module in detail.
As shown in fig. 7, the virtual environment data synchronization apparatus 400 may include a first acquisition module 410, a second acquisition module 420, a setup module 430, a rectification module 440, and a loading module 450, wherein:
the first obtaining module 410 is configured to obtain a first feature picture.
The second obtaining module 420 is configured to obtain a second feature picture similar to the first feature picture in the cloud server, and obtain a cloud anchor point corresponding to the second feature picture.
The establishing module 430 is configured to establish a local coordinate system, and set a local anchor point for the first feature picture.
And the correction module 440 is configured to correct the local coordinate system according to the cloud anchor point and the local anchor point, so that the origin of the local coordinate system coincides with the origin of the coordinate system corresponding to the cloud anchor point.
And a loading module 450, configured to construct a virtual environment.
In an exemplary embodiment, the establishing module 430 is further configured to obtain an anchor point creation rule of the cloud anchor point, and set a local anchor point for the first feature picture according to the anchor point creation rule; wherein the anchor point creation rule includes: establishing an anchor point according to the position relation between the anchor point and the characteristic picture and the geometric information of the characteristic picture; wherein the geometric information includes position, angle and direction.
In an exemplary embodiment, the rectification module 440 is further configured to calculate a quaternion and a translation vector between the local anchor point and the cloud anchor point; and correcting the origin of coordinates of the local coordinate system according to the quaternion and the translation vector.
In an exemplary embodiment, the rectification module 440 is further configured to extract a rotation matrix and a translation matrix in the anchor matrix corresponding to the cloud anchor point and the local anchor point, respectively, to obtain a first rotation matrix and a first translation matrix, and a second rotation matrix and a second translation matrix; and calculating quaternions from the first rotation matrix and the second rotation matrix, and calculating translation vectors from the first translation matrix and the second translation matrix. The correction module 440 is configured to extract a rotation matrix and a translation matrix in anchor matrices corresponding to the cloud anchor and the local anchor respectively according to the following formula, where the formula includes:
wherein M is an anchor matrix, l1, l2, l3 are the lengths of vectors formed by the 0 th column, the 1 st column and the 2 nd column of the anchor matrix M respectively, T is a translation matrix, and R is a rotation matrix.
In an exemplary embodiment, the correction module 440 calculates quaternions from the first rotation matrix and the second rotation matrix comprises: respectively calculating Euler angles of the first rotation matrix and the second rotation matrix according to Euler angle calculation formulas; and calculating the quaternion according to a quaternion calculation formula and the Euler angle difference value of the first rotation matrix and the second rotation matrix. Wherein,,
the euler angle calculation formula includes:
wherein R is a rotation matrix, euler angle +.>
The quaternion calculation formula comprises:
wherein,,and the Euler angle difference value is the Euler angle difference value of the first rotation matrix and the second rotation matrix.
In an exemplary embodiment, the correction module 440 is configured to correct the correction according to the formula Δp= (m) 30 -m' 30 ,m 31 -m' 31 ,m 32 -m' 32 ) The translation vector Δp is calculated, where m30, m31, m32 are the values of 0 to 2 rows of column 3 of the first translation matrix, and m30', m31', m32' are the values of 0 to 2 rows of column 3 of the second translation matrix.
Example III
Fig. 8 schematically shows a hardware architecture diagram of a computer device 1 adapted to implement a virtual environment data synchronization method according to a third embodiment of the present application. In the present embodiment, the computer apparatus 1 is an apparatus capable of automatically performing numerical calculation and/or information processing in accordance with an instruction set or stored in advance. For example, the server may be a rack server, a blade server, a tower server, or a rack server (including a stand-alone server or a server cluster formed by a plurality of servers) with a gateway function, or the like. As shown in fig. 8, the computer device 1 includes at least, but is not limited to: the memory 510, processor 520, and network interface 530 may be communicatively linked to each other by a system bus. Wherein:
the memory 510 includes at least one type of computer-readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 510 may be an internal storage module of the computer device 1, such as a hard disk or memory of the computer device 1. In other embodiments, the memory 510 may also be an external storage device of the computer device 1, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 1. Of course, the memory 510 may also include both internal memory modules of the computer device 1 and external memory devices. In this embodiment, the memory 510 is typically used to store an operating system installed on the computer device 1 and various types of application software, such as program codes of a virtual environment data synchronization method, and the like. In addition, the memory 510 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 520 may be a central processing unit (Central Processing Unit, simply CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 520 is generally used to control the overall operation of the computer device 1, such as performing control and processing related to data interaction or communication with the computer device 1, and the like. In this embodiment, the processor 520 is configured to execute program codes or process data stored in the memory 510.
The network interface 530 may comprise a wireless network interface or a wired network interface, which network interface 530 is typically used to establish a communication link between the computer device 1 and other computer devices. For example, the network interface 530 is used to connect the computer device 1 to an external terminal through a network, establish a data transmission channel and a communication link between the computer device 1 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, abbreviated as GSM), wideband code division multiple access (Wideband Code Division Multiple Access, abbreviated as WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, etc.
It should be noted that FIG. 8 only shows a computer device having components 510-530, but it should be understood that not all of the illustrated components are required to be implemented, and that more or fewer components may be implemented instead.
In this embodiment, the program code of the virtual environment data synchronization method stored in the memory 510 may be further divided into one or more program modules and executed by one or more processors (the processor 520 in this embodiment) to complete the embodiment of the present application.
Example IV
The present embodiment also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring a first feature picture, and comparing the first feature picture with feature pictures of a feature picture set of a cloud server one by one in a consistency way; when the first characteristic picture is consistent with a second characteristic picture in the characteristic picture set, cloud anchor point information on the second characteristic picture is obtained, wherein the cloud anchor point information comprises at least one cloud anchor point and a corresponding anchor point creation rule; establishing a local anchor point according to the anchor point establishing rule and the geometric information of the first characteristic picture; calculating quaternion and translation vector between the local anchor point and the cloud anchor point; correcting a local coordinate origin of a local coordinate system according to the quaternion and the translation vector to obtain a new local coordinate origin; and loading the virtual environment data where the cloud anchor point is positioned into a local virtual environment corresponding to the new local coordinate origin.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), etc. that are provided on the computer device. Of course, the computer-readable storage medium may also include both internal storage units of a computer device and external storage devices. In this embodiment, the computer readable storage medium is typically used to store an operating system and various types of application software installed on a computer device, such as program codes of a component management method of a service platform in the embodiment, and the like. Furthermore, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or a plurality of modules or steps in them may be fabricated into a single integrated circuit module. Thus, embodiments of the application are not limited to any specific combination of hardware and software.
The foregoing description is only the preferred embodiments of the present application, and is not intended to limit the scope of the embodiments of the present application, but rather the equivalent structures or equivalent flow changes made by the descriptions of the embodiments of the present application and the contents of the drawings, or the direct or indirect application in other related technical fields, are all included in the scope of the embodiments of the present application.

Claims (10)

1. A method for synchronizing data in a virtual environment, the method comprising:
acquiring a first characteristic picture;
acquiring a second characteristic picture with the similarity larger than a preset threshold value from a cloud server, and acquiring a cloud anchor point corresponding to the second characteristic picture;
establishing a local coordinate system, and setting a local anchor point for the first feature picture based on an anchor point creation rule of the cloud anchor point;
correcting the local coordinate system according to the cloud anchor point and the local anchor point, so that the origin of the local coordinate system coincides with the origin of the coordinate system corresponding to the cloud anchor point;
and loading the virtual environment data where the cloud anchor points are positioned in the corrected local virtual environment corresponding to the local coordinate system, and constructing a virtual environment.
2. The virtual environment data synchronization method of claim 1, wherein the setting a local anchor point for the first feature picture based on an anchor point creation rule of the cloud anchor point comprises: acquiring an anchor point creation rule of the cloud anchor point, and setting a local anchor point for the first characteristic picture according to the anchor point creation rule; wherein the anchor point creation rule includes: establishing an anchor point according to the position relation between the anchor point and the characteristic picture and the geometric information of the characteristic picture; the geometric information includes position, angle and direction.
3. The method of claim 1, wherein said correcting said local coordinate system comprises:
calculating quaternion and translation vector between the local anchor point and the cloud anchor point;
and correcting the origin of coordinates of the local coordinate system according to the quaternion and the translation vector.
4. The virtual environment data synchronization method of claim 3, wherein the computing a quaternion and a translation vector between the local anchor and the cloud anchor comprises:
respectively extracting rotation matrixes and translation matrixes in anchor matrixes corresponding to the cloud anchor points and the local anchor points to obtain a first rotation matrix and a first translation matrix and a second rotation matrix and a second translation matrix;
a quaternion is calculated from the first rotation matrix and the second rotation matrix, and a translation vector is calculated from the first translation matrix and the second translation matrix.
5. The method of claim 4, wherein the method is used for extracting the rotation matrix and the translation matrix in the anchor matrix corresponding to the cloud anchor and the local anchor respectively by the following formula, and the method comprises the following formula:
,/>,/>
wherein M is an anchor matrix, l1, l2, l3 are the lengths of vectors formed by the 0 th column, the 1 st column and the 2 nd column of the anchor matrix M respectively, T is a translation matrix, and R is a rotation matrix.
6. The virtual environment data synchronization method of claim 4, wherein the computing a quaternion from the first rotation matrix and the second rotation matrix comprises:
respectively calculating Euler angles of the first rotation matrix and the second rotation matrix according to Euler angle calculation formulas;
calculating quaternion according to a quaternion calculation formula and Euler angle difference values of the first rotation matrix and the second rotation matrix;
wherein the euler angle calculation formula includes:
,/>wherein R is a rotation matrix, and Euler angles e (phi, theta, phi);
the quaternion calculation formula comprises:
wherein (Δφ, Δθ, Δψ) is the Euler angle difference of the first rotation matrix and the second rotation matrix.
7. The virtual environment data synchronization method of claim 4, wherein the calculating a translation vector from the first translation matrix and the second translation matrix comprises:
according to the formulaCalculating a translation vector Δp, wherein m30, m31, m32 are values of 0 to 2 rows of the 3 rd column of the first translation matrix, m30', m31', m32' are values of 0 to 2 rows of the 3 rd column of the second translation matrix。
8. A virtual environment data synchronization apparatus, the apparatus comprising:
the first acquisition module is used for acquiring a first characteristic picture;
the second acquisition module is used for acquiring a second characteristic picture with the similarity larger than a preset threshold value from the cloud server, and acquiring a cloud anchor point corresponding to the second characteristic picture;
the establishing module is used for establishing a local coordinate system and setting a local anchor point for the first characteristic picture based on an anchor point establishing rule of the cloud anchor point;
the correction module is used for correcting the local coordinate system according to the cloud anchor point and the local anchor point, so that the origin of the local coordinate system coincides with the origin of the coordinate system corresponding to the cloud anchor point;
and the loading module is used for loading the virtual environment data where the cloud anchor points are positioned in the corrected local virtual environment corresponding to the local coordinate system to construct a virtual environment.
9. A computer device comprising a memory, a processor, the memory having stored thereon a computer program executable on the processor, the computer program implementing the steps of the virtual environment data synchronization method according to any of claims 1-7 when executed by the processor.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program executable by at least one processor to cause the at least one processor to perform the steps of the virtual environment data synchronization method according to any one of claims 1-7.
CN202010309515.5A 2020-04-20 2020-04-20 Virtual environment data synchronization method and device Active CN113542328B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010309515.5A CN113542328B (en) 2020-04-20 2020-04-20 Virtual environment data synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010309515.5A CN113542328B (en) 2020-04-20 2020-04-20 Virtual environment data synchronization method and device

Publications (2)

Publication Number Publication Date
CN113542328A CN113542328A (en) 2021-10-22
CN113542328B true CN113542328B (en) 2023-08-29

Family

ID=78093591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010309515.5A Active CN113542328B (en) 2020-04-20 2020-04-20 Virtual environment data synchronization method and device

Country Status (1)

Country Link
CN (1) CN113542328B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011129907A1 (en) * 2010-04-13 2011-10-20 Sony Computer Entertainment America Llc Calibration of portable devices in a shared virtual space
US8467992B1 (en) * 2010-09-15 2013-06-18 The Boeing Company Vision based location and measurement device and methods
CN108376411A (en) * 2018-01-16 2018-08-07 上海交通大学 A kind of noncooperative target relative status calculation method based on binocular vision
CN108389264A (en) * 2018-02-07 2018-08-10 网易(杭州)网络有限公司 Coordinate system determines method, apparatus, storage medium and electronic equipment
CN109087359A (en) * 2018-08-30 2018-12-25 网易(杭州)网络有限公司 Pose determines method, pose determining device, medium and calculates equipment
CN109195675A (en) * 2016-05-31 2019-01-11 微软技术许可有限责任公司 Sharing of sparse slam coordinate systems

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9111347B2 (en) * 2009-07-29 2015-08-18 Metaio Gmbh Method for determining the pose of a camera with respect to at least one real object
US20180293756A1 (en) * 2016-11-18 2018-10-11 Intel Corporation Enhanced localization method and apparatus
US10140773B2 (en) * 2017-02-01 2018-11-27 Accenture Global Solutions Limited Rendering virtual objects in 3D environments
US20180350145A1 (en) * 2017-05-30 2018-12-06 Reston Restoration Augmented Reality Devices and Methods Thereof for Rendering Virtual Objects

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011129907A1 (en) * 2010-04-13 2011-10-20 Sony Computer Entertainment America Llc Calibration of portable devices in a shared virtual space
US8467992B1 (en) * 2010-09-15 2013-06-18 The Boeing Company Vision based location and measurement device and methods
CN109195675A (en) * 2016-05-31 2019-01-11 微软技术许可有限责任公司 Sharing of sparse slam coordinate systems
CN108376411A (en) * 2018-01-16 2018-08-07 上海交通大学 A kind of noncooperative target relative status calculation method based on binocular vision
CN108389264A (en) * 2018-02-07 2018-08-10 网易(杭州)网络有限公司 Coordinate system determines method, apparatus, storage medium and electronic equipment
CN109087359A (en) * 2018-08-30 2018-12-25 网易(杭州)网络有限公司 Pose determines method, pose determining device, medium and calculates equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
单位四元数、罗德里格转换模型与欧拉角的映射关系;程烺;《北京测绘》;20200131;全文 *

Also Published As

Publication number Publication date
CN113542328A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
CN109389665B (en) Texture obtaining method, device and equipment of three-dimensional model and storage medium
CN106709899B (en) Method, device and equipment for calculating relative positions of two cameras
US20220327792A1 (en) 3-d reconstruction using augmented reality frameworks
KR102268878B1 (en) Camera calibration
CN111145294B (en) Two-dimensional house type graph construction method and device and storage medium
CN112541484B (en) Face matting method, system, electronic device and storage medium
CN111325798B (en) Camera model correction method, device, AR implementation equipment and readable storage medium
CN111161173B (en) Image correction information acquisition method, image correction information acquisition device, image correction information model construction method, image correction information model construction device, and medium
CN111432119B (en) Image shooting method and device, computer readable storage medium and electronic equipment
US8531505B2 (en) Imaging parameter acquisition apparatus, imaging parameter acquisition method and storage medium
CN105701834B (en) Automatic picture backup device and method
CN108604374B (en) Image detection method and terminal
CN112017215B (en) Image processing method, device, computer readable storage medium and computer equipment
CN111325792B (en) Method, apparatus, device and medium for determining camera pose
CN110111364B (en) Motion detection method and device, electronic equipment and storage medium
CN113542328B (en) Virtual environment data synchronization method and device
CN111429529B (en) Coordinate conversion calibration method, electronic equipment and computer storage medium
CN113344789A (en) Image splicing method and device, electronic equipment and computer readable storage medium
JP2016218849A (en) Planar conversion parameter estimation device, method and program
CN112770015B (en) Data processing method and related device
CN113780286A (en) Object recognition method and device, storage medium and electronic device
CN112669404B (en) Image processing method, device, electronic equipment and storage medium
US20220207671A1 (en) Conversion of image
CN116246085B (en) Azimuth generating method and device for AR telescope
CN115797581A (en) Three-dimensional map alignment method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant