use crate::Error;
use vision_calibration_core::{Mat3, Pt2, RansacOptions, Vec3};
mod decomposition;
mod essential;
mod fundamental;
mod polynomial;
pub use decomposition::decompose_essential;
pub use essential::essential_5point;
pub use fundamental::{fundamental_7point, fundamental_8point, fundamental_8point_ransac};
#[derive(Debug, Clone, Copy)]
pub struct EpipolarSolver;
impl EpipolarSolver {
pub fn fundamental_8point(pts1: &[Pt2], pts2: &[Pt2]) -> Result<Mat3, Error> {
fundamental::fundamental_8point(pts1, pts2)
}
pub fn fundamental_7point(pts1: &[Pt2], pts2: &[Pt2]) -> Result<Vec<Mat3>, Error> {
fundamental::fundamental_7point(pts1, pts2)
}
pub fn essential_5point(pts1: &[Pt2], pts2: &[Pt2]) -> Result<Vec<Mat3>, Error> {
essential::essential_5point(pts1, pts2)
}
pub fn decompose_essential(e: &Mat3) -> Result<Vec<(Mat3, Vec3)>, Error> {
decomposition::decompose_essential(e)
}
pub fn fundamental_8point_ransac(
pts1: &[Pt2],
pts2: &[Pt2],
opts: &RansacOptions,
) -> Result<(Mat3, Vec<usize>), Error> {
fundamental::fundamental_8point_ransac(pts1, pts2, opts)
}
}