📖
Wiki
Back to my personal website
  • Home
  • Equipment and Devices
    • 3D Printer
    • Laser Cutter
    • Motion Capture System
    • Sensors
      • RGB-D Cameras
      • Velodyne LiDAR
      • Zed Camera
      • RealSense D435i
      • IMU
    • eGPU
    • Nvidia AGX Xavier
    • CPU Benchmark
    • Installation Checklist
  • Development
    • Linux
      • Shell
      • GDB
      • Git
      • Tmux
      • Network
      • Tricks
      • Debug FAQ
    • CMake
      • Catkin Tools
      • CMakeLists
      • CMake Variables
      • CMake Commands
      • CMake: find_package()
    • ROS
      • Gazebo
      • wstool
      • roslaunch
      • rosbag
      • multi-threaded spinner
    • ROS2
      • Convert ROS1 bag to ROS2 bag
    • C++
      • C++ 11
      • C++ Examples
      • C++ Debug
      • Factory Method
      • Timing
    • Google Tools
      • GLog
      • GFlags
      • GTest
      • Style Guide
      • Clang Format
    • PCL
      • Point Type
      • Methods
      • Architecture
      • Code Explained
    • Open3D
      • Python API
      • Registration
      • Visualization
      • Tools
    • OpenCV
      • Documentation
      • Modules
    • Other Libraries
      • Eigen
      • Ceres
      • g2o
      • GTSAM
    • Website
  • Algorithm
    • SLAM
      • K-D Tree
      • Octree
      • Bag of Words
      • Distance Measures
      • Coordinate Systems
      • LOAM
      • Iterative Closest Point
      • Generalized ICP
      • Mahalanobis Distance
    • Computer Science
      • Computational Model
      • Sorting
      • Analysis
      • Complexity Classes (P, NP)
      • Divide and Conquer
      • Greedy Algorithm
      • Dynamic Programming
      • Tree
      • Graph
    • Computer Vision
      • Camera Models
      • Distortion
      • Motion Models
      • Shutter
      • Image Sensors
      • Epipolar Geometry
      • Multiple-View Geometry
    • Datasets
      • RGB-D Datasets
      • Point Cloud Datasets
      • LiDAR SLAM Datasets
  • Math
    • Optimization
      • Convex Optimization
      • Descent Methods
    • Probability
      • Moment
      • Covariance Matrix
      • Stochastic Process
    • Topology
      • References
      • Concepts
      • Topological Spaces
      • Representation of Rotations
      • Representation of 3-sphere
    • Algebra
      • Linear Algebra
      • Matrix Factorization
      • Condition Number
      • Matrix Lie Group
    • Differential Geometry
      • Manifold
      • Submanifold
      • Quotient Manifolds
      • Tangent Space
  • Quadrotor
    • PX4 Development
    • Companion Computer
    • Drone Hardware
    • Propeller Lock
    • Debug
  • Favorites
    • Bookmarks
Powered by GitBook
On this page
  • 9 Common Measures in Data Science
  • Rotation: Geodesic Distance
  • Feature Distance
  • Probability Distribution

Was this helpful?

  1. Algorithm
  2. SLAM

Distance Measures

PreviousBag of WordsNextCoordinate Systems

Last updated 3 years ago

Was this helpful?

9 Common Measures in Data Science

Reference:

Rotation: Geodesic Distance

  • Geodesic distance on the unit sphere: SO(3) is a compact Lie group and it has a natural Riemannian metric; that is, an inner product on its tangent space so(3) at every point. [Huynh 2009]

  • In the second step, it is the matrix logorithm from SO(3) to so(3). theta = arccos(1/2(tr(R)-1)). See the rule (c) before equation (3.61) in the Modern Robotics textbook.

  • Lastly, the range of the arccos function is [0, pi], so there is no need to add abs().

Feature Distance

  • Humming Distance for binary descriptors

  • L1 or L2 Distance for histogram based descriptors (a float vector)

  • Sum of Squared Distance (SSD) for image patches (in fact it is still the L2 distance)

    • can give good scores to very ambiguous (bad) matches

  • Improvement: use the ratio distance = SSD(f1, f2) / SSD(f1, f2’)

    • gives small values for ambiguous matches

Normalized Euclidean Distance vs. Normalized Cross Correlation

The normalized Euclidean distance is the distance between two normalized vectors that have been normalized to length one. If the vectors are identical then the distance is 0, if the vectors point in opposite directions the distance is 2, and if the vectors are orthogonal (perpendicular) the distance is sqrt(2). It is a positive definite scalar value between 0 and 2.

The normalized cross-correlation is the dot product between the two normalized vectors. If the vectors are identical, then the correlation is 1, if the vectors point in opposite directions the correlation is -1, and if the vectors are orthogonal (perpendicular) the correlation is 0. It is a scalar value between -1 and 1. This is also called the cosine similarity.

Probability Distribution

  • Probability Mass Functions (PMF) are used to describe discrete probability distributions.

  • Probability Density Functions (PDF) are used to describe continuous probability distributions.

KL-Divergence (Relative Entropy)

  • The relative entropy or Kullback-Leibler (KL) distance between two PMFs p(x) and q(x) (that are defined on the same alphabet) is:

  • KL-distance is not a rigorous distance metric, because it does not meet all of the properties (e.g., does not satisfy the triangular inequality and it is not symmetric), but it is (to some degree) a distance measure because it does meet some of the properties (e.g., always non-negative).

  • This is not the only measure between two distributions, but it is the most important one in information theory.

  • References: EE250 Information Theory Lecture Notes

Earth Mover's Distance (Wasserstein metric)

  • In statistics, the earth mover's distance (EMD) is a measure of the distance between two probability distributions over a region D. In mathematics, this is known as the Wasserstein metric.

  • Informally, if the distributions are interpreted as two different ways of piling up a certain amount of earth (dirt) over the region D, the EMD is the minimum cost of turning one pile into the other; where the cost is assumed to be the amount of dirt moved times the distance by which it is moved.

  • The above definition is valid only if the two distributions have the same integral (informally, if the two piles have the same amount of dirt), as in normalized histograms or probability density functions. In that case, the EMD is equivalent to the 1st Mallows distance or 1st Wasserstein distance between the two distributions.

  • Related Keywords: Transportation Theory, Optimal Transport

  • It is said that one can possibly replace KL-Divergence in machine learning papers with this new metric and attain better performance.

∣arccos(tr(R^TRo)−12)∣| \rm{arccos} (\frac{ tr(\hat{R}^T R^o)-1}{2} )|∣arccos(2tr(R^TRo)−1​)∣

This metric tries to findRRRsuch that R1=RR2R_1 = RR_2R1​=RR2​. Therefore, R=R1R2−1=R1R2TR = R_1R_2^{-1} = R_1R_2^TR=R1​R2−1​=R1​R2T​.

References:

References: ;

https://datascience.stackexchange.com/a/6545
https://en.wikipedia.org/wiki/Transportation_theory_(mathematics)
https://www.math.cmu.edu/~mthorpe/OTNotes
9 Distance Measures in Data Science
NCC equation
NED equation