File size: 2,870 Bytes
36c95ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
kornia.geometry
===============

Geometric image transformations is another key ingredient in computer vision to manipulate images.
Since geometry operations are typically performed in 2D or 3D, we provide several algorithms to work
with both cases. This module, the original core of the library, consists of the following submodules:
transforms, camera, conversions, linalg and depth. We next describe each of them:

- `transforms`: The module provides low level interfaces to manipulate 2D images, with routines for Rotating,
  Scaling, Translating, Shearing; Cropping functions in several modalities such as central crops,
  crop and resize; Flipping transformations in the vertical and horizontal axis; Resizing operations;
  Functions to warp tensors given affine or perspective transformations,
  and utilities to compute the transformation matrices to perform the mentioned operations.
- `camera`: A set of routines specific to different types of camera representations such as Pinhole
  or Orthographic models containing functionalities such as projecting and unprojecting points from the
  camera to a world frame.
- `conversions`: Routines to perform conversions between angle representation such as
  radians to degrees, coordinates normalization, and homogeneous to euclidean. Moreover, we include advanced
  conversions for 3D geometry representations such as Quaternion, Axis-Angle, Rotation Matrix, or Rodrigues
  formula.
- `linalg`: Functions to perform general rigid-body homogeneous transformations. We include implementations to
  transform points between frames and for homogeneous transformations, manipulation such as composition,
  inverse and to compute relative poses.
- `depth`: A set of layers to manipulate depth maps such as how to compute 3D point clouds given depth maps and
  calibrated cameras; compute surface normals per pixel and warp tensor frames given calibrated cameras setup.


:Resources:

   **align_corners**

   align_corners is a switch that widely offered in PyTorch geometric transform functions.
   Here is a simple illustration showing how a 4x4 image is upsampled to 8x8, made by
   `bkkm16 <https://discuss.pytorch.org/t/what-we-should-use-align-corners-false/22663/9?u=ducha-aiki>`_.

   .. image:: https://user-images.githubusercontent.com/4803565/110627988-df8a4d00-81a2-11eb-8e13-06d3f7b09ef1.png

   - `align_corners=True`, pixels are arranged as a grid of points. Points at the corners are aligned.
   - `align_corners=False`, pixels are arranged as 1x1 areas. Area boundaries, rather than their centers, are aligned.


.. currentmodule:: kornia.geometry

.. toctree::
   :maxdepth: 3

   geometry.bbox
   geometry.calibration
   geometry.camera
   geometry.conversions
   geometry.depth
   geometry.epipolar
   geometry.homography
   geometry.linalg
   geometry.subpix
   geometry.transform
   geometry.ransac