π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
fix docstrings, enhance docs and change an assertion (#1241)
Bharath Raj7e7a922af5e5
diff --git a/docs/source/geometry.camera.pinhole.rst b/docs/source/geometry.camera.pinhole.rstindex 45f4e4f81..d88ba473b 100644--- a/docs/source/geometry.camera.pinhole.rst+++ b/docs/source/geometry.camera.pinhole.rst@@ -38,16 +38,16 @@ or\end{bmatrix}where:- * :math:`M'` is a 3D point in space with coordinates :math:`[X,Y,Z]^T` expressed in a Euclidean coordinate system.+ * :math:`M'` is a 3D point in space with coordinates :math:`[X,Y,Z]^T` expressed in an Euclidean coordinate frame known as the *world coordinate system*.* :math:`m'` is the projection of the 3D point :math:`M'` onto the *image plane* with coordinates :math:`[u,v]^T` expressed in pixel units.- * :math:`K` is the *camera calibration matrix*, also referred as the intrinsics parameters matrix.+ * :math:`K` is the *camera calibration matrix*, also referred as the intrinsic matrix.* :math:`C` is the *principal point offset* with coordinates :math:`[u_0, v_0]^T` at the origin in the image plane.* :math:`fx, fy` are the focal lengths expressed in pixel units.-The camera rotation and translation are expressed in terms of Euclidean coordinate frame, also known as the *world coordinates system*. This terms are usually expressed by the joint rotation-translation matrix :math:`[R|t]`, or also called as the extrinsics parameters matrix. It is used to describe the camera pose around a static scene and translates the coordinates of a 3D point :math:`(X,Y,Z)` to a coordinate system respect to the camera.+The camera rotation and translation are expressed in terms of an Euclidean coordinate frame known as the *world coordinate system*. These terms are usually expressed by the joint rotation-translation matrix :math:`[R|t]` which is also known as the extrinsic matrix. It is used to describe the camera pose around a static scene and transforms the coordinates of a 3D point :math:`(X,Y,Z)` from the *world coordinate system* to the *camera coordinate system*.-The :class:`PinholeCamera` expects the *intrinsics parameters matrix* and the *extrensics parameters matrix*-to be of shape `(B, 4, 4)` such that each *intrinsics parameters matrix* has the following format:+The :class:`PinholeCamera` expects the *intrinsic matrices* and the *extrinsic matrices*+to be of shape `(B, 4, 4)` such that each *intrinsic matrix* has the following format:.. math::\begin{bmatrix}@@ -57,7 +57,7 @@ to be of shape `(B, 4, 4)` such that each *intrinsics parameters matrix* has th0 & 0 & 0 & 1\end{bmatrix}-And each *extrensics parameters matrix* has the following format:+And each *extrinsic matrix* has the following format:.. math::\begin{bmatrix}diff --git a/docs/source/geometry.epipolar.rst b/docs/source/geometry.epipolar.rstindex e461a6db8..096f05f1e 100644--- a/docs/source/geometry.epipolar.rst+++ b/docs/source/geometry.epipolar.rst@@ -3,7 +3,7 @@ kornia.geometry.epipolar.. currentmodule:: kornia.geometry.epipolar-Module to with useful functionalities for epipolar geometry used by Structure from Motion+Module with useful functionalities for epipolar geometry used by Structure from Motion.. image:: data/epipolar_geometry.svg.pngdiff --git a/kornia/geometry/epipolar/numeric.py b/kornia/geometry/epipolar/numeric.pyindex f795c3e44..77753970a 100644--- a/kornia/geometry/epipolar/numeric.py+++ b/kornia/geometry/epipolar/numeric.py@@ -37,7 +37,7 @@ def eye_like(n: int, input: torch.Tensor) -> torch.Tensor:The expected shape is :math:`(B, *)`.Returns:- The identity matrix with same size as input :math:`(*, N, N)`.+ The identity matrix with same size as input :math:`(B, N, N)`."""if n <= 0:@@ -58,7 +58,7 @@ def vec_like(n, tensor):The expected shape is :math:`(B, *)`.Returns:- The vector with same size as input :math:`(*, N, 1)`.+ The vector with same size as input :math:`(B, N, 1)`."""if n <= 0:diff --git a/kornia/geometry/epipolar/projection.py b/kornia/geometry/epipolar/projection.pyindex 0231bd4ad..824db5835 100644--- a/kornia/geometry/epipolar/projection.py+++ b/kornia/geometry/epipolar/projection.py@@ -181,13 +181,13 @@ def projections_from_fundamental(F_mat: torch.Tensor) -> torch.Tensor:r"""Get the projection matrices from the Fundamental Matrix.Args:- F_mat: the fundamental matrix with the shape :math:`(*, 3, 3)`.+ F_mat: the fundamental matrix with the shape :math:`(B, 3, 3)`.Returns:- The projection matrices with shape :math:`(*, 4, 4, 2)`.+ The projection matrices with shape :math:`(B, 3, 4, 2)`."""- if len(F_mat.shape) < 2:+ if len(F_mat.shape) != 3:raise AssertionError(F_mat.shape)if F_mat.shape[-2:] != (3, 3):raise AssertionError(F_mat.shape)