Skip to content

skrasekmichael/NonlinearFilters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nonlinear Filters

Bachelor's thesis

Topic: Nonlinear filtering for large 3D image data (Bilateral filter, Non-local means filter).

Milestones

  • 2D Bilateral filter (naive implementation) ✔
  • Parallel processing ✔
  • Fast 2D Bilateral filter (custom optimizations) ✔
  • 2D Non-local means filter ✔
  • Fast 2D Non-local means filter (integral image) ✔
  • CLI for 2D ✔
  • rendering 3D volumetric data ✔
  • 3D Bilateral filter ✔
  • 3D Non-local means filter ✔
  • CLI for 3D ✔
  • Piecewise processing for large 3D volumetric data
  • Optimizations via parallel processing using SIMD

Data samples

Image:

  • House 620x620 (GrayScale) source

Volumetric data:

  • CT Foot 183x255x125 (uint8) source
  • C60 64x64x64 (uint8) source

Bilateral filter

Parameter Value
Space sigma 6
Range sigma 25.5
Filter Windows [s] Ubuntu [s]
Bilateral (1 thread) ~ 0.56 ~ 0.51
Bilateral ~ 0.16 ~ 0.15
OpenCV ~ 0.30 ~ 0.32
SimpleITK ~ 1.04 ~ 0.70
Itk ~ 0.71 ~ 0.78

Noisy vs Bilateral filter Bilateral filter

Non-local means filter

Parameter Value
h 15
Patch size 3x3
Window size 21x21
Samples 500
Filter Windows [s] Ubuntu [s]
Non-local means (1 thread) ~ 8.0 ~ 6.26
Non-local means (7 threads) ~ 2.25 ~ 1.83
Non-local means sampled (7 threads) ~ 1.58 ~ 1.4
Fast Non-local means (1 thread) ~ 3.36 ~ 3.15
Fast Non-local means (7 threads) ~ 2.1 ~ 2.2
Fast Non-local means sampled (7 threads) ~ 1.5 ~ 2
OpenCV ~ 0.9 ~ 0.4

Note: Fast Non-local means filter complexity is independent to patch size due to integral image optimizations

Noisy vs Non-local means filter Non-local means filter

Non-local means filter vs OpenCV Non-local means filter Non-local means vs OpenCV filter

Sampled Non-local means filter vs OpenCV Non-local means filter Sampled Non-local means vs OpenCV filter

Bilateral vs Non-local means

Comparison

Rendering volumetric data

3D rendering of noisy volumetric data using ray casting

noisy volumetric image

3D Bilateral filter

Parameter Value
Domain sigma 5
Range sigma 20
Filter Windows Ubuntu
Fast Bilateral (1 thread) ~ 1.3 min ~ 1.6 min
Fast Bilateral (7 threads) ~ 25 sec ~ 27 sec
Simple Itk (multi-threaded) ~ 14.9 min ~ 9.2 min
Itk (multi-threaded) ~ 12 min ~ 7.75 min

Fast bilateral filter Fast 3D bilateral

Note: There are no differences discernible to the eye between measured filters.

3D Non-local means filter

Parameter Value
h 20
Patch size 3x3x3
Window size 15x15x15
Samples 500
Filter Windows Ubuntu
Non-local means sampled (7 threads) ~ 10.6 min ~ 10.5 min
Fast Non-local means sampled (1 thread) ~ 4.0 min ~ 4.2 min
Fast Non-local means sampled (7 threads) ~ 1.4 min ~ 1.5 min
scikit (1 thread) ~ 7 min ~ 4.9 min

Note: Fast Non-local means filter (as well as scikit impl.) complexity is independent to patch size due to integral image optimizations

Non-local means sampled filter 3D Non-local means sampled

scikit Non-local means filter 3D Non-local scikit

3D Bilateral vs 3D Non-local means

3D bl vs nlm

Testing environment

Tool Windows 10 Ubuntu 20.04 (WSL 2)
.NET runtime 6.0.3 6.0.3
Python 3.10.2 [MSC v.1929 64 bit (AMD64)] 3.8.10 [GCC 9.4.0]
OpenCV 4.5.5 4.5.5
Itk 5.3.0 5.2.1
SimpleITK 2.2.0rc2.post35 2.1.1
scikit image 0.19.2 0.19.2

Remainder: