| ARX 1.0 The next-generation open source augmented reality toolkit.

Loading...
Searching...
No Matches
Classes | Functions | Variables
paramFile.c File Reference
`#include <stdio.h>`
`#include <stdarg.h>`
`#include <string.h>`
`#include <ARX/AR/ar.h>`
`#include <errno.h>`
Include dependency graph for paramFile.c:

## Classes
struct | ARParamd

## Functions
int | arParamSave (const char *filename, const int num, const ARParam *param,...)
| Save camera intrinsics (pinhole lens model and distortion parameters) to a file.
int | arParamLoad (const char *filename, int num, ARParam *param,...)
| Load camera intrinsics (pinhole lens model and distortion parameters) from a file.
int | arParamLoadFromBuffer (const void *buffer, size_t bufsize, ARParam *param)
| Load camera intrinsics (pinhole lens model and distortion parameters) from a buffer.
int | arParamSaveExt (const char *filename, ARdouble para[3][4])
| Save camera extrinsic parameters from a matrix to a binary file.
int | arParamLoadExt (const char *filename, ARdouble para[3][4])
| Load camera extrinsic parameters into a matrix from a binary file.
int | arParamLoadExtFromBuffer (const void *buffer, size_t bufsize, ARdouble para[3][4])
| Load camera extrinsic parameters into a matrix from a binary buffer.
int | arParamSaveOptical (const char *filename, const ARdouble fovy, const ARdouble aspect, const ARdouble m[16])
int | arParamLoadOptical (const char *filename, ARdouble *fovy_p, ARdouble *aspect_p, ARdouble m[16])
int | arParamLoadOpticalFromBuffer (const void *buffer, size_t bufsize, ARdouble *fovy_p, ARdouble *aspect_p, ARdouble m[16])

## Variables
const arParamVersionInfo_t | arParamVersionInfo [AR_DIST_FUNCTION_VERSION_MAX]
| Constant array with parameters applicable to each version of the camera parameter distortion function.

## Function Documentation

## ◆ arParamLoad()

int arParamLoad | ( | const char * | filename,
|  | int | num,
|  | ARParam * | param,
|  |  | ...
| ) |  |

Load camera intrinsics (pinhole lens model and distortion parameters) from a file.

See the discussion under ARParam for more info.

Parameters

  filename | Path to file from which to load the parameters. The file pointed to should be a file saved with arParamSave.
  num | Number of ARParams to be loaded, normally 1.
  param | Pointer to the ARParam structure into which the parameters will be read.

Returns
  0 if successful, or -1 if an error occured.

See also
  ARParam
  arParamLoadFromBuffer
  arParamSave

## ◆ arParamLoadExt()

int arParamLoadExt | ( | const char * | filename,
|  | ARdouble | para[3][4]
| ) |  |

Load camera extrinsic parameters into a matrix from a binary file.

A typical use of this function is to load the transform expressing the pose of the right camera in a stereo-camera pair, relative to the left camera.

Parameters

  para | A 3x4 matrix in row-major order, specifying the camera extrinsic transform. (This corresponds to the first 3 rows of a 4x4 homogenous coordinate transform matrix, where the fourth row is assumed to be {0.0, 0.0, 0.0, 1.0}.)
  filename | The path to the filename from which to load the parameters in binary format.

Returns
  0 if successful, or -1 if an error occured.

See also
  arParamSaveExt
  arParamLoadExtFromBuffer

## ◆ arParamLoadExtFromBuffer()

int arParamLoadExtFromBuffer | ( | const void * | buffer,
|  | size_t | bufsize,
|  | ARdouble | para[3][4]
| ) |  |

Load camera extrinsic parameters into a matrix from a binary buffer.

A typical use of this function is to load the transform expressing the pose of the right camera in a stereo-camera pair, relative to the left camera.

Parameters

  buffer | Buffer from which the parameter(s) will be loaded. The buffer could be (for example) the contents of a parameter file read with fread().
  bufsize | Size of the contents of buffer.
  para | A 3x4 matrix in row-major order, specifying the camera extrinsic transform. (This corresponds to the first 3 rows of a 4x4 homogenous coordinate transform matrix, where the fourth row is assumed to be {0.0, 0.0, 0.0, 1.0}.)

Returns
  0 if successful, or -1 if an error occured.

See also
  arParamSaveExt
  arParamLoadExt

## ◆ arParamLoadFromBuffer()

int arParamLoadFromBuffer | ( | const void * | buffer,
|  | size_t | bufsize,
|  | ARParam * | param
| ) |  |

Load camera intrinsics (pinhole lens model and distortion parameters) from a buffer.

See the discussion under ARParam for more info.

Parameters

  buffer | Buffer from which the parameter(s) will be loaded. The buffer could be (for example) the contents of a parameter file read with fread().
  bufsize | Size of the contents of buffer.
  param | Pointer to the ARParam structure into which the parameters will be read.

Returns
  0 if successful, or -1 if an error occured.

See also
  ARParam
  arParamLoad
  arParamSave

## ◆ arParamLoadOptical()

int arParamLoadOptical | ( | const char * | filename,
|  | ARdouble * | fovy_p,
|  | ARdouble * | aspect_p,
|  | ARdouble | m[16]
| ) |  |

## ◆ arParamLoadOpticalFromBuffer()

int arParamLoadOpticalFromBuffer | ( | const void * | buffer,
|  | size_t | bufsize,
|  | ARdouble * | fovy_p,
|  | ARdouble * | aspect_p,
|  | ARdouble | m[16]
| ) |  |

## ◆ arParamSave()

int arParamSave | ( | const char * | filename,
|  | const int | num,
|  | const ARParam * | param,
|  |  | ...
| ) |  |

Save camera intrinsics (pinhole lens model and distortion parameters) to a file.

See the discussion under ARParam for more info.

Parameters

  filename | Path to file to which to save the parameters. The file pointed to may later be reloaded with arParamLoad.
  num | Number of ARParams to be saved, normally 1.
  param | Pointer to the ARParam structure to save.

Returns
  0 if successful, or -1 if an error occured.

See also
  ARParam
  arParamLoad
  arParamLoadFromBuffer

## ◆ arParamSaveExt()

int arParamSaveExt | ( | const char * | filename,
|  | ARdouble | para[3][4]
| ) |  |

Save camera extrinsic parameters from a matrix to a binary file.

A typical use of this function is to save the transform expressing the pose of the right camera in a stereo-camera pair, relative to the left camera.

Parameters

  para | A 3x4 matrix in row-major order, specifying the camera extrinsic transform. (This corresponds to the first 3 rows of a 4x4 homogenous coordinate transform matrix, where the fourth row is assumed to be {0.0, 0.0, 0.0, 1.0}.)
  filename | The path to the filename in which to store the parameters in binary format.

Returns
  0 if successful, or -1 if an error occured.

See also
  arParamLoadExt
  arParamLoadExtFromBuffer

## ◆ arParamSaveOptical()

int arParamSaveOptical | ( | const char * | filename,
|  | const ARdouble | fovy,
|  | const ARdouble | aspect,
|  | const ARdouble | m[16]
| ) |  |

## Variable Documentation

## ◆ arParamVersionInfo

const arParamVersionInfo_t arParamVersionInfo[AR_DIST_FUNCTION_VERSION_MAX]

Initial value:
= {
{4, 136},
{5, 144},
{6, 152},
{9, 176},
{17, 240},
}

Constant array with parameters applicable to each version of the camera parameter distortion function.