12个稳定版本
2.2.3 | 2024年4月21日 |
---|---|
1.4.3 | 2022年11月19日 |
1.4.2 | 2022年2月15日 |
1.4.1 | 2021年5月22日 |
0.1.0 | 2019年2月9日 |
111 在 图像 中排名
每月 79 次下载
在 2 crate 中使用
33KB
772 行
oidn
Rust绑定Intel的Open Image Denoise库。
文档
Rust文档可以在这里找到。
Open Image Denoise文档可以在这里找到。
示例
该crate提供了对Open Image Denoise库的轻量级封装,以及暴露在 oidn::sys
下的原始C绑定。下面是一个使用Open Image Denoise库中的 RT
过滤器(RayTracing
过滤器)对图像进行去噪的示例。
extern crate oidn;
fn main() {
// Load scene, render image, etc.
let input_img: Vec<f32> = // A float3 RGB image produced by your renderer
let mut filter_output = vec![0.0f32; input_img.len()];
let device = oidn::Device::new();
oidn::RayTracing::new(&device)
// Optionally add float3 normal and albedo buffers as well
.srgb(true)
.image_dimensions(input.width() as usize, input.height() as usize);
.filter(&input_img[..], &mut filter_output[..])
.expect("Filter config error!");
if let Err(e) = device.get_error() {
println!("Error denosing image: {}", e.1);
}
// Save out or display filter_output image
}
简单的示例加载一个JPG文件,对其进行去噪,并将输出图像保存为JPG。 denoise_exr 示例加载一个HDR颜色EXR文件,对其进行去噪并将色调映射结果保存为JPG。 denoise_exr
应用程序还可以通过额外的EXR文件获取漫反射和法线数据。
依赖项
~285–740KB
~17K SLoC