Struct riscan_pro::CameraCalibration [] [src]

pub struct CameraCalibration {
    pub name: String,
    pub cx: f64,
    pub cy: f64,
    pub fx: f64,
    pub fy: f64,
    pub k1: f64,
    pub k2: f64,
    pub k3: f64,
    pub k4: f64,
    pub p1: f64,
    pub p2: f64,
    pub tan_max_horz: f64,
    pub tan_max_vert: f64,
    pub tan_min_horz: f64,
    pub tan_min_vert: f64,
    pub width: usize,
    pub height: usize,
}

A camera calibration.

Only opencv camera calibrations are supported at this time.

Fields

The name of the calibration.

Methods

impl CameraCalibration
[src]

[src]

Retrieves all camera calibrations from a project.

Examples

use riscan_pro::CameraCalibration;
let camera_calibrations = CameraCalibration::from_project_path("data/project.RiSCAN")
    .unwrap();
assert_eq!(1, camera_calibrations.len());

[src]

Converts a point in the camera's coordinate system to pixel values.

The pixel values are floats, in case someone later wants to do more than a direct lookup.

Returns None if:

  • The point is behind the camera (negative z).
  • The point is ouside the angle extents, as defined by tan_{min|max}_{vert|horz}.
  • The calculated pixel values are outside of the width/height of the image.

These maths are taken from the project.dtd file in every RiSCAN Pro project.

Examples

use riscan_pro::{CameraCalibration, Point};
let camera_calibration = CameraCalibration::from_project_path("data/southpole.rsp")
    .unwrap()
    .pop()
    .unwrap();
let cmcs = Point::cmcs(1.312, -0.641, 3.019);
let (u, v) = camera_calibration.cmcs_to_ics(&cmcs).unwrap();

[src]

Returns true if this is a valid pixel value.

Examples

use riscan_pro::CameraCalibration;
let camera_calibration = CameraCalibration::from_project_path("data/project.RiSCAN")
    .unwrap()
    .pop()
    .unwrap();
// The camera calibration is 1024x768
assert!(camera_calibration.is_valid_pixel(0., 0.));
assert!(!camera_calibration.is_valid_pixel(1024., 0.));
assert!(!camera_calibration.is_valid_pixel(0., 768.));

Trait Implementations

impl Clone for CameraCalibration
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for CameraCalibration
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for CameraCalibration
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.