├── .gitattributes ├── README.md ├── TV_Regularization_Demo.m └── TVdeblur.m /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Blind_Deconvolution_Total_Variation_MATLAB_implementation 2 | Blind Deconvolution Using Total Variation - MATLAB implementation 3 | 4 | This is an implementation of the Blind Deconvolution Using Total Variation as cited in [1]. 5 | Optimization algorithm used is steepest descent. 6 | 7 | [1] T. F. Chan and C.-K. Wong, “Total Variation Blind Deconvolution,” IEEE Trans. Image Process., vol. 7, no. 3, pp. 370–375, Mar. 1998. 8 | -------------------------------------------------------------------------------- /TV_Regularization_Demo.m: -------------------------------------------------------------------------------- 1 | % Implementation of TV regularization as Blind Deconvolution Technique 2 | % Digital Image Processing Term Project - Auburn University 3 | % John Ragland 4 | clear 5 | close all 6 | clc 7 | 8 | addpath('H:\Documents\0 School Work\OverGrad\MATLAB_functions'); 9 | dbstop if error 10 | addpath('H:\Documents\0 School Work\OverGrad\Coursework\0 Digital Image Processing\Term Project - Deblurring\Pictures'); 11 | 12 | camera = im2double(imread('camera.tif')); 13 | ker = fspecial('disk',3.5); 14 | %ker = [zeros(5,11); ker; zeros(5,11) ]; 15 | 16 | %Blur with circular convolution to avoid dealing with boundaries 17 | % no noise added at this time 18 | cam_blur = imfilter(camera,ker,'conv'); 19 | 20 | figure(1) 21 | imshow(cam_blur) 22 | 23 | %% Set Up Paremeters 24 | beta = 1e-5; 25 | gamma = 1e-1; 26 | 27 | alpha1 =5e-6; 28 | alpha2 = 1e-4 29 | 30 | iterations = 50000; 31 | 32 | 33 | %% Call TVdeblur Function 34 | [un, kn] = TVdeblur(cam_blur,alpha1,alpha2,gamma,beta,iterations); 35 | 36 | %% Generate Figure 37 | figure(2) 38 | subplot(1,2,1) 39 | surf(ker) 40 | subplot(1,2,2) 41 | surf(kn) 42 | 43 | figure(3) 44 | subplot(1,2,1) 45 | imagesc(cam_blur) 46 | title('Blurry Image') 47 | 48 | subplot(1,2,2) 49 | imagesc(un) 50 | title('Rectified Image') 51 | colormap(gray) 52 | 53 | %% Figures for Report 54 | figure(3) 55 | imagesc(un) 56 | set(gca,'xticklabels','') 57 | set(gca,'yticklabels','') 58 | colormap(gray) 59 | truesize() 60 | 61 | figure(2) 62 | imagesc(cam_blur) 63 | set(gca,'xticklabels','') 64 | set(gca,'yticklabels','') 65 | colormap(gray) 66 | truesize() 67 | 68 | figure(5) 69 | subplot(1,2,1) 70 | mesh(padarray(ker,[6 6]),'edgecolor','k','LineWidth',1.2) 71 | subplot(1,2,2) 72 | mesh(padarray(kn,[6 6]),'EdgeColor','k','LineWidth',1.2) -------------------------------------------------------------------------------- /TVdeblur.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/John-Ragland/Total_Variation_MATLAB_implementation/c3c2789d8536b00bb791bf718e77a08f1e2e0b34/TVdeblur.m --------------------------------------------------------------------------------