WO2019242634A1 - 虚拟对象的增强现实显示方法和设备 - Google Patents

虚拟对象的增强现实显示方法和设备 Download PDF

Info

Publication number
WO2019242634A1
WO2019242634A1 PCT/CN2019/091863 CN2019091863W WO2019242634A1 WO 2019242634 A1 WO2019242634 A1 WO 2019242634A1 CN 2019091863 W CN2019091863 W CN 2019091863W WO 2019242634 A1 WO2019242634 A1 WO 2019242634A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual object
marker
position information
target area
terminal device
Prior art date
Application number
PCT/CN2019/091863
Other languages
English (en)
French (fr)
Inventor
戴景文
贺杰
Original Assignee
广东虚拟现实科技有限公司
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
Priority claimed from CN201810632329.8A external-priority patent/CN110618751B/zh
Priority claimed from CN201810804399.7A external-priority patent/CN110737326A/zh
Application filed by 广东虚拟现实科技有限公司 filed Critical 广东虚拟现实科技有限公司
Priority to US16/535,054 priority Critical patent/US11087545B2/en
Publication of WO2019242634A1 publication Critical patent/WO2019242634A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer

Definitions

  • the present application relates to the field of augmented reality technology, and more particularly, to a method for displaying a virtual object, a terminal device, and a storage medium.
  • Augmented reality is a technology that increases the user's perception of the real world through information provided by computer systems.
  • Content objects such as virtual objects, scenes, or system prompts are superimposed on real scenes to enhance or modify the perception of the real world environment or data representing the real world environment.
  • a terminal device cannot display a virtual object in combination with a physical object.
  • the embodiments of the present application provide a method, an apparatus, a terminal device, and a storage medium for displaying a virtual object, so as to better realize a combined display of a virtual object and a physical object.
  • 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 marker relative to the terminal device; and acquiring relative physical properties of the marker. Second spatial position information of the target area of the object; determining 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; based on the third The spatial position information displays a virtual object in a target area of the physical object.
  • an embodiment of the present application provides a terminal device including a memory, where the computer program is stored in the memory; and a processor, when the computer program is executed by the processor, causes the processor to perform the following steps Obtaining the first spatial position information of the marker relative to the terminal device; obtaining the second spatial position information of the marker relative to the target area of the physical object; determining based on the first spatial position information and the second spatial position information Third space position information of the terminal device relative to the target area; and generating a virtual object based on the third space position information, and a display position of the virtual object corresponds to the target area.
  • the marker is relative to the terminal device.
  • an embodiment of the present application provides a computer storage medium on which a computer program is stored.
  • the processor causes the processor to perform the following steps: obtaining a first phase of a marker relative to a terminal device.
  • a spatial position information ; acquiring second spatial position information of the marker relative to a target area of a physical object; and determining the relative relative of the terminal device to the target area based on the first spatial position information and the second spatial position information
  • Generating a third spatial position information based on the third spatial position information, generating a virtual object, a display position of the virtual object corresponding to the target area.
  • an embodiment of the present application provides a method for displaying a virtual object.
  • the method includes: collecting a marker image including a marker; identifying the marker included in the marker image; obtaining a constructed virtual object and all objects. The zoom ratio of the marker; rendering the virtual object according to the zoom ratio; and displaying the virtual object, the display position of the virtual object corresponding to the marker.
  • an embodiment of the present application provides a terminal device including a memory, where the computer program is stored in the memory; and the processor, when the computer program is executed by the processor, causes the processor to perform the following steps : Collecting a marker image including a marker; identifying the marker included in the marker image; obtaining a scale ratio between the constructed virtual object and the marker; rendering the virtual object according to the scale ratio, the The display position of the virtual object corresponds to the marker.
  • an embodiment of the present application provides a computer storage medium on which a computer program is stored.
  • the processor causes the processor to perform the following steps: collecting a marker image including a marker. Identifying the markers contained in the marker image; obtaining a scale ratio between the constructed virtual object and the marker; rendering the virtual object according to the zoom ratio, and displaying the virtual object at the position corresponding to the marker ⁇ ⁇ Object correspondence.
  • FIG. 1 shows a schematic diagram of a scene of an augmented reality system provided by an embodiment of the present application
  • FIG. 2 shows a structural block diagram of a terminal device according to an embodiment of the present application
  • FIG. 3 is a flowchart of a method for displaying a virtual object according to an embodiment of the present application
  • FIG. 4 is a flowchart of a method for displaying a virtual object according to another embodiment of the present application.
  • FIG. 5 is a flowchart of a method for displaying a virtual object according to another embodiment of the present application.
  • FIG. 6 shows a schematic diagram of an alignment display of a virtual object and a marker in an embodiment
  • FIG. 7 is a schematic diagram of a scene when there are two virtual objects in one embodiment.
  • an embodiment of the present application provides an augmented reality system 10 including a terminal device 100 and a marker 200.
  • the terminal device 100 is provided with a camera.
  • the terminal device 100 may use the above-mentioned marker 200 as a target marker and collect an image containing the target marker.
  • the identification and tracking processing is performed on the collected target marker image to obtain the identity information of the marker 200 and the spatial position information such as the position and posture of the terminal device 100 relative to the marker 200, so that the user can view the virtual image through the terminal device 100.
  • the object 400 is superimposed and displayed in a target area 301 corresponding to the physical object 300.
  • the surface of the marker 200 may be a pattern having a topology structure.
  • the topology structure refers to a connection relationship between a sub-marker and a feature point in the marker 200, and the topology structure represents the identity information of the marker 200.
  • the outline of the marker 200 may be rectangular, circular, or the like, which is not limited herein.
  • the marker 200 may also be other patterns, which is not limited herein, as long as it can be identified and tracked by the terminal device 100.
  • the terminal device 100 may be a head-mounted display device, or may be a mobile device such as a mobile phone or a tablet.
  • the terminal device 100 When the terminal device 100 is a head-mounted display device, it may be an integrated head-mounted display device; the terminal device 100 may also be a smart terminal such as a mobile phone connected to an external head-mounted display device, that is, the terminal device 100 may be used as a head-mounted display.
  • the processing and storage device of the device inserts or connects an external head-mounted display device, and performs a display function on the virtual object in the head-mounted display device.
  • the terminal device 100 includes a processor 110, a memory 120, a display unit 130, and a camera 140.
  • the memory 120, the display unit 130, and the camera 140 are all connected to the processor 110.
  • the camera 140 is configured to collect an image of an object to be captured and send it to the processor 110.
  • the camera 140 may be an infrared camera, a color camera, or the like.
  • the marker receives light reflected from the surface of the marker so that the infrared camera can capture an image containing the pattern of the marker.
  • the processor 110 may include any suitable type of general-purpose or special-purpose microprocessor, digital signal processor, or microcontroller, which may be configured to receive data and / or signals from various components of the system via, for example, a network, and may also process data And / or signals to determine one or more operating conditions in the system. For example, the processor 110 generates image data of the virtual world based on the pre-stored image data, and sends it to the display unit 130 for display. The processor 110 may also receive the image data sent by the smart terminal or computer through a wired or wireless network. The image data generates an image of the virtual world; the markers can also be identified and positioned according to the marker images collected by the camera to determine the corresponding display content.
  • the memory 120 may be used to store software programs and modules.
  • the processor 110 executes various functional applications and data processing by running the software programs and modules stored in the memory 120.
  • the memory 120 includes a non-transitory computer-readable medium, such as a semiconductor or solid state memory, a random access memory, a read-only memory, a hard disk, an optical disk, or other suitable storage medium.
  • the processor 110 and the memory 120 are not limited to being installed in the terminal device 100.
  • the processor 110 in the foregoing embodiment executes The processing is executed by the processor of the mobile terminal, and the data stored in the memory 120 in the foregoing embodiment is stored by the memory of the mobile terminal.
  • the terminal device 100 may further include a communication module, and the communication module is used for communication between the terminal device 100 and other devices.
  • an embodiment of the present application provides a method for displaying a virtual object.
  • the instruction corresponding to the method is stored in the memory 120 of the terminal device 100, and the instruction is executed by the processor 110.
  • the specific execution steps are as follows.
  • Step S310 Obtain first spatial position information of the marker relative to the terminal device.
  • the terminal device may perform image acquisition on a marker located within a visual range of the camera, and identify the acquired image containing the marker to obtain first spatial position information of the marker relative to the terminal device.
  • the spatial position information indicates six degrees of freedom information, and the first spatial position information may include position and attitude information of the marker relative to the terminal device.
  • the marker image collected by the terminal device through the camera also changes, and marker images of different perspectives can be obtained.
  • the image information will be different. Therefore, according to the marker images acquired by the terminal device according to different spatial positions, the first spatial position information of the acquired marker relative to the terminal device is also different.
  • the identification of the marker by the terminal device can also obtain the identity information of the marker.
  • different markers may have different identity information, and the correspondence between the markers and their identity information is stored in the terminal device.
  • the correspondence between the identity information of the marker and the related data can be stored in the terminal device.
  • the data corresponding to the marker can be read according to the identity information of the marker.
  • the model data of the virtual object corresponding to the marker can be read.
  • the marker A corresponds to the stored data information of the virtual object 1
  • the terminal device obtains the marker by identifying the marker A.
  • the identity information of A based on the correspondence between the identity information of the marker A and the virtual object 1, the corresponding data information of the virtual object 1 is obtained.
  • Step S320 Acquire second spatial position information of the marker relative to the target area of the physical object.
  • the terminal device acquires the second spatial position information of the marker relative to the target area of the physical object, so as to determine the relative position relationship between the terminal device and the target area.
  • the physical object refers to an actual object in a real space.
  • the target area of the physical object is an area where a virtual object needs to be displayed in a physical object, that is, the target area is an area where the virtual object is displayed superimposed in the real space.
  • the physical object 300 is a table board in a real space, and the marker 200 is provided on the surface of the table board.
  • the target area 301 is an area on the surface of the table board.
  • the device 100 observes that the virtual object is displayed superimposed on the target area 301.
  • the marker is not limited to being set on the physical object, and the target area is not limited to being set on the physical object.
  • the second spatial position information of the marker relative to the target area of the physical object may be stored in the terminal device in advance, read by the terminal device, or acquired by the terminal device in real time.
  • Step S330 Determine 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 third spatial position information of the terminal device relative to the target area is obtained according to the first spatial position information and the second spatial position information, and the third spatial position information may include the terminal device relative to the target The location and attitude of the area.
  • Step S340 Generate a virtual object based on the third spatial position information, and display the virtual object.
  • the display position of the virtual object corresponds to the target area of the physical object.
  • the corresponding virtual object may be determined according to the identity information of the marker, and the display coordinates of the virtual object in the virtual space may be calculated according to the third space position information, and the display coordinates may represent the virtual objects in the virtual space.
  • the display position generates a virtual object according to the display coordinates, and displays the virtual object through a display unit.
  • the correspondence between the display position of the virtual object and the target area of the physical object means that the virtual object is superimposed and displayed on the target area, and the user can see that the virtual object is superimposed and displayed on the target area of the physical object through the terminal device.
  • the terminal device may obtain a zoom ratio between the virtual object and the target area, determine display coordinates of the virtual object based on the zoom ratio and the third spatial position information, and then generate a virtual object based on the display coordinates.
  • the model size of the virtual object to be displayed is larger or smaller than the target area size of the physical object. If the size of the virtual object is not scaled, the displayed virtual object will result Too large or too small to achieve the effect of accurately overlaying the virtual object on the target area of the physical object. Therefore, by acquiring the zoom ratio between the virtual object and the target area, and adjusting and displaying the virtual object, the user can see that the virtual object is accurately displayed in the target area through the terminal device.
  • the terminal device may calculate a scaling ratio according to a ratio of the virtual object to the target area to adjust the virtual object to be displayed.
  • the scaling ratio refers to a ratio between the size of the virtual object and the size of the target area, where the ratio of sizes can represent the size of the area occupied. For example, if the area occupied by the virtual object in the virtual space is 50cm * 50cm, the size of the target area of the physical object is 1cm * 1cm, and so on, the scaling ratio between the virtual object and the target area is 50: 1.
  • the size of the virtual object refers to the size of the virtual object model after completion.
  • the size of the target area can be obtained by multiplying the proportion of the physical object occupied by the target area and the area of the physical object stored in advance.
  • the ratio of the occupied area size of the virtual object to the target area may be used as the scaling ratio, or the ratio of the occupied area size of the virtual object to the target area is multiplied by a preset coefficient as the scaling ratio.
  • the adjustment of the virtual object can be directly adjusted based on the ratio of the virtual object to the target area, or it can be adjusted based on the ratio of the virtual object to the target area multiplied by a preset coefficient.
  • the preset coefficient can be between 0.7 and 1.3.
  • the experience coefficient is set according to the user's perception experience, allowing a certain deviation value to be aligned while ensuring the user's experience, and the flexible scaling can be used to achieve the self-adaptation of the size of the virtual object and the target area, improving the user's viewing experience.
  • the terminal device can read the data corresponding to the virtual object.
  • the data can include the model data of the virtual object.
  • the model data is data used to render the virtual object, including the color and 3D used to build the model corresponding to the virtual object.
  • the terminal device can construct a virtual object according to the data corresponding to the virtual object, and then adjust the size of the virtual object. For example, if a terminal device displays a line segment of a certain color, the 3D point queue (point coordinates in multiple virtual spaces), the thickness of the line segment, and the color of the line segment may be used as model data of the virtual object.
  • the terminal device when calculating the display coordinates of the virtual object in the display space, may obtain the coordinates of the target area in the real space based on the terminal device ’s third spatial position information relative to the target area, using the terminal device as the origin, Then the coordinates of the target area in the real space are converted to the coordinates in the virtual space with the terminal device as the origin.
  • the coordinates of the target area in the virtual space can be used as the display coordinates of the virtual object.
  • the display coordinates of the object in virtual space when calculating the display coordinates of the virtual object in the display space.
  • 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 scene. target area.
  • the terminal device may also use the target area as the origin, determine the spatial coordinates and rotation information of the terminal device relative to the target area according to the third spatial position information, and assign the spatial coordinates and rotation information to the terminal device in the content space.
  • virtual objects where the content space can refer to the spatial coordinate system in the virtual space with the virtual object as the origin, and then the display coordinates of the virtual object are determined based on the zoom ratio, spatial coordinates, and rotation information.
  • the virtual object is the root node of the content space.
  • the root node can be adjusted directly based on the scaling, spatial coordinates, and rotation information.
  • the virtual object can be accurately displayed in the target area without changing the position of the virtual object, which improves rendering efficiency.
  • the user can observe the virtual object through the terminal device.
  • the virtual object viewed by the user also changes accordingly. For example, when the terminal device is far from the target area, the virtual object becomes smaller; Close to the target area, the virtual object becomes larger.
  • FIG. 4 shows another method for displaying a virtual object according to an embodiment of the present application, and instructions corresponding to the method are executed by a processor.
  • the specific execution steps are as follows.
  • Step S410 Acquire first spatial position information of the marker relative to the terminal device.
  • Step S420 Determine the target area of the physical object according to the selection operation of the target area of the physical object by the user.
  • a user may select a target area using a control device, and determine the position of the target area.
  • a user when wearing a head-mounted display device, a user can observe a physical object, and select a target area by manipulating the control device.
  • the terminal device may receive a selection instruction sent by the control device, and select a target area according to the selection instruction.
  • the control device can send its position and attitude information to the terminal device during the process of being moved, and the terminal device determines the target area according to the position and attitude information of the control device.
  • a user may perform selection operations using keys, a touchpad, and the like on a control device to select a target area.
  • the control device may generate a control instruction according to the touch operation and send the control instruction to the terminal device.
  • the terminal device can determine the target area according to the control instruction.
  • the starting point selected in the virtual space can be obtained according to the position and attitude information or control instructions of the control device, and then the movement track of the starting point can be obtained according to the change in the position and attitude of the control device. Finally, the movement track can be determined according to the movement track The selected area in the virtual space.
  • the movement trajectory may also be directly obtained according to the posture information of the control device to determine the target area. According to the position of the selected area in the virtual space and the coordinates of the physical object in the virtual space, the position relationship between the selected area in the virtual space and the physical object can be determined, and then the position relationship can be converted into the position relationship in the real space.
  • the fifth spatial position information of the target area relative to the physical object is obtained.
  • the target area can also be selected by detecting a user's gesture.
  • the terminal device may collect a gesture image of the user through the camera, and recognize the gesture image.
  • the selection of the target area is triggered, and the target area is determined according to the movement trajectory of the detected gesture.
  • the target area can also be selected by tracking changes in eyeball gaze points.
  • a head-mounted display device may be provided with a camera for acquiring an image of a user's eyes. By acquiring an image of the user's eyes, the user can capture image data of the user's retina and cornea to track the gaze point of the eyeball, thereby determining the target area.
  • other electronic devices connected to the terminal device such as a mobile phone, a tablet, etc. may also be used to select the target area.
  • the electronic device connected to the terminal device stores the model of the physical object
  • the electronic device can display the model of the physical object
  • the user can select a certain area on the physical object model on the electronic device, and the electronic device will The area selected by the user is sent to the terminal device, and the terminal device determines the target area according to the selected area.
  • an operation of selecting a target area again may be performed, and the terminal device may determine a new target area according to the instruction of selecting the target area again to convert the virtual object. Show in new target area.
  • Step S430 Obtain fourth spatial position information of the marker relative to the physical object and fifth spatial position information of the target area relative to the physical object.
  • the terminal device acquiring the second spatial position information of the marker relative to the target area may be the fourth spatial position information of the terminal device relative to the physical object according to the stored marker and the fifth space of the target area relative to the physical object.
  • the fifth spatial position information of the target area relative to the physical object may be obtained according to determining a specific target area.
  • the fifth spatial position information may be stored in the terminal device in advance, so that the terminal device can directly read the fifth spatial position information.
  • Step S440 Determine second spatial position information of the marker relative to the target area based on the fourth spatial position information and the fifth spatial position information.
  • a physical object can be used as a reference to determine the relative position relationship between the marker and the target area, and the relative position of the marker to the target area can be obtained.
  • Second spatial position information After obtaining the fourth spatial position information and the fifth spatial position information, based on the fourth and fifth spatial position information, a physical object can be used as a reference to determine the relative position relationship between the marker and the target area, and the relative position of the marker to the target area can be obtained. Second spatial position information.
  • Step S450 Determine 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.
  • Step S460 Generate a virtual object based on the third spatial position information, and display the virtual object.
  • the display position of the virtual object corresponds to the target area of the physical object.
  • a corresponding virtual object is rendered in the target area according to the changed first spatial position information.
  • the virtual object is a house, and the front of the house was previously displayed.
  • the attitude information of the marker changes, and the house is rendered based on the model data of the virtual object in the target area Side image and display it.
  • a larger house can be rendered according to the model data of the virtual object and the changed distance, and displayed, so that the user can observe more when approaching the marker. Large house; when the distance between the marker and the terminal device becomes larger, the smaller house can be rendered and displayed, so that when the user is far away from the marker, the smaller house is observed; and During the process, the house is always superimposed on the target area.
  • the above-mentioned method for displaying a virtual object may be applied to some scenes in which a marker needs to be masked, so that the terminal device recognizes the marker set at a position that does not affect the aesthetics of the physical object, so that the user can observe the virtual object
  • the area superimposed on the physical object does not affect the overall aesthetics.
  • markers can be placed next to a physical table. Users wear terminal devices and can observe virtual game objects displayed on the desktop. When applied to a theme restaurant, the markers can also be placed on the edge of the menu. After the terminal device recognizes the marker, a virtual model of some dishes superimposed and displayed on the menu can be observed, so that the user can better order meals accordingly.
  • the display method of the virtual object can also be applied to advertisement display. Markers can be placed at corner positions on the advertisement bar. After the terminal device recognizes the markers, it can observe the virtual advertisements superimposed and displayed on the advertisement board. content.
  • the virtual object may be directly displayed on the marker, that is, the target area displayed by the virtual object is the area where the marker is located.
  • FIG. 5 illustrates yet another method for displaying a virtual object according to an embodiment of the present application. Instructions corresponding to the method are executed by a processor, and specific execution steps are as follows.
  • Step S510 Collect a marker image including a marker.
  • Step S520 Identify the marker included in the marker image.
  • the terminal device can identify the marker according to the collected marker image, obtain the identity information of the marker, and the relative position and attitude information between the terminal device and the marker.
  • Step S530 Obtain the scaling ratio of the constructed virtual object and the marker.
  • the terminal device can calculate the scaling ratio according to the ratio of the virtual object to the marker, so as to realize the scaling of the virtual object.
  • the scaling ratio is the ratio of the size of the virtual object to the size of the marker.
  • the ratio of the size can refer to the size of the area occupied. For example, the size of the virtual object is 100cm * 100cm, the size of the marker is 1cm * 1cm, etc.
  • the scaling ratio of the virtual object to the marker is 100: 1.
  • the ratio of the size of the virtual object to the marker may be used as the scaling ratio, or the ratio of the virtual object to the marker may be multiplied by a preset coefficient as the scaling ratio.
  • the preset coefficient may be between 0.8 and 1.2.
  • the experience coefficient can also be set according to the user's visual experience, allowing alignment to have a certain deviation value while ensuring the user's experience, and the flexible scaling can be used to achieve the self-adaptation of the size of the virtual object and the marker to improve the user's viewing experience. .
  • Step S540 Render the virtual object according to the zoom ratio, display the virtual object, and the display position of the virtual object corresponds to the marker.
  • the zoom ratio when a zoom-in instruction for a virtual object is received, the zoom ratio is enlarged; when a zoom-in instruction for a virtual object is received, the zoom ratio is reduced.
  • the zoom-in instruction or the zoom-out instruction may be issued by the user through the controller of the terminal device, or may be issued by voice, or may be determined by the terminal device according to the length of time the user watches the virtual object.
  • the terminal device can determine the display coordinates of the virtual object according to the zoom ratio, and render the virtual object according to the display coordinates.
  • the display coordinates are used to represent the three-dimensional position of the virtual object in the virtual space, and then a corresponding virtual picture can be generated and passed through the display device. Display it.
  • the displayed virtual object conforms to the corresponding zoom ratio. The user can see that the zoomed virtual object is displayed on the marker superimposed on the terminal device, and the virtual object and the marker are aligned and displayed, so that the virtual object can be placed at random relative to the camera.
  • FIG. 6 is a schematic diagram of the alignment display of the virtual object and the marker.
  • the terminal device can read the data corresponding to the virtual object corresponding to the marker, and obtain the display position of the virtual object in the virtual space of the terminal device, and render the virtual object at the display position of the virtual space for display, so that the terminal device displays the
  • the real position of the virtual object in the content is the same as the real position of the marker observed by the user, that is, it corresponds to the same position in the real scene.
  • the user of the terminal device can observe the virtual object from different perspectives. The user of the terminal device can move the position, and the virtual object also changes with the movement of the user's position.
  • the virtual object display method provided in this embodiment collects marker images, identifies markers contained in the marker image, obtains the scale ratio of the constructed virtual object and the marker, renders the virtual object according to the scale ratio, and superimposes the display. On the marker, the self-adaptation of the virtual object to the size of the marker is realized.
  • the relative position and posture information between the marker and the terminal device can be obtained.
  • the relative position and attitude information between the marker and the terminal device may be relative coordinates and rotation information of the marker and the terminal device in different coordinate spaces.
  • the terminal device may use the terminal device as an origin, and obtain first relative position information of the marker in the first coordinate space and the terminal device.
  • the first coordinate space is the device space.
  • the terminal device is used as the origin in the device space to obtain the first relative position information in the first coordinate space, that is, to obtain the coordinate and rotation information of the marker in the device space relative to the terminal device.
  • the marker After the terminal device acquires the first relative position information, the marker can be used as the origin, and the first relative position information can be reversely restored to obtain the second relative position information of the marker in the second coordinate space and the terminal device.
  • the second coordinate space is the reference coordinate space.
  • the marker In the reference coordinate space, the marker is used as the origin, and the first relative position information is reversely restored, that is, the relative coordinates and rotation information of the terminal device with respect to the marker are obtained.
  • the relative coordinates and rotation information of the terminal device and the marker in the device space may be obtained 1: 1 and the terminal device in the reference coordinate space and Relative coordinates and rotation information of the marker.
  • the coordinates of the marker in the device space can be converted into the coordinates of the terminal device in the reference coordinate space, and the coordinates and rotation information of the terminal device relative to the marker in the reference coordinate space can be obtained with the marker as the origin.
  • the coordinates of the marker relative to the terminal device are obtained using the terminal device as the origin.
  • the marker device is the origin relative to the marker in the reference coordinate space.
  • the coordinates are (6,8, -1).
  • the terminal device may assign the second relative position information to the terminal device and the virtual object in the third coordinate space, and calculate the second relative position information according to the scaling ratio to obtain the display coordinates of the virtual object.
  • the third coordinate space is the content space.
  • the coordinates and orientation of the virtual object and the terminal device in the content space may be the same as those of the marker and the terminal in the reference coordinate space.
  • the relative coordinates and orientation of the device are the same.
  • the terminal device can assign the relative coordinates and orientation of the terminal device and the marker in the reference coordinate space to the terminal device and the virtual object in the content space, and then calculate the assigned second relative position information according to the zoom ratio to determine the display coordinates of the virtual object. . For example, assuming that the size of the virtual object is 100 cm * 100 cm, and the size of the marker in the real world is 0.1 cm * 0.1 cm, the scaling ratio is 1000.
  • the changing coordinates of the terminal device in the device space can be scaled according to the scaling ratio of the content space. For example, if the coordinates of the terminal device in the device space are (0, 0, -3), the scaling factor becomes (0, 0) 0, -3000), so that the display coordinates of the virtual object in the virtual space can be obtained.
  • the virtual object is the root node in the content space. In the process of determining the display coordinates, there is no need to move the position of the virtual object in the virtual space. Simply adjusting the root node can realize the adaptation of the virtual object to the marker and improve the rendering efficiency. .
  • a movement parameter of the marker with respect to the terminal device is acquired, and the movement parameter may include an angle and a distance of the marker with respect to the terminal device. , Orientation, etc.
  • a movement of the marker relative to the terminal device it indicates that the relative position or angle of the user and the marker has changed, or the position or angle of the marker has changed.
  • the movement can be a horizontal movement and / or the user's pitch The angle changes. At this time, the user may need to observe the virtual object from different angles or different distances.
  • the relative position information between the marker and the terminal device may be re-determined according to the movement parameter, and the display coordinates of the virtual object may be obtained again according to the re-determined relative position information, and the display object may be used to re-render the virtual object. It can be guaranteed that no matter how the terminal device or the marker moves, the displayed virtual object is always superimposed on the marker and aligned with the marker.
  • the terminal device may separately obtain a zoom ratio of each virtual object and the marker, and the obtained zoom ratio is a pre-stored ratio, that is, when The proportion of virtual objects placed on the marker when they are single.
  • the corresponding area of each virtual object on the marker can be determined, and then the corresponding zoom ratio of each virtual object is adjusted according to the corresponding area of each virtual object on the marker, and the virtual object is adjusted according to the adjusted zoom ratio of each virtual object. Superimposed on the marker.
  • the areas superimposed on the markers are different when different virtual objects are displayed, and the size of the superimposed area may be the same or different.
  • the superimposed area on the marker may be determined according to the size relationship between each virtual object and the marker. For the convenience of explanation, it is assumed that two virtual objects OB1 and OB2 need to be superimposed and displayed on the marker, wherein the size of the marker is S0, and the size ratio relationship between the virtual object OB1 and the virtual object OB2 is S1: S2.
  • the proportional relationship shows that the display area of the virtual object OB1 on the marker is S0 * [S1 / (S1 + S2)], and the overlay area of the virtual object OB2 on the marker is S0 * [S1 / (S1 + S2)].
  • an overlay area of each virtual object on the marker may also be set in advance, and a zoom ratio of the virtual object may be adjusted according to the set overlay area.
  • the virtual object OB1 and the virtual object OB2 are superimposed on the marker 21, wherein the virtual object OB1 needs to be superimposed and displayed on the area A1 on the marker 21, and the virtual object OB2 needs to be superimposed and displayed on the marker 21.
  • the scaling ratio of the virtual object OB1 can be adjusted so that the virtual object OB1 is aligned with the area A1 for display, and the scaling of the virtual object OB2 can be adjusted according to the size of the area A2 so that the virtual object OB2 is aligned with the area A2 for display. .
  • the present application further provides a terminal device including a memory and a processor.
  • the memory stores a computer program.
  • the processor implements the foregoing display method of the virtual object.
  • the present application further provides a computer storage medium on which a computer program is stored.
  • the computer program is executed by a processor, the method for displaying a virtual object described above can be implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

一种虚拟对象的显示方法包括:获取所述标记物相对终端设备的第一空间位置信息;获取所述标记物相对物理对象的目标区域的第二空间位置信息;基于所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;基于所述第三空间位置信息,将虚拟对象显示于所述物理对象的目标区域。

Description

虚拟对象的增强现实显示方法和设备
本申请要求于2018年6月19日提交中国专利局、申请号为201810632329.8、发明名称为“虚拟对象的显示方法、装置、终端设备及存储介质”及于2018年7月20日提交中国专利局、申请号为201810804399.7、发明名称为“虚拟对象的显示方法、装置、终端设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及增强现实技术领域,更具体地,涉及一种虚拟对象的显示方法、终端设备及存储介质。
背景技术
近年来,随着科技的进步,增强现实(AR,Augmented Reality)等技术已逐渐成为国内外研究的热点,增强现实是通过计算机系统提供的信息增加用户对现实世界感知的技术,其将计算机生成的虚拟对象、场景或系统提示信息等内容对象叠加到真实场景中,来增强或修改对现实世界环境或表示现实世界环境的数据的感知。在现有的增强现实的显示技术中,终端设备不能较好的将虚拟对象与物理对象结合进行显示。
申请内容
本申请实施例提供了一种虚拟对象的显示方法、装置、终端设备及存储介质,以较好的实现虚拟对象与物理对象的结合显示。
第一方面,本申请实施例提供了一种虚拟对象的显示方法,应用于终端设备,所述方法包括:获取所述标记物相对终端设备的第一空间位置信息;获取所述标记物相对物理对象的目标区域的第二空间位置信息;基于所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;基于所述第三空间位置信息,将虚拟对象显示于所述物理对象的目标区域。
第二方面,本申请实施例提供了一种终端设备,包括存储器,所述存储器中存储有计算机程序;处理器,所述计算机程序被所述处理器执行时,使得所述处理器执行如下步骤:获取标记物相对终端设备的第一空间位置信息;获取所述标记物相对物理对象的目标区域的第二空间位置信息;基于所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;基于所述第三空间位置信息,生成虚拟对象,所述虚拟对象的显示位置与所述目标区域对应。标记物相对终端设备。
第三方面,本申请实施例提供了一种计算机存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行如下步骤:获取标记物相对终端设备的第一空间位置信息;获取所述标记物相对物理对象的目标区域的第二空间位置信息;基于 所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;基于所述第三空间位置信息,生成虚拟对象,所述虚拟对象的显示位置与所述目标区域对应。
第四方面,本申请实施例提供了一种虚拟对象的显示方法,所述方法包括:采集包含标记物的标记物图像;识别所述标记物图像包含的标记物;获取构建的虚拟对象与所述标记物的缩放比例;将所述虚拟对象按照所述缩放比例进行渲染;及显示所述虚拟对象,所述虚拟对象的显示位置与所述标记物对应。
第五方面,本申请实施例提供了一种终端设备,包括存储器,所述存储器中存储有计算机程序;处理器,所述计算机程序被所述处理器执行时,使得所述处理器执行如下步骤:采集包含标记物的标记物图像;识别所述标记物图像包含的标记物;获取构建的虚拟对象与所述标记物的缩放比例;将所述虚拟对象按照所述缩放比例进行渲染,所述虚拟对象的显示位置与所述标记物对应。
第六方面,本申请实施例提供了一种计算机存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行如下步骤:采集包含标记物的标记物图像;识别所述标记物图像包含的标记物;获取构建的虚拟对象与所述标记物的缩放比例;将所述虚拟对象按照所述缩放比例进行渲染,所述虚拟对象的显示位置与所述标记物对应。
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了本申请实施例提供的增强现实系统的场景示意图;
图2示出了本申请实施例的终端设备的结构框图;
图3示出了本申请一实施例提供的虚拟对象的显示方法的流程图;
图4示出了本申请另一实施例提供的虚拟对象的显示方法的流程图;
图5示出了本申请又一实施例提供的虚拟对象的显示方法的流程图;
图6示出了一个实施例中虚拟对象与标记物对齐显示的示意图;
图7示出了一个实施例中具有两个虚拟对象时的场景示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。 基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参阅图1,本申请实施例提供一种增强现实系统10,包括终端设备100、标记物200。终端设备100上设置有相机,当设置在物理对象300表面上的标记物200处于相机的视觉范围内时,终端设备100可将上述标记物200作为目标标记物,采集包含目标标记物的图像,并通过对采集到的目标标记物图像进行识别追踪处理,以获得标记物200的身份信息,以及终端设备100相对标记物200的位置和姿态等空间位置信息,使得用户通过终端设备100观看到虚拟对象400叠加显示在物理对象300对应的目标区域301内。
在一些实施方式中,标记物200的表面可为具有拓扑结构的图案,拓扑结构是指标记物200中的子标记物和特征点等之间连通关系,该拓扑结构表示标记物200的身份信息。其中,标记物200的轮廓可以为矩形、圆形等形状,在此不做限定。标记物200也可以是其他图案,在此不作限定,仅需可被终端设备100识别追踪即可。
在一些实施方式中,终端设备100可以是头戴显示装置,也可以是手机、平板等移动设备。当终端设备100为头戴显示装置时,其可以是一体式头戴显示装置;终端设备100也可以是与外接式头戴显示装置连接的手机等智能终端,即终端设备100可作为头戴显示装置的处理和存储设备,插入或者接入外接式头戴显示装置,在头戴显示装置中对虚拟对象进行显示功能。
请参见图2,在一些示例中,终端设备100包括处理器110、存储器120、显示单元130以及相机140。其中,存储器120、显示单元130以及相机140均与处理器110连接。
相机140用于采集待拍摄物体的图像并发送至处理器110,其可以为红外相机、彩色相机等;当为红外相机时,可通过终端设备100内的照明元件或外部照明元件发射红外光到标记物,并接收标记物表面反射的光线,使得红外相机可采集到包含有标记物图案的图像。
处理器110可以包括任何适当类型的通用或专用微处理器、数字信号处理器或微控制器,其可被配置为经由例如网络从系统的各种组件接收数据和/或信号,还可处理数据和/或信号以确定系统中的一个或多个操作条件。例如,处理器110根据预先存储的图像数据生成虚拟世界的图像数据,将其发送至显示单元130进行显示;也可通过有线或无线网络接收智能终端或计算机的发送的图像数据,根据所接收的图像数据生成虚拟世界的图像;还可根据相机采集的标记物图像对标记物进行识别定位,以确定对应的显示内容。
存储器120可用于存储软件程序以及模块,处理器110通过运行存储在存储器120 内的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器120包括非暂时性计算机可读介质,如半导体或固态存储器,随机访问存储器、只读存储器、硬盘、光盘或者其他适当的存储介质。
需要指出,处理器110及存储器120并不限定于装设在终端设备100内,例如当终端设备100为与外接式头戴显示装置连接的移动终端时,上述实施方式中的处理器110执行的处理由移动终端的处理器执行,上述实施方式中的存储器120存储的数据由移动终端的存储器进行存储。
在一些实施方式中,终端设备100也还可以包括通信模块,通信模块用于终端设备100与其他设备之间的通信。
请参阅图3,本申请实施例提供了一种虚拟对象的显示方法,该方法对应的指令存储于终端设备100的存储器120中,该指令由处理器110执行,具体执行步骤如下。
步骤S310:获取标记物相对终端设备的第一空间位置信息。
在一些实施方式中,终端设备可对位于相机的视觉范围内的标记物进行图像采集,并对获取的包含有标记物的图像进行识别,以获得标记物相对终端设备的第一空间位置信息。空间位置信息表示六自由度信息,第一空间位置信息可包括标记物相对终端设备的位置及姿态信息等。
当标记物相对终端设备的空间位置发生变化时,终端设备通过相机所采集到的标记物图像也会发生变化,可获取到不同视角的标记物图像,这些不同视角的标记物图像中标记物的图像信息将会不同。因此,终端设备根据于不同空间位置获取的标记物图像,所获取的标记物相对终端设备的第一空间位置信息也不相同。
在一个实施例中,终端设备对标记物进行识别还可以获得标记物的身份信息。其中,不同的标记物可以具有不同身份信息,标记物与其身份信息的对应关系存储于终端设备中。另外,可以将标记物的身份信息与相关数据的对应关系存储于终端设备,当终端设备识别出标记物的身份信息后,可根据记物的身份信息,读取标记物所对应的数据。作为一种具体实施方式,可以读取标记物所对应的虚拟对象的模型数据等,例如,标记物A与存储的虚拟对象1的数据信息相对应,终端设备在通过识别标记物A获得标记物A的身份信息后,基于标记物A的身份信息与虚拟对象1的对应关系,获得虚拟对象1的对应数据信息。
步骤S320:获取标记物相对物理对象的目标区域的第二空间位置信息。
在一个实施例中,终端设备获取标记物相对物理对象的目标区域的第二空间位置信息,以用于确定终端设备与目标区域的相对位置关系。其中,物理对象是指现实空间中的实际物体,物理对象的目标区域为需要将虚拟对象展示在物理对象的某块区域, 即目标区域为虚拟对象在现实空间中叠加显示的区域。例如,如图1所示,物理对象300为现实空间中的桌板,标记物200设于桌板的表面上,此时,目标区域301为桌板的表面上的一区域,用户可通过终端设备100观看到虚拟对象叠加显示在目标区域301上。
需要指出,标记物并不限定于设置在物理对象上,目标区域并不限定于设置在物理对象上。
在一些实施方式中,标记物相对物理对象的目标区域的第二空间位置信息可以预先存储于终端设备中,由终端设备读取,也可以是终端设备实时获取。
步骤S330:基于第一空间位置信息以及第二空间位置信息,确定终端设备相对目标区域的第三空间位置信息。
在一个实施例中,以标记物作为参照,根据第一空间位置信息以及第二空间位置信息,获得终端设备相对目标区域的第三空间位置信息,该第三空间位置信息可包括终端设备相对目标区域的位置及姿态等信息。
步骤S340:基于第三空间位置信息,生成虚拟对象,并对虚拟对象进行显示,虚拟对象的显示位置与物理对象的目标区域相对应。
在一个实施例中,可根据标记物的身份信息确定对应的虚拟对象,根据第三空间位置信息计算得到该虚拟对象在虚拟空间中的显示坐标,该显示坐标可表示虚拟对象在虚拟空间中的显示位置,根据该显示坐标生成虚拟对象,并通过显示单元将该虚拟对象进行显示。虚拟对象的显示位置与物理对象的目标区域对应是指虚拟对象叠加显示在目标区域上,用户通过终端设备可以看到虚拟对象叠加显示于物理对象的目标区域上。
作为一种方式,终端设备可获取虚拟对象与目标区域之间的缩放比例,基于缩放比例以及第三空间位置信息确定虚拟对象的显示坐标,再基于显示坐标生成虚拟对象。
在将虚拟对象叠加显示在物理对象上时,存在待显示的虚拟对象的模型大小会大于或者小于物理对象的目标区域大小的情况,如果不对虚拟对象的大小进行缩放,则会导致展示的虚拟对象过大或者过小,无法达到将虚拟对象准确叠加显示于物理对象的目标区域的效果。因此,通过获取虚拟对象与目标区域的缩放比例,对虚拟对象进行调整显示,用户通过终端设备可以看到虚拟对象准确叠加显示目标区域内。
作为一种具体的实施方式,终端设备可以根据虚拟对象与目标区域的比值计算缩放比例,以调整待显示的虚拟对象。具体地,缩放比例指虚拟对象的大小和目标区域的大小的比值,其中,大小的比值可表示所占面积的大小。例如,虚拟对象在虚拟空间中所占的面积大小为50cm*50cm,物理对象的目标区域的大小为1cm*1cm等,则虚 拟对象与目标区域的缩放比例为50:1。虚拟对象的大小是指虚拟对象模型建成后的大小,目标区域的大小可以是目标区域所占物理对象比例,与预先存储的物理对象的面积的乘积所得。
在一些实施方式中,可将虚拟对象与目标区域的所占面积大小比值作为缩放比例,或者将虚拟对象与目标区域的所占面积大小的比值乘以预设系数后作为缩放比例。
对虚拟对象的调整可直接根据虚拟对象与目标区域的比值进行调整,也可根据虚拟对象与目标区域的比值乘以预设系数进行调整,例如预设系数可以是0.7~1.3之间,还可根据用户的观感体验设置经验系数,允许对齐存在一定的偏差值的同时保证用户的体验,还可采用灵活的缩放比例实现虚拟对象与目标区域大小的自适配,提升用户观看的体验。
在获得缩放比例后,终端设备可以读取虚拟对象对应的数据,数据可以包括虚拟对象的模型数据,模型数据为用于渲染虚拟对象的数据,包括用于建立虚拟对象对应的模型的颜色、3D模型中的各顶点坐标等,终端设备可根据虚拟对象对应的数据构建虚拟对象,再对虚拟对象的大小进行调整。例如,终端设备显示一条某颜色的线段,则可以将该线段的3D点队列(多个虚拟空间中的点坐标)、线段的粗度、线段的颜色等数据作为虚拟对象的模型数据。
在一些实施方式中,终端设备在计算虚拟对象在显示空间的显示坐标时,可根据终端设备相对目标区域的第三空间位置信息,以终端设备为原点,获得目标区域在现实空间中的坐标,然后将目标区域在现实空间中的坐标转换为虚拟空间中以终端设备为原点的坐标,可将目标区域在虚拟空间的坐标作为虚拟对象的显示坐标,即获得了需要叠加显示在目标区域的虚拟对象在虚拟空间中的显示坐标。终端设备可在计算得到的显示坐标处渲染虚拟对象,使终端设备显示的虚拟对象的真实位置,与终端设备的视野中目标区域的真实位置相同,即虚拟对象的显示位置对应于真实场景中的目标区域。
在一些实施方式中,终端设备也可以目标区域为原点,根据第三空间位置信息确定终端设备相对目标区域的空间坐标和旋转信息,并将该空间坐标和旋转信息赋值给内容空间中的终端设备及虚拟对象,其中,内容空间可指的是虚拟空间中以虚拟对象为原点的空间坐标系,再基于缩放比例、空间坐标和旋转信息确定虚拟对象的显示坐标。虚拟对象为内容空间的根节点,可基于缩放比例、空间坐标和旋转信息直接对根节点进行调整,无需变动虚拟对象的位置即可准确将虚拟对象叠加显示在目标区域,提高了渲染效率。
用户可通过终端设备观察虚拟对象,当终端设备相对目标区域的位置及姿态发生变化时,用户观看到的虚拟对象也会发生相应的变化,例如,终端设备远离目标区域时,虚拟对象变小;靠近目标区域,虚拟对象变大。
图4示出了本申请实施例又一种虚拟对象的显示方法,该方法对应的指令由处理 器执行,具体执行步骤如下。
步骤S410:获取标记物相对终端设备的第一空间位置信息。
步骤S420:根据用户对物理对象的目标区域的选取操作,确定物理对象的目标区域。
在一些实施方式中,用户可利用控制设备选取目标区域,确定目标区域的位置。
作为一种具体实施方式,用户在佩戴头戴显示设备时,可观察到物理对象,通过操控控制设备对目标区域进行选取。终端设备可接收控制设备发送的选取指令,并根据选取指令选取目标区域。控制设备可以在其被移动的过程中,将其位置及姿态信息发送至终端设备,终端设备根据控制设备的位置及姿态信息确定目标区域。
在一些实施方式中,用户可利用控制设备上的按键、触控板等进行选取操作,以对目标区域进行选取,控制设备可根据触控操作生成控制指令,并将控制指令发送至终端设备,终端设备可根据控制指令确定目标区域。
其中,根据控制设备的位置及姿态信息或控制指令,可以获得虚拟空间中选取的起始点,然后根据控制设备位置及姿态的变化,可以获得起始点的移动轨迹,最后根据移动轨迹则可以确定出虚拟空间中选取的区域。在一些实施方式中,也可直接根据控制设备的姿态信息获取移动轨迹,以确定目标区域。可根据虚拟空间中选取的区域的位置以及物理对象在虚拟空间中的坐标,确定出虚拟空间中选取的区域与物理对象的位置关系,再将该位置关系转化为现实空间的位置关系,即可得到目标区域相对物理对象的第五空间位置信息。
在一些实施方式中,还可通过检测用户的手势选取目标区域。终端设备可通过相机采集用户的手势图像,并对手势图像进行识别,在检测到用户的手势为预设手势时,触发对目标区域的选取,根据检测到的手势的移动轨迹确定目标区域。
在一些实施方式中,还可通过跟踪眼球注视点的变化,选取目标区域。例如,可在头戴显示设备中设置用于获取用户眼睛图像的摄像头,通过获取用户的眼睛图像,捕捉到用户的视网膜及角膜的图像数据,以跟踪眼球的注视点,进而确定目标区域。
在一些实施方式中,还可利用与终端设备连接的其他电子设备,例如手机、平板等,选取目标区域。具体地,与终端设备连接的电子设备中存储有上述物理对象的模型,该电子设备可显示该物理对象的模型,用户可在该电子设备上选取物理对象模型上的某块区域,电子设备将用户选取的区域发送至终端设备,终端设备根据选取的区域确定目标区域。
在一些实施方式中,当需要对虚拟对象在物理对象上的叠加位置进行调整时,可进行再次选取目标区域的操作,终端设备可根据再次选取目标区域的指令确定新的目 标区域,将虚拟对象显示于新的目标区域。
步骤S430:获取标记物相对物理对象的第四空间位置信息,以及目标区域相对物理对象的第五空间位置信息。
在一些实施方式中,终端设备获取标记物相对目标区域的第二空间位置信息,可以是终端设备根据存储的标记物相对物理对象的第四空间位置信息,以及目标区域相对物理对象的第五空间位置信息获取。其中,目标区域相对物理对象的第五空间位置信息,可根据确定具体的目标区域获得。当目标区域为预先设定的区域时,该第五空间位置信息可预先存储于终端设备中,使得终端设备可以直接读取该第五空间位置信息。
步骤S440:基于第四空间位置信息以及第五空间位置信息,确定标记物相对目标区域的第二空间位置信息。
在获得第四空间位置信息以及第五空间位置信息之后,可根据第四、第五空间位置信息,以物理对象为参照,确定出标记物与目标区域的相对位置关系,获得标记物相对目标区域的第二空间位置信息。
步骤S450:基于第一空间位置信息以及第二空间位置信息,确定终端设备相对目标区域的第三空间位置信息。
步骤S460:基于第三空间位置信息,生成虚拟对象,并对虚拟对象进行显示,虚拟对象的显示位置与物理对象的目标区域对应。
在一些实施方式中,当检测到标记物相对终端设备的第一空间位置信息发生变化时,根据变化后的第一空间位置信息,在目标区域渲染对应的虚拟对象。例如,虚拟对象为一个房子,此前展示的为房子的正面,在终端设备朝向标记物的另一侧时,相对标记物的姿态信息发生变化,则在目标区域根据虚拟对象的模型数据渲染出房子的侧面图像,并进行显示。又例如,当标记物与终端设备之间的距离变小后,可根据虚拟对象的模型数据及变化的距离渲染出变大的房子,并进行显示,使得用户在靠近标记物时可观察到更大的房子;当标记物与终端设备之间的距离变大时,可渲染出变小的房子,并进行显示,使得用户在远离标记物时,观察到更小的房子;而且在整个观察的过程中,房子始终叠加显示在目标区域上。
在一些实施方式中,上述虚拟对象的显示方法可以应用于某些需要将标记物进行掩饰的场景,使终端设备识别设置于不影响物理对象美观的位置的标记物,从而用户可以观察到虚拟对象叠加显示在物理对象上的区域,并不对整体美观造成影响。例如在一些AR桌游中,标记物可以设置于实体桌边,用户佩戴终端设备,可以观察到叠加显示在桌面上的虚拟游戏对象;应用于主题餐厅时,标记物也可以设置于菜单的边 缘,终端设备识别标记物后,可以观察到叠加显示在菜单上的一些菜品的虚拟模型,使用户可以据此更好的进行点餐。又例如,该虚拟对象的显示方法还可以应用于广告显示中,标记物可以放置于广告栏上的角落位置,终端设备设备识别标记物后,可以将观察到叠加显示在广告板上的虚拟广告内容。
在一些实施方式中,虚拟对象可直接叠加显示在标记物上,即虚拟对象叠加显示的目标区域为标记物所在的位置区域。
图5示出了本申请实施例又一种虚拟对象的显示方法,该方法对应的指令由处理器执行,具体执行步骤如下。
步骤S510:采集包含标记物的标记物图像。
步骤S520:识别标记物图像包含的标记物。
终端设备可根据采集到的标记物图像对标记物进行识别,获取标记物的身份信息,以及终端设备与标记物之间的相对位置及姿态信息。
步骤S530:获取构建的虚拟对象与标记物的缩放比例。
终端设备可根据虚拟对象与标记物的比值计算缩放比例,以实现对虚拟对象的缩放。其中,缩放比例即虚拟对象的大小和标记物大小的比值,其中,大小的比值可指所占面积的大小,例如,虚拟对象的大小为100cm*100cm,标记物的大小为1cm*1cm等,则虚拟对象与标记物的缩放比例为100:1。
在一些实施方式中,可将虚拟对象与标记物的大小比值作为缩放比例,或者将虚拟对象与标记物的比值乘以预设系数后作为缩放比例,例如预设系数可以是0.8~1.2之间,也可根据用户的观感体验设置经验系数,允许对齐存在一定的偏差值的同时保证用户的体验,还可采用灵活的缩放比例实现虚拟对象与标记物大小的自适配,提升用户观看的体验。
步骤S540:将虚拟对象按照缩放比例进行渲染,显示虚拟对象,虚拟对象的显示位置与标记物对应。
在一些实施方式中,当接收到针对虚拟对象的放大指令时,将缩放比例放大;当接收到针对虚拟对象的缩小指令时,将缩放比例缩小。放大指令或缩小指令可以是用户通过终端设备的控制器发出的,也可以是语音发出的,还可以是终端设备根据用户注视虚拟对象的时间长度确定。
终端设备可按照缩放比例确定虚拟对象的显示坐标,并根据显示坐标对虚拟对象进行渲染,该显示坐标用于表示虚拟对象在虚拟空间中的三维位置,进而可生成相应的虚拟画面并通过显示装置进行显示。显示的虚拟对象符合相应的缩放比例,用户通过终端设备可以看到进行缩放后的虚拟对象叠加显示在标记物上,将虚拟对象与标记物进行对齐显示, 从而实现虚拟对象相对于摄像机随意放置。
图6为虚拟对象与标记物对齐显示的示意图,用户通过终端设备进行观察时,可以看到虚拟对象41叠加显示在标记物21上,且虚拟对象41与标记物21对齐。
终端设备可以读取标记物所对应的虚拟对象对应的数据,并获取虚拟对象在终端设备的虚拟空间的显示位置,并在虚拟空间的显示位置处渲染虚拟对象,进行显示,使得终端设备显示的内容中虚拟对象的真实位置,与用户观察到的标记物的真实位置相同,即对应于真实场景中的位置相同。在一些实施方式中,终端设备的用户可以采用不同的视角观察虚拟对象,终端设备的用户可以进行位置的移动,虚拟对象也会随用户位置的移动而变化。
本实施例提供的虚拟对象的显示方法,通过采集标记物图像,识别标记物图像包含的标记物,获取构建的虚拟对象与标记物的缩放比例,将虚拟对象按照缩放比例进行渲染,并叠加显示在标记物上,实现了虚拟对象与标记物大小的自适配。
在一些实施方式中,终端设备识别标记物图像中包含的标记物后,可获取标记物与终端设备之间的相对位置和姿态信息。标记物与终端设备之间的相对位置和姿态信息可以是标记物与终端设备在不同的坐标空间中的相对坐标和旋转信息。
在一个实施方式中,终端设备可以终端设备为原点,获取第一坐标空间中的标记物与终端设备的第一相对位置信息。第一坐标空间即是设备空间,在设备空间中以终端设备为原点,获取第一坐标空间中的第一相对位置信息,即获取设备空间中标记物相对于终端设备的坐标和旋转信息。
终端设备获取第一相对位置信息后,可以标记物为原点,反向还原第一相对位置信息,得到第二坐标空间中的标记物与终端设备的第二相对位置信息。第二坐标空间即基准坐标空间,在基准坐标空间中以标记物为原点,反向还原第一相对位置信息,即获得终端设备相对于标记物的相对坐标和旋转信息。
由于设备空间和基准空间坐标两个坐标系中的参照坐标即坐标原点不一样,需反向还原第一相对位置信息,得到第二坐标空间中的第二相对位置信息,终端设备与标记物的相对坐标和旋转信息在两个坐标空间中是镜像的关系。作为一种具体实施方式获得第二坐标空间中的第二相对位置信息,可对设备空间中的终端设备与标记物的相对坐标和旋转信息进行1:1反向获取基准坐标空间中终端设备与标记物的相对坐标和旋转信息。可将设备空间中标记物的坐标转化为基准坐标空间中终端设备的坐标,以标记物为原点,得到基准坐标空间中终端设备相对于标记物的坐标和旋转信息。例如,设备空间中以终端设备为原点得到标记物相对于终端设备的坐标为(-6,-8,1),经过坐标变换之后,基准坐标空间中以标记物为原点终端设备相对于标记物的坐标是(6,8,-1)。
在一些实施方式中,终端设备可将第二相对位置信息赋值给第三坐标空间中的终端设备与虚拟对象,并根据缩放比例对第二相对位置信息进行计算,得到虚拟对象的显示坐标。
第三坐标空间即内容空间,作为一种具体实施方式,为了使虚拟对象与标记物准确叠加进行显示,内容空间中虚拟对象与终端设备的坐标和朝向可与基准坐标空间中的标记物与终端设备的相对坐标和朝向是相同的。终端设备可将基准坐标空间中终端设备与标记物的相对坐标和朝向赋值给内容空间中终端设备和虚拟对象,再根据缩放比例对赋值的第二相对位置信息进行计算,确定虚拟对象的显示坐标。举例说明,假设虚拟对象的大小为100cm*100cm,现实世界中的标记物的大小为0.1cm*0.1cm,则缩放比例为1000。可根据内容空间的缩放比例对设备空间中终端设备的变化坐标进行缩放,例如,设备空间中终端设备的坐标为(0,0,-3),则经过缩放比例进行缩放后变成(0,0,-3000),从而可得到虚拟空间中虚拟对象的显示坐标。虚拟对象为内容空间中的根节点,在确定显示坐标的过程中,不需要移动虚拟对象在虚拟空间的位置,仅是简单调节根节点,即可实现虚拟对象与标记物适配,提高渲染效率。
在一些实施方式中,当检测到标记物相对于终端设备的位置及姿态信息发生变化时,获取标记物相对于终端设备的移动参数,该移动参数可包括标记物相对终端设备移动的角度、距离、朝向等。当检测到标记物相对于终端设备发生移动时,表明用户与标记物的相对位置或者角度发生了改变,或者标记物的位置或者角度发生了变化,移动可以是水平方向的移动和/或用户俯仰角度的变化,此时用户有可能需要从不同的角度或者是不同的距离观察虚拟对象。可根据移动参数,重新确定标记物与终端设备之间的相对位置信息,并根据重新确定的相对位置信息重新获取虚拟对象的显示坐标,再利用该显示坐标重新渲染虚拟对象。可以保证不论终端设备或标记物以什么方式进行移动,显示的虚拟对象始终叠加在标记物上,与标记物对齐。
在一些实施方式中,当标记物对应的虚拟对象为至少两个时,终端设备可分别获取每个虚拟对象与标记物的缩放比例,获取的缩放比例是预先存储好的比例,也即,当虚拟对象为单个时放置在标记物上的比例。可确定每个虚拟对象在标记物上的对应区域,再根据每个虚拟对象在标记物上的对应区域调整各个虚拟对象对应的缩放比例,并按照各个虚拟对象调整后的缩放比例,将虚拟对象叠加显示在标记物上。
当有多个虚拟对象时,不同虚拟对象显示时在标记物上叠加的区域不同,叠加区域的大小可相同,可不同。在一些实施方式中,可根据每个虚拟对象与标记物的大小关系确定在标记物上的叠加区域。为了方便说明,假设有2个虚拟对象OB1和OB2需要叠加显示在标记物上,其中标记物的大小为S0,虚拟对象OB1与虚拟对象OB2的大小比例关系为S1:S2,根据二者的大小比例关系得到虚拟对象OB1在标记物上的 显示区域为S0*[S1/(S1+S2)],虚拟对象OB2在标记物上的叠加区域为S0*[S1/(S1+S2)]。
在一些实施方式中,也可预先设定好各个虚拟对象分别在标记物上的叠加区域,并根据设定的叠加区域调整虚拟对象的缩放比例。请参见图7,虚拟对象OB1与虚拟对象OB2叠加于标记物21上,其中,虚拟对象OB1需叠加显示在标记物21上的区域A1,虚拟对象OB2需叠加显示在标记物21上的区域A2,可根据区域A1的大小调整虚拟对象OB1的缩放比例,使虚拟对象OB1与区域A1对齐显示,可根据区域A2的大小调整虚拟对象OB2的缩放比例,使虚拟对象OB2与区域A2对齐显示。。
在一个实施例中,本申请还提供一种终端设备,包括存储器及处理器,该存储器中存储有计算机程序,该计算机程序被处理器执行时,使得处理器实现上述的虚拟对象的显示方法。
在一个实施例中,本申请还提供一种计算机存储介质,其上存储有计算机程序,该计算机程序被处理器执行时可实现上述的虚拟对象的显示方法。
以上所述,仅是本申请的较佳实施例而已,并非对本申请作任何形式上的限制,虽然本申请已以较佳实施例揭露如上,然而并非用以限定本申请,任何熟悉本专业的技术人员,在不脱离本申请技术方案范围内,当可利用上述揭示的技术内容做出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本申请技术方案内容,依据本申请的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本申请技术方案的范围内。

Claims (48)

  1. 一种虚拟对象的显示方法,其特征在于,应用于终端设备,所述方法包括:
    获取标记物相对终端设备的第一空间位置信息;
    获取所述标记物相对物理对象的目标区域的第二空间位置信息;
    基于所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;
    基于所述第三空间位置信息,生成虚拟对象;及
    对所述虚拟对象进行显示,所述虚拟对象的显示位置与所述目标区域对应。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述第三空间位置信息,生成虚拟对象,包括:
    获取虚拟对象与所述目标区域之间的缩放比例;
    基于所述缩放比例,以及所述第三空间位置信息确定所述虚拟对象的显示坐标;及
    基于所述显示坐标生成并渲染所述虚拟对象。
  3. 根据权利要求2所述的方法,其特征在于,所述获取虚拟对象与所述目标区域之间的缩放比例,包括:
    将虚拟对象与所述目标区域大小的比值作为所述缩放比例;或者
    将虚拟对象与所述目标区域大小的比值乘以预设系数后作为所述缩放比例。
  4. 根据权利要求2所述的方法,其特征在于,所述虚拟对象为至少两个;
    所述获取虚拟对象与所述目标区域之间的缩放比例,包括:
    分别获取每个虚拟对象与所述目标区域的缩放比例;
    确定所述每个虚拟对象在所述目标区域上的对应区域;及
    根据每个虚拟对象在所述目标区域上的对应区域调整各个虚拟对象对应的缩放比例。
  5. 根据权利要求2所述的方法,其特征在于,所述基于所述缩放比例,以及所述第三空间位置信息确定所述虚拟对象的显示坐标,包括:
    以所述目标区域为原点,根据所述第三空间位置信息确定所述终端设备相对所述目标区域的空间坐标和旋转信息;
    将所述空间坐标和旋转信息赋值给内容空间中的终端设备及虚拟对象,所述内容空间以所述虚拟对象为原点;及
    基于所述缩放比例、所述空间坐标和旋转信息确定所述虚拟对象的显示坐标。
  6. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    当接收到针对所述虚拟对象的放大指令时,将所述缩放比例放大;
    当接收到针对所述虚拟对象的缩小指令时,将所述缩放比例缩小。
  7. 根据权利要求1所述的方法,其特征在于,在所述获取所述标记物相对物理对象的目标区域的第二空间位置信息之前,所述方法还包括:
    根据对物理对象的目标区域的选取操作,确定所述目标区域。
  8. 根据权利要求7所述的方法,其特征在于,所述根据用户对所述物理对象的目标区域的选取操作,确定所述物理对象的目标区域,包括:
    获取所述控制设备的位置及姿态信息;及
    基于所述控制设备的位置及姿态信息确定目标区域。
  9. 根据权利要求1所述的方法,其特征在于,所述获取所述标记物相对目标区域的第二空间位置信息,包括:
    获取所述标记物相对所述物理对象的第四空间位置信息,以及所述目标区域相对所述物理对象的第五空间位置信息;及
    基于所述第四空间位置信息以及所述第五空间位置信息,确定所述标记物相对所述目标区域的第二空间位置信息。
  10. 一种终端设备,包括:
    存储器,所述存储器中存储有计算机程序;
    处理器,所述计算机程序被所述处理器执行时,使得所述处理器执行如下步骤:
    获取标记物相对终端设备的第一空间位置信息;
    获取所述标记物相对物理对象的目标区域的第二空间位置信息;
    基于所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;
    基于所述第三空间位置信息,生成虚拟对象,所述虚拟对象的显示位置与所述目标区域对应。
  11. 根据权利要求10所述的终端设备,其特征在于,所述基于所述第三空间位置信息,生成虚拟对象,包括:
    获取虚拟对象与所述目标区域之间的缩放比例;
    基于所述缩放比例,以及所述第三空间位置信息确定所述虚拟对象的显示坐标;及
    基于所述显示坐标生成并渲染所述虚拟对象。
  12. 根据权利要求11所述的终端设备,其特征在于,所述获取虚拟对象与所述目标区域之间的缩放比例,包括:
    将虚拟对象与所述目标区域大小的比值作为所述缩放比例;或者
    将虚拟对象与所述目标区域大小的比值乘以预设系数后作为所述缩放比例。
  13. 根据权利要求11所述的终端设备,其特征在于,所述虚拟对象为至少两个;
    所述获取虚拟对象与所述目标区域之间的缩放比例,包括:
    分别获取每个虚拟对象与所述目标区域的缩放比例;
    确定所述每个虚拟对象在所述目标区域上的对应区域;及
    根据每个虚拟对象在所述目标区域上的对应区域调整各个虚拟对象对应的缩放比例。
  14. 根据权利要求11所述的终端设备,其特征在于,所述基于所述缩放比例,以及所述第三空间位置信息确定所述虚拟对象的显示坐标,包括:
    以所述目标区域为原点,根据所述第三空间位置信息确定所述终端设备相对所述目标区域的空间坐标和旋转信息;
    将所述空间坐标和旋转信息赋值给内容空间中的终端设备及虚拟对象,所述内容空间以所述虚拟对象为原点;及
    基于所述缩放比例、所述空间坐标和旋转信息确定所述虚拟对象的显示坐标。
  15. 根据权利要求10所述的终端设备,其特征在于,所述处理器还执行:
    当接收到针对所述虚拟对象的放大指令时,将所述缩放比例放大;
    当接收到针对所述虚拟对象的缩小指令时,将所述缩放比例缩小。
  16. 根据权利要求10所述的终端设备,其特征在于,所述处理器在执行所述获取所述标记物相对物理对象的目标区域的第二空间位置信息的步骤之前,还执行:
    根据对物理对象的目标区域的选取操作,确定所述物理对象的目标区域的步骤。
  17. 根据权利要求16所述的终端设备,其特征在于,所述根据用户对所述物理对象的目标区域的选取操作,确定所述物理对象的目标区域,包括:
    获取所述控制设备的位置及姿态信息;及
    基于所述控制设备的位置及姿态信息确定目标区域。
  18. 根据权利要求10所述的终端设备,其特征在于,所述获取所述标记物相对目标区域的第二空间位置信息,包括:
    获取所述标记物相对所述物理对象的第四空间位置信息,以及所述目标区域相对所述物理对象的第五空间位置信息;及
    基于所述第四空间位置信息以及所述第五空间位置信息,确定所述标记物相对所述目标区域的第二空间位置信息。
  19. 一种计算机存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行如下步骤:
    获取标记物相对终端设备的第一空间位置信息;
    获取所述标记物相对物理对象的目标区域的第二空间位置信息;
    基于所述第一空间位置信息以及所述第二空间位置信息,确定所述终端设备相对所述目标区域的第三空间位置信息;
    基于所述第三空间位置信息,生成虚拟对象,所述虚拟对象的显示位置与所述目标区域对应。
  20. 根据权利要求19所述的计算机存储介质,其特征在于,所述基于所述第三空间位置信息,生成虚拟对象,包括:
    获取虚拟对象与所述目标区域之间的缩放比例;
    基于所述缩放比例,以及所述第三空间位置信息确定所述虚拟对象的显示坐标;及
    基于所述显示坐标生成并渲染所述虚拟对象。
  21. 根据权利要求20所述的计算机存储介质,其特征在于,所述获取虚拟对象与所述目标区域之间的缩放比例,包括:
    将虚拟对象与所述目标区域大小的比值作为所述缩放比例;或者
    将虚拟对象与所述目标区域大小的比值乘以预设系数后作为所述缩放比例。
  22. 根据权利要求20所述的计算机存储介质,其特征在于,所述虚拟对象为至少两个;
    所述获取虚拟对象与所述目标区域之间的缩放比例,包括:
    分别获取每个虚拟对象与所述目标区域的缩放比例;
    确定所述每个虚拟对象在所述目标区域上的对应区域;及
    根据每个虚拟对象在所述目标区域上的对应区域调整各个虚拟对象对应的缩放比例。
  23. 根据权利要求20所述的计算机存储介质,其特征在于,所述基于所述缩放比例,以及所述第三空间位置信息确定所述虚拟对象的显示坐标,包括:
    以所述目标区域为原点,根据所述第三空间位置信息确定所述终端设备相对所述目标区域的空间坐标和旋转信息;
    将所述空间坐标和旋转信息赋值给内容空间中的终端设备及虚拟对象,所述内容空间以所述虚拟对象为原点;及
    基于所述缩放比例、所述空间坐标和旋转信息确定所述虚拟对象的显示坐标。
  24. 根据权利要求19所述的计算机存储介质,其特征在于,所述计算机程序还用于被所述处理器执行如下步骤:
    当接收到针对所述虚拟对象的放大指令时,将所述缩放比例放大;
    当接收到针对所述虚拟对象的缩小指令时,将所述缩放比例缩小。
  25. 根据权利要求19所述的计算机存储介质,其特征在于,所述处理器在执行所述获取所述标记物相对物理对象的目标区域的第二空间位置信息的步骤之前,还执行:
    根据对物理对象的目标区域的选取操作,确定所述物理对象的目标区域的步骤。
  26. 根据权利要求25所述的计算机存储介质,其特征在于,所述根据用户对所述物理对象的目标区域的选取操作,确定所述物理对象的目标区域,包括:
    获取所述控制设备的位置及姿态信息;及
    基于所述控制设备的位置及姿态信息确定目标区域。
  27. 根据权利要求19所述的计算机存储介质,其特征在于,所述获取所述标记物 相对目标区域的第二空间位置信息,包括:
    获取所述标记物相对所述物理对象的第四空间位置信息,以及所述目标区域相对所述物理对象的第五空间位置信息;及
    基于所述第四空间位置信息以及所述第五空间位置信息,确定所述标记物相对所述目标区域的第二空间位置信息。
  28. 一种虚拟对象的显示方法,其特征在于,所述方法包括:
    采集包含标记物的标记物图像;
    识别所述标记物图像包含的标记物;
    获取构建的虚拟对象与所述标记物的缩放比例;
    将所述虚拟对象按照所述缩放比例进行渲染;及
    显示所述虚拟对象,所述虚拟对象的显示位置与所述标记物对应。
  29. 根据权利要求28所述的方法,其特征在于,所述获取构建的虚拟对象与所述标记物的缩放比例,包括:
    将所述虚拟对象与所述标记物大小的比值作为所述缩放比例;或者
    将所述虚拟对象与所述标记物大小的比值乘以预设系数后作为所述缩放比例。
  30. 根据权利要求28所述的方法,其特征在于,所述方法还包括:
    当接收到针对所述虚拟对象的放大指令时,将所述缩放比例放大;及
    当接收到针对所述虚拟对象的缩小指令时,将所述缩放比例缩小。
  31. 根据权利要求28所述的方法,其特征在于,所述将所述虚拟对象按照所述缩放比例进行渲染,包括:
    根据所述标记物信息获取所述标记物与终端设备之间的相对位置信息;及
    根据所述相对位置信息及缩放比例确定所述虚拟对象的显示坐标,并根据所述显示坐标对所述虚拟对象进行渲染。
  32. 根据权利要求31所述的方法,其特征在于,所述根据所述标记物信息获取所述标记物与终端设备之间的相对位置信息,包括:
    以所述终端设备为原点,获取第一坐标空间中的所述标记物与所述终端设备的第一相对位置信息;及
    以所述标记物为原点,反向还原所述第一相对位置信息,得到第二坐标空间中的所述标记物与所述终端设备的第二相对位置信息。
  33. 根据权利要求32所述的方法,其特征在于,所述根据所述相对位置信息及缩放比例确定所述虚拟对象的显示坐标,包括:
    将所述第二相对位置信息赋值给第三坐标空间中所述终端设备与所述虚拟对象;及
    根据所述缩放比例对所述第二相对位置信息进行计算,得到所述虚拟对象的显示坐标。
  34. 根据权利要求28所述的方法,其特征在于,所述虚拟对象为至少两个;所述获取构建的虚拟对象与所述标记物的缩放比例,包括:
    分别获取每个虚拟对象与标记物的缩放比例;
    确定所述每个虚拟对象在所述标记物上的显示区域;
    所述将所述虚拟对象按照所述缩放比例,显示在所述标记物所在的位置处,包括:
    根据每个虚拟对象在所述标记物上的显示区域调整各个虚拟对象对应的缩放比例,并按照各个虚拟对象调整后的缩放比例,将所述虚拟对象显示在所述标记物所在的位置处。
  35. 一种终端设备,包括:
    存储器,所述存储器中存储有计算机程序;
    处理器,所述计算机程序被所述处理器执行时,使得所述处理器执行如下步骤:
    获取包含标记物的标记物图像;
    识别所述标记物图像包含的标记物;
    获取构建的虚拟对象与所述标记物的缩放比例;
    将所述虚拟对象按照所述缩放比例进行渲染,所述虚拟对象的显示位置与所述标记物对应。
  36. 根据权利要求35所述的终端设备,其特征在于,所述获取构建的虚拟对象与所述标记物的缩放比例,包括:
    将所述虚拟对象与所述标记物大小的比值作为所述缩放比例;或者
    将所述虚拟对象与所述标记物大小的比值乘以预设系数后作为所述缩放比例。
  37. 根据权利要求35所述的终端设备,其特征在于,所述处理器还执行如下步骤:
    当接收到针对所述虚拟对象的放大指令时,将所述缩放比例放大;及
    当接收到针对所述虚拟对象的缩小指令时,将所述缩放比例缩小。
  38. 根据权利要求35所述的终端设备,其特征在于,所述将所述虚拟对象按照所述缩放比例进行渲染,包括:
    根据所述标记物信息获取所述标记物与终端设备之间的相对位置信息;及
    根据所述相对位置信息及缩放比例确定所述虚拟对象的显示坐标,并根据所述显示坐标对所述虚拟对象进行渲染。
  39. 根据权利要求38所述的终端设备,其特征在于,所述根据所述标记物信息获取所述标记物与终端设备之间的相对位置信息,包括:
    以所述终端设备为原点,获取第一坐标空间中的所述标记物与所述终端设备的第一相对位置信息;及
    以所述标记物为原点,反向还原所述第一相对位置信息,得到第二坐标空间中的所述标记物与所述终端设备的第二相对位置信息。
  40. 根据权利要求39所述的终端设备,其特征在于,所述根据所述相对位置信息及缩放比例确定所述虚拟对象的显示坐标,包括:
    将所述第二相对位置信息赋值给第三坐标空间中所述终端设备与所述虚拟对象;及
    根据所述缩放比例对所述第二相对位置信息进行计算,得到所述虚拟对象的显示坐标。
  41. 根据权利要求35所述的终端设备,其特征在于,所述虚拟对象为至少两个;所述获取构建的虚拟对象与所述标记物的缩放比例,包括:
    分别获取每个虚拟对象与标记物的缩放比例;
    确定所述每个虚拟对象在所述标记物上的显示区域;
    所述将所述虚拟对象按照所述缩放比例,显示在所述标记物所在的位置处,包括:
    根据每个虚拟对象在所述标记物上的显示区域调整各个虚拟对象对应的缩放比例,并按照各个虚拟对象调整后的缩放比例,将所述虚拟对象显示在所述标记物所在的位置处。
  42. 一种计算机存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时,使得所述处理器执行如下步骤:
    获取包含标记物的标记物图像;
    识别所述标记物图像包含的标记物;
    获取构建的虚拟对象与所述标记物的缩放比例;
    将所述虚拟对象按照所述缩放比例进行渲染,所述虚拟对象的显示位置与所述标记物对应。
  43. 根据权利要求42所述的计算机存储介质,其特征在于,所述获取构建的虚拟对象与所述标记物的缩放比例,包括:
    将所述虚拟对象与所述标记物大小的比值作为所述缩放比例;或者
    将所述虚拟对象与所述标记物大小的比值乘以预设系数后作为所述缩放比例。
  44. 根据权利要求42所述的计算机存储介质,其特征在于,所述处理器还执行如下步骤:
    当接收到针对所述虚拟对象的放大指令时,将所述缩放比例放大;及
    当接收到针对所述虚拟对象的缩小指令时,将所述缩放比例缩小。
  45. 根据权利要求42所述的计算机存储介质,其特征在于,所述将所述虚拟对象按照所述缩放比例进行渲染,包括:
    根据所述标记物信息获取所述标记物与终端设备之间的相对位置信息;及
    根据所述相对位置信息及缩放比例确定所述虚拟对象的显示坐标,并根据所述显示坐标对所述虚拟对象进行渲染。
  46. 根据权利要求45所述的计算机存储介质,其特征在于,所述根据所述标记物信息获取所述标记物与终端设备之间的相对位置信息,包括:
    以所述终端设备为原点,获取第一坐标空间中的所述标记物与所述终端设备的第一相对位置信息;及
    以所述标记物为原点,反向还原所述第一相对位置信息,得到第二坐标空间中的所述标记物与所述终端设备的第二相对位置信息。
  47. 根据权利要求46所述的计算机存储介质,其特征在于,所述根据所述相对位置信息及缩放比例确定所述虚拟对象的显示坐标,包括:
    将所述第二相对位置信息赋值给第三坐标空间中所述终端设备与所述虚拟对象;及
    根据所述缩放比例对所述第二相对位置信息进行计算,得到所述虚拟对象的显示坐标。
  48. 根据权利要求42所述的计算机存储介质,其特征在于,所述虚拟对象为至少两个;所述获取构建的虚拟对象与所述标记物的缩放比例,包括:
    分别获取每个虚拟对象与标记物的缩放比例;
    确定所述每个虚拟对象在所述标记物上的显示区域;
    所述将所述虚拟对象按照所述缩放比例,显示在所述标记物所在的位置处,包括:
    根据每个虚拟对象在所述标记物上的显示区域调整各个虚拟对象对应的缩放比例,并按照各个虚拟对象调整后的缩放比例,将所述虚拟对象显示在所述标记物所在的位置处。
PCT/CN2019/091863 2018-06-19 2019-06-19 虚拟对象的增强现实显示方法和设备 WO2019242634A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
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 (4)

Application Number Priority Date Filing Date Title
CN201810632329.8 2018-06-19
CN201810632329.8A CN110618751B (zh) 2018-06-19 2018-06-19 虚拟对象的显示方法、装置、终端设备及存储介质
CN201810804399.7 2018-07-20
CN201810804399.7A CN110737326A (zh) 2018-07-20 2018-07-20 虚拟对象的显示方法、装置、终端设备及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/535,054 Continuation US11087545B2 (en) 2018-06-19 2019-08-07 Augmented reality method for displaying virtual object and terminal device therefor

Publications (1)

Publication Number Publication Date
WO2019242634A1 true WO2019242634A1 (zh) 2019-12-26

Family

ID=68983516

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/091863 WO2019242634A1 (zh) 2018-06-19 2019-06-19 虚拟对象的增强现实显示方法和设备

Country Status (1)

Country Link
WO (1) WO2019242634A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102122392A (zh) * 2010-01-08 2011-07-13 索尼公司 信息处理设备、信息处理系统和信息处理方法
CN104270577A (zh) * 2014-08-22 2015-01-07 北京德馨同创科技发展有限责任公司 用于移动智能终端的图像处理方法和装置
US20170323488A1 (en) * 2014-09-26 2017-11-09 A9.Com, Inc. Augmented reality product preview
CN107895397A (zh) * 2016-10-01 2018-04-10 北京餐影传媒科技有限责任公司 一种虚拟显示方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102122392A (zh) * 2010-01-08 2011-07-13 索尼公司 信息处理设备、信息处理系统和信息处理方法
CN104270577A (zh) * 2014-08-22 2015-01-07 北京德馨同创科技发展有限责任公司 用于移动智能终端的图像处理方法和装置
US20170323488A1 (en) * 2014-09-26 2017-11-09 A9.Com, Inc. Augmented reality product preview
CN107895397A (zh) * 2016-10-01 2018-04-10 北京餐影传媒科技有限责任公司 一种虚拟显示方法及装置

Similar Documents

Publication Publication Date Title
US11087545B2 (en) Augmented reality method for displaying virtual object and terminal device therefor
US9256986B2 (en) Automated guidance when taking a photograph, using virtual objects overlaid on an image
KR101171660B1 (ko) 증강현실의 포인팅 장치
WO2019142560A1 (ja) 視線を誘導する情報処理装置
KR20170031733A (ko) 디스플레이를 위한 캡처된 이미지의 시각을 조정하는 기술들
US20170316582A1 (en) Robust Head Pose Estimation with a Depth Camera
TWI701941B (zh) 圖像處理方法及裝置、電子設備及儲存介質
JP6500355B2 (ja) 表示装置、表示プログラム、および表示方法
KR20130108643A (ko) 응시 및 제스처 인터페이스를 위한 시스템들 및 방법들
CN105787884A (zh) 一种图像处理方法及电子设备
CN111527468A (zh) 一种隔空交互方法、装置和设备
CN108377361B (zh) 一种监控视频的显示控制方法及装置
JP6621565B2 (ja) 表示制御装置、表示制御方法、及びプログラム
JP2012238293A (ja) 入力装置
CN110737326A (zh) 虚拟对象的显示方法、装置、终端设备及存储介质
US20220075477A1 (en) Systems and/or methods for parallax correction in large area transparent touch interfaces
CN112667137B (zh) 户型图和房屋三维模型的切换显示方法及装置
WO2019242634A1 (zh) 虚拟对象的增强现实显示方法和设备
CN110618751B (zh) 虚拟对象的显示方法、装置、终端设备及存储介质
WO2022176450A1 (ja) 情報処理装置、情報処理方法、およびプログラム
CN110060349B (zh) 一种扩展增强现实头戴式显示设备视场角的方法
JP2004310470A (ja) 視線位置を判定し組合わせるためのシステム及びコンピュータで実行可能なプログラム
EP4371296A1 (en) Adjusting pose of video object in 3d video stream from user device based on augmented reality context information from augmented reality display device
JP7287172B2 (ja) 表示制御装置、表示制御方法、及びプログラム
Qin et al. Selecting Real-World Objects via User-Perspective Phone Occlusion

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19823156

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 25/03/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19823156

Country of ref document: EP

Kind code of ref document: A1