头像函数应用
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
dither函数
i=imread('cameraman.tif'); bw=dither(i);
subplot(1,2,1);
imshow(i);
subplot(1,2,2);
imshow(bw)
i=imread('cameraman.tif'); [x,map]=gray2ind(i,16); subplot(1,2,1);
imshow(i);
subplot(1,2,2);
imshow(x,map)
Imhist函数用来绘制图形的直方图i=imread('rice.png');
>> imhist(i);
i=imread('pout.tif');
j=imadjust(i);
subplot(1,3,1);
imshow(i);
subplot(1,3,2);
imshow(j);
k=imadjust(i,[0.3 0.7],[]);
subplot(1,3,3);
imshow(k)
i=imread('wa.jpg');
j=imadjust(i,[.2 .3 0;.6 .7 1],[]); subplot(1,3,1);
imshow(i);
subplot(1,3,2);
imshow(j);
i=imread('rice.png');
background=imopen(i,strel('disk',15)); ip=imsubtract(i,background); subplot(1,3,1);
imshow(i,[]);
subplot(1,3,2);
imshow(background,[]);
subplot(1,3,3);
imshow(ip);
rgb=imread('autumn.tif'); i=rgb2gray(rgb);
subplot(2,2,1);
imshow(i);
j=fft2(i);
j=fftshift(j);
subplot(2,2,2);
imshow(log(abs(j)),[])
j(abs(j)<5000)=0; subplot(2,2,3);
imshow(log(abs(j)+eps),[]) j=ifftshift(j);
k=ifft2(j);
subplot(2,2,4);
imshow(k,[0,255])
rgb=imread('autumn.tif'); i=rgb2gray(rgb);
subplot(2,2,1);
imshow(i);
j=dct2(i);
subplot(2,2,2);
imshow(log(abs(j)),[])
j(abs(j)<10)=0;
subplot(2,2,3);
imshow(log(abs(j)),[])
k=idct2(j);
subplot(2,2,4);
imshow(k,[0,255])
i=zeros(100,100);
i(25:75,25:75)=1;
subplot(1,3,1)
imshow(i)
[r,xp]=radon(i,[0 45]);
subplot(1,3,2);plot(xp,r(:,1));title('r_{0^o}(x\prime)')
subplot(1,3,3);plot(xp,r(:,2));title('r_{45^o}(x\prime)')
theta=0:180;
[r,xp]=radon(i,theta);
imagesc(theta,xp,r);
title('r_{\theta}(x\prime)');
xlabel('\theta(degrees)');
ylabel('x\prime');
set(gca,'xtick',0:20:180);
theta=0:180;
[r,xp]=radon(i,theta); imagesc(theta,xp,r);
title('r_{\theta}(x\prime)'); xlabel('\theta(degrees)'); ylabel('x\prime');
set(gca,'xtick',0:20:180); colormap(hot);
colorbar
i=imread('coins.png'); theta=0:180;
[r,xp]=radon(i,theta);
imagesc(theta,xp,r);
title('r_{\theta}(x\prime)');
xlabel('\theta(degrees)'); ylabel('x\prime');
set(gca,'xtick',0:20:180);
i=imread('coins.png'); theta=0:180;
[r,xp]=radon(i,theta); imagesc(theta,xp,r);
title('r_{\theta}(x\prime)'); xlabel('\theta(degrees)'); ylabel('x\prime');
set(gca,'xtick',0:20:180); colormap(hot);
colorbar