声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1750|回复: 10

[图像处理] 请教matlab图象恢复的问题

[复制链接]
发表于 2008-1-18 09:34 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
怎么用matlab 恢复 理想图象与函数h=sqrt(x*x+y*y)*1/240 卷积后的模糊图象
明天要交了~~~还搞不出来~~哪位大侠帮个忙~~感激
~~

[ 本帖最后由 eight 于 2008-1-22 17:36 编辑 ]
回复
分享到:

使用道具 举报

发表于 2008-1-18 09:41 | 显示全部楼层
 楼主| 发表于 2008-1-18 09:49 | 显示全部楼层
谢谢拉~~~~
 楼主| 发表于 2008-1-18 10:00 | 显示全部楼层

回复 2楼 的帖子

有错误……我很菜 初学的……
发表于 2008-1-18 10:17 | 显示全部楼层

回复 4楼 的帖子

请说清楚问题
有什么样的错误
 楼主| 发表于 2008-1-18 10:20 | 显示全部楼层
clear all
I = imread('1.bmp');
Img = double(I);
alf=3;
n=10;%定义模板大小
n1=floor((n+1)/2);%计算中心
for i=1:n
for j=1:n
b(i,j) =exp(-((i-n1)^2+(j-n1)^2)/(4*alf))/(4*pi*alf);
end
end
Img_n = uint8(conv2(Img,b,'same'));
K=uint8(imfilter(Img,b));
Img_n2=uint8(imfilter(Img,b,'conv'));
J=(Img_n2)-Img_n;
flag=mean(J(:))
subplot(131),imshow(I);title('原图')
subplot(132),imshow(Img_n);title('卷积运算图')
subplot(133),imshow(K);title('相关运算图')
figure(2),surf(b);
??? Function 'conv2' is not defined for values of class 'double' and attributes 'full 3d re
 楼主| 发表于 2008-1-18 10:24 | 显示全部楼层
先求图像的傅立叶变换再求函数的傅立叶变换 两者相除 再求反变换

这是老师提示的~~但是怎么实现啊~~~太郁闷了~我很菜
发表于 2008-1-18 12:25 | 显示全部楼层

回复 6楼 的帖子

根据错误提示

将double转成成uint8就可以了

评分

1

查看全部评分

 楼主| 发表于 2008-1-18 14:29 | 显示全部楼层

回复 8楼 的帖子

很感激~但是~~~
改后……
>> clear all
I = imread('1.bmp');
Img = unit8(I);
alf=3;
n=10;%定义模板大小
n1=floor((n+1)/2);%计算中心
for i=1:n
for j=1:n
b(i,j) =exp(-((i-n1)^2+(j-n1)^2)/(4*alf))/(4*pi*alf);
end
end
Img_n = uint8(conv2(Img,b,'same'));
K=uint8(imfilter(Img,b));
Img_n2=uint8(imfilter(Img,b,'conv'));
J=(Img_n2)-Img_n;
flag=mean(J(:))
subplot(131),imshow(I);title('原图')
subplot(132),imshow(Img_n);title('卷积运算图')
subplot(133),imshow(K);title('相关运算图')
figure(2),surf(b);
??? Undefined command/function 'unit8'.
 楼主| 发表于 2008-1-18 14:31 | 显示全部楼层

回复 8楼 的帖子

刚才发现uint写错了,但是还是有错切磋我错误
>> clear all
I = imread('1.bmp');
Img = uint8(I);
alf=3;
n=10;%定义模板大小
n1=floor((n+1)/2);%计算中心
for i=1:n
for j=1:n
b(i,j) =exp(-((i-n1)^2+(j-n1)^2)/(4*alf))/(4*pi*alf);
end
end
Img_n = uint8(conv2(Img,b,'same'));
K=uint8(imfilter(Img,b));
Img_n2=uint8(imfilter(Img,b,'conv'));
J=(Img_n2)-Img_n;
flag=mean(J(:))
subplot(131),imshow(I);title('原图')
subplot(132),imshow(Img_n);title('卷积运算图')
subplot(133),imshow(K);title('相关运算图')
figure(2),surf(b);
Warning: CONV2 on values of class UINT8 is obsolete.
         Use CONV2(DOUBLE(A),DOUBLE(B)) or CONV2(SINGLE(A),SINGLE(B)) instead.
> In uint8.conv2 at 11
??? Function 'conv2' is not defined for values of class 'double' and attributes 'full 3d real'.

Error in ==> uint8.conv2 at 20
y = conv2(varargin{:});
发表于 2008-1-18 16:05 | 显示全部楼层

回复 10楼 的帖子

Warning: CONV2 on values of class UINT8 is obsolete.
         Use CONV2(DOUBLE(A),DOUBLE(B)) or CONV2(SINGLE(A),SINGLE(B)) instead.

运行的时候还是用double代替了
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-23 15:20 , Processed in 0.058729 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表