Difference between revisions of "Coordinate Systems"

From BoofCV
Jump to navigationJump to search
(Created page with "In this page the different standards which BoofCV follows for coordinate systems are specified. Whenever possible the most standard "standard" is used. In some cases there are...")
 
Line 32: Line 32:
= 3-D Coordinate System =
= 3-D Coordinate System =


[[File::Camera_coordinates.png]]
[[File:Camera_coordinates.png]]


BoofCV uses a right handed coordinate which matches most computer vision systems.
BoofCV uses a right handed coordinate which matches most computer vision systems.

Revision as of 20:09, 24 January 2020

In this page the different standards which BoofCV follows for coordinate systems are specified. Whenever possible the most standard "standard" is used. In some cases there are no standards. If you ever find code inside of BoofCV which does not follow one of these standards please report it.

Array and Matrix Indices

Arrays and matrix coordinates in BoofCV are all zero-indexed (unlike 1-indexed libraries like Matlab), meaning that we start counting from zero instead of one. Some variable names will start at one, i.e. point1, point2. When referencing a coordinate inside of a matrix (row,column) order is employed. For information on the data structures of matrices see EJML.


Pixel Indices

Image pixel coordinates.png

Image pixels are referred in (x,y) order where x is the columns and y is the rows, this is in contrast to matrices which as mentioned above have the reverse order. This is primarily for historical reasons.

As with arrays and matrices, images are zero indexed. The pixel (0,0) refers to the top-left corner and (width-1, height-1) referring to the bottom right. Data is stored in a row-major format.


Spatial Coordinates

Spatial image coordinates are used when using "sub-pixel" coordinates, that is floating point numbers.

Image spatial coordinates.png

Pixel (i,j) is defined as the integral from (i,j) to (i+1,j+1). Note that the upper extent is exclusive and that (i+1,j+1) is not a member of (i,j) and will belong to pixel coordinate (i+1,j+1).

Fiducial Marker Coordinate Systems

There is no true standard across all markers, whatever makes the most sense for a specific marker is used. In general the marker's 2D coordinate system will have the origin as the center, +y is up and +x is right. An example is shown below.

Square fiducial parts.png


3-D Coordinate System

Camera coordinates.png

BoofCV uses a right handed coordinate which matches most computer vision systems.

  • +x axis is to the right
  • +y axis is down
  • +z axis is out of the camera