Project details
pure-sift delivers a 100% Rust-based, zero-unsafe computer vision engine, eliminating the need for OpenCV and C++ dependencies. With SIFT feature extraction and robust RANSAC alignment, it provides lightweight visual catalog searching and HTTP workbench capabilities, perfect for seamless integration into modern applications.
pure-sift is a comprehensive computer vision engine developed entirely in Rust, emphasizing safety and performance with a commitment to zero-unsafe code (#![forbid(unsafe_code)]). The project implements the Scale-Invariant Feature Transform (SIFT), along with robust alignment techniques through RANSAC (RANdom SAmple Consensus) for both 2D similarity and planar homography alignment. With no dependencies on C/C++ FFI or OpenCV/CMake/LLVM, this engine compiles directly into static binaries suitable for a variety of environments including Docker, WebAssembly, and mobile targets.
This library can be seamlessly integrated into Rust projects. Here’s how to extract SIFT features:
use image::ImageReader;
use pure_sift::{extract_sift_features, match_descriptors, estimate_homography_ransac};
let q_luma = ImageReader::open("query.jpg")?.decode()?.into_luma8();
let t_luma = ImageReader::open("target.jpg")?.decode()?.into_luma8();
let q_feats = extract_sift_features(&luma_to_array2(&q_luma), 3, 3, DEFAULT_CONTRAST_THRESHOLD);
let t_feats = extract_sift_features(&luma_to_array2(&t_luma), 3, 3, DEFAULT_CONTRAST_THRESHOLD);
let matches = match_descriptors(&q_feats, &t_feats, DEFAULT_MATCH_RATIO);
let (inliers, homography) = estimate_homography_ransac(&matches, DEFAULT_RANSAC_REPROJ_THRESHOLD);
GET /: Access an interactive SIFT and RANSAC workbench.POST /api/v1/match-features: Match and process features between images efficiently.The engine has been benchmarked on real-world data, delivering consistent high-quality results across varying input scenarios. Detailed specifications and mathematical derivations are included in the project documentation.
Comments
0Start the conversation
Share the first comment.