Augmented reality processing method and device, storage medium and electronic device
By combining RGB and depth camera information, the automated initialization of augmented reality technology is realized, which solves the problem of long time-consuming and insufficient precision in user cooperation with translation operations, and improves the accuracy and speed of AR navigation and tracking applications.
Patent Information
- Application Number
- CN202011216152.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-04
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-11-04
AI Technical Summary
The initialization process in augmented reality technology requires the user to cooperate with slow panning operations, which takes a long time and lacks the combination of depth information, resulting in insufficient accuracy.
The RGB camera is used to collect environmental information to generate a target image. The depth camera collects depth information. It combines the target image and the depth image for relocation, extracts the three-dimensional information of the feature points, and realizes the pose determination of the mobile terminal in the map coordinate system, and then performs augmented reality. operation to avoid user translation operations and improve initialization speed and accuracy.
It achieves fast initialization without user cooperation and improves the accuracy and efficiency of augmented reality operations, such as improved accuracy in AR navigation and tracking applications.
Smart Images

Figure CN112365530B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of augmented reality technology, and in particular to an augmented reality processing method, an augmented reality processing device, a computer-readable storage medium, and an electronic device. Background Art
[0002] Augmented Reality (AR) is a technology that integrates the virtual world and the real world. This technology has been widely used in education, games, medical care, the Internet of Things, smart manufacturing and many other fields.
[0003] For the positioning operation in augmented reality technology, an initialization process is required, and the purpose of initialization is to achieve more accurate image tracking. At present, the initialization process requires the device to perform a slow translation operation, which usually requires the cooperation of the user and takes a long time. Summary of the invention
[0004] The present disclosure provides an augmented reality processing method, an augmented reality processing device, a computer-readable storage medium and an electronic device, thereby overcoming, at least to a certain extent, the problem that the augmented reality initialization process requires user cooperation and is time-consuming.
[0005] According to a first aspect of the present disclosure, there is provided an augmented reality processing method, which is applied to a mobile terminal, and includes: generating a target image using environmental information collected by an RGB camera; determining a depth image corresponding to the target image using depth information collected by a depth camera, and aligning the target image with the depth image; repositioning based on the target image and the depth image to determine a position and posture of the mobile terminal in a map coordinate system; extracting feature points of the target image, determining depth values corresponding to the feature points using the depth image, and determining three-dimensional information of the feature points in combination with the depth values corresponding to the feature points; and performing augmented reality operations using the position and posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature points.
[0006] According to a second aspect of the present disclosure, there is provided an augmented reality processing device, which is applied to a mobile terminal and includes: an RGB image acquisition module, which is used to generate a target image using environmental information collected by an RGB camera; a depth image acquisition and alignment module, which is used to determine a depth image corresponding to the target image using depth information collected by the depth camera, and align the target image with the depth image; a posture determination module, which is used to perform repositioning based on the target image and the depth image, and determine the posture of the mobile terminal in a map coordinate system; a three-dimensional information determination module, which is used to extract feature points of the target image, determine depth values corresponding to the feature points using the depth image, and determine three-dimensional information of the feature points in combination with the depth values corresponding to the feature points; and an operation execution module, which is used to perform augmented reality operations using the posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature points.
[0007] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned augmented reality processing method is implemented.
[0008] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising a processor; and a memory for storing one or more programs, wherein when the one or more programs are executed by the processor, the processor implements the above-mentioned augmented reality processing method.
[0009] In the technical solutions provided in some embodiments of the present disclosure, the mobile terminal uses the target image and its corresponding depth image for repositioning to determine the position and posture of the mobile terminal in the map coordinate system. The feature points of the target image are extracted, and the three-dimensional information of the feature points is determined using the depth image. Next, the augmented reality operation is performed using the position and posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature points. On the one hand, the disclosed solution implements the initialization process of augmented reality based on a target image and a corresponding depth image. It does not require the cooperation of the user to perform translation operations, is less time-consuming, and can quickly start AR navigation, tracking and other operations; on the other hand, the disclosed solution combines depth information to achieve initialization without the need for user participation, thereby improving the accuracy of the algorithm and making application processes such as AR navigation and tracking more accurate.
[0010] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0012] Figure 1 A schematic diagram of a scene to which the augmented reality processing solution of the embodiment of the present disclosure can be applied is shown;
[0013] Figure 2 A schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present disclosure is shown;
[0014] Figure 3 A flowchart of an augmented reality processing method according to an exemplary embodiment of the present disclosure is schematically shown;
[0015] Figure 4 A schematic diagram showing the principle of pinhole imaging;
[0016] Figure 5 A block diagram schematically shows an augmented reality processing device according to an exemplary embodiment of the present disclosure;
[0017] Figure 6 A block diagram schematically shows an augmented reality processing device according to another exemplary embodiment of the present disclosure;
[0018] Figure 7 A block diagram of an augmented reality processing device according to another exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0019] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0020] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0021] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation. In addition, all the terms "first" and "second" below are only for the purpose of distinction and should not be used as limitations of the present disclosure.
[0022] Figure 1 A schematic diagram of a scene to which the augmented reality processing solution of the embodiment of the present disclosure can be applied is shown.
[0023] like Figure 1As shown, when the mobile terminal has an AR navigation application installed, the user can click the icon of the application to enter the application interface. After opening the application and before implementing AR navigation, the mobile terminal can execute the augmented reality processing solution described in the present disclosure to complete the initialization process and improve the accuracy of AR navigation.
[0024] Specifically, first, the mobile terminal can respond to the opening operation of the augmented reality application, that is, respond to the user clicking the AR navigation application icon, and turn on the RGB camera and the depth camera at the same time. The target image is generated using the environmental information collected by the RGB camera, and the depth image corresponding to the target image is determined using the depth information collected by the depth camera.
[0025] Next, the target image is aligned with the depth image, and a relocation process is performed based on the aligned target image and depth image to determine the position and posture of the mobile terminal in the map coordinate system.
[0026] In addition, the mobile terminal can use a feature point extraction algorithm to extract feature points of the target image, use the depth image to determine the depth values corresponding to the feature points, and determine the three-dimensional information of the feature points in combination with the depth values corresponding to the feature points.
[0027] After determining the position and posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature points, it can be considered that the initialization process is completed and the augmented reality operation can be performed. Figure 1 For example, after the initialization process, it can further respond to the user's operation (such as entering the destination information, etc.) and start the AR navigation service, as shown in the figure indicating "turn right".
[0028] The augmented reality processing process disclosed herein uses an RGB image and a corresponding depth image to achieve initialization, without the need for the user to perform translation operations, and the initialization speed is fast. In addition, the algorithm integrates depth information, improves the accuracy of initialization, and thus improves the accuracy of AR applications such as navigation.
[0029] It should be understood that the mobile terminal described in the present disclosure may be a mobile phone, a tablet computer, AR glasses, an AR helmet, or other device capable of implementing AR processing and AR display functions. The present disclosure does not limit the type of mobile terminal.
[0030] It should be noted that the augmented reality processing method according to the exemplary embodiment of the present disclosure is generally executed by a mobile terminal. Accordingly, the augmented reality processing device described below is generally configured in a mobile terminal.
[0031] Figure 2 Schematic diagram of an electronic device suitable for implementing the exemplary embodiment of the present disclosure is shown. The mobile terminal described in the exemplary embodiment of the present disclosure may be configured as follows Figure 2It should be noted that Figure 2 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0032] The electronic device of the present disclosure includes at least a processor and a memory, and the memory is used to store one or more programs. When the one or more programs are executed by the processor, the processor can implement the augmented reality processing method of the exemplary embodiment of the present disclosure.
[0033] Specifically, Figure 2 As shown, the electronic device 200 may include: a processor 210, an internal memory 221, an external memory interface 222, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 271, a receiver 272, a microphone 273, an earphone interface 274, a sensor module 280, a display screen 290, a camera module 291, an indicator 292, a motor 293, a button 294, and a Subscriber Identification Module (SIM) card interface 295, etc. The sensor module 280 may include a depth sensor, a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor, etc.
[0034] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0035] The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor and / or a neural network processor (NPU). Different processing units may be independent devices or integrated into one or more processors. In addition, a memory may be provided in the processor 210 for storing instructions and data.
[0036] The electronic device 200 can implement the shooting function through the ISP, the camera module 291, the video codec, the GPU, the display screen 290 and the application processor, etc. In some embodiments, the electronic device 200 may include at least two camera modules 291, which are respectively a camera module for shooting RGB images and a camera module for shooting depth images.
[0037] The internal memory 221 can be used to store computer executable program codes, which include instructions. The internal memory 221 can include a program storage area and a data storage area. The external memory interface 222 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.
[0038] As for the augmented reality processing scheme described in the present disclosure, the mobile terminal can use the camera module that shoots RGB images to collect environmental information, generate a target image, and use the camera module that shoots depth images to collect depth information, and determine the depth image corresponding to the target image. The processor 210 can align the target image with the depth image, and reposition it based on the target image and the depth image to determine the position and posture of the mobile terminal in the map coordinate system. In addition, the processor 210 can extract the feature points of the target image, use the depth image to determine the depth value corresponding to the feature point, and combine the depth value corresponding to the feature point to determine the three-dimensional information of the feature point. When the position and posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature point are determined, the initialization is completed. Subsequently, the mobile terminal can perform augmented reality operations according to the position and posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature point, so as to realize processes such as AR navigation.
[0039] The present disclosure also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being assembled into the electronic device.
[0040] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0041] Computer-readable storage media can send, propagate or transmit programs for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0042] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiments.
[0043] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0044] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0045] Figure 3 The flowchart of the augmented reality processing method according to the exemplary embodiment of the present disclosure is schematically shown. Figure 3 The augmented reality processing method applied to a mobile terminal of the present disclosure may include the following steps:
[0046] S30. Generate a target image using the environmental information collected by the RGB camera.
[0047] In an exemplary embodiment of the present disclosure, in response to the opening operation of the augmented reality application, the RGB camera is turned on to collect environmental information. The opening operation of the augmented reality application can generally be an operation of the user clicking the AR application icon, and can also be other operations on the mobile terminal that trigger the AR process, which is not limited by the present disclosure.
[0048] According to some embodiments of the present disclosure, the first frame image captured after the RGB camera is turned on can be used as the target image. In other words, in the subsequent processing process, only the first frame image is used for initialization, and the algorithm is simple and easy to implement.
[0049] According to some other embodiments of the present disclosure, a plurality of RGB images may be captured by an RGB camera, wherein the plurality of RGB images include an intermediate RGB image. Next, based on the remaining images of the plurality of RGB images except the intermediate RGB image, the intermediate RGB image may be denoised to generate a target image.
[0050] For example, after turning on the RGB camera, 10 consecutive frames of images can be obtained, and the 5th frame can be used as the intermediate RGB image. If there is noise in the intermediate RGB image, the remaining 9 frames can be used for denoising. For example, the noise can be replaced by taking the weighted average of the corresponding pixel values in the remaining 9 frames to obtain the target image.
[0051] It is easy to understand that other multi-frame denoising processes can be applied to the process of generating a target image in the present disclosure, and the present disclosure does not limit this.
[0052] S32. Determine a depth image corresponding to the target image using the depth information collected by the depth camera, and align the target image with the depth image.
[0053] The present invention adopts a depth camera to obtain depth information, which has high accuracy and real scale and will not affect the overall accuracy of the AR algorithm.
[0054] In an exemplary embodiment of the present disclosure, in response to an opening operation of an augmented reality application, while the RGB camera is turned on, the depth camera may also be turned on to collect depth information of the environment.
[0055] According to some embodiments of the present disclosure, the first frame image captured after the depth camera is turned on may be used as a depth image corresponding to the target image.
[0056] According to some other embodiments of the present disclosure, a depth camera may be used to collect multiple depth images, wherein the multiple depth images include an intermediate depth image corresponding to the intermediate RGB image. Next, based on the remaining images of the multiple depth images except the intermediate depth image, the intermediate depth image may be denoised to generate a depth image corresponding to the target image.
[0057] For example, when the acquisition frequencies of the RGB camera and the depth camera are close, after the depth camera is turned on, 10 consecutive frames of images can be obtained, and the 5th frame can be used as the intermediate depth image. If there is noise in the intermediate depth image, the remaining 9 frames can be used for denoising. For example, the noise can be replaced by taking the weighted average of the corresponding depth values in the remaining 9 frames to obtain a depth image corresponding to the target image.
[0058] It should be understood that when the acquisition frequencies of the RGB camera and the depth camera differ greatly, the depth image corresponding to the target image can be determined based on the timestamp.
[0059] After the target image and the depth image are determined, the target image and the depth image may be aligned.
[0060] Specifically, first, the rotation matrix and translation vector for converting between the RGB image captured by the RGB camera and the depth image captured by the depth camera can be determined. Next, those skilled in the art can understand that the rotation matrix and translation vector can be used to align the target image with the depth image.
[0061] It should be understood that the process of determining the rotation matrix and the translation vector may be a pre-configured process. The process of determining the rotation matrix and the translation vector is described below.
[0062] First, the RGB camera and the depth camera are calibrated in advance to determine the intrinsic parameters and extrinsic parameters of the RGB camera and the intrinsic parameters and extrinsic parameters of the depth camera respectively; next, the rotation matrix and the translation vector are calculated using the intrinsic parameters and extrinsic parameters of the RGB camera and the intrinsic parameters and extrinsic parameters of the depth camera.
[0063] Specifically, the intrinsic parameter K of the RGB camera rgb As shown in Formula 1:
[0064]
[0065] Among them, f x_rgb and f y_rgb Indicates the focal length of the camera, c x_rgb and c y_rgb Represents the position coordinates of the optical center of the camera, which can all be determined by calibration.
[0066] The camera calibration process can be completed offline or online. For example, a linear calibration method (e.g., Faugeras calibration method, etc.), a nonlinear optimization calibration method (e.g., Levenberg-Marquadt algorithm, etc.), a two-step calibration method (e.g., Tsai two-step method, Zhang Zhengyou calibration algorithm, etc.) or other methods can be used to calculate f x_rgb 、f y_rgb 、c x_rgb and c y_rgb , which is not particularly limited in this exemplary embodiment.
[0067] Taking Zhang Zhengyou's calibration algorithm as an example, an image with a checkerboard pattern can be placed in front of the camera as the camera calibration image. Since four quantities need to be calculated, when at least three images are taken at different angles and positions, the Zhang Zhengyou calibration algorithm can be used to linearly and uniquely solve f. x_rgb 、f y_rgb 、c x_rgb and c y_rgb .
[0068] That is to say, in an exemplary embodiment of the present disclosure, the at least three images mentioned above may be used as camera calibration images, and the camera calibration images may be processed using the Zhang Zhengyou calibration algorithm to automatically calculate the camera parameters.
[0069] In addition, the camera calibration image may also be other images except the image with the checkerboard drawn on it, which is not particularly limited in this exemplary embodiment.
[0070] For RGB cameras, there is formula 2:
[0071] Z rgb *p rgb =K rgb *P rgb (Formula 2)
[0072] Among them, P rgb =[X rgb Y rgb Z rgb1] is a homogeneous 3D point in the RGB camera coordinate system, and its pixel coordinate in the RGB image coordinate system can be expressed as p rgb =[uv 1]. In addition, the homogeneous coordinate P rgb Non-homogeneous coordinates can be used To express, see formula 3:
[0073]
[0074] Similarly, the depth camera can also obtain a similar mapping formula, see Formula 4:
[0075]
[0076] For the same chessboard grid, the RGB camera’s R rgb and T rgb , R of the depth camera ir and T ir After calibration, the rigid body transformation relationship can be obtained as shown in Formula 5:
[0077]
[0078] For non-homogeneous coordinates, RGB camera coordinate system 3D point and the 3D point in the depth camera coordinate system There is a relationship as shown in Formula 6:
[0079]
[0080] In this case, we can get Formula 7:
[0081]
[0082] Therefore, p rgb With p ir To simplify the representation, let T=K ir *T ir2rgb , then we get formula 8:
[0083] Z rgb *p rgb =R*Z ir *p ir +T (Formula 8)
[0084] In this case, R can be solved by solving the overdetermined equation ir2rgb and T ir2rgb , that is, the rotation matrix and translation vector mentioned above are obtained, and then the rotation matrix and translation vector can be used to align the target image with the depth image.
[0085] S34. Reposition the mobile terminal based on the target image and the depth image to determine the position and posture of the mobile terminal in the map coordinate system.
[0086] First, the target image and the depth image can be used to determine the position and posture of the target image relative to the mapping device. The mapping device described in the present disclosure is a device that pre-builds a map and establishes a map coordinate system. Next, the posture information of the mobile terminal can be obtained. For example, the posture information can be obtained based on the information collection results of the RGB camera and IMU (Inertial Measurement Unit). The collected RGB image can also be analyzed to obtain the posture information of the mobile terminal.
[0087] Subsequently, the relative position and posture of the mobile terminal and the mapping device can be determined by using the position and posture of the target image relative to the mapping device and the posture information of the mobile terminal.
[0088] When the relative position and posture of the mobile terminal and the mapping device are obtained, the position and posture of the mobile terminal in the map coordinate system can be determined.
[0089] Specifically, the posture determination process of the mobile terminal can be implemented in combination with the ICP (Iterative Closest Point) algorithm and / or the PnP (Perspective-n-Point) algorithm, and the present disclosure does not impose any restrictions on this.
[0090] S36. Extract feature points of the target image, use the depth image to determine the depth values corresponding to the feature points, and determine the three-dimensional information of the feature points in combination with the depth values corresponding to the feature points.
[0091] The feature extraction algorithms that can be used in the exemplary embodiments of the present disclosure may include but are not limited to FAST feature point detection algorithm, DOG feature point detection algorithm, Harris feature point detection algorithm, SIFT feature point detection algorithm, SURF feature point detection algorithm, etc. The corresponding feature descriptors may include but are not limited to BRIEF feature point descriptor, BRISK feature point descriptor, FREAK feature point descriptor, etc.
[0092] The extracted feature points may include corner points in the target image, or feature points reflecting texture features. The present disclosure does not limit the type and quantity of the extracted feature points.
[0093] When feature points of the target image are extracted, the depth image can be used to determine the depth values corresponding to the feature points, and the three-dimensional information of the feature points can be determined in combination with the depth values corresponding to the feature points.
[0094] As for determining the three-dimensional information of feature points, it can be achieved based on the pinhole imaging principle. Figure 4 Schematic diagram showing the pinhole imaging principle.
[0095] Specifically, the image coordinate point (u, v) can be converted to the world coordinate point (x w ,y w ,z w ).
[0096]
[0097] Among them, (u0,v0) is the coordinate point of the center of the image, z c Represents the z-axis value of the camera coordinates, Represents the focal length component of the focal length f on the x-axis of the camera coordinate system, represents the focal length component of the focal length f on the y-axis of the camera coordinate system, R and T represent the rotation matrix and translation matrix of the external parameter matrix respectively. Since the world coordinate system and the camera origin coincide at this time, there is no rotation and translation. In addition, the same object in the camera coordinate system and the world coordinate system has the same depth, that is, z c =z w In this case, the transformation formula can be obtained as formula 10:
[0098]
[0099] Therefore, when the depth value corresponding to the feature point is obtained, the three-dimensional information of the feature point can be determined according to this transformation relationship.
[0100] It should be noted that, in some embodiments, the three-dimensional information of the feature point may only include the depth information of the feature point obtained by transformation. In other embodiments, the three-dimensional information of the feature point may include not only the information representing the depth, but also the RGB two-dimensional information of the feature point. The present disclosure does not limit this.
[0101] S38. Perform augmented reality operations using the position and posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature points.
[0102] When the position and posture of the mobile terminal in the map coordinate system are determined by step S34 and the three-dimensional information of the feature points are determined by step S36, the initialization process is completed. Next, the mobile terminal can perform operations such as AR tracking and AR navigation. The present disclosure does not limit the subsequent AR application process.
[0103] It can be understood that based on the exemplary embodiments of the present disclosure, the position and posture of the mobile terminal can be associated with the map, and the information of the corresponding key frames in the map can be determined according to the three-dimensional information of the feature points to obtain the overall situation of the current position and posture of the mobile terminal relative to the map, thereby providing a basis for subsequent tracking and navigation operations.
[0104] To summarize, based on the augmented reality processing method of the exemplary embodiment of the present disclosure, on the one hand, the present disclosure scheme realizes the initialization process of augmented reality based on a target image and a corresponding depth image, which does not require the cooperation of the user to perform translation operations, is less time-consuming, and can quickly start AR navigation, tracking and other operations; on the other hand, the present disclosure scheme combines depth information to realize initialization without the need for user participation, thereby improving the algorithm accuracy and making application processes such as AR navigation and tracking more accurate.
[0105] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0106] Furthermore, this example implementation also provides an augmented reality processing device applied to a mobile terminal.
[0107] Figure 5 FIG. 1 schematically shows a block diagram of an augmented reality processing device applied to a mobile terminal according to an exemplary embodiment of the present disclosure. Figure 5 According to an exemplary embodiment of the present disclosure, an augmented reality processing device 5 applied to a mobile terminal may include an RGB image acquisition module 51, a depth image acquisition and alignment module 53, a posture determination module 55, a three-dimensional information determination module 57 and an operation execution module 59.
[0108] Specifically, the RGB image acquisition module 51 can be used to generate a target image using the environmental information collected by the RGB camera; the depth image acquisition and alignment module 53 can be used to use the depth information collected by the depth camera to determine the depth image corresponding to the target image, and align the target image with the depth image; the posture determination module 55 can be used to reposition based on the target image and the depth image, and determine the posture of the mobile terminal in the map coordinate system; the three-dimensional information determination module 57 can be used to extract the feature points of the target image, use the depth image to determine the depth value corresponding to the feature point, and combine the depth value corresponding to the feature point to determine the three-dimensional information of the feature point; the operation execution module 59 can be used to use the posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature point to perform augmented reality operations.
[0109] According to an exemplary embodiment of the present disclosure, the process of aligning the target image with the depth image by the depth image acquisition and alignment module 53 can be configured to perform: determining the rotation matrix and translation vector for converting between the RGB image captured by the RGB camera and the depth image captured by the depth camera; and aligning the target image with the depth image using the rotation matrix and translation vector.
[0110] According to an exemplary embodiment of the present disclosure, referring to Figure 6 Compared with the augmented reality processing device 5 , the augmented reality processing device 6 may further include a preconfiguration module 61 .
[0111] Specifically, the preconfiguration module 61 can be configured to perform: pre-calibrate the RGB camera and the depth camera to determine the intrinsic and extrinsic parameters of the RGB camera and the intrinsic and extrinsic parameters of the depth camera respectively; calculate the rotation matrix and the translation vector using the intrinsic and extrinsic parameters of the RGB camera and the intrinsic and extrinsic parameters of the depth camera.
[0112] According to an exemplary embodiment of the present disclosure, the posture determination module 55 can be configured to perform: using the target image and the depth image, determining the posture of the target image relative to the mapping device; wherein the mapping device is a device that pre-builds a map and establishes a map coordinate system; obtaining the posture information of the mobile terminal; using the posture of the target image relative to the mapping device and the posture information of the mobile terminal, determining the relative posture of the mobile terminal and the mapping device; and determining the posture of the mobile terminal in the map coordinate system based on the relative posture of the mobile terminal and the mapping device.
[0113] According to an exemplary embodiment of the present disclosure, referring to Figure 7 Compared with the augmented reality processing device 5 , the augmented reality processing device 7 may further include an initialization trigger module 71 .
[0114] Specifically, the initialization trigger module 71 may be configured to execute: in response to the opening operation of the augmented reality application, turning on the RGB camera and the depth camera at the same time.
[0115] According to an exemplary embodiment of the present disclosure, the RGB image acquisition module 51 can be configured to perform: using an RGB camera to collect multiple frames of RGB images, the multiple frames of RGB images include an intermediate RGB image; based on the remaining images of the multiple frames of RGB images except the intermediate RGB image, denoising the intermediate RGB image to generate a target image.
[0116] According to an exemplary embodiment of the present disclosure, the process of the depth image acquisition and alignment module 53 determining the depth image corresponding to the target image can be configured to perform: using a depth camera to collect multiple frames of depth images, the multiple frames of depth images include an intermediate depth image corresponding to the intermediate RGB image; based on the remaining images of the multiple frames of depth images except the intermediate depth image, denoising the intermediate depth image to generate a depth image corresponding to the target image.
[0117] Since the functional modules of the augmented reality processing device in the embodiment of the present disclosure are the same as those in the above-mentioned method embodiment, they will not be described in detail here.
[0118] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0119] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0120] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0121] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing what is disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be considered merely as exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.
[0122] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An augmented reality processing method, applied to a mobile terminal, It is characterized in that include: Using an RGB camera to collect multiple frames of RGB images, wherein the multiple frames of RGB images include an intermediate RGB image; Based on the remaining images of the multiple frames of RGB images except the intermediate RGB image, denoising the intermediate RGB image to generate a target image; Using a depth camera to collect multiple depth image frames, the multiple depth image frames include an intermediate depth image corresponding to the intermediate RGB image; Based on the remaining images of the multiple depth images except the intermediate depth image, denoising the intermediate depth image to generate a depth image corresponding to the target image; aligning the target image with the depth image; Using the target image and the depth image, determine the position and posture of the target image relative to a mapping device; wherein the mapping device is a device that pre-builds a map and establishes a map coordinate system; obtain the posture information of the mobile terminal; using the position and posture of the target image relative to the mapping device and the posture information of the mobile terminal, determine the relative position and posture of the mobile terminal and the mapping device; according to the relative position and posture of the mobile terminal and the mapping device, determine the position and posture of the mobile terminal in the map coordinate system; Extracting feature points of the target image, determining depth values corresponding to the feature points using the depth image, and determining three-dimensional information of the feature points in combination with the depth values corresponding to the feature points; Performing an augmented reality operation using the position and posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature points; Wherein, when the position and posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature points are determined, the initialization process of the augmented reality is completed.
2. The augmented reality processing method according to claim 1, It is characterized in that Aligning the target image with the depth image comprises: Determine a rotation matrix and a translation vector for converting between an RGB image captured by the RGB camera and a depth image captured by the depth camera; The target image is aligned with the depth image using the rotation matrix and the translation vector.
3. The augmented reality processing method according to claim 2, It is characterized in that The augmented reality processing method further includes: Pre-calibrate the RGB camera and the depth camera to determine the internal and external parameters of the RGB camera and the internal and external parameters of the depth camera respectively; The rotation matrix and the translation vector are calculated using the intrinsic parameters and extrinsic parameters of the RGB camera and the intrinsic parameters and extrinsic parameters of the depth camera.
4. The augmented reality processing method according to claim 1, It is characterized in that The augmented reality processing method further includes: In response to an opening operation of the augmented reality application, the RGB camera and the depth camera are turned on simultaneously.
5. An augmented reality processing device, applied to a mobile terminal, It is characterized in that include: An RGB image acquisition module is used to collect multiple frames of RGB images using an RGB camera, wherein the multiple frames of RGB images include an intermediate RGB image; Based on the remaining images of the multiple frames of RGB images except the intermediate RGB image, denoising the intermediate RGB image to generate a target image; A depth image acquisition and alignment module, used to collect multiple depth image frames using a depth camera, wherein the multiple depth image frames include an intermediate depth image corresponding to the intermediate RGB image; Based on the remaining images of the multiple depth images except the intermediate depth image, denoising the intermediate depth image to generate a depth image corresponding to the target image; aligning the target image with the depth image; A posture determination module is used to determine the posture of the target image relative to a mapping device using the target image and the depth image; wherein the mapping device is a device that pre-builds a map and establishes a map coordinate system; obtain the posture information of the mobile terminal; determine the relative posture of the mobile terminal and the mapping device using the posture of the target image relative to the mapping device and the posture information of the mobile terminal; determine the posture of the mobile terminal in the map coordinate system based on the relative posture of the mobile terminal and the mapping device; A three-dimensional information determination module, used to extract feature points of the target image, determine depth values corresponding to the feature points using the depth image, and determine the three-dimensional information of the feature points in combination with the depth values corresponding to the feature points; An operation execution module, used to perform an augmented reality operation using the position and posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature point; Wherein, when the position and posture of the mobile terminal in the map coordinate system and the three-dimensional information of the feature points are determined, the initialization process of the augmented reality is completed.
6. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the augmented reality processing method according to any one of claims 1 to 4 is implemented.
7. An electronic device, It is characterized in that include: processor; A memory for storing one or more programs, which, when executed by the processor, enables the processor to implement the augmented reality processing method as claimed in any one of claims 1 to 4.
