[問題] 使用svd做影像還原重建已回收
我在發文前已爬過文和google過了,但是我還是不知如何處理。
以下的code是將繆紹綱老師的範例作的簡單改寫。
clc ;
clear all;
[x,map]=imread('200681788778.jpg');%任一張全彩影像
A=x(10:320,10:320,:);
[nx,ny]=size(A);
[nx,ny]=size(A);
I=eye(nx,nx);
for i = nx:-1:21
I(i,i)=0;
end
[ u d v]=svd(double(A));%svd 似乎並不支援uint8
B=u*I*d*v';
subplot(211)
imshow(A,map)
subplot(212)
imshow(B,map)
出現以下的錯誤訊息
??? Undefined function or method 'svd' for input arguments of type 'double'
and
attributes 'full 3d real'.
Error in ==> L4_1p2 at 13
[ u d v]=svd(double(A));
如果將這行A=x(10:320,10:320,:);改為A=x(10:320,10:320);
就有結果了,卻是黑白影像。 = =
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.85.43.177
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):