moving-least-squares-image

Crates.iomoving-least-squares-image
lib.rsmoving-least-squares-image
version0.1.1
sourcesrc
created_at2021-10-08 17:34:42.107587
updated_at2022-04-25 09:29:21.415652
descriptionImage deformation using moving least squares
homepagehttps://github.com/mpizenberg/rust_mls
repositoryhttps://github.com/mpizenberg/rust_mls
max_upload_size
id462416
size31,312
Matthieu Pizenberg (mpizenberg)

documentation

README

Image Deformation Using Moving Least Squares

Rust implementation of the paper "Image Deformation Using Moving Least Squares", Schaefer 2006.

mls demo output

The optional rayon feature enables parallel iterators for the generation of the warped image.

Here is what using the library looks like:

// Open an image from disk.
let img = image::open("data/woody.jpg")?.into_rgb8();

// Define the source control points.
let controls_src: &[(f32, f32)] = &[
    (20.0, 160.0),
    ...
    (250.0, 369.0),
];

// Define the destination control points.
let controls_dst: &[(f32, f32)] = &[
    (20.0, 250.0),
    ...
    (250.0, 369.0),
];

// Create new warped image.
let warped_img_affine =
    mls_image::reverse_dense(&img, controls_src, controls_dst, mls::deform_affine);
Commit count: 34

cargo fmt