A method for AR glasses target enhancement combined with an external depth camera
By combining an external depth camera to obtain two-dimensional color images and depth images, and calculating the three-dimensional position and distance of the target, it solves the problem in the existing technology that virtual information and the real environment cannot be accurately registered in three-dimensional space, and improves the enhancement The virtual and real fusion effect of the real system.
Patent Information
- Application Number
- CN202410710556.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-03
AI Technical Summary
In existing augmented reality technology, virtual information and the real environment cannot be accurately registered in three-dimensional space, resulting in poor virtual and real fusion effects.
Combined with an external depth camera, by acquiring two-dimensional color images and depth images, the target detection algorithm is used to obtain the plane coordinates of the target, and the coordinate system is converted according to the field of view of the depth camera, the three-dimensional position and distance of the target are calculated, and virtual information is drawn. in AR glasses.
It improves the accuracy and effect of virtual and real fusion in augmented reality systems, and achieves precise integration of virtual information and the real world.
Smart Images

Figure CN118298342B
Abstract
Description
Technical Field
[0001] The present application relates to the field of augmented reality technology, and in particular to an AR glasses target enhancement method combined with an external depth camera. Background Art
[0002] In recent decades, augmented reality technology has been in a stage of rapid development. More and more fields have linked the virtual world and the real world by combining augmented reality, achieving a sensory experience beyond reality. In the field of target enhancement, virtual information and the real environment are required to be registered in three-dimensional space, and virtual objects need to be located in real space. Through machine vision methods, the target position in the two-dimensional image can be detected, but because the distance of the target cannot be accurately obtained, the virtual information and the real environment cannot be accurately registered in three-dimensional space.
[0003] However, how to effectively improve the effect of virtual-reality fusion in augmented reality systems has always been the focus of research for relevant researchers. Summary of the invention
[0004] Based on this, it is necessary to provide an AR glasses target enhancement method combined with an external depth camera that can improve the effect of virtual-real fusion in an augmented reality system in response to the above technical problems.
[0005] A method for augmenting an AR glasses target in combination with an external depth camera, the method comprising:
[0006] Acquire a two-dimensional color image and a depth image taken by a depth camera; perform target detection on the two-dimensional color image according to a target detection algorithm to obtain the upper left corner plane coordinates, the lower right corner plane coordinates and the center point coordinates of the target circumscribed rectangle;
[0007] According to the coordinates of the center point of the target's circumscribed rectangle, the actual distance between the target and the depth camera is obtained on the depth image with the same width and height as the two-dimensional color image;
[0008] According to the actual distance between the target and the depth camera, when the target does not exceed the effective measurement range of the depth camera, the center of the depth image is taken as the origin, and according to the horizontal and vertical field angles of the depth camera, the coordinate system conversion relationship is used to map the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle into two-dimensional angular coordinates on the spherical surface;
[0009] When the target is beyond the effective measurement range of the depth camera, the target distance is calculated based on the actual height of the target and the field of view of the depth camera;
[0010] The target frame coordinates in the AR glasses are calculated based on the target distance and the two-dimensional angle coordinates, and the virtual information is drawn using the target frame coordinates and uploaded to the AR glasses.
[0011] In one embodiment, target detection is performed on a two-dimensional color image according to a target detection algorithm to obtain the upper left corner plane coordinates, the lower right corner plane coordinates and the center point coordinates of the target circumscribed rectangle, including:
[0012] The two-dimensional color image is normalized and used as the input of the yolov5 detection algorithm to obtain the upper left corner plane coordinates, lower right corner plane coordinates and center point coordinates of the target circumscribed rectangle.
[0013] In one embodiment, obtaining the actual distance between the target and the depth camera on a depth image having the same width and height as the two-dimensional color image according to the coordinates of the center point of the target's circumscribed rectangle includes:
[0014] The coordinates of the center point of the target's circumscribed rectangle are used as the pixel coordinates of the depth image, and the value corresponding to the pixel coordinates is the actual distance between the target and the depth camera.
[0015] In one embodiment, taking the center of the depth image as the origin, according to the horizontal field of view angle and the vertical field of view angle of the depth camera, and using the coordinate system conversion relationship, the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle are mapped to two-dimensional angular coordinates on the spherical surface, including:
[0016] Map the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle to the center of the depth image as the origin and parallel to the bottom edge of the depth image. Axis, from left to right The positive direction of the axis is parallel to the left side of the depth image. Axis, from bottom to top In the two-dimensional plane coordinate system of the axis square;
[0017] Will Coordinates projected to On the axis, calculate the deflection angle of the target on the horizontal section of the depth camera's cone corresponding to the center line of the cone as the two-dimensional horizontal angle coordinate;
[0018] Will Coordinates projected to The deflection angle of the target on the vertical section of the depth camera's cone corresponding to the centerline of the cone is calculated as the two-dimensional vertical angle coordinate.
[0019] In one embodiment, Coordinates projected to Axis, calculate the deflection angle of the target on the horizontal section of the depth camera cone corresponding to the center line of the cone as a two-dimensional horizontal angle coordinate, including:
[0020] If the 69° horizontal field of view of the depth camera is used as the vertex angle, and the 1280-pixel width of the acquired depth image is used as the base to form an isosceles triangle, the target The line connecting the point whose coordinates fall on the base of the isosceles triangle and the vertex is , the vertex midline is ,but and The angle formed is the two-dimensional horizontal angle coordinate; the two-dimensional horizontal angle coordinate is:
[0021] ;
[0022] ;
[0023] in, is the desired two-dimensional horizontal angle coordinate.
[0024] In one embodiment, Coordinates projected to Axis, calculate the deflection angle of the target on the vertical section of the depth camera cone corresponding to the center line of the cone as a two-dimensional vertical angle coordinate, including:
[0025] If the 42° vertical field of view of the depth camera is used as the vertex angle and the 720-pixel height of the acquired depth image is used as the base, an isosceles triangle is formed. The line connecting the point whose coordinates fall on the base of the isosceles triangle and the vertex is , the vertex midline is ,but and The angle formed is the two-dimensional vertical angle coordinate; the two-dimensional vertical angle coordinate is:
[0026] ;
[0027] ;
[0028] in, is the desired two-dimensional vertical angle coordinate.
[0029] In one embodiment, the target distance is calculated according to the actual height of the target and the field of view of the depth camera, including:
[0030] The vertical midline of the target rectangular frame and the camera position are used as the vertical field angle section of the depth camera, and a similar triangle is constructed with the image height as the base. The pixel distance of the center point of the target rectangular frame relative to the depth camera is calculated; the hypotenuse length of the triangle formed by the camera, the center point of the target rectangular frame, and the midpoint of the upper side of the target rectangular frame is calculated based on the pixel distance, the target pixel height, and the actual height of the target, which is the target distance.
[0031] In one embodiment, a vertical field angle section of a depth camera is formed by taking a vertical midline of a target rectangular frame and a camera position, and a similar triangle is constructed by taking an image height as a base, and a pixel distance of a center point of the target rectangular frame relative to the depth camera is calculated, including:
[0032] Take the vertical midline of the target rectangle and the camera position as the vertical field of view of the depth camera, construct a similar triangle with the image height as the base, and calculate the pixel distance of the center point of the target rectangle relative to the depth camera:
[0033] ;
[0034] ;
[0035] in, is the height of the constructed similar triangle, is the pixel distance, Indicates the coordinates of the target center point.
[0036] In one embodiment, the length of the hypotenuse of a triangle formed by the camera, the center point of the target rectangular frame, and the midpoint of the upper side of the target rectangular frame is calculated according to the pixel distance, the target pixel height, and the target actual height, including:
[0037] According to the pixel distance, target pixel height and target actual height, the hypotenuse length of the triangle formed by the camera, the center point of the target rectangular frame and the midpoint of the upper side of the target rectangular frame is calculated as
[0038] ;
[0039] in, is the target distance, Indicates the target pixel height, Indicates the actual height of the target. is the pixel distance.
[0040] In one embodiment, the target frame coordinates in the AR glasses are calculated based on the target distance and the two-dimensional angle coordinates, including:
[0041] The target frame coordinates in the AR glasses are calculated based on the target distance and two-dimensional angle coordinates:
[0042] ;
[0043] ;
[0044] in, and Respectively represent the two-dimensional horizontal angle coordinate and the two-dimensional vertical angle coordinate, Indicates the target distance.
[0045] The above-mentioned method for target enhancement of AR glasses combined with an external depth camera first uses the two-dimensional color image and depth image taken by the depth camera, and recognizes the target of the two-dimensional color image according to the target detection algorithm, and according to the position of the target in the depth image, the upper left corner plane coordinates, the lower right corner plane coordinates and the center point coordinates of the target circumscribed rectangle; when the target does not exceed the effective measurement range of the depth camera, the center of the depth image is taken as the origin, and according to the horizontal field of view and vertical field of view of the depth camera, the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle are mapped to two-dimensional angular coordinates on the spherical surface by using the coordinate system conversion relationship; when the target exceeds the effective measurement range of the depth camera, the target distance is calculated according to the actual distance between the target and the depth camera and the field of view of the depth camera, and the target frame coordinates in the AR glasses are calculated according to the target distance and the two-dimensional angular coordinates, and the virtual information is integrated with the real world in the AR glasses to realize augmented reality. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 The figure is a flow chart of a method for target enhancement of AR glasses combined with an external depth camera in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] In one embodiment, Figure 1 As shown, a method for AR glasses target enhancement combined with an external depth camera is provided, comprising the following steps:
[0049] Step 102, obtaining a two-dimensional color image and a depth image taken by a depth camera; performing target detection on the two-dimensional color image according to a target detection algorithm to obtain the upper left corner plane coordinates and the lower right corner plane coordinates and the center point coordinates of the target circumscribed rectangle.
[0050] The depth camera is used to detect the depth of field of the shooting space. In this step, the RealSense D435 depth camera is used. The horizontal field of view of the camera is 42°, the vertical field of view is 69°, and the ideal ranging range is 0.3 meters to 3 meters. RGB color images and depth images can be obtained. The resolution of the obtained images is 1280*720. The RealSense depth camera driver is configured to obtain real-time two-dimensional color images and depth images for obtaining distances through pipeline communication. All pixel values of the two-dimensional color image are divided by 255 to obtain a normalized image matrix. In this step, the Yolov5 detection algorithm is used. The normalized two-dimensional color image is used as the input of Yolov5 to obtain a list of the upper left corner plane coordinates, lower right corner plane coordinates, center point coordinates, categories, and confidence of the detected target circumscribed rectangle. The detected target is used as the basic unit of target enhancement.
[0051] Step 104 , obtaining the actual distance between the target and the depth camera on a depth image having the same width and height as the two-dimensional color image according to the coordinates of the center point of the target circumscribed rectangle.
[0052] In this step, the center point of the rectangular box obtained by target detection is used as the point for obtaining the distance between the target and the camera. After calculating the center point of each target detected in the color image, the value corresponding to the same position in the depth map is the actual distance between the target and the camera obtained by RealSense D435.
[0053] Step 106, based on the actual distance between the target and the depth camera, when the target does not exceed the effective measurement range of the depth camera, the center of the depth image is taken as the origin, and according to the horizontal field of view and vertical field of view of the depth camera, the coordinate system conversion relationship is used to map the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle to two-dimensional angular coordinates on the sphere.
[0054] According to the actual distance between the target and the depth camera, when the target does not exceed the effective measurement range of the depth camera, taking RealSense D435 as an example, the camera's 69° horizontal field of view is used as the vertex angle, and the 1280-pixel width of the collected image is used as the base to form an isosceles triangle. Assuming that the target's The line connecting the point whose coordinates fall on the base of the isosceles triangle and the vertex is , the vertex midline is ,but and The angle formed is the two-dimensional horizontal angle coordinate; the two-dimensional horizontal angle coordinate is:
[0055] ;
[0056] ;
[0057] in, is the desired two-dimensional horizontal angle coordinate.
[0058] Similarly, the RealSense D435 camera uses a 42° vertical field of view as the vertex angle and a 720-pixel height of the acquired image as the base to form an isosceles triangle. The line connecting the point whose coordinates fall on the base of the isosceles triangle and the vertex is , the vertex midline is ,but and The angle formed is the two-dimensional vertical angle coordinate; the two-dimensional vertical angle coordinate is:
[0059] ;
[0060] ;
[0061] in, is the desired two-dimensional vertical angle coordinate.
[0062] Step 108: When the target is beyond the effective measurement range of the depth camera, the target distance is calculated according to the actual height of the target and the field of view of the depth camera.
[0063] When the target is beyond the effective measurement range of the depth camera, if the actual height of the target is not known, it is also necessary to use the center of the depth image as the origin, and according to the horizontal and vertical field of view angles of the depth camera, use the coordinate system conversion relationship to map the upper left corner plane coordinates and lower right corner plane coordinates of the target circumscribed rectangle to two-dimensional angular coordinates on the sphere. If the actual height of the target is known, the target distance is calculated based on the actual height of the target and the field of view angle of the depth camera.
[0064] Step 110, the target frame coordinates in the AR glasses are calculated according to the target distance and the two-dimensional angle coordinates, and the virtual information is drawn using the target frame coordinates and uploaded to the AR glasses.
[0065] The target frame coordinates in the AR glasses are calculated based on the target distance and the two-dimensional angle coordinates. The virtual information is drawn using the target frame coordinates and uploaded to the AR glasses. In the AR glasses, the virtual information is integrated with the real world to achieve augmented reality.
[0066] In the above-mentioned target enhancement method for AR glasses combined with an external depth camera, the two-dimensional color image and the depth image taken by the depth camera are first used to identify the target in the two-dimensional color image according to the target detection algorithm, and the upper left corner plane coordinates, the lower right corner plane coordinates and the center point coordinates of the target circumscribed rectangle are obtained according to the position of the target in the depth image; when the target does not exceed the effective measurement range of the depth camera, the center of the depth image is taken as the origin, and according to the horizontal field of view and the vertical field of view of the depth camera, the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle are mapped to two-dimensional angular coordinates on the spherical surface by using the coordinate system conversion relationship; when the target exceeds the effective measurement range of the depth camera, the target distance is calculated according to the actual distance between the target and the depth camera and the field of view of the depth camera, and the target frame coordinates in the AR glasses are calculated according to the target distance and the two-dimensional angular coordinates, and the virtual information is integrated with the real world in the AR glasses to realize augmented reality.
[0067] In one embodiment, target detection is performed on a two-dimensional color image according to a target detection algorithm to obtain the upper left corner plane coordinates, the lower right corner plane coordinates and the center point coordinates of the target circumscribed rectangle, including:
[0068] The two-dimensional color image is normalized and used as the input of the yolov5 detection algorithm to obtain the upper left corner plane coordinates, lower right corner plane coordinates and center point coordinates of the target circumscribed rectangle.
[0069] In one embodiment, obtaining the actual distance between the target and the depth camera on a depth image having the same width and height as the two-dimensional color image according to the coordinates of the center point of the target's circumscribed rectangle includes:
[0070] The coordinates of the center point of the target's circumscribed rectangle are used as the pixel coordinates of the depth image, and the value corresponding to the pixel coordinates is the actual distance between the target and the depth camera.
[0071] In one embodiment, taking the center of the depth image as the origin, according to the horizontal field of view angle and the vertical field of view angle of the depth camera, and using the coordinate system conversion relationship, the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle are mapped to two-dimensional angular coordinates on the spherical surface, including:
[0072] Map the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle to the center of the depth image as the origin and parallel to the bottom edge of the depth image. Axis, from left to right The positive direction of the axis is parallel to the left side of the depth image. Axis, from bottom to top In the two-dimensional plane coordinate system of the axis square;
[0073] Will Coordinates projected to On the axis, calculate the deflection angle of the target on the horizontal section of the depth camera's cone corresponding to the center line of the cone as the two-dimensional horizontal angle coordinate;
[0074] Will Coordinates projected to The deflection angle of the target on the vertical section of the depth camera's cone corresponding to the centerline of the cone is calculated as the two-dimensional vertical angle coordinate.
[0075] In one embodiment, Coordinates projected to Axis, calculate the deflection angle of the target on the horizontal section of the depth camera cone corresponding to the center line of the cone as a two-dimensional horizontal angle coordinate, including:
[0076] If the 69° horizontal field of view of the depth camera is used as the vertex angle, and the 1280-pixel width of the acquired depth image is used as the base to form an isosceles triangle, the target The line connecting the point whose coordinates fall on the base of the isosceles triangle and the vertex is , the vertex midline is ,but and The angle formed is the two-dimensional horizontal angle coordinate; the two-dimensional horizontal angle coordinate is:
[0077] ;
[0078] ;
[0079] in, is the desired two-dimensional horizontal angle coordinate.
[0080] In one embodiment, Coordinates projected to Axis, calculate the deflection angle of the target on the vertical section of the depth camera cone corresponding to the center line of the cone as a two-dimensional vertical angle coordinate, including:
[0081] If the 42° vertical field of view of the depth camera is used as the vertex angle and the 720-pixel height of the acquired depth image is used as the base, an isosceles triangle is formed. The line connecting the point whose coordinates fall on the base of the isosceles triangle and the vertex is , the vertex midline is ,but and The angle formed is the two-dimensional vertical angle coordinate; the two-dimensional vertical angle coordinate is:
[0082] ;
[0083] ;
[0084] in, is the desired two-dimensional vertical angle coordinate.
[0085] In one embodiment, the target distance is calculated according to the actual height of the target and the field of view of the depth camera, including:
[0086] The vertical midline of the target rectangular frame and the camera position are used as the vertical field angle section of the depth camera, and a similar triangle is constructed with the image height as the base. The pixel distance of the center point of the target rectangular frame relative to the depth camera is calculated; the hypotenuse length of the triangle formed by the camera, the center point of the target rectangular frame, and the midpoint of the upper side of the target rectangular frame is calculated based on the pixel distance, the target pixel height, and the actual height of the target, which is the target distance.
[0087] In one embodiment, a vertical field angle section of a depth camera is formed by taking a vertical midline of a target rectangular frame and a camera position, and a similar triangle is constructed by taking an image height as a base, and a pixel distance of a center point of the target rectangular frame relative to the depth camera is calculated, including:
[0088] Take the vertical midline of the target rectangle and the camera position as the vertical field of view of the depth camera, construct a similar triangle with the image height as the base, and calculate the pixel distance of the center point of the target rectangle relative to the depth camera:
[0089] ;
[0090] ;
[0091] in, is the height of the constructed similar triangle, is the pixel distance, Indicates the coordinates of the target center point.
[0092] In one embodiment, the length of the hypotenuse of a triangle formed by the camera, the center point of the target rectangular frame, and the midpoint of the upper side of the target rectangular frame is calculated according to the pixel distance, the target pixel height, and the target actual height, including:
[0093] According to the pixel distance, target pixel height and target actual height, the hypotenuse length of the triangle formed by the camera, the center point of the target rectangular frame and the midpoint of the upper side of the target rectangular frame is calculated as
[0094] ;
[0095] in, is the target distance, Indicates the target pixel height, Indicates the actual height of the target. is the pixel distance.
[0096] In a specific embodiment, taking RealSense D435 as an example, the camera's 42° vertical field of view is used as the vertex angle, and the target pixel height is set to , the actual target height is , the target center point The coordinates are , the actual distance of the target relative to the camera is calculated as follows:
[0097] ;
[0098] ;
[0099] ;
[0100] in, is the target distance.
[0101] In one embodiment, the target frame coordinates in the AR glasses are calculated based on the target distance and the two-dimensional angle coordinates, including:
[0102] The target frame coordinates in the AR glasses are calculated based on the target distance and two-dimensional angle coordinates:
[0103] ;
[0104] ;
[0105] in, and Respectively represent the two-dimensional horizontal angle coordinate and the two-dimensional vertical angle coordinate, Indicates the target distance.
[0106] In a specific embodiment, taking the Hololens 2 mixed reality head display as an example, the formula for calculating the coordinates of the target frame displayed in the AR glasses according to the two-dimensional angle coordinates and distance information is as follows:
[0107] ;
[0108] .
[0109] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0110] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0111] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for AR glasses target enhancement combined with an external depth camera, characterized in that: The method comprises: Acquire a two-dimensional color image and a depth image taken by a depth camera; perform target detection on the two-dimensional color image according to a target detection algorithm to obtain the upper left corner plane coordinates, the lower right corner plane coordinates and the center point coordinates of the target circumscribed rectangle; According to the coordinates of the center point of the target's circumscribed rectangle, the actual distance between the target and the depth camera is obtained on the depth image with the same width and height as the two-dimensional color image; According to the actual distance between the target and the depth camera, when the target does not exceed the effective measurement range of the depth camera, the center of the depth image is taken as the origin, and according to the horizontal field of view and vertical field of view of the depth camera, the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle are mapped to two-dimensional angular coordinates on the spherical surface by using the coordinate system conversion relationship; When the target is beyond the effective measurement range of the depth camera, the target distance is calculated based on the actual height of the target and the field of view of the depth camera; Calculate the target frame coordinates in the AR glasses according to the target distance and the two-dimensional angle coordinates, and use the target frame coordinates to draw virtual information and upload it to the AR glasses; The target distance is calculated based on the actual height of the target and the field of view of the depth camera, including: The vertical midline of the target rectangular frame and the camera position are used as the vertical field angle section of the depth camera, and a similar triangle is constructed with the image height as the base. The pixel distance of the center point of the target rectangular frame relative to the depth camera is calculated; the hypotenuse length of the triangle formed by the camera, the center point of the target rectangular frame, and the midpoint of the upper side of the target rectangular frame is calculated according to the pixel distance, the target pixel height, and the actual height of the target, which is the target distance.
2. The method according to claim 1, characterized in that Performing target detection on the two-dimensional color image according to the target detection algorithm, obtaining the upper left corner plane coordinates, the lower right corner plane coordinates and the center point coordinates of the target circumscribed rectangle, including: The two-dimensional color image is normalized, and the normalized image is used as the input of the yolov5 detection algorithm to obtain the upper left corner plane coordinates, the lower right corner plane coordinates and the center point coordinates of the target circumscribed rectangle.
3. The method according to claim 1, characterized in that According to the coordinates of the center point of the target's circumscribed rectangle, the actual distance between the target and the depth camera is obtained on the depth image with the same width and height as the two-dimensional color image, including: The coordinates of the center point of the target's circumscribed rectangle are used as the pixel coordinates of the depth image, and the value corresponding to the pixel coordinates is the actual distance between the target and the depth camera.
4. The method according to any one of claims 1 to 3, characterized in that: Taking the center of the depth image as the origin, according to the horizontal field of view angle and the vertical field of view angle of the depth camera, using the coordinate system conversion relationship, the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle are mapped to two-dimensional angular coordinates on the spherical surface, including: Map the upper left corner plane coordinates and the lower right corner plane coordinates of the target circumscribed rectangle to a two-dimensional plane coordinate system with the center of the depth image as the origin, the x-axis parallel to the bottom edge of the depth image, the positive direction of the x-axis from left to right, the y-axis parallel to the left side of the depth image, and the y-axis from bottom to top; Project the x coordinate onto the x-axis, and calculate the deflection angle of the target on the horizontal section of the depth camera's cone corresponding to the center line of the cone as a two-dimensional horizontal angle coordinate; Project the y coordinate onto the y axis, and calculate the deflection angle of the target on the vertical section of the depth camera's cone corresponding to the center line of the cone as the two-dimensional vertical angle coordinate.
5. The method according to claim 4, characterized in that Project the x coordinate onto the x-axis and calculate the deflection angle of the target on the horizontal section of the depth camera's cone corresponding to the center line of the cone as a two-dimensional horizontal angle coordinate, including: If the 69° horizontal field of view of the depth camera is used as the vertex angle, the 1280-pixel width of the acquired depth image is used as the base to form an isosceles triangle. The line connecting the point where the x-coordinate of the target falls on the base of the isosceles triangle and the vertex is , the length of the midline is ,but and The formed angle is the two-dimensional horizontal angle coordinate; the two-dimensional horizontal angle coordinate is: in, is the desired two-dimensional horizontal angle coordinate.
6. The method according to claim 4, characterized in that Project the y coordinate onto the y axis and calculate the deflection angle of the target on the vertical section of the depth camera's cone corresponding to the center line of the cone as a two-dimensional vertical angle coordinate, including: If the 42° vertical field of view of the depth camera is used as the vertex angle and the 720-pixel height of the acquired depth image is used as the base, an isosceles triangle is formed. The line connecting the point where the y coordinate of the target falls on the base of the isosceles triangle and the vertex is , the length of the midline is ,but and The formed angle is the two-dimensional vertical angle coordinate; the two-dimensional vertical angle coordinate is: in, is the desired two-dimensional vertical angle coordinate.
7. The method according to claim 1, characterized in that Use the vertical midline of the target rectangle and the camera position as the vertical field of view angle section of the depth camera, use the image height as the base to construct a similar triangle, and calculate the pixel distance of the center point of the target rectangle relative to the depth camera, including: Take the vertical midline of the target rectangle and the camera position as the vertical field of view of the depth camera, construct a similar triangle with the image height as the base, and calculate the pixel distance of the center point of the target rectangle relative to the depth camera: in, is the height of the constructed similar triangle, c is the pixel distance, and y represents the coordinates of the target center point.
8. The method according to claim 1, characterized in that The length of the hypotenuse of a triangle formed by the camera, the center point of the target rectangular frame, and the midpoint of the upper side of the target rectangular frame is calculated according to the pixel distance, the target pixel height, and the target actual height, including: The length of the hypotenuse of the triangle formed by the camera, the center point of the target rectangular frame, and the midpoint of the upper side of the target rectangular frame is calculated according to the pixel distance, the target pixel height, and the target actual height. in, is the target distance, Indicates the target pixel height, Indicates the actual height of the target. is the pixel distance.
9. The method according to claim 1, characterized in that Calculating the target frame coordinates in the AR glasses according to the target distance and the two-dimensional angle coordinates includes: The target frame coordinates in the AR glasses are calculated based on the target distance and the two-dimensional angle coordinates: in, and Respectively represent the two-dimensional horizontal angle coordinate and the two-dimensional vertical angle coordinate, Indicates the target distance.
Citation Information
Patent Citations
Gesture recognition method for reality-augmented eyeglasses and reality-augmented eyeglasses system
CN104808795A
Low-voltage equipment operation and maintenance method based on AR technology
CN110728670A
Augmented reality system virtual-real fusion calibration method and device
CN113793389A
Image display device, program, and method that displays object on binocular spectacle display of optical see-through type
JP2017107359A
Augmented reality-based remote guidance method and apparatus, terminal, and storage medium
US20210120221A1
