White Paper. Denoising. February 2007 WP _v01

Similar documents
SDK White Paper. Vertex Lighting Achieving fast lighting results

SDK White Paper. Matrix Palette Skinning An Example

White Paper. Soft Shadows. February 2007 WP _v01

SDK White Paper. HLSL Blood Shader Gravity Maps

User Guide. Vertex Texture Fetch Water

Technical Report. Anisotropic Lighting using HLSL

Sparkling Effect. February 2007 WP _v01

Application Note. NVIDIA Business Platform System Builder Certification Guide. September 2005 DA _v01

SDK White Paper. Soft Shadows

NVIDIA nforce 790i SLI Chipsets

Technical Report. GLSL Pseudo-Instancing

White Paper. Texture Arrays Terrain Rendering. February 2007 WP _v01

GPU LIBRARY ADVISOR. DA _v8.0 September Application Note

SDK White Paper. Occlusion Query Checking for Hidden Pixels

White Paper. Perlin Fire. February 2007 WP _v01

Optical Flow Estimation with CUDA. Mikhail Smirnov

Technical Brief. LinkBoost Technology Faster Clocks Out-of-the-Box. May 2006 TB _v01

Enthusiast System Architecture Certification Feature Requirements

Technical Brief. NVIDIA Quadro FX Rotated Grid Full-Scene Antialiasing (RG FSAA)

Horizon-Based Ambient Occlusion using Compute Shaders. Louis Bavoil

Order Independent Transparency with Dual Depth Peeling. Louis Bavoil, Kevin Myers

White Paper. Solid Wireframe. February 2007 WP _v01

CUDA Particles. Simon Green

NVWMI VERSION 2.24 STANDALONE PACKAGE

High Quality DXT Compression using OpenCL for CUDA. Ignacio Castaño

User Guide. TexturePerformancePBO Demo

SDK White Paper. Video Filtering on the GPU. Eric Young NVIDIA Corporation 2701 San Tomas Expressway Santa Clara, CA 95050

Soft Particles. Tristan Lorach

GRID SOFTWARE FOR RED HAT ENTERPRISE LINUX WITH KVM VERSION /370.28

Technical Brief. NVIDIA and Microsoft Windows Vista Getting the Most Out Of Microsoft Windows Vista

NVWMI VERSION 2.18 STANDALONE PACKAGE

User Guide. GLExpert NVIDIA Performance Toolkit

NVIDIA SDK. NVMeshMender Code Sample User Guide

GLExpert NVIDIA Performance Toolkit

Android PerfHUD ES quick start guide

User Guide. GPGPU Disease

Technical Report. Non-Power-of-Two Mipmap Creation

Deinterleaved Texturing for Cache-Efficient Interleaved Sampling. Louis Bavoil

Multi-View Soft Shadows. Louis Bavoil

GRID SOFTWARE FOR MICROSOFT WINDOWS SERVER VERSION /370.12

Tuning CUDA Applications for Fermi. Version 1.2

Cg Toolkit. Cg 1.2 Release Notes

Technical Brief. AGP 8X Evolving the Graphics Interface

NVIDIA CAPTURE SDK 6.1 (WINDOWS)

Technical Report. SLI Best Practices

CUDA/OpenGL Fluid Simulation. Nolan Goodnight

NSIGHT ECLIPSE PLUGINS INSTALLATION GUIDE

Constant-Memory Order-Independent Transparency Techniques

Cg Toolkit. Cg 1.4 rc 1 Release Notes

NVIDIA CAPTURE SDK 6.0 (WINDOWS)

QUADRO SYNC II FIRMWARE VERSION 2.02

Technical Report. SLI Best Practices

Technical Brief. FirstPacket Technology Improved System Performance. May 2006 TB _v01

Histogram calculation in CUDA. Victor Podlozhnyuk

Technical Report. Mesh Instancing

Cg Toolkit. Cg 2.1 October 2008 Release Notes

Technical Brief. NVIDIA Storage Technology Confidently Store Your Digital Assets

GRID VIRTUAL GPU FOR HUAWEI UVP Version ,

Cg Toolkit. Cg 2.0 January 2008 Release Notes

CUDA TOOLKIT 3.2 READINESS FOR CUDA APPLICATIONS

Cg Toolkit. Cg 2.1 beta August 2008 Release Notes

NVIDIA CAPTURE SDK 7.1 (WINDOWS)

Histogram calculation in OpenCL. Victor Podlozhnyuk

Cg Toolkit. Cg 1.3 Release Notes. December 2004

Cg Toolkit. Cg 2.0 May 2008 Release Notes

User Guide. DU _v01f January 2004

MOSAIC CONTROL DISPLAYS

Cg Toolkit. Cg 2.2 April 2009 Release Notes

CUDA Particles. Simon Green

NVIDIA CUDA C GETTING STARTED GUIDE FOR MAC OS X

VIRTUAL GPU MANAGEMENT PACK FOR VMWARE VREALIZE OPERATIONS

A non-local algorithm for image denoising

Cg Toolkit. Cg 1.2 User s Manual Addendum

SDK White Paper. Improve Batching Using Texture Atlases

PASCAL COMPATIBILITY GUIDE FOR CUDA APPLICATIONS

MAXWELL COMPATIBILITY GUIDE FOR CUDA APPLICATIONS

Hyper-Q Example. Thomas Bradley

Cg Toolkit. Cg 2.2 February 2010 Release Notes

GRID VIRTUAL GPU FOR HUAWEI UVP Version /

NVIDIA CUDA GETTING STARTED GUIDE FOR MAC OS X

VIRTUAL GPU LICENSE SERVER VERSION

NVBLAS LIBRARY. DU _v6.0 February User Guide

RMA PROCESS. vr384 October RMA Process

KEPLER COMPATIBILITY GUIDE FOR CUDA APPLICATIONS

Rain. Sarah Tariq

Skinned Instancing. Bryan Dudash

Getting Started. NVIDIA CUDA C Installation and Verification on Mac OS X

CUDA-MEMCHECK. DU _v03 February 17, User Manual

Particle Simulation using CUDA. Simon Green

How does bilateral filter relates with other methods?

NVIDIA SLI Mosaic Mode

NVIDIA DEBUG MANAGER FOR ANDROID NDK - VERSION 8.0.1

CUDA-GDB: The NVIDIA CUDA Debugger

TUNING CUDA APPLICATIONS FOR MAXWELL

GRID SOFTWARE FOR HUAWEI UVP VERSION /370.28

GRID SOFTWARE FOR HUAWEI UVP VERSION /370.12

Storage Efficient NL-Means Burst Denoising for Programmable Cameras

User Guide. Melody 1.2 Normal Map Creation & Multiple LOD Generation

Getting Started. NVIDIA CUDA Development Tools 2.2 Installation and Verification on Mac OS X. May 2009 DU _v01

GRID VGPU FOR VMWARE VSPHERE Version /

Transcription:

White Paper Denoising February 2007 WP-03020-001_v01

White Paper Document Change History Version Date Responsible Reason for Change _v01 AK, TS Initial release Go to sdkfeedback@nvidia.com to provide feedback on Denoising. ii WP-03020-001_v01

Denoising Abstract Image denoising algorithms may be the oldest in image processing. Many methods, regardless of implementation, share the same basic idea noise reduction through image blurring. Blurring can be done locally, as in the Gaussian smoothing model or in anisotropic filtering; by calculus of variations; or in the frequency domain, such as Weiner filters. However a universal best approach has yet to be found. Among others, neighborhood filters filters that restore a pixel by taking an average of the values of neighboring pixels with a similar color are of great interest due to the simplicity of implementation and the quality of the result. A GPU based technique is to store an image in a texture and use a pixel shader to implement a kernel. Alexander Kharlamov NVIDIA Corporation WP-03020-001_v01 1

White Paper Motivation White noise is one of the most common problems in image processing. Even a high-resolution photo is bound to have some noise in it. But, whereas for a highresolution photo a simple box blur may be sufficient, because even a tiny features like eyelashes or cloth texture will be represented by a large group of pixels. Unfortunately, this is not the case with video where real-time noise reduction is still a subject of many researches. However, current DX10 hardware allows us to implement high quality filters that run at acceptable frame rate. Figure 1. 2 Filtering WP-03020-001_v01

Denoising How It Works The main idea of any neighborhood filter is to calculate pixel weights depending on how similar their colors are. We describe two such methods: the K Nearest Neighbors and Non Local Means filters K Nearest Neighbors Filter The K Nearest Neighbors filter was designed to reduce white noise and is basically a more complex Gaussian blur filter. Let u(x) be the original noisy image, and KNNh,ru(x) be the result produced by the KNN filter with parameters h and r. Let Ω(p) be the spatial neighborhood of a certain size surrounding pixel p. We will consider it to be a block of pixels of size NxN, where N = 2M + 1 so that p is the central pixel of Ω(p). Then let KNNh,ru(x) = where C(x) is the normalizing coefficient. Figure 2. Original, Noisy and KNN Restored Picture WP-03020-001_v01 3

White Paper Non Local Means Filter The Non Local Means filter is a more complex variation of the KNN filter. Using the same notation as for KNN, let NLMh,r,Bu(x) be the restored image, Let B(q) be the spatial neighborhood of a certain size surrounding pixel q. We will consider it to be a block of pixels of size KxK, where K = 2L + 1 so that q is the central pixel of B(q). Then let NLM h,r,b u(x) = 1 C( x ) Ω( x ) u( y )e 2 y x 2 r normalizing coefficient, and e ColorDistance(B(x),B(y)) 2 h dy where C(x) is the 1 ColorDistance( B( x ), B( y )) = u( y + ( x α )) u( α ) S( B ) B( x ) where S(B) is B s area. Thus ColorDistance(B(x),B(y)) represents a normalized sum of absolute differences between blocks around pixel u(x) and around pixel u(y). 2 dα Figure 3. Original, Noisy and NLM Restored Picture. Note: NLM can even fix some flaws in original images (Figure 3) Figure 4. Original and NLM Restored Picture. 4 WP-03020-001_v01

Denoising Choosing Parameters There is always the question of choosing the best parameters for KNN and NLM. As evident from the previous equations the weights for surrounding pixels depend on the following parameters r can be considered to be a traditional Gaussian blur coefficient. If then KNN transforms into Gaussian blur. As with Gaussian blur r should be equal to N. h is a lot more tricky to choose. In fact, the best way to select h is to make it user defined as estimation of quality of the image is highly subjective. The size of Ω depends on the size of the image, but good visual results are usually achieved with a 7x7 block of pixels. NLM has one additional parameter the size of B. B is usually a 7x7 block of pixels. Implementation Details Both methods can be easily implemented in DX10. Original and noisy pictures are loaded as textures and filter kernel is implemented in a pixel shader. The restored image is rendered into a texture. Running the Sample KNN has the following parameters that can be altered by the user: Noise Level corresponds to in the formula for KNNh,ru(x). Lerp Coefficient, Weight Threshold and Counter Threshold are used in a simple modification: Once a weight is counted, it can be compared to g_weightthreshold. The number of weights that are greater than g_weightthreshold are stored in the fcounter variable. The g_weightthreshold should lie between (0.66f, 0.95f). fcounter += (fweight > g_weightthreshold)? 1.0f: 0.0f; Once all the weights are counted, and a restored pixel has been computed, we blend between the original and restored pixels. The blending coefficient is g_lerpcoefficient, its values should lie between (0.00f 0.33f). A simple check determines if the block is smooth: if fcounter exceeds g_counterthreshold (usually more then 66% of all pixels in the block) then the block should be considered smooth, otherwise we presume that the block contains edges or small features. The blending coefficient is altered to preserve restored pixels in the smooth areas and original pixels otherwise. f4result.rgb = (fcounter > (g_counterthreshold * iwindowarea))? lerp (f4result, f4tex00, 1-g_LerpCoefficient): lerp (f4result, f4tex00, g_lerpcoefficient); WP-03020-001_v01 5

White Paper Performance Gaussian Sigma is a traditional Gaussian blur coefficient. It corresponds to in the formula for KNNh,ru(x). Window Radius determines the size of Ω. If Ω is a block of pixels of size NxN, where N = 2M + 1 then M = Window Radius. NLM has one additional parameter: Block Radius determines the size of B. If B is a block of pixels of size KxK, where K = 2L + 1 then L = Block Radius. Traditionally, image filtering is much faster on the GPU than on the CPU. Both KNN and NLM run faster on the GPU. On the CPU, KNN runs in real time while the NLM is much slower. Figure 5 shows what noise does to an image. Figure 6 shows repaired images. Original Image Noisy Image Figure 5. Noise in an Image 6 WP-03020-001_v01

Denoising Image restored with KNN, runs at ~ 290 FPS with Window Radius = 3 Image restored with NLM, runs at ~ 27 FPS with Window Radius = 3 and Block Radius = 3 Figure 6. Restored Images References [1] A. Buades, B. Coll, and J. Morel. Neighborhood Filters and PDE s. Technical Report 2005-04, CMLA, 2005. [2] L. Yaroslavsky. Digital Picture Processing - An Introduction. Springer Verlag, 1985.. WP-03020-001_v01 7

Notice ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, MATERIALS ) ARE BEING PROVIDED AS IS. NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication or otherwise under any patent or patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied. NVIDIA Corporation products are not authorized for use as critical components in life support devices or systems without express written approval of NVIDIA Corporation. Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the United States and other countries. Other company and product names may be trademarks of the respective companies with which they are associated. Copyright 2007 NVIDIA Corporation. All rights reserved. NVIDIA Corporation 2701 San Tomas Expressway Santa Clara, CA 95050 www.nvidia.com