π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
add perspective camera to docs
edgarribaefc6b6bcd7aa
diff --git a/docs/source/geometry.camera.perspective.rst b/docs/source/geometry.camera.perspective.rstnew file mode 100644index 000000000..313f3963f--- /dev/null+++ b/docs/source/geometry.camera.perspective.rst@@ -0,0 +1,8 @@+Perspective Camera+------------------++.. currentmodule:: kornia.geometry.camera.perspective+++.. autofunction:: project_points+.. autofunction:: unproject_pointsdiff --git a/docs/source/pinhole.rst b/docs/source/geometry.camera.pinhole.rstsimilarity index 97%rename from docs/source/pinhole.rstrename to docs/source/geometry.camera.pinhole.rstindex e97d79d8d..3835bc59b 100644--- a/docs/source/pinhole.rst+++ b/docs/source/geometry.camera.pinhole.rst@@ -1,7 +1,7 @@Pinhole Camera---------------.. currentmodule:: kornia.geometry.camera+.. currentmodule:: kornia.geometry.camera.pinholeIn this module we have all the functions and data structures needed to describe the projection of a 3D scene space onto a 2D image plane.diff --git a/docs/source/geometry.camera.rst b/docs/source/geometry.camera.rstindex bb01376c9..0e5423cf1 100644--- a/docs/source/geometry.camera.rst+++ b/docs/source/geometry.camera.rst@@ -1,9 +1,10 @@kornia.geometry.camera-=============================+======================.. currentmodule:: kornia.geometry.camera.. toctree:::maxdepth: 2- pinhole+ geometry.camera.pinhole+ geometry.camera.perspectivediff --git a/docs/source/geometry.linalg.rst b/docs/source/geometry.linalg.rstindex ed92adc17..2e24e51e6 100644--- a/docs/source/geometry.linalg.rst+++ b/docs/source/geometry.linalg.rst@@ -1,5 +1,5 @@kornia.geometry.linalg-=============================+======================.. currentmodule:: kornia.geometry.linalgdiff --git a/docs/source/geometry.rst b/docs/source/geometry.rstindex 69198d751..dfdd9157e 100644--- a/docs/source/geometry.rst+++ b/docs/source/geometry.rst@@ -1,5 +1,5 @@kornia.geometry-======================+===============.. currentmodule:: kornia.geometrydiff --git a/kornia/color/normalize.py b/kornia/color/normalize.pyindex 02207b3a5..e37ca695d 100644--- a/kornia/color/normalize.py+++ b/kornia/color/normalize.py@@ -5,7 +5,7 @@ import torch.nn as nnclass Normalize(nn.Module):r"""Normalize a tensor image or a batch of tensor imageswith mean and standard deviation. Input must be a tensor of shape (C, H, W)- or a batch of tensors (*, C, H, W).+ or a batch of tensors :math:`(*, C, H, W)`.Given mean: ``(M1,...,Mn)`` and std: ``(S1,..,Sn)`` for ``n`` channels,this transform will normalize each channel of the input ``torch.Tensor``diff --git a/kornia/geometry/camera/perspective.py b/kornia/geometry/camera/perspective.pyindex 60430436a..6264a4665 100644--- a/kornia/geometry/camera/perspective.py+++ b/kornia/geometry/camera/perspective.py@@ -16,12 +16,12 @@ def project_points(Args:point3d (torch.Tensor): tensor containing the 3d points to be projected- to the camera plane. The shape of the tensor can be (*, 3).+ to the camera plane. The shape of the tensor can be :math:`(*, 3)`.camera_matrix (torch.Tensor): tensor containing the intrinsics cameramatrix. The tensor shape must be Bx4x4.Returns:- torch.Tensor: array of (u, v) cam coordinates with shape (*, 2).+ torch.Tensor: array of (u, v) cam coordinates with shape :math:`(*, 2)`."""if not torch.is_tensor(point_3d):raise TypeError("Input point_3d type is not a torch.Tensor. Got {}"@@ -66,9 +66,9 @@ def unproject_points(Args:point2d (torch.Tensor): tensor containing the 2d to be projected to- world coordinates. The shape of the tensor can be (*, 2).+ world coordinates. The shape of the tensor can be :math:`(*, 2)`.depth (torch.Tensor): tensor containing the depth value of each 2d- points. The tensor shape must be equal to point2d (*, 1).+ points. The tensor shape must be equal to point2d :math:`(*, 1)`.camera_matrix (torch.Tensor): tensor containing the intrinsics cameramatrix. The tensor shape must be Bx4x4.normalize (Optional[bool]): wether to normalize the pointcloud. This@@ -76,7 +76,8 @@ def unproject_points(ray length from the camera position. Default is `False`.Returns:- torch.Tensor: tensor of (x, y, z) world coordinates with shape (*, 3).+ torch.Tensor: tensor of (x, y, z) world coordinates with shape+ :math:`(*, 3)`."""if not torch.is_tensor(point_2d):raise TypeError("Input point_2d type is not a torch.Tensor. Got {}"