I am trying to reconstruct the image using fewer observations than the dimensions of the signal(compressed sensing). I am trying to run the following piece of code -
A = imread('cameraman.png');
x_i = 37;
y_i = 95;
s = 35;
A = A([x_i:x_i+s],[y_i:y_i+s]);
x = double(A(:));
figure(1),imshow(A)
xlabel('original')
n=length(x);
m=floor(n/3);
Phi=randn(m,n); %Measurment Matrix
Psi=dftmtx(n); %sensing Matrix( or can be dct(eye(n)) )
y=Phi*x; %compressed signal
Theta=Phi*Psi;
%Initial Guess: y=Theta*s => s=Theta\y
s2=Theta\y;
%Solution
s1=l1qc_logbarrier(s2, Theta,[], y, 1e-1, 1e-1);
%Reconstruction
x1=Psi*s1;
figure,imshow(reshape(x1,size(A)), [0 256] ),xlabel('OMP')
However on running the code I get the following error.
Error using linsolve
Matrix must be positive definite.
Error in l1qc_newton (line 92)
[dx,hcond] = linsolve(H11p, w1p, opts);
Error in l1qc_logbarrier (line 104)
[xp, up, ntiter] = l1qc_newton(x, u, A, At, b, epsilon, tau, newtontol,
newtonmaxiter, cgtol, cgmaxiter);
Error in cs_image2 (line 23)
s1=l1qc_logbarrier(s2, Theta,[], y, 1e-1, 1e-1);
The above piece of code recovers the solution when the sensing matrix is the dct matrix instead of dft matrix. Could someone point me to where the error lies? Is it a problem inherent to l1-magic? Will using a different solver work for me?
Note: l1qc_logbarrier is a function from the library l1 magic. http://users.ece.gatech.edu/justin/l1magic/index.html
l1qc_logbarrier solves -