Augmented reality interaction method and electronic device
Electronic devices are used to determine real scene information and generate virtual object poses and 3D audio, which solves the problem of low realism of virtual objects in AR technology, realizes the interaction between virtual objects and real objects, and improves user experience and immersion in the virtual world. .
Patent Information
- Application Number
- CN202011627072.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-12-31
AI Technical Summary
The reality of virtual objects in existing AR technology is not high, resulting in poor user experience and a lack of effective improvement in the audio-visual interaction of virtual characters.
Use electronic devices to determine the pose information of real objects and the location of real sound sources in the real scene, and combine the SLAM algorithm and sound source localization technology to generate the pose information and 3D audio data of virtual objects, so that virtual objects can perceive and respond to the real world. visual and auditory information, thereby enhancing its realism.
It realizes the visual and auditory interaction between virtual objects and real objects, improves the intelligence level and user experience of virtual objects, and enhances the immersion of the virtual world.
Smart Images

Figure CN114693890B
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an augmented reality (AR) interaction method and electronic device. Background Art
[0002] AR technology can achieve the integration of the virtual world and the real world, but how to improve the realism of virtual objects has received little attention. Therefore, the realism of virtual characters generated by AR technology is not high, resulting in poor user experience. Summary of the invention
[0003] The present application provides an AR interaction method and an electronic device for improving the realism of virtual objects and enhancing user experience.
[0004] In a first aspect, an embodiment of the present application provides an AR interaction method, the method comprising the following steps:
[0005] The electronic device determines the posture information of a real object and / or the position of a real sound source in a real scene, wherein the posture information of the real object is used to characterize the position and posture of the real object; then, the electronic device determines the posture information of a virtual object based on the posture information of the real object and / or the position of the real sound source, wherein the posture information of the virtual object is used to characterize the position and posture of the virtual object; finally, the electronic device generates an AR image containing the virtual object based on the posture information of the virtual object; displays the AR image; and / or the electronic device generates 3D audio data of the virtual object based on the posture information of the real object and the posture information of the virtual object; and plays the 3D audio data.
[0006] Through this solution, the virtual object can perceive the position of the real object and the location of the real sound source, and make corresponding action responses or sound responses based on the above information, so that the virtual object can be like the real object. Therefore, this method realizes the virtual-real interaction that combines the visual and auditory senses of the virtual object with the real object, which can improve the intelligence level of the virtual object and thus improve the experience of virtual interaction.
[0007] In a possible design, the electronic device can also establish a world coordinate system with the electronic device as the coordinate origin; in this design, the posture information of the real object is specifically used to characterize the position and posture of the real object in the world coordinate system; the position of the real sound source is the position of the real sound source in the world coordinate system; the posture information of the virtual object is specifically used to characterize the position and posture of the virtual object in the world coordinate system.
[0008] Through this design, the accuracy of the position information of the real object, the position of the real sound source, and the position information of the virtual object determined by the electronic device can be improved.
[0009] In a possible design, the electronic device may establish a world coordinate system with the electronic device as the coordinate origin through the following steps:
[0010] The electronic device obtains a first real scene image captured by a camera, and obtains posture information of the electronic device measured by an inertial measurement unit; then the electronic device establishes the world coordinate system based on the first real scene image and the posture information of the electronic device using a set coordinate system construction algorithm (e.g., a simultaneous localization and mapping (SLAM) algorithm).
[0011] In a possible design, the electronic device may determine the position and posture information of the real object in the real scene through the following steps:
[0012] The electronic device obtains a second real-scene image captured by a camera and identifies key parts of a real object in the second real-scene image; then, the electronic device determines the posture information of the key parts (e.g., the head) of the real object in the second real-scene image based on the simultaneous positioning and map construction (SLAM) point cloud collision technology; finally, the electronic device uses the posture information of the key parts of the real object as the posture information of the real object.
[0013] Through this design, when the volume of the real object is large, the electronic device can use the posture information of the key parts of the real object as the posture information of the real object.
[0014] In a possible design, the electronic device may determine the position of a real sound source in a real scene through the following steps:
[0015] The electronic device acquires the real scene sound information collected by the microphone, and determines the positional relationship between the real sound source and the microphone through sound source localization; then, the electronic device can determine the position of the real sound source in the real scene according to the positional relationship between the real sound source and the microphone. For example, the position of the real sound source in the world coordinate system is determined according to the positional relationship between the real sound source and the microphone.
[0016] In one possible design, the electronic device can determine the posture information of the virtual object based on the posture information of the real object and / or the position of the real sound source, and at least one of the following: the action of the real object identified by the posture information of the real object, the sound command issued by the real sound source, the image model, action characteristics, action response package in the virtual object model corresponding to the virtual object, and the user's touch operation on the virtual object through the display screen.
[0017] Among them, the posture information of the real object determined by the electronic device can be regarded as the posture information of the real object seen by the virtual object, and the position of the real sound source can be regarded as the position of the real sound source heard by the virtual object. Through this design, the electronic device can use the posture of the real object perceived by the virtual object and the position of the real sound source to determine the position of the virtual object, so that the virtual object can make corresponding action responses according to the posture of the perceived real object and the position of the real sound source, so that the virtual object can be like a real object. In addition, when determining the action response, the electronic device can also consider other factors to improve the flexibility of determining the posture information of the virtual object.
[0018] In a possible design, the electronic device may generate 3D audio data of the virtual object according to the posture information of the real object and the posture information of the virtual object through the following steps:
[0019] The electronic device determines the distance between the virtual object and the ears of the real object respectively according to the posture information of the real object and the posture information of the virtual object; then, the electronic device calculates the volume difference and time difference between the ears of the real object according to the distance between the virtual object and the ears of the real object; finally, the electronic device generates 3D audio data according to the volume difference and time difference of the real object and the original sound data of the virtual object.
[0020] Through this design, the reality device can generate 3D audio data according to the volume difference and time difference of the reality object, thereby improving the authenticity of the 3D sound produced by playing the 3D audio data.
[0021] In a possible design, the original sound data is set, or is determined according to at least one of the following:
[0022] The position and posture information of the real object, the posture information of the virtual object, the action of the real object identified by the posture information of the real object, the sound command issued by the real sound source, the image model, action characteristics, action response package in the virtual object model corresponding to the virtual object, and the user's touch operation on the virtual object through the display screen.
[0023] In a possible design, before playing the 3D audio data, the electronic device may also filter the 3D audio data according to the posture information of the real object, so as to simulate the reflection and refraction of the 3D audio data during the transmission process, thereby making the 3D sound heard by the real object more realistic.
[0024] In a second aspect, an embodiment of the present application further provides an electronic device, comprising a unit or module for executing each step of the above-mentioned first aspect.
[0025] In a third aspect, the present application provides an electronic device, comprising at least one processing element and at least one storage element, wherein the at least one storage element is used to store programs and data, and the at least one processing element is used to execute the programs stored in the memory, so that each design provided in the first aspect of the present application can be implemented. Optionally, the electronic device may also include components such as a display screen, a camera, and an audio circuit.
[0026] In a fourth aspect, an embodiment of the present application further provides a computer storage medium, in which a software program is stored. When the software program is read and executed by one or more processors, the methods provided by each design in the first aspect can be implemented.
[0027] In a fifth aspect, an embodiment of the present application further provides a computer program comprising instructions, which, when executed on a computer, enables the computer to execute the methods provided by the various designs in the above-mentioned first aspect.
[0028] In a sixth aspect, an embodiment of the present application further provides a chip system, which includes a processor for supporting an electronic device to implement the functions involved in each design in the first aspect above. In a possible design, the chip system also includes a memory, which is used to store program instructions and data necessary for the electronic device. The chip system can be composed of a chip, or it can include a chip and other discrete devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of virtual-real audio-visual interaction provided in an embodiment of the present application;
[0030] Figure 2 A structural diagram of an electronic device provided in an embodiment of the present application;
[0031] Figure 3 A software architecture diagram of an electronic device provided in an embodiment of the present application;
[0032] Figure 4 A block diagram of an implementation of an AR interaction method provided in an embodiment of the present application;
[0033] Figure 5A A schematic diagram of a world coordinate system of an electronic device provided in an embodiment of the present application;
[0034] Figure 5B A simulation diagram of a SLAM point cloud collision result provided in an embodiment of the present application;
[0035] Figure 6 A schematic diagram of virtual-real audio-visual interaction provided in an embodiment of the present application;
[0036] Figure 7 An AR interaction flow chart provided in an embodiment of the present application;
[0037] Figure 8 Another AR interaction flow chart provided in an embodiment of the present application;
[0038] Fig. 9 A schematic diagram of an AR interaction example provided in an embodiment of the present application;
[0039] Fig.10 A flowchart for implementing an AR interactive service provided in an embodiment of the present application;
[0040] Fig.11 Another AR interaction flow chart provided in an embodiment of the present application;
[0041] Fig.12 Another AR interaction flow chart provided in an embodiment of the present application;
[0042] Fig.13 A structural diagram of another electronic device provided in an embodiment of the present application;
[0043] Fig.14 A structural diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The present application provides an AR interaction method and electronic device for improving the realism of virtual objects and improving user experience. The method and the electronic device are based on the same technical concept. Since the method and the electronic device solve the problem in a similar way, the implementation of the electronic device and the method can refer to each other, and the repetitive parts will not be repeated.
[0045] Below, some terms in this application are explained to facilitate understanding by those skilled in the art.
[0046] 1) Electronic devices are devices or apparatuses with data connectivity, data calculation and processing functions. For example, the electronic devices may be mobile phones, tablet computers, laptop computers, netbooks, vehicle-mounted devices, smart home devices (such as smart TVs), business smart terminals (including videophones, conference desktop smart terminals, etc.), personal digital assistants (PDAs), augmented reality (AR) and virtual reality (VR) devices, etc. This application does not limit the specific form of the electronic devices.
[0047] 2) 3D sound, which enables the listener to locate the sound source. We know that 3D display uses the parallax of the user's eyes to create a 3D perception. Similar to the concept of parallax, the user's ears can use the volume difference and time difference of the sound from the same sound source to reach the two ears to perform the most basic sound source location.
[0048] Among them, the volume difference is the volume difference of the same sound reaching the user's two ears. The user can perceive whether the sound source is on the left or right side based on the volume difference. Users cannot accurately locate the sound source simply by relying on the volume difference. Therefore, users also need to locate by time difference, which is the Haas effect. Generally speaking, the condition for realizing the Haas effect is that the time difference between the same sound reaching the user's two ears needs to be within 30ms, otherwise two sound images will be generated in the human brain, forming an echo.
[0049] 3) Virtual objects are realistic things in the virtual world that are generated by using AR technology and computers and other devices, and have the senses of sight, hearing, force, touch, and movement. For example, virtual objects can be people, animals, scenery, still life, and text, etc. They can produce various animation effects, such as posture changes, sounds, movements and expressions, and interact with real objects.
[0050] Each virtual object is generally generated by a computer according to a corresponding virtual object model. Each virtual object model can not only set the image of the corresponding virtual object, but also set its sound characteristics, action characteristics, etc., as well as the contents of the sound response package, action response package, etc.
[0051] Among them, the sound response of the virtual object is to make a sound in order to react to the real object in the real world, which is also called auditory response; the action response of the virtual object is to make an action in order to react to the real object in the real world, which is also called visual response.
[0052] Specifically, the virtual object can react to the real object based on the monitoring mode (action response and / or sound response). The monitoring mode can specifically include: visual monitoring and / or auditory monitoring. Among them, visual monitoring, that is, the virtual object can react based on the position and posture information of the real object within its field of view (the field of view of the camera of the electronic device). Auditory monitoring, that is, the virtual object can react based on the real scene sound heard (the real scene sound information obtained through the microphone).
[0053] 4) Real objects, corresponding to virtual objects, are things that actually exist in the real world. Exemplarily, real objects can also be people, actions, scenery, and so on. When real objects make sounds, they can be used as real sound sources.
[0054] 5) “Plurality” means two or more than two. “At least one” means one and more than one.
[0055] 6) "and / or" describes the relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0056] In addition, it should be understood that, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0057] The embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0058] AR technology uses computers to generate a realistic virtual world (virtual environment) that allows users to immerse themselves in the virtual world and achieve natural interaction between the user and the virtual world. Currently, AR technology mainly focuses on how to improve the integration of the virtual world and the real world, but lacks attention to improving the authenticity of virtual objects in the virtual world.
[0059] In the real world, the first real object can directly make a corresponding reaction (action response and / or sound response) when seeing or hearing the second real object. Of course, if the second real object can make an action response and / or sound response, the second real object can also make an action response and / or sound response according to the action response and / or sound response of the first real object.
[0060] Therefore, in order to improve the realism of the virtual object, in the embodiment of the present application, the virtual object can realize the above-mentioned audio-visual interaction with the real object like the real object, see Figure 1 In this way, the real object can not only see and hear the virtual object, but the virtual object can also see and / or hear the real object and make some corresponding action responses and / or sound responses, so that the real object or the user can perceive that the virtual object has audio-visual functions.
[0061] Through the solution provided in the embodiments of the present application, virtual objects can see and / or hear real objects like real objects, and make some corresponding action responses and / or sound responses, thereby improving the realism of virtual objects, allowing users to immerse themselves in the virtual world, and ultimately improving user experience.
[0062] The AR interaction method provided in the embodiment of the present application can be applied to Figure 2 In the electronic device shown, the structure of the electronic device is first described below. Figure 2 A possible structure of an electronic device is shown. Figure 2 As shown, the electronic device 200 includes: a communication unit 201, a processor 202, a memory 203, a display unit 204, an input unit 205, an audio circuit 206, a sensor 207, a camera 208 and other components. Figure 2 Each component of the electronic device 200 is introduced in detail.
[0063] The communication unit 201 is used to implement the functions of the electronic device 200 and realize data communication with other devices. Optionally, the communication unit 201 may include a wireless communication module 2011 and a mobile communication module 2012. In addition to the communication unit 201, the electronic device 200 also needs to cooperate with the antenna, the modem processor and the baseband processor in the processor 202 to realize the communication function.
[0064] The wireless communication module 2011 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied to electronic devices. The wireless communication module 2011 can be one or more devices integrating at least one communication processing module. The wireless communication module 2011 receives electromagnetic waves via an antenna, performs signal frequency modulation and filtering on the electromagnetic waves, and sends the processed signals to the processor 202. The wireless communication module 2011 can also receive signals to be sent from the processor 202, perform frequency modulation and amplification on the signals, and convert them into electromagnetic waves for radiation through the antenna. Through the wireless communication module 2011, the electronic device 200 can be connected to some peripheral devices, such as an access point, a wireless headset or a wireless speaker.
[0065] The mobile communication module 2012 can provide solutions for mobile communications including 2G / 3G / 4G / 5G applied to electronic devices. The mobile communication module 2012 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 2012 can receive electromagnetic waves by an antenna, and filter, amplify, and process the received electromagnetic waves, and transmit them to a modulation and demodulation processor for demodulation. The mobile communication module 2012 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna. In some embodiments, at least some of the functional modules of the mobile communication module 2012 can be arranged in the processor 202. In some embodiments, at least some of the functional modules of the mobile communication module 2012 can be arranged in the same device as at least some of the modules of the processor 202.
[0066] The electronic device 200 can establish a wireless connection with a base station in a mobile communication system according to the mobile communication module 2012 , and receive services of the mobile communication system through the mobile communication module 2012 .
[0067] The communication unit 201 may also include a communication interface for physically connecting the electronic device 200 to other devices. The communication interface may be connected to the communication interface of the other device via a cable to achieve data transmission between the electronic device 200 and the other device. For example, the electronic device 200 may be connected to headphones, speakers, and other devices via the communication interface.
[0068] The memory 203 may be used to store software programs and data. The processor 202 executes various functions and data processing of the electronic device 200 by running the software programs and data stored in the memory 203. In an embodiment of the present application, the software program may include an AR application that implements an AR interaction method.
[0069] Optionally, the memory 203 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, various software programs, etc.; the data storage area may store data input by a user or created by the electronic device 200 during the running of a software program, etc. The operating system may be Etc. In addition, the memory 203 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. For example, in an embodiment of the present application, an AR application that implements the control method may be stored in a program storage area, and data such as a virtual object model, a position and posture of a virtual object, and a position and posture of a real object may be stored in a data storage area.
[0070] The input unit 205 can be used to receive character information and signals input by the user. Optionally, the input unit 205 may include a touch panel 2051 and other input devices (such as function keys). Among them, the touch panel 2051, also known as a touch screen, can collect the user's touch operation on or near it, generate corresponding touch information and send it to the processor 202, so that the processor 202 executes the command corresponding to the touch information. The touch panel 2051 can be implemented in various types such as resistive, capacitive, infrared and surface acoustic wave.
[0071] The display unit 204 is used to present a user interface to achieve human-computer interaction. For example, the display unit 204 can display information input by the user, or information provided to the user, as well as various menus of the electronic device 200, various main interfaces (including icons of various applications), windows of various applications, images captured by the camera, AR images containing virtual objects generated by the AR application, and other contents.
[0072] The display unit 204 may include a display panel 2041 , which is also called a display screen and may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0073] It should be noted that the touch panel 2051 can cover the display panel 2041. Figure 2 In the embodiment, the touch panel 2051 and the display panel 2041 are used as two independent components to realize the input and output functions of the electronic device 200, but in the embodiment of the present application, the touch panel 2051 and the display panel 2041 can be integrated (i.e., the touch display screen) to realize the input and output functions of the electronic device 200.
[0074] The processor 202 is the control center of the electronic device 200, and uses various interfaces and lines to connect various components, and executes various functions and processes data of the electronic device 200 by running or executing software programs and / or modules stored in the memory 203, and calling data stored in the memory 203, thereby realizing various services of the electronic device 200. For example, the processor 202 can run an AR application stored in the memory 203 to realize the AR interaction method provided in the embodiment of the present application.
[0075] Optionally, the processor 202 may include one or more processing units. The processor 202 may integrate an application processor, a modem processor, a baseband processor, a graphics processing unit (GPU), etc., wherein the application processor mainly processes an operating system, a user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 202.
[0076] The audio circuit 206 (including a speaker 2061 and a microphone 2062) can provide an audio interface between a user and the electronic device 200. The audio circuit 206 can transmit the electrical signal converted from the received audio data to the speaker 2061, which is converted into a sound signal for output. On the other hand, the microphone 2062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 206 and converted into audio data for further processing such as transmission or storage. In an embodiment of the present application, the electronic device 200 can collect the sound signal emitted by the sound source through the microphone 2062, so that the sound source can be located according to the collected sound signal. In addition, the electronic device 200 can also output the 3D audio data through the speaker 2061 after generating it.
[0077] The electronic device 200 may further include one or more sensors 207 , such as a light sensor, a motion sensor, an ultrasonic sensor, and other sensors. The electronic device 200 may implement various functions based on the real-time sensor data collected by the sensor 207 .
[0078] The motion sensor may include an inertial measurement unit (IMU). The IMU is a device for measuring the posture information of the electronic device 200. The posture information of the electronic device 200 is used to characterize the motion posture of the electronic device 200, and may specifically include: the posture angle and acceleration of the electronic device 200 on three directional axes. Optionally, the IMU may include three acceleration sensors and three gyroscopes. Each acceleration sensor is used to measure the acceleration of a directional axis, and each gyroscope is used to measure the posture angle of a directional axis.
[0079] The electronic device 200 may further include at least one camera 208 to collect images of real scenes. When the electronic device 200 includes multiple cameras 208, the cameras 208 include a front camera located on the front of the electronic device 200 and a rear camera located on the back of the electronic device 200.
[0080] Those skilled in the art will understand that Figure 2 The structure of the electronic device 200 shown in the figure does not constitute a limitation on the electronic devices to which the present application is applicable. The electronic devices to which the embodiments of the present application are applicable may include more or fewer components than those shown in the figure, or a combination of certain components, or a different arrangement of components.
[0081] The software system of the electronic device provided in the present application may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device.
[0082] Figure 3 FIG. 1 shows a software structure diagram of an electronic device provided in an embodiment of the present application. Figure 3 As shown, the software structure of the electronic device can be a layered architecture, for example, the software can be divided into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the framework layer (framework, FWK), the Android runtime (Android runtime) and the system library, and the kernel layer.
[0083] The application layer can include a series of applications. Figure 3 As shown in , the application layer may include camera applications, voice assistant applications, AR applications, music applications, video applications, map applications, and third-party applications, etc. Among them, third-party applications may include WeChat applications, iQiyi applications, etc.
[0084] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer may include some predefined functions. Figure 3 As shown, the application framework layer may include: system service (System Service), view system (ViewSystem), web service (Web Service), phone manager, resource manager, etc.
[0085] The system service may include a window manager service (WMS) and an activity manager service (AMS). In the embodiment of the present application, the system service may also include a system-level service, namely, an AR management service. The following describes each service in the system service.
[0086] Window management service provides window management services for windows, specifically controlling the display, hiding and position of all windows on the display screen. Window management service can be responsible for the following functions: 1. Allocate a display plane (surface) to each window; 2. Manage the display order, size and position of the surface; 3. Adjust the transparency, stretching coefficient, position and size of the window by calling management functions (such as surface control function (SurfaceControl.Transaction)) to achieve the animation effect of the window; 4. Related to the input system, for example, when an electronic device receives a touch event, the electronic device can provide a suitable window for the user to display or process the message through the window management service.
[0087] Activity management service provides management services for activities in applications. The activity management service can be responsible for the following functions, but is not limited to: 1. Unified scheduling of the life cycle of all application activities; 2. Starting or ending application processes; 3. Starting and scheduling the life cycle of services; 4. Registering broadcast receivers, and receiving and distributing broadcasts; 5. Querying the current operating status of the system; 6. Scheduling tasks.
[0088] AR management service, used to implement the AR interaction method provided in the embodiment of the present application, and provide AR interaction service. The AR management service may be responsible for, but is not limited to, the following functions: 1. Constructing a world coordinate system; 2. Determining the position and posture information of a real object in the world coordinate system; 3. Identifying the position of a real sound source in the world coordinate system; 4. Determining the position and posture information of a virtual object in the world coordinate system; 5. Generating 3D audio data based on the position and posture information of the real object, the position of the real sound source, and at least one of the position and posture information of the virtual object; 6. Generating an AR image containing a virtual object based on the position and posture information of the real object, the position of the real sound source, and at least one of the position and posture information of the virtual object.
[0089] The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build applications. An interface can be composed of one or more controls. For example, an interface that includes a text notification icon can include controls for displaying text and controls for displaying images.
[0090] Web Service is an API that can be called through a web page. Phone Manager is used to provide communication functions for electronic devices, such as call status management (including connected, hung up, etc.). Resource Manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.
[0091] Android runtime includes the kernel library and the virtual machine. Android runtime is responsible for the scheduling and management of the Android system. The kernel library consists of two parts: one is the function that the Java language needs to call, and the other is the core library of the Android system, which is used to provide input / output services (Input / OutputService) and kernel services (Kernel Service) for the Android system. The application layer and the framework layer can run in the virtual machine. The virtual machine executes the Java files of the application layer and the framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
[0092] The system library may include multiple functional modules, such as virtual object model library, media library, image processing library, etc.
[0093] The virtual object model library is used to manage multiple virtual object models. Each virtual object model is used to generate a virtual object. Each virtual object model can not only set the image of the corresponding virtual object, but also set its sound characteristics, action characteristics, etc., as well as auditory response packages, visual response packages and other contents.
[0094] The media library supports playback and recording of audio and video in various formats, as well as opening of static images in various formats. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0095] The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, sensor drivers, processor drivers, camera drivers, audio drivers, etc., which are used to drive the hardware in the hardware layer.
[0096] The hardware layer can include various sensors, displays, processors, input devices, memory, cameras, etc.
[0097] In order to improve the realism of virtual objects in AR technology, the present application embodiment provides an AR interaction method, which can achieve the following Figure 1 The virtual and real audio-visual interaction shown below. Figure 2The hardware structure of the electronic device shown and Figure 3 The software structure of the electronic device shown is shown in Figure 4 The scheme is described in detail.
[0098] See also Figure 4 As shown, according to the different logical functions of the electronic device, the software for implementing the AR interaction method in the electronic device can be divided into the following modules: real object position and posture calculation module, storage module, virtual object model library, AR synthesis module. In addition, the method also needs to be implemented in conjunction with other devices inside or outside the electronic device, such as Figure 4 As shown in , these devices can be divided into two categories: acquisition devices and output devices. Among them, the acquisition device can include: camera, motion sensor (hereinafter only takes IMU in the motion sensor as an example), microphone; the output device can include: display screen, speaker or earphone.
[0099] The camera is used to shoot a real scene to obtain an image of the real scene (hereinafter referred to as the real scene image). The IMU is used to measure the posture information of the electronic device, wherein the posture information of the electronic device is used to characterize the motion posture of the electronic device, which may include: the posture angle and acceleration of the electronic device on three direction axes. Optionally, the three direction axes are orthogonal to each other to form a world coordinate system. The microphone is used to collect sounds in the real scene to obtain real scene sound information.
[0100] The real object position and posture calculation module specifically includes the following functions: obtaining a real scene image captured by a camera and obtaining posture information of an electronic device measured by an IMU; constructing a world coordinate system with the electronic device as the coordinate origin based on the acquired real scene image and posture information of the electronic device; identifying the real object in the real scene image, and determining the position of the real object in the world coordinate system (hereinafter referred to as the position of the real object) and posture information; obtaining real scene sound information collected by a microphone; calculating the physical position of a real sound source based on the real scene sound information; and converting the physical position of the real sound source into the position of the real sound source in the world coordinate system (hereinafter referred to as the position of the real sound source).
[0101] Among them, similar to the posture information of the electronic device, the posture information of the real object is used to characterize the motion posture of the real object, which may include: the posture angle and acceleration of the real object on the three direction axes of the world coordinate system. The physical position of the real sound source can characterize the positional relationship between the real sound source and the microphone (i.e., the electronic device), such as the direction of the real sound source of the electronic device and the distance between the real sound source and the electronic device.
[0102] Optionally, the real object position and posture calculation module can construct the world coordinate system based on the acquired real scene image and the posture information of the electronic device, using a simultaneous localization and mapping (SLAM) algorithm or other algorithms. It should be noted that the real object position and posture calculation module can use a corner of the electronic device display screen as the coordinate origin, or the center point of one edge of the display screen as the coordinate origin, or the center point of the display screen as the coordinate origin, or a set position in the display screen as the coordinate origin, and the embodiments of the present application are not limited to this. Exemplarily, the world coordinate system can be as follows Figure 5A As shown, the coordinate origin is the center point of one side of the display screen, the virtual world can be displayed in the display screen, and the real world is outside the display screen.
[0103] In addition, the real object position and posture calculation module can determine the position and posture information of the real object in a variety of ways. Due to the large size of the real object, in order to ensure accuracy, the real object position and posture calculation module can use the position and posture information of key parts of the real object as the position and posture information of the real object.
[0104] For example, the real object position and posture calculation module can identify the key parts of the real object in the real scene image, collide the key parts of the real object with the SLAM point cloud, and calculate the position and posture information of the key parts according to the collision value. Figure 5B As shown, Figure 5B Figure (a) shows the real object in the real scene image. Figure 5B Figure (b) is a simulation diagram of the SLAM point cloud collision results.
[0105] For another example, the real object position and posture calculation module can identify the key parts of the real object in the real scene image, and determine the feature information of the key parts of the real object through image recognition technology; finally, according to the feature information of the key parts, the position and posture information of the real object is determined. Exemplarily, when the real object is a person or an animal, the key part can be the head, and the real object position and posture calculation module can identify the feature information of the head of the person or animal (for example, including eyes, nose, ears, and mouth).
[0106] It should also be noted that, in the embodiments of the present application, the real object position and posture calculation module can use a variety of methods to identify the key parts of the real object in the real scene image. Exemplarily, when the real object is a person or an animal, the real object position and posture calculation module can identify the head of the real object through facial recognition technology or bone feature recognition technology. For another example, the real object position and posture calculation module can use 3D physical recognition technology to identify the key parts of the real object in the real scene image.
[0107] The real object position and posture calculation module can determine the positional relationship between the real sound source and the microphone (i.e., the physical position of the real sound source) through traditional sound source localization technology, and finally convert the positional relationship between the real sound source and the microphone into the position of the real sound source in the world coordinate system.
[0108] The storage module is used to store the position and posture information of the real object calculated by the real object position and posture calculation module; and to store the position of the real sound.
[0109] The virtual object module library is used to store at least one virtual object model. Each virtual object model may include, but is not limited to, at least one of the following: an image model, a sound feature, an action feature, a sound response package, and an action response package. Among them, the image model is used to set the image of the virtual object. The sound feature is used to set the sound emitted by the virtual object, and may specifically include: volume, timbre, pitch, etc. The action feature is used to set the actions that the virtual object can perform, and may specifically include: action type, action amplitude, etc. The sound response package contains the correspondence between the sensing information of multiple virtual objects and the original sound that needs to be emitted. The action response package contains the correspondence between the sensing information of multiple virtual objects and the actions that need to be performed.
[0110] Among them, the sensing information of the virtual object may include but is not limited to the following two categories: visual sensing information and auditory sensing information. Among them, the visual sensing information includes: the position and posture information of the real object calculated by the real object position and posture calculation module, the movement of the real object, etc. Auditory sensing information includes: the position of the real sound source, the sound instructions issued by the real sound source, etc. Optionally, the sensing information of the virtual object may also include the touch operations performed by the user on the virtual object through the display screen, and these touch operations may also be called tactile sensing information. Optionally, the sound instructions issued by the real sound can be obtained by performing voice recognition on the real scene sound information through voice recognition technology.
[0111] Exemplarily, the virtual object model is described in detail below by taking a virtual object in which a virtual object is a person as an example:
[0112] The image model can be specifically set up with respect to: gender, height, weight, body proportions, facial features, clothing features, and other visual features (location of facial spots), etc.
[0113] The sound characteristics can specifically set the volume, timbre, and pitch so that the sound characteristics emitted by the virtual object are consistent with the image of the virtual object.
[0114] The action feature can specifically set the basic actions that the virtual object can perform, such as walking, running, jumping, shaking hands, waving, etc. Any of these basic actions can independently become an action response of the virtual object, or can be repeated multiple times or combined with other basic actions to form an action response of the virtual object.
[0115] The sound response package may include: when the sensing information of the virtual object represents that the real object is approaching, the corresponding original sound is "Hello"; when the sensing information of the virtual object represents that the real object is leaving, the corresponding original sound is "Goodbye"; when the user performs a touch operation by clicking on the virtual object through the display screen, the corresponding original sound is laughter.
[0116] The action response package may include: when the sensing information of the virtual object represents that the real object approaches, the corresponding action is walking in-reaching out-shaking hands; when the sensing information of the virtual object represents that the real object leaves, the corresponding action is raising hands-waving; when the user performs a touch operation on the virtual object through the display screen, the corresponding action is shaking.
[0117] The AR synthesis module is used to synthesize AR images and 3D audio data through AR technology, and display the AR image through a display screen and play the 3D audio data through speakers, headphones, etc. Specifically, the AR synthesis module may include an AR image generation module and a 3D sound generation module.
[0118] Specifically, the AR image generation module can synthesize the AR image through the following steps:
[0119] A1: The AR image generation module determines the position and posture information of the virtual object.
[0120] Optionally, the AR image generation module may determine the position and posture information of the virtual object in a variety of ways.
[0121] Optionally, the AR image generation module determines the position and posture information of the virtual object in real time according to at least one of the following:
[0122] The position and posture information of the real object, the action of the real object, the position of the real sound source, the sound command issued by the real sound source, the image model in the virtual object model, the action characteristics, the action response package, and the user's touch operation on the virtual object through the display screen. Similar to the posture information of the real object, the posture information of the virtual object is used to characterize the motion posture of the virtual object, which may include: the posture angle and acceleration of the virtual object on the three direction axes of the world coordinate system.
[0123] For another example, the position and posture information of the virtual object may be set by the electronic device, or by the user, or by the virtual object model.
[0124] A2: The AR image generation module can synthesize the AR image according to the position and posture information of the virtual object. The process can refer to the traditional AR image synthesis technology, which will not be described here. Optionally, in this step, the AR image generation module can also use the real scene image to synthesize the AR image.
[0125] In addition, the 3D sound generation module can also synthesize 3D audio data specifically through the following steps:
[0126] B1: The 3D sound generation module may determine the original sound data of the virtual object according to at least one of the following:
[0127] The position and posture information of the real object, the movement of the real object, the position of the real sound source, the sound instructions, sound characteristics, sound response packages issued by the real sound source, and the user's touch operation on the virtual object through the display screen.
[0128] B2: The 3D sound generation module generates 3D audio data according to the position and posture information of the real object, the position and posture information of the virtual object, and the original sound data.
[0129] Exemplarily, step B2 may specifically include the following steps:
[0130] C1: the 3D sound generation module calculates the distance between the virtual object and the ears of the real object according to the position and posture information of the real object and the position and posture information of the virtual object;
[0131] C2: The 3D sound generation module calculates the volume difference and time difference between the two ears of the real object according to the distance between the two ears of the virtual object and the real object;
[0132] C3: The 3D sound generation module generates 3D audio data based on the volume difference and time difference between the two ears of the real object and the original sound data. Optionally, before playing the 3D audio data, the 3D sound generation module can also filter the 3D audio data based on the posture information of the real object to further improve the realism of the 3D sound.
[0133] The display screen in the output device is used to display the AR image. The speaker or earphone in the output device is used to play the 3D audio data, so that the user can hear the 3D sound and perceive the location of the virtual sound source (i.e., the virtual object) through sound source localization.
[0134] It is noted that the electronic device can acquire real-world scene images, electronic device posture information, and real-world scene sound information in real time or periodically, so as to update the audiovisual responses of virtual objects in real time or periodically, thereby enabling the virtual objects to quickly make corresponding audiovisual responses based on the sensed real world, thereby improving the realism of the virtual objects.
[0135] It should also be noted that when the software structure of the electronic device is as follows: Figure 3 As shown, the real object position and posture calculation module, storage module, and AR synthesis module in the above AR interaction scheme can be implemented through the AR management service in the system service in the electronic device framework layer, and the virtual object model library in this scheme can be implemented through the virtual object model located in the system library. In addition, the interaction between each module and the acquisition device and the output device in this scheme can be implemented through the client, such as the AR application in the application layer. Obviously, this scheme can be implemented by combining the background system service and the foreground client.
[0136] The AR interaction solution provided by the embodiment of the present application can realize the virtual-real interaction that combines vision and hearing, thereby bringing a better immersive experience to users of AR applications. In addition, by combining various recognition technologies, virtual characters can perceive the position and posture of real objects, as well as the position of real sound sources, and make corresponding action responses and sound responses based on the above information, thereby improving the intelligence level of virtual objects and improving the experience of virtual-real interaction. In addition, the solution can be implemented using the architecture of the server and the client, making the client more operable, which is conducive to developers developing rich and colorful immersive AR applications.
[0137] based on Figure 2 and Figure 3 The electronic device shown, and Figure 4 The AR interaction scheme shown in the present application also provides multiple embodiments, which can respectively realize Figure 6 Different virtual and real audio-visual interactions are shown. Figure 6 As shown, in the following embodiments, virtual-real audio-visual interactions such as virtual viewing of reality, reality listening to virtuality, and virtual listening to reality can be realized respectively. Among them, virtual viewing of reality means that the virtual object can make action response or sound response according to the position and posture information of the real object within its field of view; reality listening to virtuality means that the virtual object can emit 3D sound according to the position and posture information of the real object and the position and posture information of the virtual object, so that the real object can hear the 3D sound, thereby locating the position of the virtual object through the sound source; virtual listening to reality means that the virtual object can determine the physical position of the real sound source according to the real scene sound information collected by the microphone, and make action response or sound response according to the position of the real sound source.
[0138] Example 1: Visual Interaction - Seeing Reality from Virtual Reality
[0139] See below Figure 7 The AR interaction flow chart shown takes a real object as a person as an example to explain in detail the AR interaction method provided in this embodiment.
[0140] S701: The electronic device obtains a real scene image captured by a camera, and obtains posture information of the electronic device collected by a motion sensor (IMU).
[0141] S702: The electronic device constructs a world coordinate system with the electronic device as the coordinate origin according to the real scene image and the posture information of the electronic device. Exemplarily, the electronic device may construct the world coordinate system using a SLAM algorithm.
[0142] It should be noted that after constructing the world coordinate system, the electronic device can directly use the world coordinate system until the world coordinate system becomes invalid (for example, the electronic device moves); or periodically update the world coordinate system. The length of the update period is not limited in this application, and the update period can be equal to or greater than the acquisition period of the real scene image.
[0143] S703: The electronic device determines whether the distance between the real object and the electronic device is greater than a set threshold, and if so, executes S704; otherwise, executes S705.
[0144] Since facial recognition technology requires facial details, if the real object is far away from the electronic device, the facial details in the real scene image cannot be displayed clearly, which may lead to inaccurate recognition results. However, bone feature recognition technology is based on the entire bone features of the human body. Even if the real object is far away from the electronic device, it will not affect the accuracy of the recognition results.
[0145] In addition, the electronic device may determine the distance between the real object and the electronic device in a variety of ways. For example, the electronic device may detect the distance between the real object and the electronic device through an internal infrared sensor, ultrasonic sensor, etc.
[0146] S704: When the distance between the real object and the electronic device is greater than the set threshold, the electronic device uses a bone feature recognition technology to recognize the head of the real object.
[0147] S705: When the distance between the real object and the electronic device is less than or equal to the set threshold, the electronic device uses facial recognition technology to recognize the head of the real object.
[0148] S706: The electronic device collides the head of the real object in the real scene image with the SLAM point cloud, and calculates the position and posture information of the head of the real object in the world coordinate system according to the collision value, for example Figure 5B The specific process of this step can refer to the traditional SLAM point cloud collision method, which will not be repeated here.
[0149] Optionally, the electronic device may also determine the position and posture information of the head of the real object in the world coordinate system by other methods. For example, when the distance between the real object and the electronic device is less than or equal to the set threshold, the electronic device may determine the feature information of the head of the real object (e.g., feature information of at least one of the eyes, nose, ears, and mouth) by image recognition technology; finally, the position and posture information of the real object is determined based on the feature information of the head.
[0150] S707: When the AR application sets virtual object visual monitoring (i.e., the virtual object performs action response and / or sound response based on visual sensing information), the electronic device updates the action response or sound response of the virtual object based on the position and posture information of the head of the real object in the world coordinate system.
[0151] The visual sensing information of the virtual object includes: the position and posture information of the real object calculated by the real object position and posture calculation module, and the movement of the real object.
[0152] Optionally, the electronic device may repeatedly execute the above S703-S707 in an update cycle of the real scene image (ie, execute S703-S707 frame by frame) to enable the virtual object to respond according to real-time visual sensing information.
[0153] The specific process of this step can be referred to Figure 4The process of the AR synthesis module generating the AR image and generating the 3D audio data in the illustrated embodiment will not be described in detail here.
[0154] In an embodiment of the present application, the electronic device can construct a world coordinate system with the electronic device as the coordinate origin based on the existing SLAM technology according to the real scene image captured by the camera and the posture information of the electronic device collected by the IMU; and use the camera field of view as the field of view of the virtual object, thereby determining the position and posture information of the real object in the field of view of the virtual object in the world coordinate system, and then according to the position and posture information of the real object, the virtual object can make corresponding actions. For example, when a real person appears in the visual range of the virtual object, the virtual object's gaze adaptively follows the real person, and / or follows the movement of the real person.
[0155] Example 2: Visual Interaction - Reality and Virtuality
[0156] See below Figure 8 The AR interaction flow chart shown takes a real object as a person as an example to explain in detail the AR interaction method provided in this embodiment.
[0157] S801: The electronic device may update the position and posture information of the head of the real object in the world coordinate system, and the position and posture information of the virtual object in the world coordinate system in the update cycle of the real scene image, specifically including steps S8011 and S8012.
[0158] S8011: The electronic device updates the position and posture information of the head of the real object in the world coordinate system. For the specific process, please refer to Figure 7 The methods described in S701-S706 in the illustrated embodiment are not described in detail here.
[0159] S8012: The electronic device updates the position and posture information of the virtual object in the world coordinate system. Optionally, the position and posture information of the virtual object in the world coordinate system may be set by the electronic device, or by the user, or may be determined in real time by the electronic device. For example, the electronic device may refer to Figure 4 In the illustrated embodiment, the AR image generation module performs step A1 to determine the position and posture information of the virtual object in the world coordinate system.
[0160] The electronic device may perform the following steps S802-S804 when the AR application sets visual monitoring of the virtual object (ie, the virtual object responds to sound according to visual sensing information).
[0161] S802: The electronic device determines the original sound data of the virtual object. Similar to S8012, the electronic device determines the position and posture information of the virtual object in the world coordinate system. The original sound data of the virtual object can be set by the electronic device, or set by the user, or can be determined by the electronic device in real time. For example, the electronic device can refer to Figure 4 In the illustrated embodiment, the 3D sound generation module performs step B1 to determine the original sound data of the virtual object.
[0162] S803: The electronic device generates 3D audio data according to the position and posture information of the head of the real object in the world coordinate system, the position and posture information of the virtual object in the world coordinate system, and the original sound data of the virtual object, which may specifically include steps S8031-S8034.
[0163] S8031: The electronic device determines the distance between the virtual object and the ears of the real object (i.e., the distance between the virtual object and the left ear of the real object, and the distance between the virtual object and the right ear of the real object) based on the position and posture information of the head of the real object in the world coordinate system and the position and posture information of the virtual object in the world coordinate system.
[0164] S8032: The electronic device calculates the volume difference and time difference between the two ears of the real object according to the distance between the virtual object and the two ears of the real object.
[0165] S8033: The electronic device generates 3D audio data according to the obtained volume difference and time difference between the two ears of the real object and the original sound data.
[0166] S8034: The electronic device may filter the 3D audio data according to the head posture information of the real object to further enhance the realism of the 3D sound. Since the sound may undergo various reflections and refractions during the transmission process in the transmission medium, by filtering the 3D audio data, the reflection and refraction of the 3D audio data during the transmission process may be simulated, thereby making the 3D sound heard by the real object more realistic.
[0167] S804: The electronic device plays the 3D audio data through a speaker or earphone. The real object can hear the 3D sound and locate the sound source according to the 3D sound to perceive the location of the virtual object.
[0168] In an embodiment of the present application, the electronic device can update the position and posture information of the virtual object and the real object in real time, so that the 3D audio data can be synthesized according to the position and posture relationship between the two, so that the emitted 3D sound is more realistic. For example, the virtual musical instrument in the virtual world can emit 3D sound through the above method, and the people in the real world can determine the specific position of the virtual musical instrument in the virtual world through the 3D sound emitted by the headphones. For another example, there are multiple virtual characters in the virtual world. After a virtual character emits a 3D sound through the above method, the people in the real world can judge which virtual character the sound comes from through the 3D sound emitted by the headphones. For another example, in a virtual world where there are flowers, birds, fish, insects, mountains and rivers, each virtual object can emit 3D sound through the above method, so that people in the real world can determine the specific virtual objects in the virtual world and the position of the virtual objects through the 3D sound emitted by the headphones, making people in the real world more immersive.
[0169] For another example, see Fig. 9 As shown, the virtual object (virtual cat) in the virtual world can send 3D sound (cat's meow) through the above method, and people in the real world can determine that the virtual cat is in the middle of the sofa, rather than on the coffee table, through the 3D sound emitted by the headphones, thereby ensuring that what people hear through the headphones is consistent with what they see on the display of the electronic device.
[0170] See also Fig.10 As shown in the AR interactive service implementation flow chart, the electronic device can be implemented by, but not limited to, the following functions: Figure 8 The AR interaction method shown is: original sound calculation function, posture calculation function, and 3D sound synthesis function. The 3D sound synthesis function can call the original sound calculation function to obtain the original sound data of the virtual object; and call the posture calculation function to update the position and posture information of the virtual object and the position and posture information of the real object in real time; finally, 3D audio data can be generated according to the original sound data of the virtual object, the position and posture information of the virtual object, and the position and posture information of the real object.
[0171] Example 3: Auditory Interaction - Virtual Auditory Reality
[0172] See below Fig.11 The AR interaction flow chart shown provides a detailed description of the AR interaction method provided in the embodiment of the present application.
[0173] S1101: The electronic device constructs a world coordinate system with the electronic device as the coordinate origin. For the specific process, please refer to Figure 7 The description of S701-S702 in the illustrated embodiment will not be repeated here.
[0174] S1102: The electronic device collects real-world scene sound information in real time through a microphone, and determines the position of the real sound source in the world coordinate system through sound source localization, which may specifically include steps S11021 and S11022.
[0175] S11021: The electronic device collects real-world scene sound information through a microphone in real time, and determines the physical position of the real sound source through sound source localization.
[0176] Among them, the physical position of the real sound source can represent the positional relationship between the real sound source and the microphone (ie, the electronic device), such as the direction of the electronic device where the real sound source is located and the distance between the real sound source and the electronic device.
[0177] S11022: The electronic device converts the physical position of the real sound source into the position of the real sound source in the world coordinate system.
[0178] S1103: When the AR application sets virtual object auditory monitoring (i.e., the virtual object performs action response and / or sound response based on auditory sensing information), the electronic device updates the action response and / or sound response of the virtual object according to the position of the real sound source in the world coordinate system.
[0179] The auditory sensing information of the virtual object includes: the position of the real sound source in the world coordinate system, the sound instructions issued by the real sound source, etc.
[0180] The specific process of this step can be referred to Figure 4 The process of the AR synthesis module generating the AR image and generating the 3D audio data in the illustrated embodiment will not be described in detail here.
[0181] Through the embodiments of the present application, when a real sound source in the real world makes a sound, the virtual object in the virtual world can identify the position of the real sound source and make an action response or a sound response according to the position of the real sound source. For example, when a person in the real world makes a blowing sound, the seeds of dandelions that are closer to the real sound source in the virtual world can spread out and make a movement that floats in the wind. For another example, when a person in the real world shouts, a flock of birds that are closer to the real sound source in the virtual world can make an action that flies away.
[0182] It should be noted that Example 1 and Example 3 provided in the present application can be implemented separately or in combination, and the present application does not limit this.
[0183] Exemplarily, based on the above embodiments, the present application also provides an AR interaction method, see Fig.12 As shown, the method comprises the following steps:
[0184] S1201: The electronic device determines the position and posture information of a real object and / or the position of a real sound source in a real scene, wherein the position and posture information of the real object is used to represent the position and posture of the real object.
[0185] In one implementation, the electronic device may determine the position and posture information of the real object by the following steps:
[0186] The electronic device obtains a second real scene image captured by a camera and identifies key parts of a real object in the second real scene image; the electronic device determines the posture information of the key parts of the real object in the second real scene image based on the simultaneous positioning and map construction SLAM point cloud collision technology; the electronic device uses the posture information of the key parts of the real object as the posture information of the real object.
[0187] In one implementation, the electronic device may determine the position of the real sound source by following the steps below:
[0188] The electronic device obtains real-scene sound information collected by the microphone, and determines the positional relationship between the real sound source and the microphone through sound source positioning; the electronic device determines the position of the real sound source in the real scene based on the positional relationship between the real sound source and the microphone.
[0189] The detailed description of the above determination process can refer to the description in the above embodiments, which will not be repeated here.
[0190] S1202: The electronic device determines the position and posture information of the virtual object according to the position and posture information of the real object and / or the position of the real sound source, wherein the position and posture information of the virtual object is used to represent the position and posture of the virtual object.
[0191] In one embodiment, before executing S1201, the electronic device may also establish a world coordinate system with the electronic device as the coordinate origin. Exemplarily, the electronic device may establish the world coordinate system by the following steps: obtaining a first real scene image captured by a camera, and obtaining the posture information of the electronic device measured by an inertial measurement unit; and establishing the world coordinate system based on the first real scene image and the posture information of the electronic device.
[0192] In this embodiment, in order to improve the accuracy of various information determined by the electronic device in S1201 and S1202, the posture information of the real object is specifically used to characterize the position and posture of the real object in the world coordinate system; the position of the real sound source is the position of the real sound source in the world coordinate system; the posture information of the virtual object is specifically used to characterize the position and posture of the virtual object in the world coordinate system.
[0193] Optionally, the electronic device can determine the posture information of the virtual object based on the posture information of the real object and / or the position of the real sound source, and at least one of the following: the action of the real object identified by the posture information of the real object, the sound command issued by the real sound source, the image model, action characteristics, action response package in the virtual object model corresponding to the virtual object, and the user's touch operation on the virtual object through the display screen.
[0194] S1203: The electronic device generates an AR image including the virtual object according to the posture information of the virtual object; displays the AR image; and / or generates 3D audio data of the virtual object according to the posture information of the real object and the posture information of the virtual object; and plays the 3D audio data.
[0195] In one implementation, the electronic device may generate the 3D audio data of the virtual object by following the steps below:
[0196] The electronic device determines the distance between the two ears of the virtual object and the real object respectively according to the posture information of the real object and the posture information of the virtual object;
[0197] The electronic device calculates the volume difference and time difference between the two ears of the real object according to the distance between the virtual object and the two ears of the real object;
[0198] The electronic device generates 3D audio data according to the volume difference and time difference of the real object and the original sound data of the virtual object.
[0199] Optionally, in this embodiment, the original sound data is set, or is determined based on at least one of the following: the position and posture information of the real object, the posture information of the virtual object, the action of the real object identified by the posture information of the real object, the sound instructions issued by the real sound source, the image model, action features, action response package in the virtual object model corresponding to the virtual object, and the user's touch operation on the virtual object through the display screen.
[0200] Optionally, before playing the 3D audio data, the electronic device may further filter the 3D audio data according to the posture information of the real object, thereby simulating reflection and refraction of the 3D audio data during transmission, thereby making the 3D sound heard by the real object more realistic.
[0201] The embodiment of the present application provides an AR interaction method, in which the electronic device can determine the position information of the virtual object based on the position information of the real object or the position of the real sound source, so as to generate and display an AR image. In addition, the 3D sound data of the virtual object can be generated and played based on the position information of the real object and the position information of the virtual object. Obviously, through this scheme, the virtual object can perceive the position of the real object and the position of the real sound source, and make corresponding action responses or sound responses based on the above information, so that the virtual object can be like a real object. Therefore, this method realizes the virtual-real interaction of the virtual object and the visual and auditory combination of the real object, which can improve the intelligence level of the virtual object and thus improve the experience of virtual interaction.
[0202] Based on the same technical concept, the present application also provides an electronic device, which is used to implement the method provided in the above embodiment. Fig.13 As shown, the electronic device 1300 may include: a determination unit 1301 , an AR synthesis unit 1302 , a display unit 1303 , and an audio unit 1304 .
[0203] The display unit 1303 is used to present a user interface (such as an AR image) to achieve human-computer interaction. Figure 2 The display unit 204 in the electronic device shown is the same, and the display unit 1303 includes a display panel, which is also called a display screen.
[0204] The audio unit 1304 is used to collect sound signals and play audio data. Figure 2 Similar to the audio circuit 206 in the electronic device shown, the audio unit 1304 may include a speaker and a microphone.
[0205] The functions of each unit when implementing the method provided in the above embodiment are described below.
[0206] The determining unit 1301 is used to determine the position information of a real object and / or the position of a real sound source in a real scene, wherein the position information of the real object is used to represent the position and posture of the real object; and determine the position information of a virtual object according to the position information of the real object and / or the position of the real sound source, wherein the position information of the virtual object is used to represent the position and posture of the virtual object;
[0207] The AR synthesis unit 1302 is used to generate an AR image including the virtual object according to the posture information of the virtual object; and / or to generate 3D audio data of the virtual object according to the posture information of the real object and the posture information of the virtual object;
[0208] A display unit 1303, configured to display the AR image;
[0209] The audio unit 1304 is configured to play the 3D audio data.
[0210] In one implementation, the determining unit 1301 is further configured to:
[0211] Establishing a world coordinate system with the electronic device as the coordinate origin;
[0212] The position and posture information of the real object is specifically used to represent the position and posture of the real object in the world coordinate system;
[0213] The position of the real sound source is the position of the real sound source in the world coordinate system;
[0214] The position and posture information of the virtual object is specifically used to represent the position and posture of the virtual object in the world coordinate system.
[0215] In one implementation, when the electronic device 1300 further includes a camera and an inertial measurement unit, the determining unit 1301, when establishing a world coordinate system with the electronic device as the coordinate origin, is specifically configured to:
[0216] Acquire a first real scene image captured by a camera, and acquire attitude information of the electronic device measured by an inertial measurement unit;
[0217] The world coordinate system is established according to the first real scene image and the posture information of the electronic device.
[0218] In one implementation, when the electronic device 1300 further includes a camera, the determining unit 1301, when determining the position and posture information of a real object in a real scene, is specifically used to:
[0219] Acquire a second real scene image captured by a camera, and identify key parts of a real object in the second real scene image;
[0220] Determine the position and posture information of the key parts of the real object in the second real scene image according to the simultaneous localization and mapping SLAM point cloud collision technology;
[0221] The position and posture information of the key parts of the real object is used as the position and posture information of the real object.
[0222] In one implementation, when the audio unit 1304 further includes a microphone, the determination unit 1301, when determining the position of a real sound source in a real scene, is specifically configured to:
[0223] Acquire real scene sound information collected by a microphone, and determine the positional relationship between the real sound source and the microphone through sound source localization;
[0224] The position of the real sound source in the real scene is determined according to the positional relationship between the real sound source and the microphone.
[0225] In one implementation, the AR synthesis unit 1302, when determining the posture information of the virtual object according to the posture information of the real object and / or the position of the real sound source, is specifically used to:
[0226] The posture information of the virtual object is determined according to the posture information of the real object and / or the position of the real sound source, and at least one of the following: the action of the real object identified by the posture information of the real object, the sound command issued by the real sound source, the image model, action characteristics, action response package in the virtual object model corresponding to the virtual object, and the user's touch operation on the virtual object through the display screen.
[0227] In one implementation, when the AR synthesis unit 1302 generates the 3D audio data of the virtual object according to the posture information of the real object and the posture information of the virtual object, it is specifically used to:
[0228] Determine the distance between the two ears of the virtual object and the real object respectively according to the posture information of the real object and the posture information of the virtual object;
[0229] Calculating a volume difference and a time difference between the two ears of the real object according to the distance between the virtual object and the two ears of the real object;
[0230] 3D audio data is generated according to the volume difference and time difference of the real object and the original sound data of the virtual object.
[0231] In one embodiment, the original sound data is set, or is determined according to at least one of the following:
[0232] The position and posture information of the real object, the posture information of the virtual object, the action of the real object identified by the posture information of the real object, the sound command issued by the real sound source, the image model, action characteristics, action response package in the virtual object model corresponding to the virtual object, and the user's touch operation on the virtual object through the display screen.
[0233] In one implementation, the AR synthesis unit 1302 is further configured to:
[0234] Before the audio unit 1304 plays the 3D audio data, the 3D audio data is filtered according to the posture information of the real object.
[0235] It should be noted that the division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0236] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0237] Based on the same technical concept, the embodiment of the present application also provides an electronic device, which is used to implement the AR interaction method provided in the above embodiment. Fig.13 Functions of the electronic devices shown. Fig.14 As shown, the electronic device 1400 may include: a processor 1401, a memory 1402, a camera 1403, a display screen 1404, and an audio circuit 1405. Of course, the electronic device 1400 may also have Figure 2 Each peripheral or internal hardware shown.
[0238] The processor 1401 and other components are interconnected. Optionally, the processor 1401 and other components can be interconnected by a bus. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.14 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0239] The processor 1401 is used to implement the AR interaction method provided in the above embodiment, including:
[0240] Determining position information of a real object and / or the position of a real sound source in a real scene, wherein the position information of the real object is used to characterize the position and posture of the real object;
[0241] Determining the position and posture information of the virtual object according to the position and posture information of the real object and / or the position of the real sound source, wherein the position and posture information of the virtual object is used to represent the position and posture of the virtual object;
[0242] According to the posture information of the virtual object, an AR image including the virtual object is generated; the AR image is displayed through the display screen 1404; and / or according to the posture information of the real object and the posture information of the virtual object, 3D audio data of the virtual object is generated; and the 3D audio data is played through the audio circuit 1405.
[0243] The specific process in the above steps can be found in the description of the above embodiments, which will not be repeated here.
[0244] The memory 1402 is used to store program instructions and data. Specifically, the program instructions may include program codes, which include computer operation instructions. The memory 1402 may include random access memory (RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk storage. The processor 1401 executes the program stored in the memory 1402, and implements the above functions through the above components, thereby finally implementing the method provided in the above embodiment.
[0245] Based on the above embodiments, the embodiments of the present application further provide a computer program, which, when executed on a computer, enables the computer to execute the methods provided in the above embodiments.
[0246] Based on the above embodiments, the embodiments of the present application further provide a computer storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes the method provided in the above embodiments.
[0247] Based on the above embodiments, an embodiment of the present application further provides a chip, which is used to read a computer program stored in a memory to implement the method provided in the above embodiments.
[0248] Based on the above embodiments, the embodiments of the present application provide a chip system, which includes a processor for supporting a computer device to implement the functions involved in the electronic device in the method provided in the above embodiments. In a possible design, the chip system also includes a memory, which is used to store the necessary programs and data for the computer device. The chip system can be composed of a chip, or it can include a chip and other discrete devices.
[0249] In summary, the present application provides an AR interaction method and electronic device. In this solution, the electronic device can determine the position information of the virtual object based on the position information of the real object or the position of the real sound source, so as to generate and display the AR image. In addition, the 3D sound data of the virtual object can be generated and played based on the position information of the real object and the position information of the virtual object. Obviously, through this solution, the virtual object can perceive the position of the real object and the position of the real sound source, and make corresponding action responses or sound responses based on the above information, so that the virtual object can be like a real object. Therefore, this method realizes the virtual-real interaction of the virtual object and the real object in combination with the visual and auditory senses, which can improve the intelligence level of the virtual object and thus improve the experience of virtual interaction.
[0250] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0251] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0252] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0253] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0254] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. An augmented reality (AR) interaction method, applied to an electronic device, characterized in that: include: Establishing a world coordinate system with the electronic device as the coordinate origin; Determine the position information of a real object and the position of a real sound source in a real scene, wherein the position information of the real object is used to characterize the position and posture of the real object; the position information of the real object is specifically used to characterize the position and posture of the real object in the world coordinate system; the position of the real sound source is the position of the real sound source in the world coordinate system; Determine the posture information of the virtual object according to the posture information of the real object and the position of the real sound source, wherein the posture information of the virtual object is used to represent the position and posture of the virtual object; the posture information of the virtual object is specifically used to represent the position and posture of the virtual object in the world coordinate system; Generate an AR image including the virtual object according to the position information of the virtual object; display the AR image; generate 3D audio data of the virtual object according to the position information of the real object and the position information of the virtual object; play the 3D audio data; Establishing a world coordinate system with the electronic device as the coordinate origin, including: Acquire a first real scene image captured by a camera, and acquire attitude information of the electronic device measured by an inertial measurement unit; Establishing the world coordinate system according to the first real scene image and the posture information of the electronic device; The display screen of the electronic device is parallel to two direction axes of the world coordinate system and perpendicular to one direction axis of the world coordinate system.
2. The method according to claim 1, characterized in that The coordinate origin is a corner of the display screen of the electronic device; The coordinate origin is the center point of one side of the display screen of the electronic device; The coordinate origin is the center point of the display screen; or, The coordinate origin is any point preset in the display screen.
3. The method according to claim 1, characterized in that Determine the pose information of real objects in the real scene, including: Acquire a second real scene image captured by a camera, and identify key parts of a real object in the second real scene image; Determine the position and posture information of the key parts of the real object in the second real scene image according to the simultaneous localization and mapping SLAM point cloud collision technology; The position and posture information of the key parts of the real object is used as the position and posture information of the real object.
4. The method according to claim 1, characterized in that Determine the location of real-world sound sources in real-world scenes, including: Acquire real scene sound information collected by a microphone, and determine the positional relationship between the real sound source and the microphone through sound source localization; The position of the real sound source in the real scene is determined according to the positional relationship between the real sound source and the microphone.
5. The method according to claim 1, characterized in that Determining the position and posture information of the virtual object according to the position and posture information of the real object and the position of the real sound source includes: The posture information of the virtual object is determined according to the posture information of the real object and the position of the real sound source, and at least one of the following: the action of the real object identified by the posture information of the real object, the sound command issued by the real sound source, the image model, action characteristics, and action response package in the virtual object model corresponding to the virtual object, and the user's touch operation on the virtual object through a display screen.
6. The method according to any one of claims 1 to 5, characterized in that: Generating 3D audio data of the virtual object according to the posture information of the real object and the posture information of the virtual object, including: Determine the distance between the two ears of the virtual object and the real object respectively according to the posture information of the real object and the posture information of the virtual object; Calculating a volume difference and a time difference between the two ears of the real object according to the distance between the virtual object and the two ears of the real object; 3D audio data is generated according to the volume difference and time difference of the real object and the original sound data of the virtual object.
7. The method according to claim 6, characterized in that The original sound data is set, or is determined according to at least one of the following: The position and posture information of the real object, the posture information of the virtual object, the action of the real object identified by the posture information of the real object, the sound command issued by the real sound source, the image model, action characteristics, action response package in the virtual object model corresponding to the virtual object, and the user's touch operation on the virtual object through the display screen.
8. The method according to any one of claims 1 to 5, characterized in that: Before playing the 3D audio data, the method further includes: The 3D audio data is filtered according to the posture information of the real object.
9. An electronic device for augmented reality (AR) interaction, characterized in that: include: A determination unit, used for establishing a world coordinate system with the electronic device as a coordinate origin; Determine the posture information of a real object and the position of a real sound source in a real scene, wherein the posture information of the real object is used to characterize the position and posture of the real object; the posture information of the real object is specifically used to characterize the position and posture of the real object in the world coordinate system; the position of the real sound source is the position of the real sound source in the world coordinate system; and determine the posture information of a virtual object according to the posture information of the real object and the position of the real sound source, wherein the posture information of the virtual object is used to characterize the position and posture of the virtual object; the posture information of the virtual object is specifically used to characterize the position and posture of the virtual object in the world coordinate system; An AR synthesis unit is used to generate an AR image containing the virtual object according to the posture information of the virtual object; and to generate 3D audio data of the virtual object according to the posture information of the real object and the posture information of the virtual object; A display unit, configured to display the AR image; An audio unit, used for playing the 3D audio data; When establishing a world coordinate system with the electronic device as the coordinate origin, the determination unit is specifically used to: obtain a first real scene image captured by a camera, and obtain posture information of the electronic device measured by an inertial measurement unit; establish the world coordinate system based on the first real scene image and the posture information of the electronic device; wherein the display screen of the electronic device is parallel to two direction axes of the world coordinate system and perpendicular to one direction axis of the world coordinate system.
10. The electronic device according to claim 9, characterized in that: The coordinate origin is a corner of the display screen of the electronic device; The coordinate origin is the center point of one side of the display screen of the electronic device; The coordinate origin is the center point of the display screen; or, The coordinate origin is any point preset in the display screen.
11. The electronic device according to claim 9, characterized in that: The determining unit, when determining the position and posture information of the real object in the real scene, is specifically used to: Acquire a second real scene image captured by a camera, and identify key parts of a real object in the second real scene image; Determine the position and posture information of the key parts of the real object in the second real scene image according to the simultaneous localization and mapping SLAM point cloud collision technology; The position and posture information of the key parts of the real object is used as the position and posture information of the real object.
12. The electronic device according to claim 9, characterized in that: The determining unit, when determining the position of a real sound source in a real scene, is specifically used to: Acquire real scene sound information collected by a microphone, and determine the positional relationship between the real sound source and the microphone through sound source localization; The position of the real sound source in the real scene is determined according to the positional relationship between the real sound source and the microphone.
13. The electronic device according to claim 9, characterized in that: The AR synthesis unit, when determining the position and posture information of the virtual object according to the position and posture information of the real object and the position of the real sound source, is specifically used to: The posture information of the virtual object is determined according to the posture information of the real object and the position of the real sound source, and at least one of the following: the action of the real object identified by the posture information of the real object, the sound command issued by the real sound source, the image model, action characteristics, and action response package in the virtual object model corresponding to the virtual object, and the user's touch operation on the virtual object through a display screen.
14. The electronic device according to any one of claims 9 to 13, characterized in that: The AR synthesis unit, when generating the 3D audio data of the virtual object according to the posture information of the real object and the posture information of the virtual object, is specifically used to: Determine the distance between the two ears of the virtual object and the real object respectively according to the posture information of the real object and the posture information of the virtual object; Calculating a volume difference and a time difference between the two ears of the real object according to the distance between the virtual object and the two ears of the real object; 3D audio data is generated according to the volume difference and time difference of the real object and the original sound data of the virtual object.
15. The electronic device according to claim 14, characterized in that: The original sound data is set, or is determined according to at least one of the following: The position and posture information of the real object, the posture information of the virtual object, the action of the real object identified by the posture information of the real object, the sound command issued by the real sound source, the image model, action characteristics, action response package in the virtual object model corresponding to the virtual object, and the user's touch operation on the virtual object through the display screen.
16. The electronic device according to any one of claims 9 to 13, characterized in that: The AR synthesis unit is further used for: Before the audio unit plays the 3D audio data, the 3D audio data is filtered according to the posture information of the real object.
17. An electronic device, characterized in that: The electronic device comprises: a display screen, a processor, and a memory; wherein the memory stores a computer program, and the computer program comprises instructions, and when the instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-8.
18. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program runs on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.
19. A chip, characterized in that: The chip is used to read a computer program stored in a memory and execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Gaming device with volumetric sensing
CN106233227A
Identification interaction method and apparatus, storage medium and terminal device
CN108681402A
Dual listener positions for mixed reality
CN111713121A
Virtual character control method and device, equipment and computer readable storage medium
CN111880659A
Display method and device, display equipment and computer readable storage medium
CN111897431A
Cited By
Augmented reality interaction method and electronic device
EP4254353B1
