newfla / CUDA-K-SVD-Denoising

K-SVD CUDA implementation for Image Denoising
GNU Lesser General Public License v3.0
6 stars 0 forks source link

K-SVD CUDA implementation for Image Denoising

The algorithm uses Orthogonal Matching Pursuit (OMP) for sparsecoding and kSVD for dictionary learning.

The code uses the thrust library to simplify the vectors' management on the device, the cuSolver library to implement the SVD and cuBlas for implementing OMP

90% of K-SVD computation runs on GPU

Dependencies

Build

cd src  
mkdir build
cd build   
cmake ..    
make     

Setup data

"inputFolder" : "absolute path to images ",

"outputFolder" : "absolute path where processed images will be saved",

"globalParams" : { //for input files
    "patchWidthDim" : 12, //patch side dimension
    "patchHeightDim" : 12,  //other patch side dimension
    "slidingWidth" : 3, //sliding between patches x-axis
    "slidingHeight" : 3, //sliding between patches y-axis
    "atoms" : 256, //number of dicitonary elements 
    "ksvditer" : 10, //Ksvd iterations
    "ompIter": 5, //OMP phase limit
    "B&W" : true, //gray scale images
    "speckle" : false, //don't use log/exp transform
    "type": "CUDA_K_GESVDJ", //SVD decomposition alghorithm check denoisingLib.h for further details
},

"files": [
    {"name" : "barbara.png", //input image file 
     "ref" : "barbaraRef.png", //no noise image file useful for PSNR
     "patchWidthDim": 22 //override globalPatchWidthDim
    }
]

Run

cd src/build
./denoising config.json

Results

Noise Image Recovered Image
image image
image image
image image

Activity Diagram

Overview Diagram

Class Diagram

History

Issues

Credits