kornia / kornia-rs

Low-level Computer Vision library in Rust
https://docs.rs/kornia-rs
Apache License 2.0
150 stars 10 forks source link

implement `warp_affine` / `warp_perspective` #47

Closed edgarriba closed 1 month ago

edgarriba commented 4 months ago

reference:

needs (to abstract / reuse code)

gau-nernst commented 3 months ago

I recently had to implement warp_affine from scratch in Dart to do image transformation in Flutter without OpenCV. I could contribute warp_affine here if you are okay with that. It's probably not gonna be super fast.

grid_sample is not needed. The current bilinear_interpolation() function should be enough.

edgarriba commented 3 months ago

feel free to go for it -- about grid_sample, it will basically a way to reuse code. If you see in the resize_native function the ndarray::Zip is basically parallelizing over the destination points. In any case you will have to reimplement that to make it efficient, we don't want regular looping but instead iterators (which is what's happening in that code already.

gau-nernst commented 3 months ago

Interesting. Do you have benchmarks between naive for-loop version and the current version?

Some observations

In any case, let's get a working implementation first before looking more into the speed.

edgarriba commented 1 month ago

done