Position parameter acquisition method, device, equipment and medium

Through the combination of preset image algorithm and inertial acceleration, the problem of low accuracy and efficiency of camera position parameter calculation in the prior art is solved, and efficient real position acquisition is achieved, which is suitable for a variety of application scenarios.

CN115482275BActive Publication Date: 2024-11-05BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110603476.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-31
Publication Date
2024-11-05
Estimated Expiration
2041-05-31

AI Technical Summary

Technical Problem

In the prior art, a method of obtaining the real position of a camera requires a depth camera and a color camera, which is highly restrictive and has low calculation accuracy and efficiency.

Method used

The preset image algorithm calculates the candidate position parameters of the target image in the continuous multi-frame image, determines the algorithm error value in combination with the inertial acceleration, and corrects the candidate position parameters to obtain the target position parameters, so as to realize the conversion from scaleless position parameters to real-world coordinates.

Benefits of technology

It improves the calculation accuracy and efficiency of camera position parameters, reduces hardware requirements, and enhances application flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115482275B_ABST
    Figure CN115482275B_ABST
Patent Text Reader

Abstract

The disclosed embodiments relate to a method, device, equipment and medium for obtaining position parameters, wherein the method comprises: calculating candidate position parameters of a target image in a plurality of consecutive frames of images according to a preset image algorithm; the candidate position parameters are scale-free position parameters, obtaining the inertial acceleration of the target image, and determining the algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameters, correcting the candidate position parameters according to the algorithm error value to obtain the target position parameters; the target position parameters are scaled position parameters. Thus, the conversion of the scale-free position parameters calculated by the preset image algorithm to the real world coordinates is realized, providing technical support for the scene of obtaining the real pixel position, and the position parameters are solved in a loosely coupled manner between the image algorithm and the inertial acceleration, and the application flexibility is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication terminal technology, and in particular to a method, device, equipment and medium for obtaining position parameters. Background Art

[0002] With the popularization of mobile terminals such as smart phones, it is becoming more and more common for users to take photos through camera applications of mobile terminals. Along with this, users' needs for captured images are becoming more and more diverse. For example, in order to know the real position of pixels in an image, there is a need to obtain the real position of the camera shooting.

[0003] In the related art, in order to meet the demand for obtaining the real position of the camera, images are usually taken through a mobile terminal equipped with a depth camera and a color camera. The depth information and color pixel information in the image are aligned to calculate the conversion relationship between the pixel coordinates and the real-world coordinates, and the real position of the camera is derived based on the conversion relationship.

[0004] However, in the above-mentioned method of obtaining the real position of the camera, on the one hand, the shooting mobile terminal must be equipped with a depth camera and a color camera, which is highly restrictive, and on the other hand, multiple calculations such as pixel alignment are required, and the calculation accuracy and efficiency are not high. Summary of the invention

[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method for obtaining position parameters, the method comprising: calculating candidate position parameters of a target image in a plurality of consecutive frames of images according to a preset image algorithm; the candidate position parameters are scale-free position parameters; obtaining the inertial acceleration of the target image, and determining an algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameters; correcting the candidate position parameters according to the algorithm error values ​​to obtain target position parameters; the target position parameters are scaled position parameters.

[0006] The disclosed embodiment also provides a position parameter acquisition device, which includes: a calculation module, used to calculate candidate position parameters of a target image in a plurality of consecutive frames of images according to a preset image algorithm; the candidate position parameters are scale-free position parameters; an acquisition module, used to obtain the inertial acceleration of the target image, and determine an algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameters; a correction module, used to correct the candidate position parameters according to the algorithm error value to obtain target position parameters; the target position parameters are scaled position parameters.

[0007] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the position parameter acquisition method provided in the embodiment of the present disclosure.

[0008] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the position parameter acquisition method provided by the embodiment of the present disclosure.

[0009] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0010] The position parameter acquisition scheme provided by the embodiment of the present disclosure calculates the candidate position parameters of the target image in the continuous multi-frame image according to the preset image algorithm, wherein the candidate position parameters are scale-free position parameters, and then obtains the inertial acceleration of the target image, and determines the algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameters, and finally, corrects the candidate position parameters according to the algorithm error value to obtain the target position parameters; the target position parameters are scaled position parameters. Thus, the conversion of the scale-free position parameters calculated by the preset image algorithm to the real world coordinates is realized, which provides technical support for the acquisition scenario of the real pixel position, and the position parameters are solved in a loosely coupled manner between the image algorithm and the inertial acceleration, and the application flexibility is high. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0012] Figure 1 A flow chart of a method for obtaining position parameters provided in an embodiment of the present disclosure;

[0013] Figure 2 A schematic diagram of an application scenario for obtaining position parameters provided by an embodiment of the present disclosure;

[0014] Figure 3 A schematic diagram of a flow chart of another method for obtaining position parameters provided in an embodiment of the present disclosure;

[0015] Figure 4 A schematic diagram of a flow chart of another method for obtaining position parameters provided in an embodiment of the present disclosure;

[0016] Figure 5 A schematic diagram of another application scenario for obtaining position parameters provided by an embodiment of the present disclosure;

[0017] Figure 6 A schematic diagram of another application scenario for obtaining position parameters provided by an embodiment of the present disclosure;

[0018] Figure 7 A schematic diagram of the structure of a position parameter acquisition device provided in an embodiment of the present disclosure;

[0019] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0021] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0022] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0023] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0024] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0025] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0026] In order to solve the problems of low accuracy in calculating the real position of the camera and inflexible application mentioned in the above background technology, the present disclosure provides a method for obtaining position parameters, which can efficiently and accurately calculate the real position parameters of the camera. The camera position parameters of the present disclosure embodiment can be any parameters indicating the shooting pose of the camera in the real world coordinate system, including but not limited to the camera world coordinates and camera pose, or camera rotation parameters and camera translation parameters.

[0027] The method is introduced below in conjunction with specific embodiments.

[0028] Figure 1 The present invention provides a flow chart of a method for obtaining position parameters according to an embodiment of the present invention. The method can be performed by a position parameter obtaining device, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method includes:

[0029] Step 101, according to a preset image algorithm, calculate candidate position parameters of a target image in a plurality of consecutive frames of images; the candidate position parameters are scale-free position parameters.

[0030] The preset image algorithms include but are not limited to visual-inertial odometry (VIO), simultaneous localization and mapping (SLAM) and any other algorithms that can locate candidate position parameters of an image.

[0031] In this embodiment, candidate position parameters of a target image in a plurality of consecutive image frames are calculated according to a preset image algorithm, wherein the target image may be any image in the plurality of consecutive image frames.

[0032] Of course, the preset image algorithms are different, and the methods of calculating the candidate position parameters of the target image in the continuous multi-frame images are also different:

[0033] In some possible embodiments, when the preset image algorithm is a SLAM algorithm, since the camera position parameters are cumulatively calculated based on the previous frame image, therefore, in this embodiment, multiple pairs of feature points (for example, 4 pairs) that match the target image and the reference image are determined, wherein the reference image is the previous frame image adjacent to the target image in the continuous multiple frames of images, and the target image in this embodiment is not the first image in the continuous multiple images. Then, the candidate position parameters of the target image frame are calculated based on the coordinates of the multiple pairs of feature points and the intrinsic parameters of the camera, that is, according to the homography matrix calculation method, multiple equations are constructed based on the coordinates of the multiple pairs of feature points to calculate the position mapping relationship between the multiple pairs of feature points in the world coordinate system and the pixel coordinate system, and the position mapping relationship is the candidate position parameter.

[0034] In some other possible embodiments, the pixel coordinates of the feature points of the target image with pre-calibrated standard world coordinates may be calculated according to an image processing algorithm, and the candidate position parameters may be obtained based on the conversion calculation between the pixel coordinates and the standard world coordinates.

[0035] It should be emphasized that the candidate position parameter of the target image calculated by the preset image algorithm is a relative position parameter without a real scale due to the limitations of the preset image algorithm, and is not a position parameter in real-world coordinates.

[0036] For example, when the preset image algorithm is the SLAM algorithm, and the position parameters are the camera pose: rotation parameter R and offset parameter t, the calculated camera pose R without real scale of the target image is 10, and t is 2. For t, it is not clear what the real scale represented by 2 is, that is, it is impossible to know the value of t in the world coordinate system corresponding to 2. Therefore, the camera pose of the target image calculated based on the SLAM algorithm is the relative pose under the algorithm, not the real pose in the world coordinate system. Therefore, the candidate position parameters need to be further processed.

[0037] Step 102: Acquire the inertial acceleration of the target image, and determine the algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameters.

[0038] Among them, the inertial acceleration can be one or more of the three-dimensional accelerations of speed (X dimension), direction (Y dimension) and gravity (Z dimension) measured by the three sensors of the mobile terminal, namely, the accelerometer, gyroscope and magnetometer when shooting the target image. It should be emphasized that when the inertial acceleration in this embodiment is one of the three-dimensional accelerations of speed, direction and gravity, the real world coordinates of the pixel point can also be obtained, and the algorithm efficiency is relatively high.

[0039] It should be understood that inertial acceleration is real acceleration data measured by sensors in the real world. Therefore, if the inertial acceleration and the preset image algorithm can be aligned, the real position parameters corresponding to the candidate position parameters can obviously be derived.

[0040] Therefore, in the embodiment of the present disclosure, the algorithm error value of the preset image algorithm is obtained according to the inertial acceleration and the candidate position parameters. The algorithm error value can be understood as the difference that needs to be compensated when the preset image algorithm is aligned to the inertial acceleration.

[0041] Of course, in one embodiment of the present disclosure, in order to further ensure the accuracy of the obtained algorithm error, the algorithm error value can also be calculated based on multiple target images in the continuous multi-needle images.

[0042] In this embodiment, the error mean of all algorithm error values ​​corresponding to multiple target images is calculated, and then the algorithm error mean is used as the algorithm error value for correcting the first candidate world coordinates. Therefore, the first candidate world coordinates can be further corrected according to the error mean.

[0043] Step 103: Correct the candidate position parameters according to the algorithm error value to obtain the target position parameters, where the target position parameters are scaled position parameters.

[0044] In this embodiment, since the inertial acceleration has a value with a scale, the algorithm error value has a difference value under the corresponding scale. Therefore, the candidate position parameters are corrected according to the algorithm error value to obtain the target position parameters, that is, the candidate position parameters are aligned from the image coordinates under the preset image algorithm dimension to the world coordinate system.

[0045] For example, when the candidate position parameter is corrected according to the algorithm error value, it is corrected according to the product of the algorithm error value and the candidate position parameter. When t in the candidate position parameter is the unscaled 2 mentioned above, the algorithm error value is 10. Therefore, the scaled value of t in the target position parameter is 2*10.

[0046] Among them, the method of correcting the candidate position parameters according to the algorithm error value varies according to different algorithm error values. For example, when the algorithm error value is the alignment ratio of the candidate position parameters from the image coordinates to the world coordinate system, the method of correcting the candidate position parameters according to the algorithm error value is: calculating the product of the algorithm error value and the candidate position parameter. For another example, when the algorithm error value is the alignment difference of the candidate position parameters from the image coordinates to the world coordinate system, the method of correcting the candidate position parameters according to the algorithm error value is: calculating the addition of the algorithm error value and the candidate position parameter.

[0047] It should be emphasized that the alignment and image algorithm calculations in this embodiment are separate, and the two are loosely coupled calculation methods. This loosely coupled algorithm is easy to apply and does not rely on the robustness of the image algorithm compared to the tightly coupled method. For example, Figure 2 As shown, when the preset image algorithm is the VIO algorithm, the output end of the VIO algorithm system can be directly connected to the position parameter acquisition system in this embodiment (the world coordinates and calculations of the pixel points can be converted from the target position parameters). Even if the VIO algorithm has divergent calculation results, the position parameter acquisition system in this embodiment does not depend on the specific parameters of the algorithm, and can also achieve accurate acquisition of the world coordinates of the pixel points in the world coordinate system.

[0048] In summary, the method for obtaining position parameters of the embodiment of the present disclosure calculates the candidate position parameters of the target image in multiple consecutive frames of images according to the preset image algorithm, wherein the candidate position parameters are scale-free position parameters, and then obtains the inertial acceleration of the target image, and determines the algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameters, and finally, corrects the candidate position parameters according to the algorithm error value to obtain the target position parameters; the target position parameters are scaled position parameters. Thus, the conversion of the scale-free position parameters calculated by the preset image algorithm to the real-world coordinates is realized, which provides technical support for the scene of obtaining the real pixel position, and the position parameters are solved in a loosely coupled manner between the image algorithm and the inertial acceleration, and the application flexibility is high.

[0049] It should be noted that in different application scenarios, the method of obtaining the algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameter is different in different application scenarios, and the examples are as follows:

[0050] Example 1:

[0051] In this example, if Figure 3 As shown, the algorithm error value of the preset image algorithm is obtained according to the inertial acceleration and the candidate position parameters, including:

[0052] Step 301, obtaining the corresponding visual speed according to the pose coordinate parameters in the candidate position parameters.

[0053] It can be understood that the posture coordinate parameter is the relative displacement length of the target image frame relative to the first frame image. For example, the posture coordinate parameter can be t in the above embodiment, etc. Therefore, the corresponding visual speed can be obtained according to the posture coordinate parameter in the candidate position parameter.

[0054] For example, the posture coordinate parameters are differentiated to obtain the corresponding speed as the visual speed; for another example, the posture coordinate parameters are input into a preset deep learning model to obtain the visual speed output by the deep learning model.

[0055] Step 302: Obtain an algorithm error value of a preset image algorithm according to visual velocity and inertial acceleration.

[0056] In this embodiment, the inertial acceleration data and the visual speed can be aligned in the speed dimension, so that the algorithm error of the preset image algorithm can be obtained.

[0057] In some possible embodiments, the inertial acceleration data is aligned with the visual speed in the speed dimension. In this embodiment, the inertial acceleration is integrated and calculated. Since the integral of the acceleration is the speed, the inertial navigation speed of the target image can be obtained, and then the ratio of the inertial navigation speed to the visual speed is calculated to obtain the algorithm error value.

[0058] Furthermore, in this example, the product of the algorithm error value and the candidate position parameter is calculated to obtain the target position parameter.

[0059] The following takes the preset algorithm as the SLAM algorithm as an example. When the inertial acceleration data is an X-dimensional acceleration, the SLAM algorithm is run to obtain the scale-free camera pose of the target image, and the pose coordinate parameters in the camera pose are differentiated to obtain the visual velocity v_img of the target image. Then, the inertial acceleration is integrated to obtain the inertial navigation velocity v_imu. The two velocities are aligned v_imu=s*v_im, and s is used as the algorithm error value. Thus, s is multiplied by the candidate position parameters to obtain the target position parameters.

[0060] In some other possible embodiments, the inertial acceleration data and the visual velocity are aligned in the acceleration dimension. In this embodiment, since the differential of the velocity is acceleration, the visual velocity differential is calculated to obtain the corresponding visual acceleration, and then the ratio of the inertial acceleration to the visual acceleration is calculated to obtain the algorithm error value.

[0061] Furthermore, in this example, the product of the algorithm error value and the candidate position parameter label is calculated to obtain the target position parameter.

[0062] The following takes the preset algorithm as the SLAM algorithm as an example. When the inertial acceleration data is the X-dimensional acceleration a-imu, the SLAM algorithm is run to obtain the scale-free camera pose of the target image, and the visual velocity v_img of the target image is obtained according to the pose coordinate parameters in the camera pose. Then, the visual acceleration a-img is obtained by differentiating the visual velocity v_img, and the two accelerations are aligned a_imu=s*a_im, and s is used as the algorithm error value. Thus, s is multiplied by the candidate position parameters to obtain the target position parameters.

[0063] Example 2:

[0064] In this embodiment, a deep model is learned in advance based on a large amount of sample data. The input of the deep model is inertial acceleration and candidate position parameters, and the output is an algorithm error value. Therefore, the inertial acceleration and candidate position parameters can be input into the deep model to obtain the algorithm error value output by the deep model.

[0065] The algorithm error value can be understood as the alignment difference of the candidate position parameter from the image coordinate system to the world coordinate system, and the addition value of the algorithm error value and the first candidate world coordinate system is calculated to correct the first candidate world coordinate system.

[0066] In summary, the position parameter acquisition method of the embodiment of the present invention obtains the algorithm error value of the preset image algorithm based on the inertial acceleration and the candidate position parameters. The calculation of the algorithm error value and the calculation time of the preset image algorithm are loosely coupled, which improves the application flexibility when acquiring the position parameters.

[0067] Based on the above embodiment, the position parameters of the camera in the real scale of the world coordinate system can be obtained, so that the real coordinates of the pixel points can be determined according to the position parameters in the real scale. For example, when the target position parameter is the camera posture, the corresponding pixel world coordinates can be obtained after the pixel coordinates are multiplied by the camera intrinsic parameter and the camera posture. Therefore, when the camera posture in this embodiment has the scale in the real world coordinate system, the world coordinates of the real scale of the pixel points can be directly calculated according to the camera posture. In addition, it can meet the scene applications such as size measurement and three-dimensional modeling.

[0068] In one embodiment of the present disclosure, Figure 4 As shown in Figure 2, this method can be applied to size measurement, such as Figure 4 As shown, the method further comprises:

[0069] Step 401, obtaining the first image coordinates of the first pixel point in the target image, and obtaining the first world coordinates according to the target position parameter and the first image coordinates.

[0070] Among them, the method for obtaining the first image coordinates can be obtained according to the above-mentioned preset image algorithm. The first image coordinates here are scale-free relative coordinates of the pixel system. In order to obtain the coordinates of the first pixel point in the real world coordinates, since the above-mentioned target position parameters indicate the actual shooting position of the camera, the actual shooting position can directly or indirectly correspond to the camera posture. Therefore, the first world coordinates can be obtained according to the target position parameters and the first image coordinates.

[0071] For example, when the target position parameters are the camera rotation parameters and the camera translation parameters, that is, the camera extrinsic parameters, the product of the first pixel point and the camera extrinsic parameters and the camera intrinsic parameters is calculated to obtain the corresponding first world coordinates.

[0072] Step 402: Acquire the second image coordinates of at least one second pixel point in the target image, and acquire the second world coordinates according to the target position parameter and the second image coordinates.

[0073] The second pixel point may be any pixel point other than the first pixel point, and the second pixel point may be triggered and selected by a user.

[0074] Similarly, the second image coordinates of at least one second pixel point in the target image are acquired, and the second world coordinates are acquired according to the target position parameter and the second image coordinates.

[0075] Step 403: when the at least one second pixel point is one, determine the real distance between the first pixel point and the second pixel point according to the first world coordinate and the second world coordinate.

[0076] When there is only one second pixel point, after obtaining the second world coordinate of the second pixel point at the real scale, the distance between the first pixel point and the second pixel point in the world coordinate system is determined according to the first world coordinate and the second world coordinate, thereby realizing the size measurement of any two pixel points on the target image.

[0077] For example, Figure 5 As shown, when the target image includes a ruler image, the first pixel point of the edge where the ruler scale is located is A, and the second pixel point is B. The first image coordinate of A calculated according to the preset image algorithm is a1, and the first world coordinate is a2. The second image coordinate of B is b1, and the second world coordinate is b2. If the distance between the two is 0.03 calculated directly according to the first image coordinate a1 and the second image coordinate b1, this is obviously not the actual distance between the two. In this embodiment, by calculating the distance between the first world coordinate a2 and the second world coordinate b2, the actual distance between the first pixel point and the second pixel point is 2 cm.

[0078] In another embodiment of the present disclosure, the method can be applied to three-dimensional modeling, such as Figure 4 As shown, the method further comprises:

[0079] Step 404: when there are multiple at least one second pixel points, construct a three-dimensional model corresponding to the first pixel point and the multiple second pixel points according to the first world coordinate and the multiple second world coordinates.

[0080] Among them, multiple second pixel points can be pixel points other than any first pixel points belonging to the same object in the target image, and the selection method of the third pixel point can be triggered by the user, or by identifying the contour of the object and determining the corner points of the contour as the corresponding second pixel points.

[0081] Similarly, the multiple second image world coordinates of the third pixel point calculated according to the preset image algorithm are relative coordinates. Therefore, the multiple second image world coordinates need to be corrected according to the algorithm error value to obtain the second world coordinates of the multiple second pixel points.

[0082] In this embodiment, after obtaining the second world coordinates of the real scale of the plurality of second pixel points, the position relationship between the first pixel point and the plurality of second pixel points in the world coordinate system is determined according to the first target world coordinates and the second world coordinates, thereby realizing the construction of the three-dimensional model. Of course, when constructing the three-dimensional model, if the distance between the first pixel point and the plurality of second pixel points is long, the three-dimensional model can also be constructed by geometric scaling.

[0083] For example, Figure 6 As shown, when the target image includes a cube, the acquired first pixel point and multiple second pixel points correspond to the vertices of the cube (the black dots in the figure), respectively. After obtaining the world coordinates corresponding to the first pixel point and the multiple second pixel points, a three-dimensional model can be constructed according to the world coordinates. This method of constructing a three-dimensional model does not require the camera that captures the image to include a depth camera, and the image captured by a monocular camera can also be processed to obtain a three-dimensional model.

[0084] In summary, the position parameter acquisition method of the embodiment of the present disclosure can obtain the real-world coordinates of multiple pixel points in an image, providing technical support for scene applications such as real-size measurement between pixel points and three-dimensional modeling.

[0085] Figure 7 This is a schematic diagram of the structure of a position parameter acquisition device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device. Figure 7 As shown, it includes: a calculation module 710, an acquisition module 720 and a correction module 730, wherein:

[0086] The calculation module 710 is used to calculate the candidate position parameters of the target image in the continuous multiple frames of images according to a preset image algorithm; the candidate position parameters are scale-free position parameters;

[0087] An acquisition module 720, configured to acquire the inertial acceleration of the target image, and determine an algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameter;

[0088] The correction module 730 is used to correct the candidate position parameters according to the algorithm error value to obtain target position parameters; the target position parameters are scaled position parameters.

[0089] The position parameter acquisition device provided in the embodiments of the present disclosure can execute the position parameter acquisition method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0090] In order to implement the above embodiments, the present disclosure further proposes a computer program product, including a computer program / instruction, which implements the position parameter acquisition method in the above embodiments when executed by a processor.

[0091] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.

[0092] The following specific reference Figure 8 , which shows a schematic diagram of the structure of an electronic device 800 suitable for implementing the embodiment of the present disclosure. The electronic device 800 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 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.

[0093] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0094] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 808 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0095] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 808, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the position parameter acquisition method of the embodiment of the present disclosure are executed.

[0096] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. 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 of the above. 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 combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0097] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0098] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0099] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0100] According to the preset image algorithm, the candidate position parameters of the target image in the continuous multi-frame image are calculated, wherein the candidate position parameters are scale-free position parameters, and then the inertial acceleration of the target image is obtained, and the algorithm error value of the preset image algorithm is determined according to the inertial acceleration and the candidate position parameters, and finally, the candidate position parameters are corrected according to the algorithm error value to obtain the target position parameters; the target position parameters are scaled position parameters. Thus, the conversion of the scale-free position parameters calculated by the preset image algorithm to the real world coordinates is realized, which provides technical support for the scene of obtaining the real pixel position, and the position parameters are solved in a loosely coupled manner between the image algorithm and the inertial acceleration, and the application flexibility is high.

[0101] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0102] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / 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.

[0103] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0104] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0105] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 of the foregoing.

[0106] According to one or more embodiments of the present disclosure, the present disclosure provides a method for obtaining a position parameter, including:

[0107] According to a preset image algorithm, candidate position parameters of a target image in a plurality of consecutive frames of images are calculated; the candidate position parameters are scale-free position parameters;

[0108] Acquiring the inertial acceleration of the target image, and determining an algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameter;

[0109] The candidate position parameters are corrected according to the algorithm error value to obtain target position parameters; the target position parameters are position parameters with scale.

[0110] According to one or more embodiments of the present disclosure, in the method for obtaining position parameters provided by the present disclosure, the step of calculating candidate position parameters of a target image in a plurality of consecutive frames of images includes:

[0111] Determine a plurality of pairs of feature points matching the target image with a reference image, wherein the reference image is a previous frame image adjacent to the target image in the continuous multiple frames of images;

[0112] The candidate position parameters of the target image frame are calculated according to the coordinates of the multiple pairs of feature points and the intrinsic parameters of the camera.

[0113] According to one or more embodiments of the present disclosure, in the method for obtaining position parameters provided by the present disclosure,

[0114] The step of determining the algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameter includes:

[0115] Acquire the corresponding visual speed according to the pose coordinate parameters in the candidate position parameters;

[0116] An algorithm error value of the preset image algorithm is determined according to the visual speed and the inertial acceleration.

[0117] According to one or more embodiments of the present disclosure, in the position parameter acquisition method provided by the present disclosure, determining the algorithm error value of the preset image algorithm according to the visual speed and the inertial acceleration includes:

[0118] Determining the inertial navigation velocity of the target image according to the inertial acceleration;

[0119] The ratio of the inertial navigation speed to the visual speed is calculated to determine the algorithm error value.

[0120] According to one or more embodiments of the present disclosure, in the position parameter acquisition method provided by the present disclosure, determining the algorithm error value of the preset image algorithm according to the visual speed and the inertial acceleration includes:

[0121] Determining a corresponding visual acceleration according to the visual speed;

[0122] The ratio of the inertial acceleration to the visual acceleration is calculated to determine the algorithm error value.

[0123] According to one or more embodiments of the present disclosure, in the method for obtaining position parameters provided by the present disclosure, the step of correcting the candidate position parameters according to the algorithm error value to obtain the target position parameters of the first pixel point includes:

[0124] The product of the algorithm error value and the candidate position parameter is calculated to determine the target position parameter.

[0125] According to one or more embodiments of the present disclosure, in the method for obtaining position parameters provided by the present disclosure, when there are multiple target images, the step of correcting the candidate position parameters according to the algorithm error value includes:

[0126] Calculate the error mean of all algorithm error values ​​corresponding to the multiple target images;

[0127] The first candidate world coordinate is corrected according to the error mean.

[0128] According to one or more embodiments of the present disclosure, the method for obtaining position parameters provided by the present disclosure further includes:

[0129] Acquire a first image coordinate of a first pixel point in the target image, and acquire a first world coordinate according to the target position parameter and the first image coordinate;

[0130] Acquire a second image coordinate of at least one second pixel point in the target image, and acquire a second world coordinate according to the target position parameter and the second image coordinate;

[0131] When the at least one second pixel point is one, the real distance between the first pixel point and the second pixel point is determined according to the first world coordinate and the second world coordinate.

[0132] According to one or more embodiments of the present disclosure, the method for obtaining position parameters provided by the present disclosure further includes:

[0133] When there are multiple at least one second pixel points, a three-dimensional model corresponding to the first pixel point and the multiple second pixel points is constructed according to the first world coordinate and the multiple second world coordinates.

[0134] According to one or more embodiments of the present disclosure, in the method for obtaining position parameters provided by the present disclosure, the target position parameters include:

[0135] Camera world coordinates and camera pose; and / or,

[0136] Camera rotation parameters and camera translation parameters.

[0137] According to one or more embodiments of the present disclosure, the present disclosure provides a position parameter acquisition device, including:

[0138] A calculation module, used to calculate candidate position parameters of a target image in a plurality of consecutive frames of images according to a preset image algorithm; the candidate position parameters are scale-free position parameters;

[0139] An acquisition module, used for acquiring the inertial acceleration of the target image, and determining an algorithm error value of the preset image algorithm according to the inertial acceleration and the candidate position parameter;

[0140] The correction module is used to correct the candidate position parameters according to the algorithm error value to obtain target position parameters; the target position parameters are position parameters with scale.

[0141] According to one or more embodiments of the present disclosure, in the position parameter acquisition device provided by the present disclosure, the calculation module is specifically used to:

[0142] Determine a plurality of pairs of feature points matching the target image with a reference image, wherein the reference image is a previous frame image adjacent to the target image in the continuous multiple frames of images;

[0143] The candidate position parameters of the target image frame are calculated according to the coordinates of the multiple pairs of feature points and the intrinsic parameters of the camera.

[0144] According to one or more embodiments of the present disclosure, in the position parameter acquisition device provided by the present disclosure, the acquisition module includes:

[0145] An acquisition unit, configured to acquire a corresponding visual speed according to the pose coordinate parameters in the candidate position parameters;

[0146] A determination unit is used to determine an algorithm error value of the preset image algorithm according to the visual speed and the inertial acceleration.

[0147] According to one or more embodiments of the present disclosure, in the position parameter acquisition device provided by the present disclosure, the determining unit is specifically used to:

[0148] Determining the inertial navigation velocity of the target image according to the inertial acceleration;

[0149] The ratio of the inertial navigation speed to the visual speed is calculated to determine the algorithm error value.

[0150] According to one or more embodiments of the present disclosure, in the position parameter acquisition device provided by the present disclosure, the determining unit is specifically used to: determine the corresponding visual acceleration according to the visual speed;

[0151] The ratio of the inertial acceleration to the visual acceleration is calculated to determine the algorithm error value.

[0152] According to one or more embodiments of the present disclosure, in the position parameter acquisition device provided by the present disclosure, the correction module is specifically used to:

[0153] The product of the algorithm error value and the candidate position parameter is calculated to determine the target position parameter.

[0154] According to one or more embodiments of the present disclosure, in the position parameter acquisition device provided by the present disclosure, when there are multiple target images, the correction module is specifically used to:

[0155] Calculate the error mean of all algorithm error values ​​corresponding to the multiple target images;

[0156] The first candidate world coordinate is corrected according to the error mean.

[0157] According to one or more embodiments of the present disclosure, in the position parameter acquisition device provided by the present disclosure,

[0158] The acquisition module is further used to: acquire a first image coordinate of a first pixel point in the target image, and acquire a first world coordinate according to the target position parameter and the first image coordinate;

[0159] Acquire a second image coordinate of at least one second pixel point in the target image, and acquire a second world coordinate according to the target position parameter and the second image coordinate;

[0160] A distance measurement module is used to determine the real distance between the first pixel point and the second pixel point according to the first world coordinate and the second world coordinate when the at least one second pixel point is one.

[0161] According to one or more embodiments of the present disclosure, the position parameter acquisition device provided by the present disclosure further includes:

[0162] Building blocks, also used

[0163] When there are multiple at least one second pixel points, a three-dimensional model corresponding to the first pixel point and the multiple second pixel points is constructed according to the first world coordinate and the multiple second world coordinates.

[0164] According to one or more embodiments of the present disclosure, in the position parameter acquisition device provided by the present disclosure, the target position parameter includes:

[0165] Camera world coordinates and camera pose; and / or,

[0166] Camera rotation parameters and camera translation parameters.

[0167] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:

[0168] processor;

[0169] a memory for storing instructions executable by the processor;

[0170] The processor is used to read the executable instructions from the memory and execute the instructions to implement any of the position parameter acquisition methods provided in the present disclosure.

[0171] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute any of the position parameter acquisition methods provided by the present disclosure.

[0172] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0173] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0174] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for obtaining position parameters, characterized in that: The following steps are involved: According to a preset image algorithm, candidate position parameters of the target image in the continuous multiple frames of images are calculated; the candidate position parameters are scale-free position parameters in the image coordinate system; Acquire the inertial acceleration of the target image, and acquire the corresponding visual speed according to the posture coordinate parameters in the candidate position parameters, wherein the inertial acceleration is acceleration data in the world coordinate system; Determine the corresponding visual acceleration according to the visual speed, and calculate the ratio of the inertial acceleration to the visual acceleration to determine the algorithm error value; or determine the inertial navigation speed of the target image according to the inertial acceleration, and calculate the ratio of the inertial navigation speed to the visual speed to determine the algorithm error value, wherein the algorithm error value is the alignment ratio corresponding to the visual speed and the inertial acceleration; The candidate position parameters are corrected according to the algorithm error value to obtain target position parameters; the target position parameters are scaled position parameters in the world coordinate system.

2. The method according to claim 1, characterized in that The step of calculating candidate position parameters of a target image in a plurality of consecutive frames of images includes: Determine a plurality of pairs of feature points matching the target image with a reference image, wherein the reference image is a previous frame image adjacent to the target image in the continuous multiple frames of images; The candidate position parameters of the target image frame are calculated according to the coordinates of the multiple pairs of feature points and the intrinsic parameters of the camera.

3. The method according to claim 1, characterized in that The step of correcting the candidate position parameter according to the algorithm error value to obtain the target position parameter includes: The product of the algorithm error value and the candidate position parameter is calculated to determine the target position parameter.

4. The method according to any one of claims 1 to 3, characterized in that: When there are multiple target images, the step of correcting the candidate position parameters according to the algorithm error value includes: Calculate the error mean of all algorithm error values ​​corresponding to the multiple target images; The candidate position parameters are modified according to the error mean.

5. The method according to claim 1, characterized in that Also includes: Acquire a first image coordinate of a first pixel point in the target image, and acquire a first world coordinate according to the target position parameter and the first image coordinate; Acquire a second image coordinate of at least one second pixel point in the target image, and acquire a second world coordinate according to the target position parameter and the second image coordinate; When the at least one second pixel point is one, the real distance between the first pixel point and the second pixel point is determined according to the first world coordinate and the second world coordinate.

6. The method according to claim 5, characterized in that Also includes: When there are multiple at least one second pixel points, a three-dimensional model corresponding to the first pixel point and the multiple second pixel points is constructed according to the first world coordinate and the multiple second world coordinates.

7. The method according to claim 1, characterized in that The target position parameters include: Camera world coordinates and camera pose; and / or, Camera rotation parameters and camera translation parameters.

8. A position parameter acquisition device, characterized in that: include: A calculation module, used to calculate candidate position parameters of a target image in a plurality of consecutive frames of images according to a preset image algorithm; The candidate position parameters are scale-free position parameters in the image coordinate system; An acquisition module, configured to acquire the inertial acceleration of the target image, and acquire the corresponding visual velocity according to the pose coordinate parameters in the candidate position parameters, wherein the inertial acceleration is acceleration data in a world coordinate system, and the corresponding visual acceleration is determined according to the visual velocity, and the ratio of the inertial acceleration to the visual acceleration is calculated to determine an algorithm error value; or, the inertial navigation velocity of the target image is determined according to the inertial acceleration, and the ratio of the inertial navigation velocity to the visual velocity is calculated to determine the algorithm error value, wherein the algorithm error value is an alignment ratio corresponding to the visual velocity and the inertial acceleration; A correction module is used to correct the candidate position parameters according to the algorithm error value to obtain target position parameters; the target position parameters are scaled position parameters in the world coordinate system.

9. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the position parameter acquisition method described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the position parameter acquisition method described in any one of claims 1 to 7.