CN110737326A - Virtual object display method and device, terminal equipment and storage medium - Google Patents
Virtual object display method and device, terminal equipment and storage medium Download PDFInfo
- Publication number
- CN110737326A CN110737326A CN201810804399.7A CN201810804399A CN110737326A CN 110737326 A CN110737326 A CN 110737326A CN 201810804399 A CN201810804399 A CN 201810804399A CN 110737326 A CN110737326 A CN 110737326A
- Authority
- CN
- China
- Prior art keywords
- target area
- position information
- spatial position
- marker
- virtual object
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/006—Mixed reality
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/011—Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
- G06F3/012—Head tracking input arrangements
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Graphics (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Processing Or Creating Images (AREA)
Abstract
本申请实施例公开了一种虚拟对象的显示方法、装置、终端设备及存储介质,涉及显示技术领域。该虚拟对象的显示方法应用于终端设备,该方法包括:获取所述终端设备相对标记物的第一空间位置信息;获取所述标记物相对实物的目标区域的第二空间位置信息;基于所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;基于所述第三空间位置信息,将虚拟对象显示于所述实物的目标区域。本方法可以实现虚拟对象显示于实物的目标区域。
The embodiments of the present application disclose a method, device, terminal device and storage medium for displaying a virtual object, which relate to the technical field of display. The method for displaying a virtual object is applied to a terminal device, and the method includes: acquiring first spatial position information of the terminal device relative to a marker; acquiring second spatial position information of the marker relative to a target area of a real object; The first spatial position information and the second spatial position information determine the third spatial position information of the terminal device relative to the target area; based on the third spatial position information, the virtual object is displayed on the physical target area. The method can realize that the virtual object is displayed in the target area of the real object.
Description
技术领域technical field
本申请涉及显示技术领域,更具体地,涉及一种虚拟对象的显示方法、装置、终端设备及存储介质。The present application relates to the field of display technology, and more particularly, to a method, apparatus, terminal device and storage medium for displaying virtual objects.
背景技术Background technique
近年来,随着科技的进步,增强现实(AR,Augmented Reality)等技术已逐渐成为国内外研究的热点,增强现实是通过计算机系统提供的信息增加用户对现实世界感知的技术,其将计算机生成的虚拟对象、场景或系统提示信息等内容对象叠加到真实场景中,来增强或修改对现实世界环境或表示现实世界环境的数据的感知。在现有的增强现实的显示技术中,终端设备不能较好的将虚拟对象与实物结合进行显示。In recent years, with the advancement of science and technology, technologies such as augmented reality (AR, Augmented Reality) have gradually become the focus of research at home and abroad. Augmented reality is a technology that increases users' perception of the real world through information provided by computer systems. The content objects such as virtual objects, scenes or system prompt information are superimposed on the real scene to enhance or modify the perception of the real-world environment or data representing the real-world environment. In the existing augmented reality display technology, the terminal device cannot combine virtual objects with real objects to display well.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种虚拟对象的显示方法、装置、终端设备及存储介质,以较好的实现虚拟对象与实物的结合显示。Embodiments of the present application provide a method, device, terminal device and storage medium for displaying virtual objects, so as to better realize the combined display of virtual objects and real objects.
第一方面,本申请实施例提供了一种虚拟对象的显示方法,应用于终端设备,所述方法包括:获取所述终端设备相对标记物的第一空间位置信息;获取所述标记物相对实物的目标区域的第二空间位置信息;基于所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;基于所述第三空间位置信息,将虚拟对象显示于所述实物的目标区域。In a first aspect, an embodiment of the present application provides a method for displaying a virtual object, which is applied to a terminal device. The method includes: acquiring first spatial position information of the terminal device relative to a marker; acquiring the marker relative to a real object the second spatial location information of the target area; based on the first spatial location information and the second spatial location information, determine the third spatial location information of the terminal device relative to the target area; based on the third spatial location information The location information displays the virtual object in the target area of the object.
第二方面,本申请实施例提供了一种虚拟对象的显示装置,应用于终端设备,所述装置包括:第一位置获取模块、第二位置获取模块、第三位置获取模块以及显示执行模块,其中,所述第一位置获取模块用于获取所述终端设备相对标记物的第一空间位置信息;所述第二位置获取模块用于获取所述标记物相对实物的目标区域的第二空间位置信息;所述第三位置获取模块用于基于所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;所述显示执行模块用于基于所述第三空间位置信息,将虚拟对象显示于所述目标区域。In a second aspect, an embodiment of the present application provides a device for displaying a virtual object, which is applied to a terminal device. The device includes: a first position acquisition module, a second position acquisition module, a third position acquisition module, and a display execution module, Wherein, the first position acquisition module is used to acquire the first spatial position information of the terminal device relative to the marker; the second position acquisition module is used to acquire the second spatial position of the marker relative to the physical target area information; the third position acquisition module is configured to determine the third spatial position information of the terminal device relative to the target area based on the first spatial position information and the second spatial position information; the display execution module for displaying the virtual object in the target area based on the third spatial position information.
第三方面,本申请实施例提供了一种终端设备,包括存储器及处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器实现上述第一方面提供的虚拟对象的显示方法。In a third aspect, an embodiment of the present application provides a terminal device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor enables the processor to implement the above-mentioned first step. On the one hand, a display method of a virtual object is provided.
第四方面,本申请实施例提供了一种计算机存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面提供的虚拟对象的显示方法。In a fourth aspect, an embodiment of the present application provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the method for displaying a virtual object provided in the first aspect.
本申请提供的上述的虚拟对象的显示方法、装置、终端设备及存储介质,通过获取终端设备相对标记物的第一空间位置信息,然后获取标记物相对实物的目标区域的第二空间位置信息,再基于第一空间位置信息以及第二空间位置信息,确定终端设备相对目标区域的第三空间位置信息,最后基于第三空间位置信息,将虚拟对象显示于实物的目标区域,从而实现将虚拟对象显示于实物的目标区域,完成实物与虚拟对象的结合显示。The above-mentioned display method, device, terminal device and storage medium for virtual objects provided by the present application, by acquiring the first spatial position information of the terminal device relative to the marker, and then acquiring the second spatial position information of the marker relative to the target area of the real object, Then, based on the first spatial position information and the second spatial position information, the third spatial position information of the terminal device relative to the target area is determined, and finally based on the third spatial position information, the virtual object is displayed in the real target area, so as to realize the virtual object. It is displayed in the target area of the real object, and the combined display of the real object and the virtual object is completed.
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。These and other aspects of the present application will be more clearly understood in the description of the following embodiments.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
图1示出了本申请实施例提供的虚拟对象的显示方法的应用场景的一种示意图;FIG. 1 shows a schematic diagram of an application scenario of a method for displaying a virtual object provided by an embodiment of the present application;
图2示出了本申请实施例提供的虚拟对象的显示方法的应用场景的另一种示意图;FIG. 2 shows another schematic diagram of an application scenario of the method for displaying a virtual object provided by an embodiment of the present application;
图3示出了本申请实施例的终端设备的结构框图;3 shows a structural block diagram of a terminal device according to an embodiment of the present application;
图4示出了本申请一实施例提供的虚拟对象的显示方法的流程图;FIG. 4 shows a flowchart of a method for displaying a virtual object provided by an embodiment of the present application;
图5示出了本申请实施例提供的虚拟对象的显示方法的一种效果示意图;FIG. 5 shows a schematic diagram of an effect of a method for displaying a virtual object provided by an embodiment of the present application;
图6示出了本申请实施例提供的虚拟对象的显示方法的另一种效果示意图;FIG. 6 is a schematic diagram showing another effect of the method for displaying a virtual object provided by an embodiment of the present application;
图7示出了本申请另一实施例提供的虚拟对象的显示方法的流程图;FIG. 7 shows a flowchart of a method for displaying a virtual object provided by another embodiment of the present application;
图8示出了本申请实施例提供的虚拟对象的显示装置的一种结构框图;FIG. 8 shows a structural block diagram of a display device for a virtual object provided by an embodiment of the present application;
图9示出了本申请实施例提供的虚拟对象的显示装置的另一种结构框图。FIG. 9 shows another structural block diagram of a display device for a virtual object provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
请参阅图1,示出了本申请实施例提供的虚拟对象的显示方法的应用场景的示意图,该应用场景包括显示系统10。该显示系统10包括:终端设备100、标记物200以及实物300。Referring to FIG. 1 , it is a schematic diagram showing an application scenario of the method for displaying a virtual object provided by an embodiment of the present application, where the application scenario includes a display system 10 . The display system 10 includes: a
在本申请实施例中,标记物200可以处于终端设备100的视野范围内,标记物200可以放置于实物300表面,也可以放置于实物300的附近位置。例如,请参见图2,实物300为一平面,标记物200可以贴设于平面的一区域。In this embodiment of the present application, the
在本申请实施例中,终端设备100可以是头戴显示装置,也可以是手机、平板等移动设备。在终端设备100为头戴显示装置时,头戴显示装置可以为一体式头戴显示装置。终端设备100也可以是与外接式头戴显示装置连接的手机等智能终端,即终端设备100可作为头戴显示装置的处理和存储设备,插入或者接入外接式头戴显示装置,在头戴显示装置中对虚拟对象进行显示功能。In this embodiment of the present application, the
在本申请实施例中,请参见图3,终端设备100可以包括:存储器120、处理器110、显示装置130以及图像采集装置140。存储器120、显示装置130以及图像采集装置140均与处理器110连接。In this embodiment of the present application, referring to FIG. 3 , the
图像采集装置140用于采集待拍摄物体的图像并发送至处理器110。该图像采集装置140可以为红外摄像头、彩色摄像头等,图像采集装置的具体类型在本申请实施例中并不作为限定。The image capturing device 140 is used for capturing an image of the object to be photographed and sending it to the
处理器110可以包括任何适当类型的通用或专用微处理器、数字信号处理器或微控制器。处理器可以被配置为经由例如网络从系统的各种组件接收数据和/或信号。处理器110还可处理数据和/或信号以确定系统中的一个或多个操作条件。例如,处理器110根据预先存储的图像数据生成虚拟世界的图像数据,将其发送至显示装置进行显示;也可以通过有线或无线网络接收智能终端或计算机的发送的图像数据,根据所接收的图像数据生成虚拟世界的图像进行显示;还可以根据图像采集装置采集的图像进行识别定位,并根据定位信息确定在虚拟世界中对应的显示内容,发送至显示装置进行显示。可以理解的是,处理器110并不限定于装设在终端设备100内。
存储器120可用于存储软件程序以及模块,处理器110通过运行存储在存储器130内的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器130可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。The memory 120 may be used to store software programs and modules, and the
在本申请实施例中,在终端设备100为与外接式头戴显示装置连接的移动终端时,外接式头戴显示装置的显示装置以及摄像头与移动终端连接。可以理解的是,上述实施方式中的处理器执行的处理由移动终端的处理器执行,上述实施方式中的存储器存储的数据由移动终端的存储器进行存储。In this embodiment of the present application, when the
当然,以上终端设备100所包括的组件仅为举例,并不代表对本申请实施例中的终端设备100所包括的组件的限定,终端设备100也可以包括更多或更少的组件,例如,终端设备100也还可以包括通信模块,通信模块与处理器连接。通信模块用于终端设备100与其他设备之间的通信。Of course, the above components included in the
在本申请实施例中,标记物200放置于终端设备100的摄像头视野范围内,即摄像头可以采集到标记物200的图像。该标记物200的图像存储于终端设备中,用于定位终端设备相对标记物的位置。标记物200中可以包括至少一个子标记物,子标记物可以是具有一定形状的图案。在一个实施例中,每个子标记物可具有一个或多个特征点,其中,特征点的形状不做限定,可以是圆点、圆环,也可以是三角形、其他形状。本申请实施方式中,不同标记物内的子标记物的分布规则不同,因此,每个标记物200可具备不同的身份信息,终端设备100通过识别标记物200中包含的子标记物,可以获取与标记物200对应的身份信息,该身份信息可以是编码等可用于唯一标识标记物200的信息,但不限于此。In this embodiment of the present application, the
作为一种实施方式,标记物200的轮廓可以为矩形,当然,标记物200的形状也可以是其他形状,在此不做限定,矩形的区域以及该区域内的多个子标记物构成一个标记物200。在本申请实施例中,标记物200可以为终端设备可以识别追踪的图案。需要说明的是,具体的标记物200在本申请实施例中并不作为限定,仅需要标记物能被终端设备识别追踪即可。As an embodiment, the outline of the
用户在使用终端设备时,当标记物200在终端设备的视野范围内时,终端设备可以采集到包含有标记物200的标记物图像。终端设备的处理器获取到标记物图像及相关信息,对标记物图像进行识别,获得标记物200的身份信息,并获取到该标记物200与终端设备的摄像头之间的位置与旋转关系,进而得到标记物相对于终端设备的位置及旋转关系。When the user is using the terminal device, when the
针对上述的显示系统,本申请实施例提供了一种虚拟对象的显示方法,具体地,请参阅以下实施例。请参阅图4,示出了一种虚拟对象的显示方法。如图4所示,该方法包括:For the above-mentioned display system, an embodiment of the present application provides a method for displaying a virtual object. Specifically, please refer to the following embodiments. Referring to FIG. 4, a display method of a virtual object is shown. As shown in Figure 4, the method includes:
步骤S110:获取终端设备相对标记物的第一空间位置信息。Step S110: Obtain first spatial position information of the terminal device relative to the marker.
在本申请实施例中,终端设备可以对其图像采集装置的视野范围内的标记物进行识别,以获得终端设备相对标记物的第一空间位置信息。对标记物进行识别,除可以获得终端设备相对标记物的第一空间位置信息之外,还可以获得标记物的身份信息以及姿态信息。In this embodiment of the present application, the terminal device may identify markers within the field of view of the image acquisition device to obtain first spatial position information of the terminal device relative to the markers. When identifying the marker, in addition to obtaining the first spatial position information of the terminal device relative to the marker, the identity information and posture information of the marker can also be obtained.
其中,不同的标记物可以具有不同身份信息,标记物与其身份信息的对应关系存储于终端设备中。另外,可以将标记物的身份信息与相关数据的对应关系存储于终端设备,以用于终端设备在识别出标记物的身份信息之后,可以利用标记物的身份信息,读取标记物所对应的数据,例如,读取标记物所对应的虚拟对象的模型数据等。Wherein, different markers may have different identity information, and the corresponding relationship between the markers and their identity information is stored in the terminal device. In addition, the correspondence between the identity information of the marker and the relevant data can be stored in the terminal device, so that after the terminal device recognizes the identity information of the marker, the identity information of the marker can be used to read the corresponding data of the marker. Data, for example, read the model data of the virtual object corresponding to the marker.
作为一种实施方式,获取终端设备相对标记物的第一空间位置信息,可以包括:采集包含有标记物的图像;识别包含有标记物的图像,得到终端设备相对标记物的第一空间位置信息。As an implementation manner, acquiring the first spatial position information of the terminal device relative to the marker may include: collecting an image containing the marker; identifying the image containing the marker to obtain the first spatial position information of the terminal device relative to the marker .
可以理解的是,终端设备可以利用图像采集装置对视野范围内的标记物进行图像采集,从而获得包含有标记物的图像。终端设备根据包含有标记物的图像中对标记物进行识别追踪,以得到终端设备相对于标记物的空间位置信息。空间位置信息表示标记物的六自由度信息,包括位置信息和姿态信息等。其中,姿态信息为标记物相对终端设备的朝向、旋转角度等。It can be understood that, the terminal device can use the image acquisition device to perform image acquisition on the markers within the field of view, so as to obtain an image containing the markers. The terminal device identifies and tracks the marker according to the image containing the marker, so as to obtain spatial position information of the terminal device relative to the marker. The spatial position information represents the six-degree-of-freedom information of the marker, including position information and attitude information. The attitude information is the orientation, rotation angle, etc. of the marker relative to the terminal device.
在终端设备的位置发生变化时,终端设备利用摄像头所获取到的标记物图像也会发生变化,即获取到不同视角的标记物图像,这些不同视角的标记物图像中标记物的内容将会不同。因此,终端设备根据于不同位置获取的标记物图像,所识别到的标记物相对终端设备的朝向、旋转角度等将会不同。When the position of the terminal device changes, the marker image obtained by the terminal device using the camera will also change, that is, marker images from different perspectives are acquired, and the content of the markers in these marker images from different perspectives will be different. . Therefore, according to the marker images acquired by the terminal device at different positions, the orientation, rotation angle, etc. of the recognized marker relative to the terminal device will be different.
例如,标记物的轮廓为包括多个不同图案的子标记物的矩形贴纸时,终端设备处于矩形贴纸的第一侧的前上方,且图像采集装置朝向矩形贴纸的第一侧时,终端设备所获取到的标记物图像为从标记物的第一侧的视角获取的图像,根据该图像则可以识别出标记物的第一侧朝向终端设备,以及标记物的朝向与正对方向的角度等。For example, when the outline of the marker is a rectangular sticker including multiple sub-markers with different patterns, the terminal device is located in front of and above the first side of the rectangular sticker, and when the image capture device faces the first side of the rectangular sticker, the terminal device The acquired image of the marker is an image obtained from the perspective of the first side of the marker. According to the image, it can be identified that the first side of the marker faces the terminal device, and the angle between the facing direction and the facing direction of the marker.
另外,在标记物对应有存储的信息时,还可以通过识别标记物而获得标记物对应的存储信息。例如,标记物A对应有用于显示的虚拟对象1,则终端设备在通过识别标记物A获得标记物A的身份信息之后,基于标记物A与虚拟对象1的对应关系,获得虚拟对象1。In addition, when the marker corresponds to the stored information, the stored information corresponding to the marker can also be obtained by identifying the marker. For example, if marker A corresponds to virtual object 1 for display, after obtaining the identity information of marker A by identifying marker A, the terminal device obtains virtual object 1 based on the corresponding relationship between marker A and virtual object 1 .
终端设备可以从包含有标记物的图像中任意选取特定数量的特征点作为目标特征点,用于确定终端设备(摄像头)与具有目标特征点的标记物之间的真实的位置信息以及姿态信息。其中,终端设备可以获取所有目标特征点的像素坐标。然后,根据所有特征点的像素坐标和预先获取的所有特征点的物理坐标,获取终端设备与标记物之间的位置信息以及姿态信息,其中,物理坐标为预先获取的特征点在标记物对应的物理坐标系中的坐标,各个特征点的物理坐标可以预先获取并存储于终端设备中。The terminal device can arbitrarily select a specific number of feature points from the image containing the marker as the target feature point to determine the real position information and attitude information between the terminal device (camera) and the marker with the target feature point. Wherein, the terminal device can obtain the pixel coordinates of all target feature points. Then, according to the pixel coordinates of all the feature points and the pre-acquired physical coordinates of all the feature points, the position information and attitude information between the terminal device and the marker are acquired, wherein the physical coordinates are the pre-acquired feature points corresponding to the marker. The coordinates in the physical coordinate system, the physical coordinates of each feature point can be acquired in advance and stored in the terminal device.
终端设备还可以通过识别包含有标记物的图像中的特征点,确定出标记物的身份信息。The terminal device can also determine the identity information of the marker by identifying the feature points in the image containing the marker.
当然,具体对包含有标记物的图像进行识别获得终端设备相对标记物的位置信息、姿态信息以及身份信息的方式,在本申请实施例中并不作限定。Of course, the specific manner of identifying the image containing the marker to obtain the position information, posture information and identity information of the terminal device relative to the marker is not limited in the embodiments of the present application.
步骤S120:获取标记物相对实物的目标区域的第二空间位置信息。Step S120: Acquire second spatial position information of the marker relative to the target area of the object.
在获得终端设备相对标记物的第一空间位置信息之后,可以再获取标记物相对实物的目标区域的第二空间位置信息,以便于后续确定终端设备与目标区域的相对位置关系,其中,实物的目标区域为需要将虚拟对象展示于实物的某块区域。例如,如图5所示,实物300为平面时,标记物200贴设于平面300,此时,目标区域400为平面上的一区域,后续将虚拟对象显示时,则将虚拟对象显示于平面的该区域。After the first spatial position information of the terminal device relative to the marker is obtained, the second spatial position information of the marker relative to the target area of the object can be obtained, so as to facilitate the subsequent determination of the relative positional relationship between the terminal device and the target area. The target area is a certain area where the virtual object needs to be displayed on the real object. For example, as shown in FIG. 5 , when the
在本申请实施例中,标记物相对实物的目标区域的第二空间位置信息可以预先存储于终端设备中,由终端设备读取该第二空间位置信息。也可以是终端设备实时获取标记物相对实物的目标区域的第二空间位置信息。In the embodiment of the present application, the second spatial position information of the marker relative to the target area of the real object may be pre-stored in the terminal device, and the second spatial position information can be read by the terminal device. It may also be that the terminal device acquires the second spatial position information of the marker relative to the real target area in real time.
步骤S130:基于第一空间位置信息以及第二空间位置信息,确定终端设备相对目标区域的第三空间位置信息。Step S130: Based on the first spatial location information and the second spatial location information, determine third spatial location information of the terminal device relative to the target area.
可以理解的是,在获得终端设备相对标记物的第一空间位置信息以及标记物相对实物的目标区域的第二空间位置信息之后,则可以根据第一空间位置信息以及第二空间位置信息,以标记物作为参照,获得终端设备相对目标区域的第三空间位置信息。It can be understood that, after obtaining the first spatial position information of the terminal device relative to the marker and the second spatial position information of the marker relative to the target area of the real object, it can be based on the first spatial position information and the second spatial position information. The marker is used as a reference to obtain third spatial position information of the terminal device relative to the target area.
步骤S140:基于第三空间位置信息,将虚拟对象显示于实物的目标区域。Step S140: Display the virtual object in the target area of the real object based on the third spatial position information.
在本申请实施例中,在获得终端设备相对目标区域的第三空间位置信息之后,可根据该第三空间位置信息计算得到虚拟对象在虚拟空间中的显示坐标,并根据显示坐标显示虚拟对象,使虚拟对象显示于需要显示的目标区域。In the embodiment of the present application, after obtaining the third spatial position information of the terminal device relative to the target area, the display coordinates of the virtual object in the virtual space can be calculated according to the third spatial position information, and the virtual object is displayed according to the display coordinates, Make the virtual object display in the target area that needs to be displayed.
作为一种方式,基于第三空间位置信息,将虚拟对象显示于实物的目标区域,可以包括:As a method, based on the third spatial position information, displaying the virtual object in the target area of the real object may include:
获取虚拟对象与目标区域之间的缩放比例;基于缩放比例,以及第三空间位置信息确定虚拟对象的显示坐标;基于显示坐标将虚拟对象显示于目标区域。acquiring the zoom ratio between the virtual object and the target area; determining the display coordinates of the virtual object based on the zoom ratio and the third spatial position information; and displaying the virtual object in the target area based on the display coordinates.
在本申请实施例中,上述虚拟对象可以是与标记物对应,即与标记物的身份信息对应,虚拟对象也可以是在终端设备中预先创建的虚拟对象。在具体将虚拟对象与实物结合进行展示时,存在所要展示的虚拟对象的模型大小会大于或者小于实物的目标区域大小的情况,如果不对虚拟对象的大小进行缩放,则会导致展示的虚拟对象过大或者过小,虚拟对象无法与实物的目标区域对齐,无法达到虚拟对象显示于实物的目标区域的效果。In the embodiment of the present application, the above-mentioned virtual object may be corresponding to a marker, that is, corresponding to the identity information of the marker, and the virtual object may also be a virtual object pre-created in the terminal device. When the virtual object is displayed in combination with the real object, the size of the model of the virtual object to be displayed may be larger or smaller than the target area size of the real object. If the size of the virtual object is not scaled, the displayed virtual object will be too large. If it is too large or too small, the virtual object cannot be aligned with the target area of the real object, and the effect of displaying the virtual object in the target area of the real object cannot be achieved.
因此,在获得终端相对目标区域的第三空间位置信息之后,可以获取虚拟对象与目标区域之间的缩放比例,以对虚拟对象进行缩放后根据显示坐标显示于实物的目标区域。Therefore, after obtaining the third spatial position information of the terminal relative to the target area, the zoom ratio between the virtual object and the target area can be obtained, so as to scale the virtual object and display it in the real target area according to the display coordinates.
进一步的,可以根据虚拟对象与实物的目标区域的比值计算缩放比例,以实现对虚拟对象的缩放。具体地,缩放比例即虚拟对象的大小和目标区域的大小的比值,其中,大小的比值可指的是所占面积的大小。例如,虚拟对象在虚拟空间中所占的面积大小为50m(米)*50m,实物的目标区域的大小为1m*1m等,则虚拟对象与目标区域的缩放比例为50:1,但不限于此,虚拟对象与目标区域也可以是其他任意大小。虚拟对象的大小可以是在虚拟对象模型建好之后确定的大小,目标区域的大小可以是用户选取的区域所占实物比例,与预先存储的实物的面积的乘积所得。Further, the scaling ratio can be calculated according to the ratio of the virtual object to the target area of the real object, so as to realize the scaling of the virtual object. Specifically, the scaling ratio is the ratio of the size of the virtual object to the size of the target area, where the ratio of the size may refer to the size of the occupied area. For example, the size of the area occupied by the virtual object in the virtual space is 50m (meters) * 50m, and the size of the target area of Therefore, the virtual object and the target area may be any other size. The size of the virtual object may be determined after the virtual object model is built, and the size of the target area may be the product of the proportion of the real object occupied by the region selected by the user and the area of the pre-stored real object.
根据虚拟对象与目标区域的比值计算缩放比例,可以包括将虚拟对象与目标区域的所占面积大小比值作为缩放比例,或者将虚拟对象与目标区域的所占面积大小的比值乘以预设系数后作为缩放比例。Calculating the scaling ratio according to the ratio between the virtual object and the target area may include taking the ratio of the area occupied by the virtual object and the target area as the scaling ratio, or multiplying the ratio of the area occupied by the virtual object and the target area by a preset coefficient. as the zoom ratio.
也就是说,对虚拟对象的缩放比值可以是虚拟对象与目标区域的比值,这样虚拟对象就能与目标区域对齐,实现虚拟对象叠加于目标区域;对虚拟对象的缩放比值也可以是虚拟对象与目标区域的比值乘以预设系数,例如预设系数可以是0.7~1.3之间,也可以根据用户的观感体验设置经验系数,允许对齐存在一定的偏差值的同时保证用户的体验。可以采用灵活的缩放比例实现虚拟对象与目标区域大小的自适配,提升用户观看的体验。That is to say, the zoom ratio of the virtual object can be the ratio of the virtual object to the target area, so that the virtual object can be aligned with the target area, so that the virtual object can be superimposed on the target area; the zoom ratio of the virtual object can also be the virtual object and the target area. The ratio of the target area is multiplied by a preset coefficient, for example, the preset coefficient can be between 0.7 and 1.3, or an experience coefficient can be set according to the user's visual experience, allowing the alignment to have a certain deviation value while ensuring the user's experience. A flexible scaling ratio can be used to realize the self-adaptation of the virtual object and the size of the target area, so as to improve the user's viewing experience.
在获得虚拟对象的缩放比例后,按照缩放比例对需要展示的虚拟对象进行缩放。终端设备可以读取虚拟对象对应的数据,数据可以包括虚拟对象的模型数据,模型数据为用于渲染虚拟对象的数据,可以包括用于建立虚拟对象对应的模型的颜色、3D模型中的各顶点坐标等,终端设备根据虚拟对象对应的数据对虚拟对象的大小进行缩放。After the scaling ratio of the virtual object is obtained, the virtual object to be displayed is scaled according to the scaling ratio. The terminal device can read the data corresponding to the virtual object, and the data can include the model data of the virtual object. The model data is the data used to render the virtual object, and can include the color used to create the model corresponding to the virtual object, and the vertices in the 3D model. Coordinates, etc., the terminal device scales the size of the virtual object according to the data corresponding to the virtual object.
例如,终端设备显示一条某颜色的线段,则可以将该线段的3D点队列(多个虚拟空间中的点坐标)、线段的粗度、线段的颜色等数据作为虚拟对象的模型数据。For example, if the terminal device displays a line segment of a certain color, data such as the 3D point queue (point coordinates in multiple virtual spaces) of the line segment, the thickness of the line segment, and the color of the line segment can be used as the model data of the virtual object.
终端设备在计算虚拟对象在显示空间的显示坐标时,可由终端设备相对目标区域的第三空间位置信息,获得目标区域在真实空间中的坐标,然后将目标区域在真实空间中的坐标转换为终端设备的显示空间中的坐标,即获得了需要于目标区域进行显示的虚拟对象,在终端设备的显示空间中的显示坐标。终端设备可在计算得到的显示坐标处渲染虚拟对象,使终端设备显示的虚拟对象的真实位置,与终端设备的视野中目标区域的真实位置相同,即虚拟对象的显示位置对应于真实场景中的目标区域。例如,请参见图6,实物300为平面时,标记物200设置于该平面上,虚拟对象500显示于该平面的目标区域400。When the terminal device calculates the display coordinates of the virtual object in the display space, it can obtain the coordinates of the target area in the real space from the third space position information of the terminal device relative to the target area, and then convert the coordinates of the target area in the real space into the terminal device. The coordinates in the display space of the device, that is, the display coordinates of the virtual object that needs to be displayed in the target area in the display space of the terminal device are obtained. The terminal device can render the virtual object at the calculated display coordinates, so that the real position of the virtual object displayed by the terminal device is the same as the real position of the target area in the field of view of the terminal device, that is, the display position of the virtual object corresponds to the real position in the real scene. target area. For example, referring to FIG. 6 , when the
用户可以通过终端设备观察虚拟对象,终端设备的用户可以进行位置的移动,虚拟对象也会随用户位置的移动而变化,例如,终端设备远离虚拟对象于真实场景中的位置时,则虚拟对象变小,反之,靠近虚拟对象于真实场景中的位置时,虚拟对象变大等。The user can observe the virtual object through the terminal device, the user of the terminal device can move the position, and the virtual object will also change with the movement of the user's position. For example, when the terminal device is far away from the position of the virtual object in the real scene, the virtual object changes. On the contrary, when the virtual object is close to the position in the real scene, the virtual object becomes larger and so on.
另外,终端设备的用户在可以通过自己的视角观察虚拟对象时,也可以进行显示内容的录制,以便于本次观察以后的观察以及分析。In addition, when the user of the terminal device can observe the virtual object from his own perspective, he can also record the displayed content, so as to facilitate the observation and analysis after the current observation.
本申请实施例提供的虚拟对象的显示方法,通过获取终端设备相对标记物的空间位置信息以及标记物相对实物的目标区域的空间位置信息后,确定出终端设备相对目标区域的空间位置信息,最后根据终端设备相对目标区域的空间位置信息确定出虚拟对象的显示坐标,将虚拟对象显示于该实物的目标区域,实现虚拟内容与实物之间的结合显示,提升用户的观看体验。In the display method of a virtual object provided by the embodiment of the present application, after obtaining the spatial position information of the terminal device relative to the marker and the spatial position information of the marker relative to the physical target area, the spatial position information of the terminal device relative to the target area is determined, and finally the spatial position information of the terminal device relative to the target area is determined. According to the spatial position information of the terminal device relative to the target area, the display coordinates of the virtual object are determined, and the virtual object is displayed in the target area of the real object, so as to realize the combined display between the virtual content and the real object, and improve the user's viewing experience.
在一个实施例中,请参阅图7,图7示出了本申请实施例提供的虚拟对象的显示方法的流程示意图。下面将针对图7所示的流程进行详细的阐述,虚拟对象的显示方法具体可以包括以下步骤:In one embodiment, please refer to FIG. 7 , which is a schematic flowchart of a method for displaying a virtual object provided by an embodiment of the present application. The flow shown in FIG. 7 will be described in detail below, and the method for displaying a virtual object may specifically include the following steps:
步骤S210:获取终端设备相对标记物的第一空间位置信息。Step S210: Obtain first spatial position information of the terminal device relative to the marker.
步骤S220:根据用户对实物的目标区域的选取指令,确定实物的目标区域。Step S220: Determine the target area of the physical object according to the user's instruction for selecting the target area of the physical object.
在本申请实施例中,可以根据用户利用控制设备对实物的目标区域的选取,确定实物的目标区域。具体的,步骤S220可以包括:In the embodiment of the present application, the target area of the physical object may be determined according to the selection of the target area of the physical object by the user using the control device. Specifically, step S220 may include:
根据控制设备发送的姿态信息、空间位置信息以及控制指令,获得用户选取的实物的目标区域。According to the attitude information, spatial position information and control instructions sent by the control device, the target area of the object selected by the user is obtained.
可以理解的是,用户在使用终端设备观看时,可以根据控制设备选取需要将虚拟对象显示于实体的目标区域。It can be understood that, when the user uses the terminal device to watch, the virtual object can be displayed in the target area of the entity according to the selection requirement of the control device.
例如,用户在佩戴头戴显示设备时,可以通过头戴显示设备观察到实物,然后用户通过控制设备移动,并利用控制设备的控制按键对需要显示虚拟对象的目标区域进行选取。即控制设备可以在其被移动的过程中,将其姿态信息、空间位置信息发送至终端设备,另外在用户利用按键对实物的目标区域进行选取时,控制设备可以将控制指令即控制设备的按键信息发送至终端设备。终端设备则可以接收到控制设备发送的姿态信息、空间位置信息以及控制指令后,根据控制设备的姿态信息、空间位置信息以及控制指令确定出用户需要选取的目标区域。For example, when the user wears the head-mounted display device, he can observe the real object through the head-mounted display device, and then the user moves through the control device, and uses the control buttons of the control device to select the target area where the virtual object needs to be displayed. That is, the control device can send its attitude information and spatial position information to the terminal device in the process of being moved. In addition, when the user selects the target area of the object by using the buttons, the control device can send the control instruction, that is, the button of the control device. The information is sent to the terminal device. After receiving the attitude information, spatial position information and control instructions sent by the control equipment, the terminal equipment can determine the target area to be selected by the user according to the attitude information, spatial position information and control instructions of the control equipment.
其中,根据控制设备的姿态信息、空间位置信息以及控制指令,可以获得显示空间中选取的起始点,然后根据控制设备姿态以及位置的变化,可以获得起始点的移动轨迹,最后根据移动轨迹则可以确定出显示空间中选取的目标区域。另外,可以根据显示空间中目标区域的位置以及实物的位置,确定出显示空间中目标区域与实物的位置关系,即目标区域相对实物的第五空间位置信息。Among them, according to the attitude information, spatial position information and control instructions of the control device, the starting point selected in the display space can be obtained, and then according to the change of the attitude and position of the control device, the movement trajectory of the starting point can be obtained, and finally according to the movement trajectory, the starting point can be obtained. Determines the selected target area in the display space. In addition, according to the position of the target area in the display space and the position of the physical object, the positional relationship between the target area and the physical object in the display space can be determined, that is, the fifth spatial position information of the target area relative to the physical object.
在本申请实施例中,也可以通过检测用户的手势对目标区域进行选取。在检测到显示空间中的预设手势时,则触发对目标区域的选取,然后可以根据检测到的手势的移动轨迹确定出显示空间中选取的目标区域。In this embodiment of the present application, the target area may also be selected by detecting the user's gesture. When a preset gesture in the display space is detected, the selection of the target area is triggered, and then the target area selected in the display space can be determined according to the movement trajectory of the detected gesture.
在本申请实施例中,还可以通过跟踪眼球的焦点的变化,对目标区域进行选取。可以理解的是,可以于头戴显示设备中,设置用于获取用户眼睛图像的摄像头,在用户利用头戴显示设备观看实物时,获取用户的眼睛图像,在确定目标区域的过程中会捕捉到用户的视网膜及角膜的图像数据,终端设备根据这些数据构建眼睛的3D模型,并通过三维空间跟踪眼球的焦点,实现目标区域的选取。In the embodiment of the present application, the target area can also be selected by tracking the change of the focus of the eyeball. It can be understood that a camera can be set in the head-mounted display device to obtain the image of the user's eyes. When the user uses the head-mounted display device to view the real object, the user's eye image is obtained, and the target area will be captured in the process of determining the target area. Based on the image data of the user's retina and cornea, the terminal device builds a 3D model of the eye based on these data, and tracks the focus of the eyeball through the three-dimensional space to achieve the selection of the target area.
步骤S230:获取标记物相对实物的第四空间位置信息,以及目标区域相对实物的第五空间位置信息。Step S230: Obtain fourth spatial position information of the marker relative to the real object, and fifth spatial position information of the target area relative to the real object.
在本申请实施例中,终端设备获取标记物相对目标区域的第二空间位置信息,可以是终端设备中存储有标记物相对实物的第四空间位置信息,以及目标区域相对实物的第五空间位置信息(可以根据步骤220中确定实物的目标区域获得)。其中,目标区域相对实物的第五空间位置信息,可以根据步骤220中确定实物的目标区域获得。在目标区域为实物的预先设定的区域时,目标区域相对实物的第五空间位置信息也可以预先存储于终端设备中。终端设备在需要获取标记物相对目标区域的空间位置信息时,则可以读取标记物相对实物的第四空间位置信息,以及目标区域相对实物的第五空间位置信息。In this embodiment of the present application, the terminal device obtains the second spatial position information of the marker relative to the target area, which may be the fourth spatial position information of the marker relative to the physical object stored in the terminal device, and the fifth spatial position of the target area relative to the physical object. Information (which can be obtained according to the target area of the object determined in step 220). The fifth spatial position information of the target area relative to the real object can be obtained according to the target area of the real object determined in step 220 . When the target area is a preset area of the real object, the fifth spatial position information of the target area relative to the real object may also be pre-stored in the terminal device. When the terminal device needs to obtain the spatial position information of the marker relative to the target area, it can read the fourth spatial position information of the marker relative to the real object and the fifth spatial position information of the target area relative to the real object.
步骤S240:基于第四空间位置信息以及第五空间位置信息,确定标记物相对目标区域的第二空间位置信息。Step S240: Based on the fourth spatial position information and the fifth spatial position information, determine the second spatial position information of the marker relative to the target area.
在获得标记物相对实物的第四空间位置信息以及目标区域相对实物的第五空间位置信息之后,则可以根据第四空间位置信息以及第五空间位置信息,以实物为参照,确定出标记物与目标区域的位置关系,获得标记物相对目标区域的第二空间位置信息。After the fourth spatial position information of the marker relative to the real object and the fifth spatial position information of the target area relative to the real object are obtained, it is possible to determine the relationship between the marker and the real object according to the fourth spatial position information and the fifth spatial position information, taking the real object as a reference. The positional relationship of the target area is obtained, and the second spatial position information of the marker relative to the target area is obtained.
步骤S250:基于第一空间位置信息以及第二空间位置信息,确定终端设备相对目标区域的第三空间位置信息。Step S250: Based on the first spatial position information and the second spatial position information, determine third spatial position information of the terminal device relative to the target area.
步骤S260:基于第三空间位置信息,将虚拟对象显示于实物的目标区域。Step S260: Display the virtual object in the target area of the real object based on the third spatial position information.
在本申请实施例中,在基于终端设备相对目标区域的第三空间位置信息,将虚拟对象显示于实物的目标区域之后,还可能存在终端设备相对目标区域的位置和姿态发生变化的情况,例如终端设备相对目标区域的远近发生变化,终端设备朝向目标区域的角度发生变化。在终端设备相对目标区域的位置和姿态发生变化时,终端设备相对标记物的位置和姿态也会发生变化,即终端设备所根据获取的包含标记物的图像识别到的标记物的位置以及姿态会发生变化。此时,则可以根据终端设备的移动,对显示虚拟对象的进行调整,例如终端设备相对目标区域靠近时,则终端设备展示的虚拟对象的会变大,反之则变小。In this embodiment of the present application, after the virtual object is displayed in the physical target area based on the third spatial position information of the terminal device relative to the target area, the position and posture of the terminal device relative to the target area may also change, for example The distance of the terminal device relative to the target area changes, and the angle of the terminal device toward the target area changes. When the position and posture of the terminal device relative to the target area changes, the position and posture of the terminal device relative to the marker will also change, that is, the position and posture of the marker recognized by the terminal device according to the acquired image containing the marker will change. change. At this time, the displayed virtual object can be adjusted according to the movement of the terminal device. For example, when the terminal device is close to the target area, the virtual object displayed by the terminal device will become larger, and vice versa.
具体的,在本申请实施例中,该虚拟对象的显示方法还可以包括:Specifically, in the embodiment of the present application, the display method of the virtual object may further include:
在检测到标记物的姿态信息发生变化时,根据标记物的姿态信息,在目标区域渲染与姿态信息对应的虚拟对象。When it is detected that the gesture information of the marker changes, according to the gesture information of the marker, a virtual object corresponding to the gesture information is rendered in the target area.
可以理解的是,在终端设备根据获取的包含标记物的图像,确定出标记物的姿态信息发生变化,则可以根据标记物的姿态信息,对显示的虚拟对象进行调整,例如,虚拟对象为一个房子,此前展示的为房子的正面,在终端设备朝向标记物的另一侧时,检测到的标记物的姿态信息发生变化,则在目标区域根据虚拟对象的模型数据,渲染出房子的侧面。从而,可以实现用户在调整相对标记物的朝向时,实物的目标区域展示的虚拟对象也随之变化,使用户可以感受到更真实的视觉效果,提升用户的视觉体验。It can be understood that, when the terminal device determines that the gesture information of the marker has changed according to the acquired image containing the marker, the displayed virtual object can be adjusted according to the gesture information of the marker. For example, the virtual object is a The house, previously shown as the front of the house, when the terminal device faces the other side of the marker, and the detected gesture information of the marker changes, the side of the house is rendered in the target area according to the model data of the virtual object. Therefore, when the user adjusts the orientation of the relative marker, the virtual object displayed in the target area of the object also changes accordingly, so that the user can feel a more realistic visual effect and improve the user's visual experience.
当然,在本申请实施例中,该虚拟对象的显示方法也还可以包括:Of course, in this embodiment of the present application, the method for displaying the virtual object may also include:
在检测到终端设备相对标记物的距离发生变化时,根据终端设备相对标记物的距离,在目标区域渲染与该变化后的距离对应的虚拟对象。When it is detected that the distance of the terminal device relative to the marker changes, according to the distance of the terminal device relative to the marker, a virtual object corresponding to the changed distance is rendered in the target area.
可以理解的是,在终端设备根据获取的包含标记物的图像,确定出终端设备相对标记物的距离发生变化,则可以根据终端设备相对标记物的距离,对显示的虚拟对象进行调整。例如,虚拟对象为一个房子,在检测到终端设备相对标记物的距离更小,则在目标区域根据虚拟对象的模型数据,渲染出大小更大的房子,使用户可以在靠近标记物时,可以观察到更大的房子,在检测到终端设备相对标记物的距离更大时,则在目标区域根据虚拟对象的模型数据,渲染出大小更小的房子,使用户可以在远离标记物时,可以观察到更小的房子。从而,可以实现用户在调整相对标记物的距离时,实物的目标区域展示的虚拟对象也随之变化,即可以感受到虚拟对象相对用户的位置的变化,使用户可以感受到更真实的视觉效果,提升用户的视觉体验。It can be understood that, when the terminal device determines that the distance between the terminal device and the marker changes according to the acquired image containing the marker, the displayed virtual object can be adjusted according to the distance between the terminal device and the marker. For example, if the virtual object is a house, when it is detected that the distance between the terminal device and the marker is smaller, a larger house is rendered in the target area according to the model data of the virtual object, so that the user can When a larger house is observed, when it is detected that the distance between the terminal device and the marker is larger, a smaller house is rendered in the target area according to the model data of the virtual object, so that the user can move away from the marker. Smaller houses observed. Therefore, when the user adjusts the distance relative to the marker, the virtual object displayed in the target area of the real object also changes, that is, the change in the position of the virtual object relative to the user can be felt, so that the user can feel a more realistic visual effect. , to enhance the user's visual experience.
在本申请实施例中,还存在着显示虚拟对象的目标区域调整的情况,因此,该虚拟对象的显示方法还可以包括:In the embodiment of the present application, there is also a situation in which the target area for displaying the virtual object is adjusted. Therefore, the method for displaying the virtual object may further include:
再次获得用户对实物的目标区域的选取指令;根据再次获得的选取指令,调整目标区域;将虚拟对象显示于调整后的目标区域。Obtaining the user's selection instruction for the target area of the object again; adjusting the target area according to the selection instruction obtained again; displaying the virtual object in the adjusted target area.
可以理解的时,在用户需要对虚拟对象于实物上显示的位置进行调整,则可以重新对实物的目标区域进行选取,终端设备可以获得用户利用控制设备对实物的目标区域的选取指令,然后重新确定出目标区域。在重新确定出目标区域后,终端设备可以将虚拟对象重新显示于新的目标区域,具体显示可以根据上述虚拟对象的显示方式进行。Understandably, when the user needs to adjust the position of the virtual object displayed on the physical object, the target area of the physical object can be re-selected, and the terminal device can obtain the user's selection instruction for the physical target area using the control device, and then re-select the target area of the physical object. Determine the target area. After re-determining the target area, the terminal device may redisplay the virtual object in the new target area, and the specific display may be performed according to the above-mentioned display mode of the virtual object.
在本申请实施例中,该虚拟对象的显示方法可以应用于某些需要将标记物进行掩饰的场景,使终端设备识别设置于不影响实物美观的位置的标记物,即可将虚拟对象展示于实物的某区域,使用户可以观察到实物上某区域的虚拟对象,并不对整体美观造成影响。例如在一些AR桌游中,标记物则可以设置于桌边,用户佩戴终端设备,可以观察到桌面上虚拟的游戏对象;应用于主题餐厅时,标记物也可以设置于桌子的边缘,终端设备识别标记物后,可以观察到菜单上一些菜品的虚拟模型,使用户可以据此更好的进行点餐。又例如,该虚拟对象的显示方法还可以应用于广告显示中,标记物可以放置于广告栏上的一位置,终端设备设备识别标记物后,可以将广告内容显示于广告栏上的目标区域处,使用户可以观察到广告内容。In the embodiment of the present application, the display method of the virtual object can be applied to some scenes where markers need to be masked, so that the terminal device can recognize the markers set at a position that does not affect the beauty of the real object, and the virtual object can be displayed on the A certain area of the real object allows users to observe the virtual objects in a certain area of the real object without affecting the overall appearance. For example, in some AR board games, markers can be placed on the edge of the table, and users can observe virtual game objects on the table by wearing a terminal device; when applied to themed restaurants, markers can also be placed on the edge of the table, and the terminal device After identifying the markers, virtual models of some dishes on the menu can be observed, so that users can better order food accordingly. For another example, the method for displaying virtual objects can also be applied to advertisement display. The marker can be placed at a position on the advertisement column. After the terminal device recognizes the marker, the advertisement content can be displayed at the target area on the advertisement column. , so that users can observe the advertising content.
本申请实施例提供的虚拟对象的显示方法,通过获取终端设备相对标记物的第一空间位置信息,然后根据用户对实物的目标区域的选取指令,确定实物的目标区域,然后在根据标记物与实物的位置关系,实物与目标区域的位置关系,确定出标记物相对目标区域的第二空间位置信息,再根据第一空间位置信息以及第二空间位置信息确定出终端设备相对目标区域的空间位置信息,最后根据该空间位置信息将虚拟对象显示于实物的目标区域。另外,该实施例还提供了根据终端设备相对标记物的位置和姿态,对显示的虚拟对象进行调整,使用户看到的虚拟对象与其移动相对应,提升用户的视觉体验。In the display method of a virtual object provided by the embodiment of the present application, the first spatial position information of the terminal device relative to the marker is obtained, and then the target area of the physical object is determined according to the user's selection instruction for the target area of the physical object, and then the target area of the physical object is determined according to the target area of the physical object. The positional relationship of the physical object, the positional relationship between the physical object and the target area, determine the second spatial position information of the marker relative to the target area, and then determine the spatial position of the terminal device relative to the target area according to the first spatial position information and the second spatial position information information, and finally display the virtual object in the target area of the object according to the spatial position information. In addition, this embodiment also provides that the displayed virtual object is adjusted according to the position and posture of the terminal device relative to the marker, so that the virtual object seen by the user corresponds to its movement, and the user's visual experience is improved.
当然,除了上述实施例中提供的通过控制设备获取显示虚拟对象的目标区域以外,还可以利用与终端设备连接的其他电子设备,例如手机、平板等,对目标区域进行获取。具体方式可以为,与终端设备连接的电子设备中存储有上述实物的模型,该电子设备可以将该实物的模型进行展示,用户可以于该电子设备显示的实物模型,选取实物模型上的某块区域。然后,电子设备将用户选取的实物模型上的区域发送至终端设备,终端设备根据实物模型上的区域,确定出实物上用于显示虚拟对象的目标区域。Of course, in addition to obtaining the target area for displaying virtual objects through the control device provided in the above embodiments, other electronic devices connected to the terminal device, such as mobile phones, tablets, etc., can also be used to obtain the target area. The specific method may be as follows: an electronic device connected to the terminal device stores the model of the physical object, the electronic device can display the physical model, and the user can select a certain block on the physical model from the physical model displayed by the electronic device. area. Then, the electronic device sends the area on the physical model selected by the user to the terminal device, and the terminal device determines the target area on the physical model for displaying the virtual object according to the area on the physical model.
在一个实施例中,请参阅图8,图8示出了本申请实施例提供的虚拟对象的显示装置400的模块框图。该虚拟对象的显示装置400应用于终端设备。下面将针对图8所示的框图进行阐述,所述虚拟对象的显示装置400包括:第一位置获取模块410、第二位置获取模块420、第三位置获取模块430以及显示执行模块440。其中,所述第一位置获取模块410用于获取所述终端设备相对标记物的第一空间位置信息;所述第二位置获取模块420用于获取所述标记物相对实物的目标区域的第二空间位置信息;所述第三位置获取模块430用于基于所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;所述显示执行模块440用于基于所述第三空间位置信息,将虚拟对象显示于所述目标区域。In one embodiment, please refer to FIG. 8 , which shows a block diagram of a module of a display apparatus 400 for a virtual object provided by an embodiment of the present application. The display apparatus 400 of the virtual object is applied to a terminal device. The block diagram shown in FIG. 8 will be described below. The virtual object display device 400 includes: a first position acquisition module 410 , a second position acquisition module 420 , a third position acquisition module 430 , and a display execution module 440 . Wherein, the first position obtaining module 410 is used to obtain the first spatial position information of the terminal device relative to the marker; the second position obtaining module 420 is used to obtain the second position of the marker relative to the physical target area. spatial location information; the third location acquisition module 430 is configured to determine third spatial location information of the terminal device relative to the target area based on the first spatial location information and the second spatial location information; the The display execution module 440 is configured to display the virtual object in the target area based on the third spatial position information.
在本申请实施例中,显示执行模块440可以具体用于:获取所述虚拟对象与所述目标区域之间的缩放比例;基于所述缩放比例,以及所述第三空间位置信息确定所述虚拟对象的显示坐标;基于所述显示坐标将所述虚拟对象显示于所述目标区域。In this embodiment of the present application, the display execution module 440 may be specifically configured to: obtain a zoom ratio between the virtual object and the target area; determine the virtual object based on the zoom ratio and the third spatial position information Display coordinates of an object; displaying the virtual object in the target area based on the display coordinates.
在本申请实施例中,请参见图9,该虚拟对象的显示装置400还可以包括:对象渲染模块450。对象渲染模块450用于在检测到所述标记物的姿态信息发生变化时,根据所述标记物的姿态信息,在所述目标区域渲染与所述姿态信息对应的虚拟对象。In this embodiment of the present application, referring to FIG. 9 , the display apparatus 400 of the virtual object may further include: an object rendering module 450 . The object rendering module 450 is configured to render a virtual object corresponding to the gesture information in the target area according to the gesture information of the marker when it is detected that the gesture information of the marker changes.
在本申请实施例中,请参见图9,该虚拟对象的显示装置还可以包括:区域确定模块460。区域确定模块460用于根据用户对实物的目标区域的选取指令,确定所述实物的目标区域。In this embodiment of the present application, referring to FIG. 9 , the display apparatus for the virtual object may further include: a region determination module 460 . The area determination module 460 is configured to determine the target area of the physical object according to the user's instruction for selecting the target area of the physical object.
进一步的,该区域确定模块460可以具体用于:根据控制设备发送的姿态信息、空间位置信息以及控制指令,获得用户选取的实物的目标区域。Further, the area determination module 460 may be specifically configured to: obtain the target area of the object selected by the user according to the attitude information, spatial position information and control instructions sent by the control device.
在本申请实施例中,请参见图9,该虚拟对象的显示装置还可以包括:指令获得模块470、区域调整模块480以及对象显示模块490。其中,指令获得模块470用于再次获得用户对所述实物的目标区域的选取指令;区域调整模块480用于根据所述再次获得的选取指令,调整所述目标区域;对象显示模块490用于将所述虚拟对象显示于所述调整后的目标区域。In this embodiment of the present application, referring to FIG. 9 , the display apparatus for the virtual object may further include: an instruction obtaining module 470 , an area adjustment module 480 , and an object display module 490 . Wherein, the instruction obtaining module 470 is used to obtain the user's selection instruction for the target area of the object again; the area adjustment module 480 is used to adjust the target area according to the selection instruction obtained again; the object display module 490 is used to The virtual object is displayed in the adjusted target area.
在本申请实施例中,第二位置获取模块420可以具体用于:获取所述标记物相对所述实物的第四空间位置信息,以及所述目标区域相对所述实物的第五空间位置信息;基于所述第四空间位置信息以及所述第五空间位置信息,确定所述标记物相对所述目标区域的第二空间位置信息。In this embodiment of the present application, the second position obtaining module 420 may be specifically configured to: obtain fourth spatial position information of the marker relative to the real object, and fifth spatial position information of the target area relative to the real object; Based on the fourth spatial position information and the fifth spatial position information, second spatial position information of the marker relative to the target area is determined.
在一个实施例中,本申请还提供一种终端设备,包括存储器及处理器,该存储器中存储有计算机程序,该计算机程序被处理器执行时,使得处理器实现上述的虚拟对象的显示方法。In one embodiment, the present application further provides a terminal device, including a memory and a processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the above method for displaying virtual objects.
在一个实施例中,本申请还提供一种计算机存储介质,其上存储有计算机程序,该计算机程序被处理器执行时可实现上述的虚拟对象的显示方法。In one embodiment, the present application further provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned method for displaying a virtual object can be implemented.
综上所述,本申请提供的上述的虚拟对象的显示方法、装置、终端设备及存储介质,通过获取终端设备相对标记物的第一空间位置信息,然后获取标记物相对实物的目标区域的第二空间位置信息,再基于第一空间位置信息以及第二空间位置信息,确定终端设备相对目标区域的第三空间位置信息,最后基于第三空间位置信息,将虚拟对象显示于实物的目标区域,从而实现将虚拟对象显示于实物的目标区域,完成实物与虚拟对象的结合显示。To sum up, the above-mentioned display method, device, terminal device and storage medium for virtual objects provided by this application can obtain the first spatial position information of the terminal device relative to the marker, and then obtain the first position of the marker relative to the target area of the real object. Second spatial position information, and then based on the first spatial position information and the second spatial position information, determine the third spatial position information of the terminal device relative to the target area, and finally display the virtual object in the physical target area based on the third spatial position information, Therefore, the virtual object is displayed in the target area of the real object, and the combined display of the real object and the virtual object is completed.
需要说明的是,本申请实施例的系统中各设备的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,在此不赘述。It should be noted that, the functions of each device in the system of the embodiment of the present application may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the relevant description of the foregoing method embodiment, which is not repeated here.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于装置类实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. For the same and similar parts among the various embodiments, refer to each other Can. As for the apparatus type embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant part, please refer to the partial description of the method embodiment.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.
以上所述,仅是本申请的较佳实施例而已,并非对本申请作任何形式上的限制,虽然本申请已以较佳实施例揭露如上,然而并非用以限定本申请,任何熟悉本专业的技术人员,在不脱离本申请技术方案范围内,当可利用上述揭示的技术内容做出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本申请技术方案内容,依据本申请的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本申请技术方案的范围内。The above are only preferred embodiments of the present application, and are not intended to limit the present application in any form. Although the present application has been disclosed above with preferred embodiments, it is not intended to limit the present application. The technical personnel, within the scope of the technical solution of the present application, can make some changes or modifications to equivalent examples of equivalent changes by using the technical content disclosed above. Any simple modifications, equivalent changes and modifications made to the above embodiments still fall within the scope of the technical solutions of the present application.
Claims (10)
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810804399.7A CN110737326A (en) | 2018-07-20 | 2018-07-20 | Virtual object display method and device, terminal equipment and storage medium |
| PCT/CN2019/091863 WO2019242634A1 (en) | 2018-06-19 | 2019-06-19 | Method and device for displaying virtual object in augmented reality |
| US16/535,054 US11087545B2 (en) | 2018-06-19 | 2019-08-07 | Augmented reality method for displaying virtual object and terminal device therefor |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810804399.7A CN110737326A (en) | 2018-07-20 | 2018-07-20 | Virtual object display method and device, terminal equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN110737326A true CN110737326A (en) | 2020-01-31 |
Family
ID=69234720
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810804399.7A Pending CN110737326A (en) | 2018-06-19 | 2018-07-20 | Virtual object display method and device, terminal equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110737326A (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111162840A (en) * | 2020-04-02 | 2020-05-15 | 北京外号信息技术有限公司 | Method and system for setting virtual objects around optical communication device |
| CN113288087A (en) * | 2021-06-25 | 2021-08-24 | 成都泰盟软件有限公司 | Virtual-real linkage experimental system based on physiological signals |
| CN114356089A (en) * | 2021-12-30 | 2022-04-15 | Oppo广东移动通信有限公司 | Augmented reality glasses control method and device, storage medium and electronic equipment |
| CN114827338A (en) * | 2021-01-29 | 2022-07-29 | 北京外号信息技术有限公司 | Method and electronic device for presenting virtual objects on a display medium of a device |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101551732A (en) * | 2009-03-24 | 2009-10-07 | 上海水晶石信息技术有限公司 | Method for strengthening reality having interactive function and a system thereof |
| CN103270537A (en) * | 2011-10-27 | 2013-08-28 | 索尼公司 | Image processing apparatus, image processing method, and program |
| CN103503013A (en) * | 2010-10-13 | 2014-01-08 | 哈默尔Tlc公司 | Method and system for creating a personalized experience with video associated with stored value tokens |
| CN104808795A (en) * | 2015-04-29 | 2015-07-29 | 王子川 | Gesture recognition method for reality-augmented eyeglasses and reality-augmented eyeglasses system |
| CN106575153A (en) * | 2014-07-25 | 2017-04-19 | 微软技术许可有限责任公司 | Gaze-based object placement within a virtual reality environment |
| CN107895397A (en) * | 2016-10-01 | 2018-04-10 | 北京餐影传媒科技有限责任公司 | A kind of virtual display methods and device |
-
2018
- 2018-07-20 CN CN201810804399.7A patent/CN110737326A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101551732A (en) * | 2009-03-24 | 2009-10-07 | 上海水晶石信息技术有限公司 | Method for strengthening reality having interactive function and a system thereof |
| CN103503013A (en) * | 2010-10-13 | 2014-01-08 | 哈默尔Tlc公司 | Method and system for creating a personalized experience with video associated with stored value tokens |
| CN103270537A (en) * | 2011-10-27 | 2013-08-28 | 索尼公司 | Image processing apparatus, image processing method, and program |
| CN106575153A (en) * | 2014-07-25 | 2017-04-19 | 微软技术许可有限责任公司 | Gaze-based object placement within a virtual reality environment |
| CN104808795A (en) * | 2015-04-29 | 2015-07-29 | 王子川 | Gesture recognition method for reality-augmented eyeglasses and reality-augmented eyeglasses system |
| CN107895397A (en) * | 2016-10-01 | 2018-04-10 | 北京餐影传媒科技有限责任公司 | A kind of virtual display methods and device |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111162840A (en) * | 2020-04-02 | 2020-05-15 | 北京外号信息技术有限公司 | Method and system for setting virtual objects around optical communication device |
| CN114827338A (en) * | 2021-01-29 | 2022-07-29 | 北京外号信息技术有限公司 | Method and electronic device for presenting virtual objects on a display medium of a device |
| CN113288087A (en) * | 2021-06-25 | 2021-08-24 | 成都泰盟软件有限公司 | Virtual-real linkage experimental system based on physiological signals |
| CN114356089A (en) * | 2021-12-30 | 2022-04-15 | Oppo广东移动通信有限公司 | Augmented reality glasses control method and device, storage medium and electronic equipment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11880956B2 (en) | Image processing method and apparatus, and computer storage medium | |
| US9651782B2 (en) | Wearable tracking device | |
| US11087545B2 (en) | Augmented reality method for displaying virtual object and terminal device therefor | |
| TWI701941B (en) | Method, apparatus and electronic device for image processing and storage medium thereof | |
| GB2577962A (en) | Markerless image analysis for augmented reality | |
| JPWO2017134886A1 (en) | Information processing apparatus, information processing method, and recording medium | |
| US20160012644A1 (en) | Augmented Reality System and Method | |
| TW201214266A (en) | Three dimensional user interface effects on a display by using properties of motion | |
| WO2021143282A1 (en) | Three-dimensional facial model generation method and apparatus, computer device and storage medium | |
| JP5791434B2 (en) | Information processing program, information processing system, information processing apparatus, and information processing method | |
| CN105872381A (en) | Interesting image shooting method | |
| CN108416832B (en) | Media information display method, device and storage medium | |
| CN111679742A (en) | Interaction control method and device based on AR, electronic equipment and storage medium | |
| CN112912936B (en) | Mixed reality system, program, mobile terminal device and method | |
| CN110737414B (en) | Interactive display method, device, terminal equipment and storage medium | |
| CN110737326A (en) | Virtual object display method and device, terminal equipment and storage medium | |
| JP2005256232A (en) | 3D data display method, apparatus, and program | |
| CN110706283A (en) | Calibration method, device, mobile terminal and storage medium for gaze tracking | |
| US10345595B2 (en) | Head mounted device with eye tracking and control method thereof | |
| CN113470190A (en) | Scene display method and device, equipment, vehicle and computer readable storage medium | |
| CN111651031A (en) | Display method, device, terminal device and storage medium for virtual content | |
| CN116912463A (en) | 3D virtual image processing method, device, electronic device and readable storage medium | |
| CN114092668B (en) | Virtual-reality fusion method, device, equipment and storage medium | |
| CN108764135B (en) | Image generation method, device, and electronic device | |
| CN117011495A (en) | Method, host computer and computer readable storage medium for providing visual content |
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 | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200131 |