声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1618|回复: 2

[图像处理] 图象重复问题

[复制链接]
发表于 2007-5-24 08:48 | 显示全部楼层 |阅读模式

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

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

x
帮忙看下这段代码:
clear;
I=imread('4.jpg');
figure
imshow(I);
I=rgb2gray(I);
H=size(I);
%if(isgray(I))%判断是否为灰度图像
I=double(I)/255;
I=log(I+1);
constant=mean2(I);
v=ceil(H(2)/2);
  h=ceil(H(1)/2);
while(v>1|h>1)
if(h>1)
  for y=1:H(2)
   for x=1:h
     R_l=log((I(x+h,y)+1/255)/(I(x,y)+1));
     R(x,y)=constant-R_l;
     R(x+h,y)=constant+R_l;
   end
  end
end
if(v>1)  
for x=1:H(1)
   for y=1:v
     R_k=log((I(x,y+v)+1/255)/(I(x,y)+1));
     R(x,y)=constant-R_k;
     R(x,y+v)=constant+R_k;
   end
  end
end
h=ceil(h/2);
v=ceil(v/2);
end
high=max(max(R));
low=min(min(R));
for x=1:H(1)
for y=1:H(2)
L(x,y)=((R(x,y)-low)/(high-low))*255;
end
end
figure
imshow(uint8(L));
处理效果不知道怎么回事好象有断层和某些部分重复的现象,能否帮忙改改,谢谢拉

[ 本帖最后由 eight 于 2007-5-24 09:33 编辑 ]
回复
分享到:

使用道具 举报

发表于 2007-5-24 09:37 | 显示全部楼层
原帖由 yishionyang 于 2007-5-24 08:48 发表
帮忙看下这段代码:
clear;
I=imread('4.jpg');
figure
imshow(I);
I=rgb2gray(I);
H=size(I);
%if(isgray(I))%判断是否为灰度图像
I=double(I)/255;
I=log(I+1);
constant=mean2(I);
v=ceil(H(2)/2 ...


1. 没有数据,不能测试
2. 没有注释,谁有空帮你看
3. 就算1、2都有,你写的程序其效果只有自己明白,因此最好自己修改
 楼主| 发表于 2007-5-24 18:57 | 显示全部楼层
问题解决了,还是要谢谢你虽然不能帮到我
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-9-24 09:26 , Processed in 0.072822 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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