2016-06-03 10 views
0

신호의 크기 (압축 감지)보다 적은 관측을 사용하여 이미지를 재구성하려고합니다. 다음 코드를 실행하려고합니다. -l1 마법 오류 - matlab

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') 

그러나 코드를 실행할 때 다음 오류가 발생합니다.

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); 

위의 코드는 감지 매트릭스가 dft 매트릭스 대신 dct 매트릭스 인 경우 솔루션을 복구합니다. 누군가가 오류가있는 곳으로 나를 가리킬 수 있습니까? 그것은 l1-magic에 내재 된 문제입니까? 다른 해결사를 사용하면 저에게 도움이됩니까?

참고 : l1qc_logbarrier는 라이브러리 l1 마법의 함수입니다. http://users.ece.gatech.edu/justin/l1magic/index.html

l1qc_logbarrier로 해결할 -

l1 minimization

+0

무엇이'l1qc_logbarrier'입니까 ?? 귀하의 게시물에 코드를 포함하십시오! –

+0

l1qc_barrier는 라이브러리 l1 마법의 함수입니다. http://users.ece.gatech.edu/justin/l1magic/index.html – pyronic

답변

1

오류 때문에 소자 복잡한 숫자 및 L1-마법 경우 작동하지 않는 행렬을 출력 dftmtx를 사용 온 것 .

enter image description here

여기 psi이 복잡 - 내가 해결하기 위해 노력했다 문제는 L1-최소화합니다. 그래서 l1-magic은 실패합니다. 그것을 극복하기 위해 나는 다음과 같이 조정했다. enter image description here, 여기서 R은 실수이고 C는 허수 부인 psi이고 마찬가지로, enter image description here이라고합시다. 이

enter image description here

이 우리를 제공

enter image description here

, 우리가 얻을, 2 개 제약을 병합,

enter image description here

우리는 B 따라서, 진짜 것을 알고 있습니다 단일 진짜 제약 enter image description here 형태로되어 있으며, 이는 l1-magic을 사용하여 해결할 수 있습니다.

+0

Matlab에서는 다음과 같이 보일 것입니다 : R = real (Theta); C = imag (세타); Theta2 = [R5-C; C R]; s1 = l1qc_logbarrier ([s2; ... 0 ... 세타, [], ... [y; 0 (길이 (y), 1)] , 1e-1, 1e-1); s1의 마지막 부분은 기본적으로 쓸모없는 정보이므로 버려야합니다. –