


技术领域technical field
本申请属于定位技术领域,尤其涉及定位方法、装置及终端设备。The present application belongs to the technical field of positioning, and in particular relates to a positioning method, device and terminal equipment.
背景技术Background technique
随着科学技术的不断发展,各种终端设备如雨后春笋般出现在人们的生活中,比如全景相机。全景相机利用采集到的全景图像,能够实现较为强大的功能,例如,全景相机能够基于全景图像进行定位跟踪。然而,目前的全景相机定位的准确度较低。With the continuous development of science and technology, various terminal devices have sprung up in people's lives, such as panoramic cameras. The panoramic camera can realize relatively powerful functions by using the collected panoramic images, for example, the panoramic camera can perform positioning and tracking based on the panoramic images. However, the accuracy of current panoramic camera localization is low.
发明内容Contents of the invention
本申请实施例提供了一种定位方法、装置、终端设备及计算机可读存储介质,可以解决目前终端设备定位的准确度较低的问题。Embodiments of the present application provide a positioning method, device, terminal device, and computer-readable storage medium, which can solve the current problem of low positioning accuracy of terminal devices.
第一方面,本申请实施例提供了一种定位方法,包括:获取全景相机的初始姿态;获取初始的全景图像,以及获取全景图像姿态,所述全景图像姿态为:在所述初始的全景图像对应的曝光时刻下全景相机的姿态;根据所述初始姿态和所述全景图像姿态,对所述初始的全景图像进行调整,得到调整结果;根据所述调整结果对所述全景相机进行定位。In the first aspect, the embodiment of the present application provides a positioning method, including: obtaining the initial pose of the panoramic camera; obtaining the initial panoramic image, and obtaining the panoramic image pose, the panoramic image pose is: The posture of the panoramic camera at the corresponding exposure moment; adjusting the initial panoramic image according to the initial posture and the posture of the panoramic image to obtain an adjustment result; positioning the panoramic camera according to the adjustment result.
在第一方面的一种可能的实现方式中,所述根据所述初始姿态和所述全景图像姿态,对所述初始的全景图像进行调整,得到调整结果,包括:对所述初始姿态对应的四元数求逆,得到求逆结果;根据所述求逆结果和所述全景图像姿态对应的四元数,对所述初始的全景图像进行调整,得到调整结果。In a possible implementation manner of the first aspect, the adjusting the initial panoramic image according to the initial pose and the panoramic image pose to obtain an adjustment result includes: Inverting the quaternion to obtain an inversion result; adjusting the initial panoramic image according to the inversion result and the quaternion corresponding to the posture of the panoramic image to obtain an adjustment result.
在第一方面的一种可能的实现方式中,所述根据所述求逆结果和所述全景图像姿态对应的四元数,对所述初始的全景图像进行调整,包括:根据所述求逆结果和所述全景图像姿态对应的四元数,对所述初始的全景图像进行旋转,对应地,所述调整结果包括旋转后的全景图像。In a possible implementation manner of the first aspect, the adjusting the initial panoramic image according to the inversion result and the quaternion corresponding to the pose of the panoramic image includes: according to the inversion The result is a quaternion corresponding to the pose of the panoramic image, and the initial panoramic image is rotated, and correspondingly, the adjustment result includes the rotated panoramic image.
在第一方面的一种可能的实现方式中,所述初始的全景图像包括初始的第一图像和初始的第二图像,所述全景图像姿态包括第一图像姿态和第二图像姿态,所述第一图像姿态在所述初始的第一图像对应的曝光时刻下全景相机的姿态,所述第二图像姿态在所述初始的第二图像对应的曝光时刻下全景相机的姿态;对应地,所述根据所述初始姿态和所述全景图像姿态,对所述初始的全景图像进行调整,得到调整结果,包括:根据所述初始姿态和所述第一图像姿态,对所述初始的第一图像进行调整,以得到第一调整结果;根据所述初始姿态和所述第二图像姿态,对所述初始的第二图像进行调整,以得到第二调整结果;对应地,所述根据调整结果对所述全景相机进行定位包括:根据所述第一调整结果和所述第二调整结果对所述全景相机进行定位。In a possible implementation manner of the first aspect, the initial panoramic image includes an initial first image and an initial second image, the panoramic image pose includes a first image pose and a second image pose, and the The pose of the first image pose is the pose of the panoramic camera at the exposure moment corresponding to the initial first image, and the pose of the second image is the pose of the panoramic camera at the exposure moment corresponding to the initial second image; correspondingly, the The step of adjusting the initial panoramic image according to the initial posture and the posture of the panoramic image to obtain an adjustment result includes: adjusting the initial first image according to the initial posture and the posture of the first image performing adjustments to obtain a first adjustment result; adjusting the initial second image according to the initial pose and the second image pose to obtain a second adjustment result; correspondingly, according to the adjustment result The positioning of the panoramic camera includes: positioning the panoramic camera according to the first adjustment result and the second adjustment result.
在第一方面的一种可能的实现方式中,所述根据所述初始姿态和所述第一图像姿态,对所述初始的第一图像进行调整,以得到第一调整结果;根据所述初始姿态和所述第二图像姿态,对所述初始的第二图像进行调整,以得到第二调整结果,包括:对所述初始姿态对应的四元数求逆,得到求逆结果;根据所述求逆结果和所述第一图像姿态对应的四元数,对所述初始的第一图像进行调整,以得到第一调整结果;根据所述求逆结果和所述第二图像姿态对应的四元数,对所述初始的第二图像进行调整,以得到第二调整结果。In a possible implementation manner of the first aspect, the initial first image is adjusted according to the initial pose and the first image pose to obtain a first adjustment result; according to the initial posture and the posture of the second image, adjusting the initial second image to obtain a second adjustment result, including: inverting the quaternion corresponding to the initial posture to obtain an inversion result; according to the According to the quaternion corresponding to the inversion result and the first image pose, adjust the initial first image to obtain a first adjustment result; according to the quaternion corresponding to the inversion result and the second image pose arity, and adjust the initial second image to obtain a second adjustment result.
在第一方面的一种可能的实现方式中,所述定位方法还包括:根据所述第一调整结果和所述第二调整结果对所述全景相机进行跟踪。In a possible implementation manner of the first aspect, the positioning method further includes: tracking the panoramic camera according to the first adjustment result and the second adjustment result.
第二方面,本申请实施例提供了一种定位装置,包括:第一获取单元,用于获取全景相机的初始姿态;第二获取单元,用于获取初始的全景图像,以及获取全景图像姿态,所述全景图像姿态为:在所述初始的全景图像对应的曝光时刻下全景相机的姿态;调整单元,用于根据所述初始姿态和所述全景图像姿态,对所述初始的全景图像进行调整,得到调整结果;定位单元,根据所述调整结果对所述全景相机进行定位。In a second aspect, an embodiment of the present application provides a positioning device, including: a first acquisition unit, configured to acquire an initial pose of a panoramic camera; a second acquisition unit, used to acquire an initial panoramic image, and acquire a panoramic image pose, The panoramic image posture is: the posture of the panoramic camera at the exposure moment corresponding to the initial panoramic image; an adjustment unit is configured to adjust the initial panoramic image according to the initial posture and the panoramic image posture , to obtain an adjustment result; a positioning unit, configured to position the panoramic camera according to the adjustment result.
第三方面,本申请实施例提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述任一项所述的方法。In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and operable on the processor. When the processor executes the computer program, Implement any of the methods described above.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method described in any one of the foregoing is implemented.
可以理解的是,上述第二方面至第四方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the above-mentioned second aspect to the fourth aspect, reference can be made to the relevant description in the above-mentioned first aspect, and details are not repeated here.
本申请实施例与现有技术相比存在的有益效果是:本申请实施例能够获取全景相机的初始姿态;然后获取初始的全景图像,以及获取全景图像姿态,所述全景图像姿态为:在所述初始的全景图像对应的曝光时刻下全景相机的姿态;再根据所述初始姿态和所述全景图像姿态,对所述初始的全景图像进行调整,得到调整结果,调整结果(调整后的全景图像)可被视为全景相机在初始姿态下所拍摄到的图像;再根据所述调整结果对所述全景相机进行定位,如此,能够有效地避免因全景相机的大幅度运动所导致的定位失败,即能够优化全景相机的防抖效果,能够提高全景相机定位的准确度。The beneficial effect of the embodiment of the present application compared with the prior art is: the embodiment of the present application can obtain the initial pose of the panoramic camera; then obtain the initial panoramic image, and obtain the panoramic image pose, and the panoramic image pose is: The posture of the panoramic camera at the exposure moment corresponding to the initial panoramic image; then according to the initial posture and the panoramic image posture, the initial panoramic image is adjusted to obtain an adjustment result, and the adjustment result (adjusted panoramic image ) can be regarded as the image captured by the panoramic camera in the initial posture; and then the panoramic camera is positioned according to the adjustment result, so that the positioning failure caused by the large-scale movement of the panoramic camera can be effectively avoided, That is, the anti-shake effect of the panoramic camera can be optimized, and the positioning accuracy of the panoramic camera can be improved.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the accompanying drawings that need to be used in the descriptions of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are only for the present application For some embodiments, those of ordinary skill in the art can also obtain other drawings based on these drawings without creative effort.
图1是本申请一实施例提供的定位方法的流程示意图;FIG. 1 is a schematic flowchart of a positioning method provided by an embodiment of the present application;
图2是本申请一实施例提供的定位装置的流程示意图;Fig. 2 is a schematic flowchart of a positioning device provided by an embodiment of the present application;
图3是本申请一实施例提供的终端设备的示意图。Fig. 3 is a schematic diagram of a terminal device provided by an embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components, but does not exclude one or more other Presence or addition of features, wholes, steps, operations, elements, components and/or collections thereof.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the description of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当…时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this specification and the appended claims, the term "if" may be construed as "when" or "once" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be construed, depending on the context, to mean "once determined" or "in response to the determination" or "once detected [the described condition or event] ]” or “in response to detection of [described condition or event]”.
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification and the appended claims of the present application, the terms "first", "second", "third" and so on are only used to distinguish descriptions, and should not be understood as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.
实施例一Embodiment one
图1示出了本申请实施例提供的一种定位方法的流程示意图,该定位方法可应用于终端设备,作为示例而非限定的是,该终端设备为服务器或者全景相机。所述定位方法包括步骤S101、步骤S102、步骤S103以及步骤S104。详述如下:FIG. 1 shows a schematic flowchart of a positioning method provided by an embodiment of the present application. The positioning method can be applied to a terminal device. As an example but not a limitation, the terminal device is a server or a panoramic camera. The positioning method includes step S101, step S102, step S103 and step S104. The details are as follows:
步骤S101、获取全景相机的初始姿态。Step S101, acquiring the initial pose of the panoramic camera.
作为示例而非限定的是,全景相机的初始姿态可以用四元数表示,全景相机中可设置有惯性测量单元,全景相机可基于惯性测量单元中的陀螺仪所采集到的数据和加速度计所采集到的数据计算出四元数。As an example and not limitation, the initial attitude of the panoramic camera can be represented by a quaternion, an inertial measurement unit can be arranged in the panoramic camera, and the panoramic camera can be based on the data collected by the gyroscope in the inertial measurement unit and the data collected by the accelerometer. The collected data is calculated into a quaternion.
步骤S102、获取初始的全景图像,以及获取全景图像姿态,所述全景图像姿态为:在所述初始的全景图像对应的曝光时刻下全景相机的姿态。Step S102 , acquiring an initial panoramic image, and acquiring a panoramic image pose, the panoramic image pose being the pose of the panoramic camera at the exposure moment corresponding to the initial panoramic image.
其中,所述全景图像姿态和所述初始姿态为全景相机在不同时刻下的姿态。Wherein, the panoramic image pose and the initial pose are poses of the panoramic camera at different moments.
作为示例而非限定的是,该全景相机能够在时刻T0时进行曝光,以获取全景图像P1,以及获取全景图像姿态R1,全景图像姿态R1为在时刻T0时全景相机的姿态。所述初始的全景图像指的是未经过步骤S103处理的全景图像。As an example and not limitation, the panoramic camera can perform exposure at time T0 to obtain a panoramic image P1 , and obtain a panoramic image pose R1 , the panoramic image pose R1 is the pose of the panoramic camera at time T0 . The initial panoramic image refers to a panoramic image that has not been processed in step S103.
步骤S 103、根据所述初始姿态和所述全景图像姿态,对所述初始的全景图像进行调整,得到调整结果。Step S 103. Adjust the initial panoramic image according to the initial pose and the panoramic image pose to obtain an adjustment result.
作为示例而非限定的是,该初始的全景图像为球面全景图,所述步骤S103包括:根据所述初始姿态和所述全景图像姿态,将该初始的全景图像进行旋转。其中,所述将该初始的全景图像进行旋转可包括:将该初始的全景图像绕着全景球的指定轴进行旋转,其中,所述全景球为该全景相机所拍摄出的球面全景图像所对应的球体。As an example and not limitation, the initial panoramic image is a spherical panoramic image, and the step S103 includes: rotating the initial panoramic image according to the initial pose and the pose of the panoramic image. Wherein, the rotating the initial panoramic image may include: rotating the initial panoramic image around a designated axis of a panoramic sphere, wherein the panoramic sphere corresponds to the spherical panoramic image captured by the panoramic camera sphere.
可选地,所述步骤S103包括:对所述初始姿态对应的四元数求逆,得到求逆结果;根据所述求逆结果和所述全景图像姿态对应的四元数,对所述初始的全景图像进行调整,得到调整结果。Optionally, the step S103 includes: inverting the quaternion corresponding to the initial pose to obtain an inversion result; according to the inversion result and the quaternion corresponding to the panoramic image pose, inverting the The panoramic image is adjusted to obtain the adjustment result.
其中,所述初始姿态对应的四元数为能够表示该初始姿态的四元数;所述全景图像姿态对应的四元数为能够表示所述全景图像姿态的四元数。Wherein, the quaternion corresponding to the initial pose is a quaternion capable of representing the initial pose; the quaternion corresponding to the pose of the panoramic image is a quaternion capable of representing the pose of the panoramic image.
在一些实施例中,所述根据所述求逆结果和所述全景图像姿态对应的四元数,对所述初始的全景图像进行调整,包括:根据所述求逆结果和所述全景图像姿态对应的四元数,对所述初始的全景图像进行旋转,对应地,所述调整结果包括旋转后的全景图像。如此,能够提高全景相机定位的准确度。In some embodiments, the adjusting the initial panoramic image according to the inversion result and the quaternion corresponding to the panoramic image pose includes: according to the inversion result and the panoramic image pose Corresponding to the quaternion, the initial panoramic image is rotated, and correspondingly, the adjustment result includes the rotated panoramic image. In this way, the accuracy of positioning the panoramic camera can be improved.
具体地,该初始的全景图像为未旋转过的球面全景图,根据所述求逆结果和所述全景图像姿态对应的四元数,将该初始的全景图像绕着全景球的指定轴进行旋转。Specifically, the initial panoramic image is an unrotated spherical panoramic image, and the initial panoramic image is rotated around the specified axis of the panoramic sphere according to the inversion result and the quaternion corresponding to the posture of the panoramic image .
作为示例而非限定的是,该全景球包括南极和北极,所述指定轴可为从南极指向北极的轴,将该初始的全景图像绕着指定轴进行旋转。As an example and not limitation, the panoramic sphere includes a south pole and a north pole, the specified axis may be an axis pointing from the south pole to the north pole, and the initial panoramic image is rotated around the specified axis.
在一些实施例中,所述初始姿态对应的四元数可用R0表示,对所述初始姿态对应的四元数求逆,得到求逆结果,求逆结果可用表示,所述全景图像姿态对应的四元数R1、所述初始的全景图像P1、所述调整结果/>满足以下关系:/>In some embodiments, the quaternion corresponding to the initial posture can be represented by R0 , and the quaternion corresponding to the initial posture is inverted to obtain the inverse result, which can be used Indicates that the quaternion R1 corresponding to the pose of the panoramic image, the initial panoramic image P1 , the adjustment result /> The following relationship is satisfied: />
步骤S104、根据所述调整结果对所述全景相机进行定位。Step S104. Position the panoramic camera according to the adjustment result.
具体地,所述调整结果为调整后的全景图像,例如,所述调整结果为旋转后的全景图像,根据旋转后的全景图像确定所述全景相机所在的位置。Specifically, the adjustment result is an adjusted panoramic image, for example, the adjustment result is a rotated panoramic image, and the position of the panoramic camera is determined according to the rotated panoramic image.
在一些实施里中,所述初始的全景图像包括初始的第一图像和初始的第二图像,所述全景图像姿态包括第一图像姿态和第二图像姿态,所述第一图像姿态在所述初始的第一图像对应的曝光时刻下全景相机的姿态,所述第二图像姿态在所述初始的第二图像对应的曝光时刻下全景相机的姿态;对应地,所述根据所述初始姿态和所述全景图像姿态,对所述初始的全景图像进行调整,得到调整结果,包括:根据所述初始姿态和所述第一图像姿态,对所述初始的第一图像进行调整,以得到第一调整结果;根据所述初始姿态和所述第二图像姿态,对所述初始的第二图像进行调整,以得到第二调整结果;对应地,所述根据调整结果对所述全景相机进行定位包括:根据所述第一调整结果和所述第二调整结果对所述全景相机进行定位。In some implementations, the initial panoramic image includes an initial first image and an initial second image, the panoramic image pose includes a first image pose and a second image pose, the first image pose is in the The posture of the panoramic camera at the exposure moment corresponding to the initial first image, and the posture of the panoramic camera at the exposure moment corresponding to the second image in the second image; correspondingly, according to the initial posture and The panoramic image pose, adjusting the initial panoramic image to obtain an adjustment result includes: adjusting the initial first image according to the initial pose and the first image pose to obtain a first Adjusting the result; adjusting the initial second image according to the initial posture and the second image posture to obtain a second adjustment result; correspondingly, the positioning of the panoramic camera according to the adjustment result includes : Positioning the panoramic camera according to the first adjustment result and the second adjustment result.
其中,第一调整结果为调整后的第一图像,第二调整结果为调整后的第二图像。Wherein, the first adjustment result is the adjusted first image, and the second adjustment result is the adjusted second image.
作为示例而非限定的是,所述初始的第一图像和所述初始的第二图像为两帧相邻的图像。As an example but not a limitation, the initial first image and the initial second image are images of two adjacent frames.
在一些实施例中,所述根据所述初始姿态和所述第一图像姿态,对所述初始的第一图像进行调整,以得到第一调整结果;根据所述初始姿态和所述第二图像姿态,对所述初始的第二图像进行调整,以得到第二调整结果,包括:对所述初始姿态对应的四元数求逆,得到求逆结果;根据所述求逆结果和所述第一图像姿态对应的四元数,对所述初始的第一图像进行调整,以得到第一调整结果;根据所述求逆结果和所述第二图像姿态对应的四元数,对所述初始的第二图像进行调整,以得到第二调整结果。In some embodiments, according to the initial pose and the first image pose, the initial first image is adjusted to obtain a first adjustment result; according to the initial pose and the second image attitude, adjusting the initial second image to obtain a second adjustment result, including: inverting the quaternion corresponding to the initial attitude to obtain an inversion result; according to the inversion result and the first A quaternion corresponding to an image pose, adjusting the initial first image to obtain a first adjustment result; according to the inversion result and the quaternion corresponding to the second image pose, adjusting the initial The second image is adjusted to obtain the second adjustment result.
其中,所述初始姿态对应的四元数可用R0表示,对所述初始姿态对应的四元数求逆,得到求逆结果,求逆结果可用表示,所述第一图像姿态对应的四元数R11、所述初始的第一图像P11、所述第一调整结果/>满足以下关系:/>所述第二图像姿态对应的四元数R12、所述初始的第二图像P12、所述第二调整结果/>满足以下关系:Wherein, the quaternion corresponding to the initial posture can be represented byR0 , and the quaternion corresponding to the initial posture is inverted to obtain the inversion result, and the inversion result can be obtained by Indicates that the quaternion R11 corresponding to the first image pose, the initial first image P11 , the first adjustment result/> The following relationship is satisfied: /> The quaternion R12 corresponding to the pose of the second image, the initial second image P12 , the second adjustment result/> Satisfy the following relationship:
在一些实施例中,所述定位方法还包括:根据所述第一调整结果和所述第二调整结果对所述全景相机进行跟踪。In some embodiments, the positioning method further includes: tracking the panoramic camera according to the first adjustment result and the second adjustment result.
具体地,所述根据所述第一调整结果和所述第二调整结果对所述全景相机进行定位包括:根据所述第一调整结果对所述全景相机进行定位,以得到第一定位信息,根据所述第二调整结果对所述全景相机进行定位,以得到第二定位信息,其中,第一定位信息用于表示在所述初始的第一图像对应的曝光时刻下全景相机所在的位置,第二定位信息用于表示在所述初始的第二图像对应的曝光时刻下全景相机所在的位置,所述根据所述第一调整结果和所述第二调整结果对所述全景相机进行跟踪包括:根据所述第一定位信息和所述第二定位信息对所述全景相机进行跟踪。Specifically, the positioning of the panoramic camera according to the first adjustment result and the second adjustment result includes: positioning the panoramic camera according to the first adjustment result to obtain first positioning information, Positioning the panoramic camera according to the second adjustment result to obtain second positioning information, wherein the first positioning information is used to indicate the position of the panoramic camera at the exposure moment corresponding to the initial first image, The second positioning information is used to indicate the position of the panoramic camera at the exposure moment corresponding to the initial second image, and the tracking of the panoramic camera according to the first adjustment result and the second adjustment result includes : Tracking the panoramic camera according to the first positioning information and the second positioning information.
其中,第一调整结果为调整后的第一图像,第二调整结果为调整后的第二图像。第一调整结果可被视为全景相机在所述初始姿态下所拍摄到的全景图像,第二调整结果也可被视为全景相机在所述初始姿态下所拍摄到的全景图像;因此,第一调整结果到第二调整结果的画面变化幅度比较小,将第一调整结果和第二调整结果作为图像作为即时定位与地图构建(Simultaneous Localization and Mapping,SLAM)跟踪的源图像,能够有效地降低SLAM跟踪的失败率。Wherein, the first adjustment result is the adjusted first image, and the second adjustment result is the adjusted second image. The first adjustment result can be regarded as the panoramic image captured by the panoramic camera in the initial posture, and the second adjustment result can also be regarded as the panoramic image captured by the panoramic camera in the initial posture; therefore, the first The picture change range from the first adjustment result to the second adjustment result is relatively small, and the first adjustment result and the second adjustment result are used as images as source images for real-time positioning and map construction (Simultaneous Localization and Mapping, SLAM) tracking, which can effectively reduce the Failure rate of SLAM tracking.
本申请实施例能够获取全景相机的初始姿态;然后获取初始的全景图像,以及获取全景图像姿态,所述全景图像姿态为:在所述初始的全景图像对应的曝光时刻下全景相机的姿态;再根据所述初始姿态和所述全景图像姿态,对所述初始的全景图像进行调整,得到调整结果,调整结果(调整后的全景图像)可被视为全景相机在初始姿态下所拍摄到的图像;再根据所述调整结果对所述全景相机进行定位,如此,能够有效地避免因全景相机的大幅度运动所导致的定位失败,即能够优化全景相机的防抖效果,能够提高全景相机定位的准确度。The embodiment of the present application can obtain the initial posture of the panoramic camera; then obtain the initial panoramic image, and obtain the posture of the panoramic image, the posture of the panoramic image is: the posture of the panoramic camera at the exposure moment corresponding to the initial panoramic image; and then According to the initial posture and the panoramic image posture, the initial panoramic image is adjusted to obtain an adjustment result, and the adjustment result (adjusted panoramic image) can be regarded as an image captured by the panoramic camera at the initial posture The panoramic camera is positioned according to the adjustment result, so that the positioning failure caused by the large-scale motion of the panoramic camera can be effectively avoided, that is, the anti-shake effect of the panoramic camera can be optimized, and the positioning accuracy of the panoramic camera can be improved. Accuracy.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
实施例二Embodiment two
对应于上文实施例所述的定位方法,图2示出了本申请实施例提供的定位装置的示意图,为了便于说明,仅示出了与本申请实施例相关的部分。该定位装置包括:第一获取单元201、第二获取单元202、调整单元203以及定位单元204。Corresponding to the positioning method described in the above embodiments, FIG. 2 shows a schematic diagram of a positioning device provided by the embodiment of the present application. For the convenience of description, only the parts related to the embodiment of the present application are shown. The positioning device includes: a
第一获取单元201,用于获取全景相机的初始姿态;The
第二获取单元202,用于获取初始的全景图像,以及获取全景图像姿态,所述全景图像姿态为:在所述初始的全景图像对应的曝光时刻下全景相机的姿态;The second acquiring
调整单元203,用于根据所述初始姿态和所述全景图像姿态,对所述初始的全景图像进行调整,得到调整结果;An
定位单元204,根据所述调整结果对所述全景相机进行定位。The
在一些实施例中,所述定位装置还包括:跟踪单元。In some embodiments, the positioning device further includes: a tracking unit.
跟踪单元用于根据所述第一调整结果和所述第二调整结果对所述全景相机进行跟踪。The tracking unit is configured to track the panoramic camera according to the first adjustment result and the second adjustment result.
本申请实施例能够获取全景相机的初始姿态;然后获取初始的全景图像,以及获取全景图像姿态,所述全景图像姿态为:在所述初始的全景图像对应的曝光时刻下全景相机的姿态;再根据所述初始姿态和所述全景图像姿态,对所述初始的全景图像进行调整,得到调整结果,调整结果(调整后的全景图像)可被视为全景相机在初始姿态下所拍摄到的图像;再根据所述调整结果对所述全景相机进行定位,如此,能够有效地避免因全景相机的大幅度运动所导致的定位失败,即能够优化全景相机的防抖效果,能够提高全景相机定位的准确度。The embodiment of the present application can obtain the initial posture of the panoramic camera; then obtain the initial panoramic image, and obtain the posture of the panoramic image, the posture of the panoramic image is: the posture of the panoramic camera at the exposure moment corresponding to the initial panoramic image; and then According to the initial posture and the panoramic image posture, the initial panoramic image is adjusted to obtain an adjustment result, and the adjustment result (adjusted panoramic image) can be regarded as an image captured by the panoramic camera at the initial posture The panoramic camera is positioned according to the adjustment result, so that the positioning failure caused by the large-scale motion of the panoramic camera can be effectively avoided, that is, the anti-shake effect of the panoramic camera can be optimized, and the positioning accuracy of the panoramic camera can be improved. Accuracy.
需要说明的是,未在本实施例中详尽描述的技术细节,可参见上述实施例一中的各个实施例所提供的定位方法。It should be noted that for technical details not described in detail in this embodiment, reference may be made to the positioning methods provided by the various embodiments in the first embodiment above.
实施例三Embodiment three
本实施例中的终端设备3包括:至少一个处理器30、存储器31以及存储在所述存储器31中并可在所述至少一个处理器30上运行的计算机程序32,所述处理器30执行所述计算机程序32时实现上述任意各个定位方法实施例中的步骤。The
所述处理器30执行所述计算机程序32时实现上述各个定位方法实施例中的步骤,例如图1所示的步骤S101至步骤S104。或者,处理器30执行所述计算机程序32时实现上述各装置实施例中各单元的功能,例如,图2所示单元201至204的功能。作为示例而非限定的是,所述终端设备3可为全景相机。When the
本领域技术人员可以理解,本实施例仅是终端设备3的举例,并不构成对终端设备3的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。Those skilled in the art can understand that this embodiment is only an example of the
所称处理器30可以是中央处理单元(Central Processing Unit,CPU),该处理器30还可以是其他通用处理器30、数字信号处理器30(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器30可以是微处理器30或者该处理器30也可以是任何常规的处理器30等。The so-called
所述存储器31在一些实施例中可以是所述终端设备3的内部存储单元,例如终端设备3的硬盘或内存。所述存储器31在另一些实施例中也可以是所述终端设备3的外部存储设备,例如所述终端设备3上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器31还可以既包括所述终端设备3的内部存储单元也包括外部存储设备。所述存储器31用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序32的程序代码等。所述存储器31还可以用于暂时地存储已经输出或者将要输出的数据。The
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction and execution process between the above-mentioned devices/units are based on the same concept as the method embodiment of the present application, and its specific functions and technical effects can be found in the method embodiment section. I won't repeat them here.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used for illustration. In practical applications, the above-mentioned functions can be assigned to different functional units, Completion of modules means that the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit, and the above-mentioned integrated units may adopt hardware It can also be implemented in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above system, reference may be made to the corresponding processes in the aforementioned method embodiments, and details will not be repeated here.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序32,所述计算机程序32被处理器30执行时实现可实现上述各个方法实施例中的步骤。The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a
本申请实施例提供了一种计算机程序32产品,当计算机程序32产品在终端设备3上运行时,使得终端设备3执行时实现可实现上述各个方法实施例中的步骤。The embodiment of the present application provides a
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序32来指令相关的硬件来完成,所述的计算机程序32可存储于一计算机可读存储介质中,该计算机程序32在被处理器30执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序32包括计算机程序32代码,所述计算机程序32代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序32代码携带到终端设备3的任何实体或装置、记录介质、计算机存储器31、只读存储器31(ROM,Read-Only Memory)、随机存取存储器31(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above-mentioned embodiments in the present application can be completed by instructing related hardware through the
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed device/network device and method may be implemented in other ways. For example, the device/network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still implement the foregoing embodiments Modifications to the technical solutions described in the examples, or equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the application, and should be included in the Within the protection scope of this application.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211721726.5ACN116295282A (en) | 2022-12-30 | 2022-12-30 | Positioning method and device and terminal equipment |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211721726.5ACN116295282A (en) | 2022-12-30 | 2022-12-30 | Positioning method and device and terminal equipment |
| Publication Number | Publication Date |
|---|---|
| CN116295282Atrue CN116295282A (en) | 2023-06-23 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211721726.5APendingCN116295282A (en) | 2022-12-30 | 2022-12-30 | Positioning method and device and terminal equipment |
| Country | Link |
|---|---|
| CN (1) | CN116295282A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004185132A (en)* | 2002-11-29 | 2004-07-02 | Canon Inc | Image processing method and apparatus |
| CN105208247A (en)* | 2015-09-02 | 2015-12-30 | 长春理工大学 | Quaternion-based panoramic image stabilizing method |
| CN110209847A (en)* | 2019-04-29 | 2019-09-06 | 中国科学院遥感与数字地球研究所 | Quasi real time processing method, device and storage medium on Airborne Data Classification machine |
| CN111192323A (en)* | 2020-04-10 | 2020-05-22 | 支付宝(杭州)信息技术有限公司 | Image-based object localization method and device |
| CN114460617A (en)* | 2020-11-03 | 2022-05-10 | 阿里巴巴集团控股有限公司 | Positioning method, apparatus, electronic device, and computer-readable storage medium |
| CN114463374A (en)* | 2021-12-16 | 2022-05-10 | 杭州环峻科技有限公司 | Visual SLAM method and system based on panoramic annular camera |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004185132A (en)* | 2002-11-29 | 2004-07-02 | Canon Inc | Image processing method and apparatus |
| CN105208247A (en)* | 2015-09-02 | 2015-12-30 | 长春理工大学 | Quaternion-based panoramic image stabilizing method |
| CN110209847A (en)* | 2019-04-29 | 2019-09-06 | 中国科学院遥感与数字地球研究所 | Quasi real time processing method, device and storage medium on Airborne Data Classification machine |
| CN111192323A (en)* | 2020-04-10 | 2020-05-22 | 支付宝(杭州)信息技术有限公司 | Image-based object localization method and device |
| CN114460617A (en)* | 2020-11-03 | 2022-05-10 | 阿里巴巴集团控股有限公司 | Positioning method, apparatus, electronic device, and computer-readable storage medium |
| CN114463374A (en)* | 2021-12-16 | 2022-05-10 | 杭州环峻科技有限公司 | Visual SLAM method and system based on panoramic annular camera |
| Publication | Publication Date | Title |
|---|---|---|
| US10789676B2 (en) | Image processing device, image processing method, and program | |
| CN103026385B (en) | Method, apparatus and computer program product for providing object tracking using template switching and feature adaptation | |
| CN110784651B (en) | A kind of anti-shake method and electronic device | |
| CN112348863B (en) | Image alignment method, image alignment device and terminal equipment | |
| TW201918772A (en) | Apparatus and method of five dimensional (5D) video stabilization with camera and gyroscope fusion | |
| WO2021114990A1 (en) | Method and apparatus for correcting face distortion, electronic device, and storage medium | |
| CN108776822B (en) | Target area detection method, device, terminal and storage medium | |
| CN113608641B (en) | Adjustment method, device, smart speaker and storage medium for curved screen display position | |
| CN111754435A (en) | Image processing method, apparatus, terminal device, and computer-readable storage medium | |
| CN110163914B (en) | vision-based positioning | |
| CN113052915A (en) | Camera external parameter calibration method and device, augmented reality system, terminal device and storage medium | |
| CN112261262B (en) | Image calibration method and device, electronic equipment and readable storage medium | |
| CN111340722A (en) | Image processing method, processing device, terminal device and readable storage medium | |
| CN116134476B (en) | Plane correction method and device, computer readable medium and electronic device | |
| CN114170366A (en) | Three-dimensional reconstruction method based on dotted line feature fusion and electronic equipment | |
| US20220086350A1 (en) | Image Generation Method and Apparatus, Terminal and Corresponding Storage Medium | |
| CN116295282A (en) | Positioning method and device and terminal equipment | |
| CN112945231A (en) | IMU and rigid body posture alignment method, device, equipment and readable storage medium | |
| CN116128738A (en) | Image processing method and terminal equipment | |
| CN114913105A (en) | Laser point cloud fusion method, device, server and computer-readable storage medium | |
| CN114549348A (en) | Panoramic image denoising method and device, server and readable storage medium | |
| JP5651975B2 (en) | Image browsing device and camera | |
| CN119183022B (en) | Video generation method and device and panoramic camera | |
| CN118400594B (en) | Image stitching method, device and panoramic camera | |
| CN115035186B (en) | Target object marking method and terminal equipment |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |