| Crates.io | inlier |
| lib.rs | inlier |
| version | 0.1.0 |
| created_at | 2025-12-04 12:15:17.376001+00 |
| updated_at | 2025-12-04 12:15:17.376001+00 |
| description | Robust model fitting primitives for RANSAC-based pipelines in Rust. |
| homepage | https://github.com/soraxas/inlier |
| repository | https://github.com/soraxas/inlier |
| max_upload_size | |
| id | 1966422 |
| size | 532,743 |
inlier is a rust library for robust model fitting.
It exposes idiomatic Rust API with
pluggable estimators, samplers, scoring functions, and optimizers.
# Robust line fitting with plot output
cargo run --example linear_regression
# Homography estimation demo
cargo run --example homography_estimation
See examples/README.md for the full catalog.
use inlier::{estimate_homography, RansacSettings};
use nalgebra::DMatrix;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let points1 = DMatrix::from_row_slice(4, 2, &[0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0]);
let points2 = DMatrix::from_row_slice(4, 2, &[1.0, 1.0, 2.0, 1.0, 2.0, 2.0, 1.0, 2.0]);
let result = estimate_homography(&points1, &points2, 1.0, Some(RansacSettings::default()))?;
println!("Inliers: {}", result.inliers.len());
Ok(())
}
Implement the core traits to add custom functionality:
Estimator (models)Sampler / NeighborhoodGraphScoringLocalOptimizerTerminationCriterionEach trait includes documentation and doctests describing the expected behavior.
This uses the c++ library superansac as reference implementation, of which the author had done an excellent work on improving the SOTA sample consensus algorithm!