METADATA 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. Metadata-Version: 2.4
  2. Name: poselib
  3. Version: 2.0.5
  4. Summary: RANSAC + collection of minimal solvers for camera pose estimation.
  5. Author: Viktor Larsson and contributors
  6. Author-email: Viktor Larsson and contributors <viktor.larsson@math.lth.se>
  7. License: BSD 3-Clause License
  8. Copyright (c) 2020, Viktor Larsson
  9. All rights reserved.
  10. Redistribution and use in source and binary forms, with or without
  11. modification, are permitted provided that the following conditions are met:
  12. 1. Redistributions of source code must retain the above copyright notice, this
  13. list of conditions and the following disclaimer.
  14. 2. Redistributions in binary form must reproduce the above copyright notice,
  15. this list of conditions and the following disclaimer in the documentation
  16. and/or other materials provided with the distribution.
  17. 3. Neither the name of the copyright holder nor the names of its
  18. contributors may be used to endorse or promote products derived from
  19. this software without specific prior written permission.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  23. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  24. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  26. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  27. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. Requires-Python: >=3.8
  31. Description-Content-Type: text/markdown
  32. License-File: LICENSE
  33. Requires-Dist: numpy
  34. Provides-Extra: test
  35. Requires-Dist: pytest>=8.3.5; extra == "test"
  36. Dynamic: author
  37. Dynamic: license-file
  38. ![GitHub release (latest by date)](https://img.shields.io/github/v/release/PoseLib/PoseLib)
  39. [![Conan Center](https://img.shields.io/conan/v/poselib)](https://conan.io/center/recipes/poselib)
  40. ![PyPI](https://img.shields.io/pypi/v/poselib)
  41. # PoseLib
  42. This library provides a collection of minimal solvers for camera pose estimation. The focus is on calibrated absolute pose estimation problems from different types of correspondences (e.g. point-point, point-line, line-point, line-line).
  43. The goals of this project are to provide
  44. * Fast and robust implementation of the current state-of-the-art solvers.
  45. * Consistent calling interface between different solvers.
  46. * Minimize dependencies, both external (currently only [Eigen](http://eigen.tuxfamily.org/)) and internal. Each solver is (mostly) stand-alone, making it easy to extract only a specific solver to integrate into other frameworks.
  47. * Robust estimators (based on LO-RANSAC) that just works out-of-the-box for most cases.
  48. # Robust Estimation and Non-linear Refinement
  49. We provide robust estimators for the most common problems
  50. * Absolute pose from points (and lines)
  51. * Essential / Fundamental matrix
  52. * Homography
  53. * Generalized relative pose
  54. It is fairly straight-forward to implement robust estimators for other problems. See for example [absolute_pose.h](PoseLib/robust/estimators/absolute_pose.h). If you implement estimators for other problems, please consider submitting a pull-request.
  55. In [robust.h](PoseLib/robust.h) we provide interfaces which normalizes the data, calls the RANSAC and runs a post-RANSAC non-linear refinement. It is also possible to directly call the individual components as well (see e.g. [ransac.h](PoseLib/robust/ransac.h), [bundle.h](PoseLib/robust/bundle.h), etc.). The RANSAC is straight-forward implementation of LO-RANSAC which generate hypothesis with minimal solvers and relies on non-linear refinement for refitting.
  56. The robust estimator takes the following options
  57. ```c++
  58. struct RansacOptions {
  59. size_t max_iterations = 100000;
  60. size_t min_iterations = 1000;
  61. double dyn_num_trials_mult = 3.0;
  62. double success_prob = 0.9999;
  63. double max_reproj_error = 12.0; // used for 2D-3D matches
  64. double max_epipolar_error = 1.0; // used for 2D-2D matches
  65. unsigned long seed = 0;
  66. // If we should use PROSAC sampling. Assumes data is sorted
  67. bool progressive_sampling = false;
  68. size_t max_prosac_iterations = 100000;
  69. // Whether to use real focal length checking for F estimation: https://arxiv.org/abs/2311.16304
  70. // Assumes that principal points of both cameras are at origin.
  71. bool real_focal_check = false;
  72. // Whether to treat the input 'best_model' as an initial model and score it before running the main RANSAC loop
  73. bool score_initial_model = false;
  74. };
  75. ```
  76. and the non-linear refinement
  77. ```c++
  78. struct BundleOptions {
  79. size_t max_iterations = 100;
  80. enum LossType {
  81. TRIVIAL, TRUNCATED, HUBER, CAUCHY, TRUNCATED_LE_ZACH
  82. } loss_type = LossType::CAUCHY;
  83. double loss_scale = 1.0;
  84. double gradient_tol = 1e-8;
  85. double step_tol = 1e-8;
  86. double initial_lambda = 1e-3;
  87. double min_lambda = 1e-10;
  88. double max_lambda = 1e10;
  89. bool verbose = false;
  90. };
  91. ```
  92. Note that in [robust.h](PoseLib/robust.h) this is only used for the post-RANSAC refinement.
  93. In [bundle.h](PoseLib/robust/bundle.h) we provide non-linear refinement for different problems. Mainly minimizing reprojection error and Sampson error as these performed best in our internal evaluations. These are used in the LO-RANSAC to perform non-linear refitting. Most estimators directly minimize the MSAC score (using `loss_type = TRUNCATED` and `loss_scale = threshold`) over all input correspondences. In practice we found that this works quite well and avoids recursive LO where inliers are added in steps.
  94. ## Camera models
  95. PoseLib use [COLMAP](https://colmap.github.io/cameras.html)-compatible camera models. These are defined in [colmap_models.h](PoseLib/misc/colmap_models.h). Currently we only support
  96. * SIMPLE_PINHOLE
  97. * PINHOLE
  98. * SIMPLE_RADIAL
  99. * RADIAL
  100. * OPENCV
  101. * OPENCV_FISHEYE
  102. but it is relatively straight-forward to add other models. If you do so please consider opening a pull-request. In contrast to COLMAP, we require analytical jacobians for the distortion mappings which make it a bit more work to port them.
  103. The `Camera` struct currently contains `width`/`height` fields, however these are not used anywhere in the code-base and are provided simply to be consistent with COLMAP. The `Camera` class also provides the helper function `initialize_from_txt(str)` which initializes the camera from a line given by the `cameras.txt` file of a COLMAP reconstruction.
  104. The python bindings also expose the `poselib.Camera` class with `focal(), focal_x(), focal_y(), model_name(), prinicipal_point()` read-only methods and a read-write `params` property, but currently this is only used as a return type for some methods. To supply camera information to robust estimators you should use python `dicts` as shown below.
  105. ## Python bindings
  106. The python bindings can be installed by running `pip install .`. The python bindings expose all minimal solvers, e.g. `poselib.p3p(x,X)`, as well as all robust estimators from [robust.h](PoseLib/robust.h).
  107. Examples of how the robust estimators can be called are
  108. ```python
  109. camera = {'model': 'SIMPLE_PINHOLE', 'width': 1200, 'height': 800, 'params': [960, 600, 400]}
  110. pose, info = poselib.estimate_absolute_pose(p2d, p3d, camera, {'max_reproj_error': 16.0}, {})
  111. ```
  112. or
  113. ```python
  114. F, info = poselib.estimate_fundamental_matrix(p2d_1, p2d_2, {'max_epipolar_error': 0.75, 'progressive_sampling': True}, {})
  115. ```
  116. The return value `info` is a dict containing information about the robust estimation (inliers, iterations, etc). The last two options are dicts which describe the `RansacOptions` and `BundleOptions`. Ommited values are set to their default (see above), except for the `loss_scale` used for the Cauchy loss which is set to half of the threshold used in RANSAC (which seems to be a good heuristic). Dicts with the default options can be obtained as `opt = poselib.RansacOptions()` or `poselib.BundleOptions()`.
  117. Some of the available estimators are listed below, check [pyposelib.cpp](pybind/pyposelib.cc) and [robust.h](PoseLib/robust.h) for more details. The table also shows which error threshold is used in the estimation (`RansacOptions.max_reproj_error` or `RansacOptions.max_epipolar_error`). All thresholds are given in pixels.
  118. | Method | Arguments | (RansacOptions) Threshold |
  119. | --- | --- | --- |
  120. | <sub>`estimate_absolute_pose`</sub> | <sub> `(p2d, p3d, camera, ransac_opt, bundle_opt, initial_pose=None)`</sub> | <sub>`max_reproj_error` </sub> |
  121. | <sub>`estimate_absolute_pose_pnpl`</sub> | <sub>`(p2d, p3d, l2d_1, l2d_2, l3d_1, l3d_2, camera, ransac_opt, bundle_opt, initial_pose=None)` </sub> | <sub>`max_reproj_error` (points), `max_epipolar_error` (lines) |
  122. | <sub>`estimate_generalized_absolute_pose` | <sub>`(p2ds, p3ds, camera_ext, cameras, ransac_opt, bundle_opt, initial_pose=None)`</sub> | <sub>`max_reproj_error`</sub> |
  123. | <sub>`estimate_relative_pose`</sub> | <sub>`(x1, x2, camera1, camera2, ransac_opt, bundle_opt, initial_pose=None)`</sub> | <sub>`max_epipolar_error` </sub>|
  124. | <sub>`estimate_shared_focal_relative_pose`</sub> | <sub>`(x1, x2, pp, ransac_opt, bundle_opt, initial_image_pair=None)`</sub> | <sub>`max_epipolar_error` </sub>|
  125. | <sub>`estimate_fundamental`</sub> | <sub>`(x1, x2, ransac_opt, bundle_opt, initial_F=None)`</sub> | <sub>`max_epipolar_error`</sub> |
  126. | <sub>`estimate_homography`</sub> | <sub>`(x1, x2, ransac_opt, bundle_opt, initial_H=None)`</sub> | <sub>`max_reproj_error`</sub> |
  127. | <sub>`estimate_generalized_relative_pose`</sub> | <sub>`(matches, camera1_ext, cameras1, camera2_ext, cameras2, ransac_opt, bundle_opt, initial_pose=None)`</sub> | <sub>`max_epipolar_error`</sub> |
  128. ### Storing poses and estimated camera parameters
  129. To handle poses and cameras we provide the following classes:
  130. - `CameraPose`: This class is the return type for the most of the methods. While the class internally represent the pose with `q` and `t`, it also exposes `R` (3x3) and `Rt` (3x4) which are read/write, i.e. you can do `pose.R = Rnew` and it will update the underlying quaternion `q`.
  131. - `Image`: Following COLMAP, this class stores information about the camera (`image.camera`) and its pose (`image.pose`) used to take an image.
  132. - `ImagePair`: This class holds information about two cameras (`image_pair.camera1`, `image_pair.camera2`) and their relative pose (`image_pair.pose`). This class is used as the return type for the `estimate_shared_focal_relative_pose` robust estimator.
  133. All of these are also exposed via python bindings as: `poselib.CameraPose, poselib.Image, poselib.ImagePair`.
  134. ### Benchmarking the robust estimators
  135. To sanity-check the robust estimators we benchmark against the LO-RANSAC implementation from [pycolmap](https://github.com/colmap/pycolmap).
  136. <a href="https://user-images.githubusercontent.com/48490995/149815304-b3c1049a-ee64-4c14-be60-d4930535a3e7.png"><img src="https://user-images.githubusercontent.com/48490995/149815304-b3c1049a-ee64-4c14-be60-d4930535a3e7.png" width="75%"></a>
  137. For all of the metrics higher is better (except for runtime).
  138. # Minimal Solvers
  139. ## Naming convention
  140. For the solver names we use a slightly non-standard notation where we denote the solver as
  141. <pre>
  142. p<b><i>X</i></b>p<b><i>Y</i></b>pl<b><i>Z</i></b>lp<b><i>W</i></b>ll
  143. </pre>
  144. where the number of correspondences required is given by
  145. * <b><i>X</i></b>p - 2D point to 3D point,
  146. * <b><i>Y</i></b>pl - 2D point to 3D line,
  147. * <b><i>Z</i></b>lp - 2D line to 3D point,
  148. * <b><i>W</i></b>ll - 2D line to 3D line.
  149. The prefix with `u` is for upright solvers and `g` for generalized camera solvers. Solvers that estimate focal length have the postfix with `f` and similarly `s` for solvers that estimate scale.
  150. ## Calling conventions
  151. All solvers return their solutions as a vector of `CameraPose` structs, which defined as
  152. ```c++
  153. struct CameraPose {
  154. Eigen::Vector4d q;
  155. Eigen::Vector3d t;
  156. };
  157. ```
  158. where the rotation is representation as a quaternion `q` and the convention is that `[R t]` maps from the world coordinate system into the camera coordinate system.
  159. For <b>2D point to 3D point</b> correspondences, the image points are represented as unit-length bearings vectors. The returned camera poses `(R,t)` then satisfies (for some `lambda`)
  160. ```c++
  161. lambda * x[i] = R * X[i] + t
  162. ```
  163. where `x[i]` is the 2D point and `X[i]` is the 3D point.
  164. <b>Note</b> that only the P3P solver filters solutions with negative `lambda`.
  165. Solvers that use point-to-point constraints take one vector with bearing vectors `x` and one vector with the corresponding 3D points `X`, e.g. for the P3P solver the function declaration is
  166. ```c++
  167. int p3p(const std::vector<Eigen::Vector3d> &x,
  168. const std::vector<Eigen::Vector3d> &X,
  169. std::vector<CameraPose> *output);
  170. ```
  171. Each solver returns the number of real solutions found.
  172. For constraints with <b>2D lines</b>, the lines are represented in homogeneous coordinates. In the case of 2D line to 3D point constraints, the returned camera poses then satisfies
  173. ```c++
  174. l[i].transpose() * (R * X[i] + t) = 0
  175. ```
  176. where `l[i]` is the line and `X[i]` is the 3D point.
  177. For constraints with <b>3D lines</b>, the lines are represented by a 3D point `X` and a bearing vector `V`. In the case of 2D point to 3D point constraints
  178. ```c++
  179. lambda * x[i] = R * (X[i] + mu * V[i]) + t
  180. ```
  181. for some values of `lambda` and `mu`. Similarly, for line to line constraints we have
  182. ```c++
  183. l[i].transpose() * (R * (X[i] + mu * V[i]) + t) = 0
  184. ```
  185. ### Generalized Cameras
  186. For generalized cameras we represent the image rays similarly to the 3D lines above, with an offset `p` and a bearing vector `x`. For example, in the case of point-to-point correspondences we have
  187. ```c++
  188. p[i] + lambda * x[i] = R * X[i] + t
  189. ```
  190. In the case of unknown scale we also estimate `alpha` such that
  191. ```c++
  192. alpha * p[i] + lambda * x[i] = R * X[i] + t
  193. ```
  194. For example, the generalized pose and scale solver (from four points) has the following signature
  195. ```c++
  196. int gp4ps(const std::vector<Eigen::Vector3d> &p, const std::vector<Eigen::Vector3d> &x,
  197. const std::vector<Eigen::Vector3d> &X, std::vector<CameraPose> *output);
  198. ```
  199. ### Upright Solvers
  200. For the upright solvers it assumed that the rotation is around the y-axis, i.e.
  201. ```c++
  202. R = [a 0 -b; 0 1 0; b 0 a]
  203. ```
  204. To use these solvers it necessary to pre-rotate the input such that this is satisfied.
  205. ## Implemented solvers
  206. The following solvers are currently implemented.
  207. ### Absolute Pose
  208. | Solver | Point-Point | Point-Line | Line-Point | Line-Line | Upright | Generalized | Approx. runtime | Max. solutions | Comment |
  209. | --- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | --- |
  210. | `p3p` | 3 | 0 | 0| 0| | | 250 ns | 4 | Ding et al., (CVPR23) |
  211. | `gp3p` | 3 | 0 | 0| 0| | :heavy_check_mark: | 1.6 us | 8 | Kukelova et al., E3Q3 (CVPR16) |
  212. | `gp4ps` | 4 | 0 | 0| 0| | :heavy_check_mark: | 1.8 us | 8 | Unknown scale.<br> Kukelova et al., E3Q3 (CVPR16)<br>Camposeco et al.(ECCV16) |
  213. | `p4pf` | 4 | 0 | 0| 0| | | 2.3 us | 8 | Unknown focal length.<br> Kukelova et al., E3Q3 (CVPR16) |
  214. | `p2p2pl` | 2 | 2 | 0| 0| | | 30 us | 16 | Josephson et al. (CVPR07) |
  215. | `p6lp` | 0 | 0 | 6| 0| | | 1.8 us | 8 | Kukelova et al., E3Q3 (CVPR16) |
  216. | `p5lp_radial` | 0 | 0 | 5| 0| | | 1 us | 4 | Kukelova et al., (ICCV13) |
  217. | `p2p1ll` | 2 | 0 | 0 | 1| | | 1.6 us | 8 | Kukelova et al., E3Q3 (CVPR16), Zhou et al. (ACCV18) |
  218. | `p1p2ll` | 1 | 0 | 0 | 2| | | 1.7 us | 8 | Kukelova et al., E3Q3 (CVPR16), Zhou et al. (ACCV18) |
  219. | `p3ll` | 0 | 0 | 0 | 3| | | 1.8 us | 8 | Kukelova et al., E3Q3 (CVPR16), Zhou et al. (ACCV18) |
  220. | `up2p` | 2 | 0 | 0| 0| :heavy_check_mark: | | 65 ns | 2 | Kukelova et al. (ACCV10) |
  221. | `ugp2p` | 2 | 0 | 0| 0| :heavy_check_mark: | :heavy_check_mark: | 65 ns | 2 | Adapted from Kukelova et al. (ACCV10) |
  222. | `ugp3ps` | 3 | 0 | 0| 0| :heavy_check_mark: | :heavy_check_mark: | 390 ns | 2 | Unknown scale. Adapted from Kukelova et al. (ACCV10) |
  223. | `up1p2pl` | 1 | 2 | 0| 0| :heavy_check_mark: | | 370 ns | 4 | |
  224. | `up4pl` | 0 | 4 | 0| 0| :heavy_check_mark: | | 1.4 us | 8 | Sweeney et al. (3DV14) |
  225. | `ugp4pl` | 0 | 4 | 0| 0| :heavy_check_mark: | :heavy_check_mark: | 1.4 us | 8 | Sweeney et al. (3DV14) |
  226. ### Relative Pose
  227. | Solver | Point-Point | Upright | Planar | Generalized | Approx. runtime | Max. solutions | Comment |
  228. | --- | :---: | :---: | :---: | :---: | :---: | :---: | --- |
  229. | `relpose_5pt` | 5 | | | | 5.5 us | 10 | Nister (PAMI 2004) |
  230. | `relpose_8pt` | 8+ | | | | 2.2+ us | 1 | |
  231. | `relpose_upright_3pt` | 3 | :heavy_check_mark: | | | 210 ns | 4 | Ding et al., (CVPR23) |
  232. | `gen_relpose_upright_4pt` | 4 | :heavy_check_mark: | | :heavy_check_mark: | 1.2 us | 6 | Sweeney et al. (3DV14) |
  233. | `relpose_upright_planar_2pt` | 2 | :heavy_check_mark: | :heavy_check_mark: | | 120 ns | 2 | Choi and Kim (IVC 2018) |
  234. | `relpose_upright_planar_3pt` | 3 | :heavy_check_mark: | :heavy_check_mark: | | 300 ns | 1 | Choi and Kim (IVC 2018) |
  235. | `gen_relpose_5p1pt` | 5+1 | | | :heavy_check_mark: | 5.5 us | 10 | E + 1pt to fix scale |
  236. | `relpose_6pt_shared_focal` | 6 | | | | 33 us | 15 | Stewénius et al. (IVC 2008) |
  237. ## Decompositions
  238. Poselib also provides methods and python bindings for decomposing fundamental matrices to obtain the focal lengths of the cameras and a method for decomposition of homography to poses and plane normals.
  239. | Method | Arguments | Output | Comment |
  240. |---|:---:|:---:|:---:|
  241. | <sub>`focals_from_fundamental` </sub> | <sub>`(F, pp1, pp2)`</sub> | <sub>`(cam1, cam2)`</sub> | Bougnoux (ICCV 1998) |
  242. | <sub>`focals_from_fundamental_iterative`</sub> | <sub>`(F, cam1_prior, cam2_prior, max_iters = 50, weights = {5e-4, 1.0, 5e-4, 1.0})`</sub> | <sub>`(cam1, cam2, iters)`</sub> | Kocur et al. (CVPR 2024) |
  243. | <sub>`motion_from_homography`</sub> | <sub>`(H)`</sub> | <sub>`(poses, normals)`</sub> | Adapted from Ma et al. (Springer 2004) |
  244. To obtain the focal lengths from the camera object you can use `focal = cam.focal()`. Note that both focal length methods can produce very inaccurate results and fail often such that the output focal lengths can be NaNs or negative numbers. If you need to estimate a focal length shared by both cameras (e.g. the same camera in both views) you should use `estimate_shared_focal_relative_pose`.
  245. If you use H obtained using correspondences in image coordinates from two cameras you need to use `K2_inv * H * K1` as input to `motion_from_homography`.
  246. ## How to compile?
  247. Getting the code:
  248. > git clone --recursive https://github.com/vlarsson/PoseLib.git
  249. > cd PoseLib
  250. Example of a local installation:
  251. > mkdir _build && cd _build
  252. > cmake -DCMAKE_INSTALL_PREFIX=../_install ..
  253. > cmake --build . --target install -j 8
  254. (equivalent to 'make install -j8' in linux)
  255. Installed files:
  256. > tree ../_install
  257. .
  258. ├── bin
  259. │   └── benchmark
  260. ├── include
  261. │   └── PoseLib
  262. │   ├── solvers/gp3p.h
  263. │   ├── ...
  264. │   ├── poselib.h <== Library header (includes all the rest)
  265. │   ├── ...
  266. │   └── version.h
  267. └── lib
  268. ├── cmake
  269. │   └── PoseLib
  270. │   ├── PoseLibConfig.cmake
  271. │   ├── PoseLibConfigVersion.cmake
  272. │   ├── PoseLibTargets.cmake
  273. │   └── PoseLibTargets-release.cmake
  274. └── libPoseLib.a
  275. Uninstall library:
  276. > make uninstall
  277. ## Installation
  278. ### Installing PoseLib using Conan
  279. You can install pre-built binaries for PoseLib or build it from source using
  280. [Conan](https://conan.io/). Use the following command:
  281. ```bash
  282. conan install --requires="poselib/[*]" --build=missing
  283. ```
  284. The PoseLib Conan recipe is kept up to date by Conan maintainers and community
  285. contributors. If the version is out of date, please
  286. [create an issue or pull request](https://github.com/conan-io/conan-center-index)
  287. on the ConanCenterIndex repository.
  288. ## Benchmark
  289. Conditional compilation of `benchmark` binary is controlled by `WITH_BENCHMARK` option. Default if OFF (without benchmark).
  290. Add `-DWITH_BENCHMARK=ON` to cmake to activate.
  291. > cmake -DWITH_BENCHMARK=ON ..
  292. ## Use library (as dependency) in an external project.
  293. cmake_minimum_required(VERSION 3.13)
  294. project(Foo)
  295. find_package(PoseLib REQUIRED)
  296. add_executable(foo foo.cpp)
  297. target_link_libraries(foo PRIVATE PoseLib::PoseLib)
  298. ## Citing
  299. If you are using the library for (scientific) publications, please cite the following source:
  300. ```
  301. @misc{PoseLib,
  302. title = {{PoseLib - Minimal Solvers for Camera Pose Estimation}},
  303. author = {Viktor Larsson and contributors},
  304. URL = {https://github.com/vlarsson/PoseLib},
  305. year = {2020}
  306. }
  307. ```
  308. Please cite also the original publications of the different methods (see table above).
  309. ## Changelog
  310. 2.0.5 - Aug. 2025
  311. * Add Conan install section in README by @uilianries in https://github.com/PoseLib/PoseLib/pull/106
  312. * Add some badges to README.md. by @pablospe in https://github.com/PoseLib/PoseLib/pull/107
  313. * Move objects to avoid copy in camera constructors by @ahojnnes in https://github.com/PoseLib/PoseLib/pull/114
  314. * Change default -march=native to be disabled by @vlarsson in https://github.com/PoseLib/PoseLib/pull/115
  315. * Refined P3P solver, and a new implementation for rel_pose_upright_3pt by @yaqding in https://github.com/PoseLib/PoseLib/pull/93
  316. * Bugfix in default camera for shared focal relpose by @kocurvik in https://github.com/PoseLib/PoseLib/pull/120
  317. * Add numpy as a dependency for the python wheel by @theartful in https://github.com/PoseLib/PoseLib/pull/125
  318. * Fix pybind11 calling overhead by @vlarsson in https://github.com/PoseLib/PoseLib/pull/116
  319. * Wrapper for relative pose with non-upright gravity by @B1ueber2y in https://github.com/PoseLib/PoseLib/pull/124
  320. * Add overloaded wrapper methods for passing poselib::Camera instead of py::dict. by @ghanning in https://github.com/PoseLib/PoseLib/pull/127
  321. * Added H decomposition by @kocurvik in https://github.com/PoseLib/PoseLib/pull/121
  322. * Release the GIL whenever possible to allow multithreading from python by @theartful in https://github.com/PoseLib/PoseLib/pull/123
  323. * Pybind reference fixes by @ghanning in https://github.com/PoseLib/PoseLib/pull/128
  324. * Restore default arguments for `ransac_opt` and `bundle_opt` by @ghanning in https://github.com/PoseLib/PoseLib/pull/135
  325. * Add option to pass initial model to robust solvers. by @ghanning in https://github.com/PoseLib/PoseLib/pull/136
  326. * Added `FULL_OPENCV` camera model from `dev` by @VladislavZavadskyy in https://github.com/PoseLib/PoseLib/pull/138
  327. * faster up1p2pl solver by @yaqding in https://github.com/PoseLib/PoseLib/pull/139
  328. * New homography solver by @yaqding in https://github.com/PoseLib/PoseLib/pull/141
  329. * Scale cauchy loss to approximate r^2 in inlier region by @theartful in https://github.com/PoseLib/PoseLib/pull/143
  330. * Remove gcc flags when using msvc for building pyposelib by @theartful in https://github.com/PoseLib/PoseLib/pull/132
  331. * Symmetric homography transfer error in local optimization by @yaqding in https://github.com/PoseLib/PoseLib/pull/144
  332. * Updated Python packaging + CI by @Parskatt in https://github.com/PoseLib/PoseLib/pull/146
  333. 2.0.4 - Aug. 2024
  334. * Added implementation of OpenCVFisheye camera model
  335. * Bumped pybind11 version which seems to fix some crashes
  336. * Added cmake option to disable -march=native
  337. 2.0.3 - Jul. 2024
  338. * Added decomposition methods for estimation of focal lengths from fundamental matrices
  339. 2.0.2 - Apr. 2024
  340. * Added solver and robust estimator for 6p relative pose with unknown shared focal length
  341. * Added Image, ImagePair classes with python bindings
  342. * Exposed Camera via python bindings
  343. 2.0.1 - Sep. 2023
  344. * Refactor pybind such that `pip install .` works. Moved pybind11 to submodule.
  345. * C++ alignment fixes. Should now work with Eigen 3.3 and the header should be COLMAP compatible.
  346. 2.0 - Jan. 2022
  347. * Added robust estimators (LO-RANSAC) and non-linear refinement
  348. * Refactored CameraPose to use quaternion instead 3x3 matrix. Removed alpha.
  349. * Implemented TR-IRLS method from Le and Zach (3DV 2021)
  350. * Restructured pybind11 interface
  351. * Added support for PROSAC sampling
  352. * Many minor fixes and improvements....
  353. 1.0 - Jan. 2020
  354. * Initial release
  355. ## License
  356. PoseLib is licensed under the BSD 3-Clause license. Please see [License](https://github.com/vlarsson/PoseLib/blob/master/LICENSE) for details.
  357. ## Acknowledgements
  358. The RANSAC implementation is heavily inspired by [RansacLib](https://github.com/tsattler/RansacLib) from Torsten Sattler.