Spatial position detection method and system, electronic equipment and readable storage medium
By obtaining reference device images from different viewing angles and pseudo-random lattice sequence feature point matching, combined with the spherical reference device, the problem of insufficient positioning accuracy of extended reality equipment is solved, and accurate positioning in multi-viewing and dynamic environments is achieved, which is suitable for VR, AR and other application scenarios.
Patent Information
- Application Number
- CN202410683628.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-06
AI Technical Summary
Existing technology is difficult to achieve accurate positioning of extended reality devices, especially in multi-viewing and dynamic environments, resulting in insufficient positioning accuracy.
By obtaining images of the reference device from different viewing angles, the target orientation and distance of the head-up display device relative to the reference device are determined, and combined with the reference position, the real-time position of the head-up display device is calculated. This method uses a pseudo-random lattice sequence and a spherical reference device to accurately position the device through feature point matching and angle calculation.
It achieves accurate positioning in different viewing angles and dynamic environments, improves the positioning accuracy and reliability of extended reality devices, and is suitable for VR, AR and other application scenarios.
Smart Images

Figure CN118608601A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of spatial positioning, and in particular to a spatial position detection method, system, electronic equipment and readable storage medium. Background Art
[0002] With the development of extended reality technologies such as AR and VR, the application scenarios of extended reality devices are increasing. In some application scenarios, it is necessary to locate the position of extended reality devices in space. Therefore, how to achieve accurate positioning of extended reality devices is an urgent problem that needs to be solved. Summary of the invention
[0003] The main purpose of the present invention is to propose a spatial position detection method, system, electronic device and readable storage medium, aiming to solve the problem of how to achieve accurate positioning of extended reality devices in the prior art.
[0004] To achieve the above object, the present invention provides a spatial position detection method, the method comprising the steps of:
[0005] Acquire a device image corresponding to a reference device in the captured image, wherein the device image corresponding to the reference device is different in different viewing angles;
[0006] determining a target position of a head-up display device relative to the reference device based on the device image;
[0007] Acquiring a target distance between the head-up display device and the reference device;
[0008] A reference position of the reference device is acquired, and a real-time position of the head-up display device is determined according to the reference position, the target orientation and the target distance.
[0009] Optionally, determining a target position of a head-up display device relative to the reference device according to the device image comprises:
[0010] Acquire reference data corresponding to the reference device, wherein the reference data includes a corresponding reference image and a reference orientation;
[0011] Determining an orientation change value of the device image relative to the reference image;
[0012] The target orientation is determined according to the reference orientation and the orientation change value.
[0013] Optionally, the acquiring reference data corresponding to the reference device includes:
[0014] Obtain historical device images collected in the previous detection cycle and the determined historical target positions;
[0015] Using the historical device image as the reference image and the historical target orientation as the reference orientation;
[0016] The reference data is obtained according to the reference image and the reference orientation.
[0017] Optionally, the reference device is a spherical device with a pseudo-random dot matrix sequence arranged on the surface; and determining the orientation change value of the device image relative to the reference image comprises:
[0018] Determining a first feature point in a pseudo-random dot matrix sequence of the device image, wherein the first feature point is located at a center of the device image;
[0019] Determining a second feature point in the pseudo-random dot matrix sequence of the reference image, wherein the second feature point is located at the center of the reference image;
[0020] The orientation change value is determined according to the first feature point and the second feature point.
[0021] Optionally, determining the orientation change value according to the first feature point and the second feature point includes:
[0022] Determine a horizontal distance in a horizontal direction and a vertical distance in a vertical direction between the first feature point and the second feature point;
[0023] Determine the azimuth difference between the first feature point and the second feature point according to the horizontal distance;
[0024] Determine a difference in pitch angle between the first feature point and the second feature point according to the vertical distance;
[0025] The azimuth change value is obtained according to the azimuth angle difference and the elevation angle difference.
[0026] Optionally, determining the target orientation according to the reference orientation and the orientation change value includes:
[0027] Acquire a reference azimuth angle and a reference elevation angle in the reference azimuth, and an azimuth angle difference and an elevation angle difference in the azimuth change value;
[0028] Calculating the sum of the difference between the reference azimuth and the azimuth to obtain the target azimuth;
[0029] Calculating the sum of the reference pitch angle and the pitch angle difference to obtain a target pitch angle;
[0030] The target azimuth is obtained according to the target azimuth and the target elevation angle.
[0031] Optionally, the reference device is spherical; acquiring a reference position of the reference device, and determining a real-time position of the head-up display device according to the reference position, the target orientation and the target distance comprises:
[0032] obtaining a radius of the reference device;
[0033] Calculating the sum of the target distance and the radius of the reference device to obtain the origin distance;
[0034] Determine a spherical center coordinate system based on the reference position, wherein the spherical center coordinate system is a coordinate system with the spherical center of the reference device as the coordinate origin;
[0035] The real-time position of the head-up display device is determined in the spherical center coordinate system according to the origin distance and the target orientation.
[0036] To achieve the above object, the present invention further provides a spatial position detection system, the spatial position detection system comprising a reference device and a spatial position detection device, the spatial position detection device comprising:
[0037] A first acquisition module is used to acquire a device image corresponding to a reference device in a captured image, wherein the device image corresponding to the reference device is different in different viewing angles;
[0038] A first determination module, configured to determine a target position of a head-up display device relative to the reference device according to the device image;
[0039] A second acquisition module, used to acquire a target distance between the head-up display device and the reference device;
[0040] The second determination module obtains a reference position of the reference device, and determines a real-time position of the head-up display device according to the reference position, the target orientation and the target distance.
[0041] To achieve the above objectives, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the spatial position detection method as described above when executed by the processor.
[0042] To achieve the above-mentioned purpose, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the spatial position detection method as described above are implemented.
[0043] The present invention proposes a spatial position detection method, system, electronic device and readable storage medium, which obtains a device image corresponding to a reference device in a captured image, wherein the device image corresponding to the reference device is different in different viewing angles; determines the target orientation of a head-up display device relative to the reference device according to the device image; obtains the target distance between the head-up display device and the reference device; obtains the reference position of the reference device, and determines the real-time position of the head-up display device according to the reference position, the target orientation and the target distance. By setting a reference device with different device images captured at different viewing angles, the target orientation of the head-up display device and the reference device can be determined based on the captured device image when the reference position of the reference device is known, and the real-time position of the head-up display device can be accurately determined based on the target orientation and the distance between the two. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 It is a schematic diagram of the flow chart of the first embodiment of the spatial position detection method of the present invention;
[0047] Figure 2 Schematic diagram of a pseudo-random dot matrix sequence in the spatial position detection method of the present invention;
[0048] Figure 3 A schematic diagram of an application scenario of the spatial position detection method of the present invention;
[0049] Figure 4 A schematic diagram of the orientation change value in the spatial position detection method of the present invention;
[0050] Figure 5 It is a schematic diagram of the module structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present application.
[0052] The present invention provides a spatial position detection method, referring to Figure 1 , Figure 1 This is a flow chart of a first embodiment of a spatial position detection method of the present invention, wherein the method comprises the following steps:
[0053] Step S10, acquiring a device image corresponding to a reference device in the captured image, wherein the device image corresponding to the reference device is different in different viewing angles;
[0054] The spatial position detection method of the present invention is applied to extended reality devices such as VR, AR, and MR, such as VR / AR / MR head-mounted display devices; this embodiment and subsequent embodiments are described using VR devices as an example.
[0055] The captured image is image data acquired by the VR device through an image capture device; the image capture device may be a camera.
[0056] The reference device is a reference object set outside the VR device; a pattern is set on the reference device, and the device images obtained by capturing images of the reference device at different viewing angles are different; the device image is the part of the captured image corresponding to the reference device; specifically, the reference device can be set to a spherical shape, and a pseudo-random dot matrix sequence is set on the reference device, and the setting method is such as spraying or printing; see Figure 2 , Figure 2 Schematic diagram of a pseudo-random dot sequence; the pseudo-random dot sequence is composed of dots of different colors, and for any dot, the arrangement of the dots around it is unique.
[0057] The number of reference devices may be one or more. For example, by setting multiple reference devices, the VR device can capture the device image of at least one reference device at any viewing angle.
[0058] Step S20, determining a target position of the head-up display device relative to the reference device according to the device image;
[0059] It can be understood that since the device images of the reference device captured at different perspectives are different, in other words, the perspective and the captured device image correspond, and when the position of the reference device is fixed, the perspective depends on the position of the VR device relative to the reference device. Therefore, the position of the VR device relative to the reference device corresponds to the captured device image.
[0060] HMD (Helmet Mounted Display) is the display device currently in use. The head-up display device can be a VR device, an AR device, an XR device, an MR device, etc. The target position is the position of the VR device relative to the reference device. Therefore, the target position of the head-up display device relative to the reference device can be accurately determined through the device image.
[0061] When the reference device is a sphere with a pseudo-random dot sequence, if a partial area image of the pseudo-random dot sequence is obtained, it is possible to determine the position of the area image in the pseudo-random dot sequence based on the arrangement of points in the area image. The reference device is spherical, so when images of the reference device are captured from different perspectives, a device image containing a partial pseudo-random dot sequence can be obtained. When the reference device is fixed, the position of the VR device relative to the reference device can be determined by determining the position of the device image in the pseudo-random dot sequence.
[0062] Step S30, obtaining a target distance between the head-up display device and the reference device;
[0063] The target distance is the straight-line distance between the head-up display device and the reference device; the method for obtaining the target distance can be set based on actual needs, and can be but not limited to a distance sensor, a TOF camera, or a binocular camera.
[0064] Step S40, obtaining a reference position of the reference device, and determining a real-time position of the head-up display device according to the reference position, the target orientation and the target distance.
[0065] Reference position is used to indicate the determined position of a reference device; see Figure 3 When in use, the reference position needs to be fixed, that is, the reference position is used as a fixed position reference in space. As the VR device moves, the relative position relationship between the VR device and the reference device changes, causing changes in the target orientation and target distance. When the reference position is fixed, the real-time position of the VR device can be determined based on the target orientation and target distance relative to the reference device.
[0066] This embodiment sets a reference device with different device images captured at different viewing angles, so that when the reference position of the reference device is known, the target orientation of the head-up display device and the reference device can be determined based on the captured device image, and the real-time position of the head-up display device can be accurately determined based on the target orientation and the distance between the two.
[0067] Further, in the second embodiment of the spatial position detection method of the present invention proposed based on the first embodiment of the present invention, the step S20 includes the steps of:
[0068] Step S21, obtaining reference data corresponding to the reference device, wherein the reference data includes a corresponding reference image and a reference orientation;
[0069] Step S22, determining an orientation change value of the device image relative to the reference image;
[0070] Step S23, determining the target orientation according to the reference orientation and the orientation change value.
[0071] The reference data is relevant data of a known reference device; specifically, the reference data includes a corresponding reference image and a reference orientation; the reference image is an image of the device captured at a certain viewing angle; the reference orientation is the target orientation corresponding to the VR device when the reference image is captured.
[0072] It can be understood that the appearance of the reference device is determined and the reference device is fixed; therefore, the position of the device image under different viewing angles in the reference device can also be determined; and when two device images are known, the positional relationship between the two device images in the reference device can be determined, and the position in the device image corresponds to the viewing angle, that is, the orientation of the VR device relative to the reference device, and thus the difference between the corresponding target orientations of the two device images, that is, the orientation change value, can be determined.
[0073] The orientation change value indicates the difference in target orientation between the two device images. When the target orientation corresponding to the reference image, ie, the reference orientation, is known, the target orientation of the device image can be determined based on the reference orientation and the orientation change value.
[0074] Furthermore, the step S21 comprises the steps of:
[0075] Step S211, obtaining the historical device images collected in the previous detection cycle and the determined historical target orientation;
[0076] Step S212, using the historical device image as the reference image, and using the historical target orientation as the reference orientation;
[0077] Step S213: obtaining the reference data according to the reference image and the reference orientation.
[0078] The historical device image is the device image collected in the previous detection cycle, and the historical target position is the target position determined in the previous detection cycle; it can be understood that the device image is collected once and the target position is determined once in one detection cycle; the interval between two consecutive detection cycles can be set based on actual needs. The shorter the interval, the more sensitive it is to changes in real-time position, but the higher the requirements for data processing capabilities.
[0079] After the last detection cycle ends, the historical device image, historical target orientation, and real-time position of the VR device are all determined accordingly. Therefore, using the historical device image as a reference image and the historical target orientation as a reference orientation enables known and accurate reference data to be obtained, and the accurate orientation change value can be determined through the reference data obtained.
[0080] Further, the reference device is a spherical device with a pseudo-random dot array sequence arranged on the surface; the step S22 comprises the steps of:
[0081] Step S221, determining a first feature point in a pseudo-random dot matrix sequence of the device image, wherein the first feature point is located at the center of the device image;
[0082] Step S222, determining a second feature point in the pseudo-random dot matrix sequence of the reference image, wherein the second feature point is located at the center of the reference image;
[0083] Step S223: determining the orientation change value according to the first feature point and the second feature point.
[0084] In this embodiment, a pseudo-random dot matrix sequence is taken as an example to illustrate the determination of the orientation change value.
[0085] The feature point is the midpoint of the pseudo-random dot matrix sequence contained in the device image; it is understandable that when capturing an image of a spherical reference device, the captured device image is circular, and therefore, in order to facilitate identification, the point where the center of the device image in the pseudo-random dot matrix sequence is located is used as the feature point; in other embodiments, points at other positions can also be selected as feature points, but the selection rules for all feature points need to remain consistent, such as selecting the topmost point in the device image as the feature point, or selecting the bottommost point in the device image as the feature point.
[0086] It is understandable that the number of points in the pseudo-random dot matrix sequence can be set based on actual needs. The more points there are, the higher the real-time position detection accuracy is. At the same time, the requirements for image acquisition capabilities and data processing are also higher.
[0087] The first feature point is a feature point determined based on the device image, and the second feature point is a feature point determined based on the reference image; see Figure 4 , Figure 4 Where B is the first feature point, A is the second feature point, and O is the origin of the spatial rectangular coordinate system XYZ. For the sake of convenience, Figure 4 A is set in the XOY plane of the spatial rectangular coordinate system, and C is the projection of B on the XOY plane.
[0088] Furthermore, the step S223 includes the steps of:
[0089] Step S2231, determining a horizontal distance in a horizontal direction and a vertical distance in a vertical direction between the first feature point and the second feature point;
[0090] Step S2232, determining the azimuth difference between the first feature point and the second feature point according to the horizontal distance;
[0091] Step S2233, determining a pitch angle difference between the first feature point and the second feature point according to the vertical distance;
[0092] Step S2234, obtaining the azimuth change value according to the azimuth angle difference and the elevation angle difference.
[0093] It can be understood that the position of the points in the pseudo-random dot lattice sequence is determined, and at the same time, the relevant information of the pseudo-random dot lattice sequence will also be stored in the VR device; since the position of each point is determined, the relative position relationship between the points is also determined; that is, after the first feature point and the second feature point are determined, the relative position relationship between the first feature point and the second feature point can be determined based on the pseudo-random dot lattice sequence; the relative position relationship includes horizontal distance and vertical distance.
[0094] Since C is the projection of B on the XOY plane, the distance between C and A on the spherical surface is represented as the horizontal distance, and the distance between C and B on the spherical surface is represented as the vertical distance; and the azimuth angle is the angle based on the horizontal plane, which is reflected in the spatial rectangular coordinate system as the angle between the line connecting the projection on the XOY plane and the origin and the X-axis. Therefore, the angle θ, that is, ∠AOC, can represent the difference between the azimuth angles of B and A. Similarly, the pitch angle is the angle between the line connecting the point and the origin and the XOY plane, and in this embodiment, point A is located in the XOY plane, so the angle That is, ∠BOC can represent the difference in pitch angles between B and A. Specifically, let the horizontal distance be D1 and the vertical distance be D2, then:
[0095]
[0096] Where R is the radius of the reference device.
[0097] The azimuth angle difference and the elevation angle difference fully reflect the change between the first feature point and the second feature point. Therefore, the azimuth angle difference and the elevation angle difference are used as azimuth change values.
[0098] It should be noted that, in this embodiment, a specific method for determining the orientation change value is described. Since the pseudo-random dot matrix sequence is determined, the orientation change values between each point are also determined. In practical applications, in order to determine the real-time position more quickly, the orientation change values between each point can be determined and stored in advance. When it is necessary to calculate the orientation change value between two points, it can be obtained by directly matching it in the stored orientation change values, which saves the calculation process and can improve the detection efficiency.
[0099] Furthermore, the step S23 comprises the steps of:
[0100] Step S231, obtaining a reference azimuth angle and a reference elevation angle in the reference azimuth, and an azimuth angle difference and an elevation angle difference in the azimuth change value;
[0101] Step S232, calculating the sum of the difference between the reference azimuth and the azimuth to obtain the target azimuth;
[0102] Step S233, calculating the sum of the reference pitch angle and the pitch angle difference to obtain a target pitch angle;
[0103] Step S234, obtaining the target azimuth according to the target azimuth and the target elevation angle.
[0104] The target position is also determined in the form of azimuth and elevation.
[0105] After the azimuth change value is determined, since the reference azimuth is known, the target azimuth can be obtained by superimposing the azimuth change value on the reference azimuth.
[0106] Likewise Figure 4 For example, the azimuth of A, that is, the reference azimuth is θ a , the pitch angle of A, that is, the reference pitch angle is Then the target azimuth can be determined as θ a +θ, the target pitch angle is It can be understood that since the azimuth angle difference and the pitch angle difference represent the position change between the first feature point and the second feature point, the azimuth angle difference θ and the pitch angle difference Can be positive or negative.
[0107] Further, in a third embodiment of the spatial position detection method of the present invention proposed based on the first embodiment of the present invention, the reference device is spherical; the step S40 includes the steps of:
[0108] Step S41, obtaining the radius of the reference device;
[0109] Step S42, calculating the sum of the target distance and the radius of the reference device to obtain the origin distance;
[0110] Step S43, determining a spherical center coordinate system based on the reference position, wherein the spherical center coordinate system is a coordinate system with the spherical center of the reference device as a coordinate origin;
[0111] Step S44: determining the real-time position of the head-up display device in the spherical center coordinate system according to the origin distance and the target orientation.
[0112] In this embodiment, a spatial rectangular coordinate system is constructed with the center of the reference device as the origin, and the target orientation is also based on the spatial rectangular coordinate system; and the target distance indicates the distance between the VR device and the surface of the reference device. Therefore, when calculating the real-time position, it is necessary to determine the distance between the VR device and the origin, so it is necessary to calculate the sum of the target distance and the radius of the reference device.
[0113] From the conversion relationship between the spherical coordinate system and the spatial rectangular coordinate system, it can be seen that the coordinates of the real-time position in the spatial rectangular coordinate system (X d , Y d , Z d )for:
[0114]
[0115] Z d =(R+D)cos(θ+θ a )
[0116] Thus, the real-time position of the VR device in the spatial rectangular coordinate system with the center of the sphere of the reference device as the origin is determined.
[0117] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0119] The present application also provides a spatial position detection system for implementing the above-mentioned spatial position detection method, the spatial position detection system comprising a reference device and a spatial position detection device, the spatial position detection device comprising:
[0120] A first acquisition module is used to acquire a device image corresponding to a reference device in a captured image, wherein the device image corresponding to the reference device is different in different viewing angles;
[0121] A first determination module, configured to determine a target position of a head-up display device relative to the reference device according to the device image;
[0122] A first acquisition module, configured to acquire a target distance between the head-up display device and the reference device;
[0123] The second determination module obtains a reference position of the reference device, and determines a real-time position of the head-up display device according to the reference position, the target orientation and the target distance.
[0124] The spatial position detection system sets up different reference devices for collecting device images at different viewing angles, so that when the reference position of the reference device is known, the target orientation of the head-up display device and the reference device can be determined based on the collected device images, and the real-time position of the head-up display device can be accurately determined based on the target orientation and the distance between the two.
[0125] It should be noted that the first acquisition module in this embodiment can be used to execute step S10 in the embodiment of the present application, the first determination module in this embodiment can be used to execute step S20 in the embodiment of the present application, the second acquisition module in this embodiment can be used to execute step S30 in the embodiment of the present application, and the second determination module in this embodiment can be used to execute step S40 in the embodiment of the present application.
[0126] Furthermore, the first determining module includes:
[0127] A first acquisition submodule, configured to acquire reference data corresponding to the reference device, wherein the reference data includes a corresponding reference image and a reference orientation;
[0128] A first determination submodule, used to determine an orientation change value of the device image relative to the reference image;
[0129] The second determination submodule is used to determine the target orientation according to the reference orientation and the orientation change value.
[0130] Furthermore, the first acquisition submodule includes:
[0131] A first acquisition unit is used to acquire the historical device images collected in the previous detection cycle and the determined historical target orientation;
[0132] A first execution unit, configured to use the historical device image as the reference image and the historical target orientation as the reference orientation;
[0133] The second execution unit is used to obtain the reference data according to the reference image and the reference orientation.
[0134] Further, the reference device is a spherical device with a pseudo-random dot array sequence arranged on the surface; the first determination submodule includes:
[0135] A first determining unit, configured to determine a first feature point in a pseudo-random dot matrix sequence of the device image, wherein the first feature point is located at a center of the device image;
[0136] A second determining unit, configured to determine a second feature point in the pseudo-random dot matrix sequence of the reference image, wherein the second feature point is located at the center of the reference image;
[0137] A third determining unit is used to determine the orientation change value according to the first feature point and the second feature point.
[0138] Further, the third determining unit includes:
[0139] A first determining subunit, configured to determine a horizontal distance between the first feature point and the second feature point in a horizontal direction and a vertical distance between the first feature point and the second feature point in a vertical direction;
[0140] a second determining subunit, configured to determine an azimuth difference between the first feature point and the second feature point according to the horizontal distance;
[0141] a third determining subunit, configured to determine a difference in pitch angles between the first feature point and the second feature point according to the vertical distance;
[0142] The first execution subunit is used to obtain the azimuth change value according to the azimuth angle difference and the elevation angle difference.
[0143] Furthermore, the second determining submodule includes:
[0144] A second acquisition unit is used to acquire a reference azimuth angle and a reference elevation angle in the reference azimuth, and an azimuth angle difference and an elevation angle difference in the azimuth change value;
[0145] A first calculation unit, used for calculating the sum of the difference between the reference azimuth and the azimuth to obtain a target azimuth;
[0146] A second calculation unit, configured to calculate a sum of a difference between the reference pitch angle and the pitch angle to obtain a target pitch angle;
[0147] The third execution unit is used to obtain the target azimuth according to the target azimuth and the target elevation angle.
[0148] Further, the reference device is spherical; and the second determination module includes:
[0149] A second acquisition submodule, used to acquire the radius of the reference device;
[0150] A first calculation submodule, configured to calculate the sum of the target distance and the radius of the reference device to obtain an origin distance;
[0151] A third determination submodule is used to determine a spherical center coordinate system based on the reference position, wherein the spherical center coordinate system is a coordinate system with the spherical center of the reference device as a coordinate origin;
[0152] The fourth determination submodule is used to determine the real-time position of the head-up display device in the spherical center coordinate system according to the origin distance and the target orientation.
[0153] Reference Figure 5 In terms of hardware structure, the electronic device may include components such as a communication module 10, a memory 20, and a processor 30. In the electronic device, the processor 30 is connected to the memory 20 and the communication module 10 respectively, and a computer program is stored in the memory 20. The computer program is executed by the processor 30 at the same time, and the steps of the above method embodiment are implemented when the computer program is executed.
[0154] The communication module 10 can be connected to an external communication device through a network. The communication module 10 can receive requests from an external communication device, and can also send requests, instructions and information to the external communication device, which can be other electronic devices, servers or Internet of Things devices, such as televisions, etc.
[0155] The memory 20 can be used to store software programs and various data. The memory 20 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as obtaining a device image corresponding to a reference device in an acquired image), etc.; the data storage area can include a database, and the data storage area can store data or information created according to the use of the system, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0156] The processor 30 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 20, and calling data stored in the memory 20, so as to monitor the electronic device as a whole. The processor 30 may include one or more processing units; optionally, the processor 30 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 30.
[0157] although Figure 5 Although not shown, the electronic device may further include a circuit control module, which is used to connect to a power source to ensure the normal operation of other components. Figure 5 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0158] The present invention also provides a computer-readable storage medium on which a computer program is stored. The computer-readable storage medium may be Figure 5 The memory 20 in the electronic device may also be at least one of a ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, and an optical disk. The computer-readable storage medium includes a number of instructions for enabling a terminal device with a processor (which may be a television, a car, a mobile phone, a computer, a server, a terminal, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0159] In the present invention, the terms "first", "second", "third", "fourth" and "fifth" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0160] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0161] Although the embodiments of the present invention have been shown and described above, the scope of protection of the present invention is not limited thereto. It is understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art can change, modify and replace the above embodiments within the scope of the present invention, and these changes, modifications and replacements should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A spatial position detection method, It is characterized in that The spatial position detection method comprises: Acquire a device image corresponding to a reference device in the captured image, wherein the device image corresponding to the reference device is different in different viewing angles; determining a target position of a head-up display device relative to the reference device based on the device image; Acquiring a target distance between the head-up display device and the reference device; A reference position of the reference device is acquired, and a real-time position of the head-up display device is determined according to the reference position, the target orientation and the target distance.
2. The spatial position detection method according to claim 1, It is characterized in that Determining the target position of the head-up display device relative to the reference device according to the device image comprises: Acquire reference data corresponding to the reference device, wherein the reference data includes a corresponding reference image and a reference orientation; Determining an orientation change value of the device image relative to the reference image; The target orientation is determined according to the reference orientation and the orientation change value.
3. The spatial position detection method according to claim 2, It is characterized in that The acquiring the reference data corresponding to the reference device comprises: Obtain historical device images collected in the previous detection cycle and the determined historical target positions; Using the historical device image as the reference image and the historical target orientation as the reference orientation; The reference data is obtained according to the reference image and the reference orientation.
4. The spatial position detection method according to claim 2, It is characterized in that The reference device is a spherical device with a pseudo-random dot array sequence arranged on the surface; Determining the position change value of the device image relative to the reference image includes: Determining a first feature point in a pseudo-random dot matrix sequence of the device image, wherein the first feature point is located at a center of the device image; Determining a second feature point in the pseudo-random dot matrix sequence of the reference image, wherein the second feature point is located at the center of the reference image; The orientation change value is determined according to the first feature point and the second feature point.
5. The spatial position detection method according to claim 4, It is characterized in that The determining the orientation change value according to the first feature point and the second feature point comprises: Determine a horizontal distance in a horizontal direction and a vertical distance in a vertical direction between the first feature point and the second feature point; Determine the azimuth difference between the first feature point and the second feature point according to the horizontal distance; Determine a difference in pitch angle between the first feature point and the second feature point according to the vertical distance; The azimuth change value is obtained according to the azimuth angle difference and the elevation angle difference.
6. The spatial position detection method according to claim 2, It is characterized in that Determining the target orientation according to the reference orientation and the orientation change value comprises: Acquire a reference azimuth angle and a reference elevation angle in the reference azimuth, and an azimuth angle difference and an elevation angle difference in the azimuth change value; Calculating the sum of the difference between the reference azimuth and the azimuth to obtain the target azimuth; Calculating the sum of the reference pitch angle and the pitch angle difference to obtain a target pitch angle; The target azimuth is obtained according to the target azimuth and the target elevation angle.
7. The spatial position detection method according to claim 1, It is characterized in that The reference device is spherical; obtaining the reference position of the reference device, and determining the real-time position of the head-up display device according to the reference position, the target orientation and the target distance includes: obtaining a radius of the reference device; Calculating the sum of the target distance and the radius of the reference device to obtain the origin distance; Determine a spherical center coordinate system based on the reference position, wherein the spherical center coordinate system is a coordinate system with the spherical center of the reference device as the coordinate origin; The real-time position of the head-up display device is determined in the spherical center coordinate system according to the origin distance and the target orientation.
8. A spatial position detection system, It is characterized in that The spatial position detection system comprises a reference device and a spatial position detection device, wherein the spatial position detection device comprises: A first acquisition module is used to acquire a device image corresponding to a reference device in a captured image, wherein the device image corresponding to the reference device is different in different viewing angles; A first determination module, configured to determine a target position of a head-up display device relative to the reference device according to the device image; A second acquisition module, used to acquire a target distance between the head-up display device and the reference device; The second determination module obtains a reference position of the reference device, and determines a real-time position of the head-up display device according to the reference position, the target orientation and the target distance.
9. An electronic device, It is characterized in that The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the spatial position detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the spatial position detection method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Robot vision locating method based on round road sign imaging analysis
CN102679960A
Positioning method, system and device, electronic equipment and storage medium
CN111462226A
Position detection method of control equipment, positioning system and readable storage medium
CN115314700A
System and Method for Displaying Object Location in Augmented Reality
EP2439920A1
Systems and methods for determining movement of a controller with respect to an hmd
US20200174552A1
