数字图像处理第二次作业

合集下载

数字图像处理第二章课后习题及中文版解答

数字图像处理第二章课后习题及中文版解答

数字图像处理(冈萨雷斯版,第二版)课后习题及解答(部分)Ch 22.1使用2.1节提供的背景信息,并采用纯几何方法,如果纸上的打印点离眼睛0.2m 远,估计眼睛能辨别的最小打印点的直径。

为了简明起见,假定当在黄斑处的像点变得远比视网膜区域的接收器(锥状体)直径小的时候,视觉系统已经不能检测到该点。

进一步假定黄斑可用1.5mm × 1.5mm 的方阵模型化,并且杆状体和锥状体间的空间在该阵列上的均匀分布。

解:对应点的视网膜图像的直径x 可通过如下图题2.1所示的相似三角形几何关系得到,即()()220.20.014d x = 解得x =0.07d 。

根据2.1节内容,我们知道:如果把黄斑想象为一个有337000个成像单元的正方形传感器阵列,它转换成一个大小580×580成像单元的阵列。

假设成像单元之间的间距相等,这表明在总长为1.5 mm 的一条线上有580个成像单元和579个成像单元间隔。

则每个成像单元和成像单元间隔的大小为s =[(1.5 mm)/1159]=1.3×10-6 m 。

如果在黄斑上的成像点的大小是小于一个可分辨的成像单元,在我们可以认为改点对于眼睛来说不可见。

换句话说,眼睛不能检测到以下直径的点:x =0.07d<1.3×10-6m ,即d <18.6×10-6 m 。

下图附带解释:因为眼睛对近处的物体聚焦时,肌肉会使晶状体变得较厚,折射能力也相对提高,此时物体离眼睛距离0.2 m ,相对较近。

而当晶状体的折射能力由最小变到最大时,晶状体的聚焦中心与视网膜的距离由17 mm 缩小到14 mm ,所以此图中选取14mm(原书图2.3选取的是17 mm)。

图 题2.12.2 当在白天进入一个黑暗的剧场时,在能看清并找到空座位时要用一段时间适应,2.1节(视觉感知要素)描述的视觉过程在这种情况下起什么作用?解:根据人眼的亮度适应性,1)由于户外与剧场亮度差异很大,因此当人进入一个黑暗的剧场时,无法适应如此大的亮度差异,在剧场中什么也看不见;2)人眼不断调节亮度适应范围,逐渐的将视觉亮度中心调整到剧场的亮度范围,因此又可以看见、分清场景中的物体了。

数字图像处理 灰度级递减 插值 第二次作业

数字图像处理 灰度级递减 插值 第二次作业

一、实验内容:题目一:把lena.bmp 512*512图像灰度级逐级递减8-1显示。

1. 算法分析:本题中对图像进行的操作是直接灰度变换。

直接灰度变化可以借助图像的位面表示进行。

对一幅用多个比特表示其灰度值的图像来说,其中的每个比特可看做表示了一个二值的平面,也称位面(如下图所示)。

一幅其灰度级用8bit表示的图像有8个位面,一般用位面0 表示最低位面,位面7 表示最高位面。

借助图像的位面表示形式可通过对图像特定位面的操作来达到对图像的增强效果。

2. 具体 MATLAB 实现程序见附录3. 运行结果:256灰度级128灰度级64灰度级32灰度级16灰度级8灰度级4灰度级2灰度级4. 结果分析:对一幅512*512,256个灰度级的具有较多细节的图像,保持空间分辨率不变,仅将灰度级数依次递减为128、64、32、16、8、4、2,比较如下得到的结果就可以发现灰度级数对图像的影响。

当灰度级递减为128或64,一般并不能发现有什么区别。

如果将其灰度级数进一步减为32,则在灰度缓变区常会出现一些几乎看不出来的非常细的山脊状结构。

这种效应成为虚假轮廓,是由于在数字图像的灰度平滑去使用的灰度级数不够而造成的,它一般在用16级或不到16级均匀灰度数的图中比较明显。

因此,运行结果中的前四幅图还基本比较相似,而从第五幅(16灰度级)开始就可以很明显的看到一些虚假轮廓,之后的图中这种现象就也来越明显了,最后一幅2灰度级的图像就已经具有木刻画的效果了。

对比实验中处理过的图像,可以发现,虽然都是灰度图,但是灰度范围越大则图像显示出的色彩越丰富。

题目二:把elain 图像和lena 图像进行加减乘除运算,并按0-255灰度级显示。

1. 算法分析:(1)使用imadd 函数实现两幅图像相加,或常数与图像相加。

该函数将两幅图像对应像素的值相加,将和返回给输出图像的对应像素,若是给每个像素添加一个常数值,可以提高图像的亮度。

数字图像处理第二次作业

数字图像处理第二次作业

电英1102 江嘉栋 2011815302. Chapter4-4(b)%% Shuang Li Chapter4-4(b)clear;clc;M=[7 6 5 4 -4 -5 -6 -7];S=[2 2 -5 -5 6 6 -7 -7];N=length(M)+length(S)-1;M2=[M zeros(1,N-length(M))];S2=[S zeros(1,N-length(S))];left = conv(M,S)right = ifft(fft(M2).*fft(S2))结果:left 与 right 相等,证明卷积定理成立3. Chapter4-9(a) ideal filters (low pass)%% Shuang Li Chapter4-9(a)clear;clc;cm=rgb2gray(imread('twins.tif'));cf=fftshift(fft2(cm));figure,fftshow(cf,'log');height=size(cm,1) ;width=size(cm,2);[x,y]=meshgrid(-floor(width/2): floor((width-1)/2), -floor(height/2):floor((height-1)/2)) ;z=sqrt(x.^2+y.^2);c=(z<15);cfl=cf.*c;figure,fftshow(cfl,'log');cfli=ifft2(cfl);figure,fftshow(cfli,'abs')(a)ideal filters (high pass)与上面的理想低通滤波器代码一样,这是将 c=(z<15); 改成 c=(z>15);实验结果如下:(b)Butterworth filters (low pass)%% Shuang Li Chapter4-9(b)clear;clc;cm=rgb2gray(imread('twins.tif'));cf=fftshift(fft2(cm));figure,fftshow(cf,'log');height=size(cm,1) ;width=size(cm,2);[x,y]=meshgrid(-floor(width/2): floor((width-1)/2), -floor(height/2):floor((height-1)/2)) ;z=sqrt(x.^2+y.^2);c=(z<15);bl=lbutter(c,15,1);cfbl=cf.*bl;figure,fftshow(cfbl,'log')cfbli=ifft2(cfbl);figure,fftshow(cfbli,'abs')(b) Butterworth filters (high pass)%% Shuang Li Chapter4-9(b)clear;clc;cm=rgb2gray(imread('twins.tif'));cf=fftshift(fft2(cm));figure,fftshow(cf,'log');bh=hbutter(cm,15,1);cfbh=cf.*bh;figure,fftshow(cfbh,'log')cfbhi=ifft2(cfbh);figure,fftshow(cfbhi,'abs')(c)Gaussian filters%% Shuang Li Chapter4-9(b)clear;clc;cm=rgb2gray(imread('twins.tif'));cf=fftshift(fft2(cm));figure,fftshow(cf,'log');g1=mat2gray(fspecial('gaussian',256,10)); cg1=cf.*g1;figure;fftshow(cg1,'log')g2=mat2gray(fspecial('gaussian',256,30));cg2=cf.*g2;figure,fftshow(cg2,'log')cgi1=ifft2(cg1);cgi2=ifft2(cg2);figure;fftshow(cgi1,'abs');figure;fftshow(cgi2,'abs');What is the smallest radius of a low pass ideal filter for which the face is still recognizable?当半径<7的时候,不能看清脸,图为半径为7的情况4. Chapter5-6(a)average filtering%% Shuang Li Chapter5-6(a)clear;clc;f=imread('flowers.tif');fg=rgb2gray(f);f=im2uint8(f(30:285,60:315));t_sp=imnoise(f,'salt & pepper',0.05); figure;imshow(t_sp);a3=fspecial('average');t_sp_a3=filter2(a3,t_sp);figure;imshow(t_sp_a3,[]);(b)median filtering%% Shuang Li Chapter5-6(b)clear;clc;f=imread('flowers.tif');fg=rgb2gray(f);f=im2uint8(f(30:285,60:315));figure;imshow(f);t_sp=imnoise(f,'salt & pepper',0.05); figure;imshow(t_sp);t_sp_m3=medfilt2(t_sp);figure;imshow(t_sp_m3,[]);(c)the outlier method%% Shuang Li Chapter5-6(c)clear;clc;f=imread('flowers.tif');fg=rgb2gray(f);f=im2uint8(f(30:285,60:315));t_sp=imnoise(f,'salt & pepper',0.05);figure;imshow(t_sp);res=outlier(t_sp,0.6);figure;imshow(res,[]);(d)pseudo-median filteringWhich method gives the best results?5. Chapter6-2%% Shuang Li Chapter6-2clear;clc;t=imread('cameraman.tif');[x,y]=meshgrid(1:256,1:256);s1=1+sin(x/3+y/5);s2=1+sin(x/5+y/1.5);s3=1+sin(x/6+y/6);tp1=(double(t)/128+s1)/4;tp2=(double(t)/128+s2)/4;tp3=(double(t)/128+s3)/4;figure;subplot(221),imshow(t),title('oir im'); subplot(222),imshow(tp1),title('s1');subplot(223),imshow(tp2),title('s2');subplot(224),imshow(tp3),title('s3');z=sqrt((x-129).^2+(y-129).^2);br=(z < 47 | z > 51);tf1=fftshift(fft2(tp1));tf2=fftshift(fft2(tp2));tf3=fftshift(fft2(tp3));tbr1=tf1.*br;tbr2=tf2.*br;tbr3=tf3.*br;figure;subplot(131),fftshow(tbr1,'log'),title('s1');subplot(132),fftshow(tbr2,'log'),title('s2');subplot(133),fftshow(tbr3,'log'),title('s3');tbr1i=ifft2(tbr1);tbr2i=ifft2(tbr2);tbr3i=ifft2(tbr3);figure;subplot(221),imshow(t),title('oir im');subplot(222),fftshow(tbr1i,'abs'),title('s1');subplot(223),fftshow(tbr2i,'abs'),title('s2');subplot(224),fftshow(tbr3i,'abs'),title('s3');Which of the three is easiest to "clean up"?*******************************************************************7. Chapter7-7%% Shuang Li Chapter7-7 结果:clear;clc;t=imread('circles.tif');[x,y]=meshgrid(1:256,1:256);t2=double(t).*((x+y)/2+64)+x+y;t3=uint8(255*mat2gray(t2));fun=inline('im2bw(t3,graythresh(t3))');t4=blkproc(t,[256,64],fun);figure;imshow(t4);What sized blocks produce the best result?因为图像是256*256的,所以 256*64 的 block 产生的效果最好。

完整版数字图像处理作业题及部分答案

完整版数字图像处理作业题及部分答案

1.数字图像与连续图像相比具有哪些优点?连续图像f(x,y)与数字图像I(c,r)中各量的含义是什么?它们有何联系和区别? (To be compared with an analog image, what are the advantagesof a digital image? Let f(x,y) be an analog image, I(r, c) be a digital image, please giveexplanation and comparison for defined variables: f/I, x/r, and y/c)2.图像处理可分为哪三个阶段? 它们是如何划分的?各有什么特点? (We can divide image processing into 3 stages, what are they? how they are divided? What are their features?)答:低级处理---低层操作,强调图像之间的变换,是一个从图像到图像的过程;中级处理---中层操作,主要对图像中感兴趣的目标进行检测和测量,从而建立对图像的描述,是一个从图像到数值或符号的过程;高级处理---高层操作,研究图像中各目标的性质和相互联系,得出对图像内容含义的理解以及对原来客观场景的解释;3.试从结构和功能等角度分析人类视觉中最基本的几个要素是什么?什么是马赫带效应? 什么是同时对比度?它们反映了什么共同问题? (According to the structure and function of theeyes, what are the basic elements in human vision? What is the Mach Band Effect? What is Simultaneous Contrast? What common facts can we infer from both Mach Band Effect and Simultaneous Contrast?)答:人的视觉系统趋向于过高或过低估计不同亮度区域边界的现象称为“马赫带”效应;同时对比度指的是人的视觉系统对某个区域感觉到的亮度除了依赖于它本身的强度,还与背景有关. 马赫带效应和同时对比度现象表明人所感觉到的亮度并不是强度的简单函数.4.比较说明像素邻域、连接、通路以及连通基本概念的联系与区别。

数字图像处理第二章课后习题及中文版解答

数字图像处理第二章课后习题及中文版解答

数字图像处理(冈萨雷斯版,第二版)课后习题及解答(部分)Ch 22.1使用2.1节提供的背景信息,并采用纯几何方法,如果纸上的打印点离眼睛0.2m 远,估计眼睛能辨别的最小打印点的直径。

为了简明起见,假定当在黄斑处的像点变得远比视网膜区域的接收器(锥状体)直径小的时候,视觉系统已经不能检测到该点。

进一步假定黄斑可用1.5mm × 1.5mm 的方阵模型化,并且杆状体和锥状体间的空间在该阵列上的均匀分布。

解:对应点的视网膜图像的直径x 可通过如下图题2.1所示的相似三角形几何关系得到,即()()220.20.014d x = 解得x =0.07d 。

根据2.1节内容,我们知道:如果把黄斑想象为一个有337000个成像单元的正方形传感器阵列,它转换成一个大小580×580成像单元的阵列。

假设成像单元之间的间距相等,这表明在总长为1.5 mm 的一条线上有580个成像单元和579个成像单元间隔。

则每个成像单元和成像单元间隔的大小为s =[(1.5 mm)/1159]=1.3×10-6 m 。

如果在黄斑上的成像点的大小是小于一个可分辨的成像单元,在我们可以认为改点对于眼睛来说不可见。

换句话说,眼睛不能检测到以下直径的点:x =0.07d<1.3×10-6m ,即d <18.6×10-6 m 。

下图附带解释:因为眼睛对近处的物体聚焦时,肌肉会使晶状体变得较厚,折射能力也相对提高,此时物体离眼睛距离0.2 m ,相对较近。

而当晶状体的折射能力由最小变到最大时,晶状体的聚焦中心与视网膜的距离由17 mm 缩小到14 mm ,所以此图中选取14mm(原书图2.3选取的是17 mm)。

图 题2.12.2 当在白天进入一个黑暗的剧场时,在能看清并找到空座位时要用一段时间适应,2.1节(视觉感知要素)描述的视觉过程在这种情况下起什么作用?解:根据人眼的亮度适应性,1)由于户外与剧场亮度差异很大,因此当人进入一个黑暗的剧场时,无法适应如此大的亮度差异,在剧场中什么也看不见;2)人眼不断调节亮度适应范围,逐渐的将视觉亮度中心调整到剧场的亮度范围,因此又可以看见、分清场景中的物体了。

电大一网一《数字与图像处理》2023春季学期数字与图像处理第2次平时作业-100分

电大一网一《数字与图像处理》2023春季学期数字与图像处理第2次平时作业-100分

新疆开放大学直属《数字与图像处理》2023春季学期数字与图像处理第2
次平时作业-100分
题1:下列哪一个不是数字图像处理的目的。

A.存储和传输
B.显示和打印
C.增强和恢复
D.可视化
正确答案:D
题2:下列算法中属于图象锐化处理的是:()
A.低通滤波
B.加权平均法
C.高通滤波
D.中值滤波
正确答案:C
题3:下列算法中属于局部处理的是:()
A.灰度线性变换
B.二值化
C.傅立叶变换
D.中值滤波
正确答案:D
题4:下列哪一项不是伪彩色图像增强的方法。

A.过滤法
B.密度切割法
C.灰度级-彩色变换
D.滤波法。

数字图像处理第二次作业

数字图像处理第二次作业

2014301220040李进华Problem 3.13The purpose of this simple problem is to make the student think of the meaningof histograms and arrive at the conclusion that histograms carry no informationabout spatial properties of images. Thus, the only time that the histogram of the images formed by the operations shown in the problem statement can be determined in terms of the original histograms is when one (both) of the imagesis (are) constant. In (d) we have the additional requirement that none of thepixels of g(x, y) can be 0. Assume for convenience that the histograms are not normalized, so that,for example,h f (r k )is the number of pixels in f (x, y) havingIn tensity level r k. Assume also that all the pixels in g(x, y)have constant value c.The pixels of both images are assumed to be positive. Finally, let u k denote the intensity levels of the pixels of the images formed by any of the arithmetic operations given in the problem statement. Under the preceding set of conditions,the histograms are determined as follows:(a) We obtain the histogram h sum (u k ) of the sum by letting u k =r k +c, and alsoh sum (u k ) = h f (r k ) for all k. In other words, the values (height) of the components of h sum are the same as the components of h f , but their locations on the intensity axis are shifted right by an amount c.(b) Similarly, the histogram h diff (u k ) of the difference has the same componentsas h f but their locations are moved left by an amount c as a result of the sub-traction operation.(c) Following the same reasoning, the values (heights) of the components of histogram h prod (u k ) of the product are the same as h f , but their locations are atu k = c ×r k . Note that while the spacing between components of the resulting histograms in (a) and (b) was not affected, the spacing between components ofh prod (u k ) will be spread out by an amount c.(d) Finally, assuming that c ≠0, the components of h div (u k ) are the same asthose of h f , but their locations will be at u k = r k /c. Thus, the spacing between components of h div (u k ) will be compressed by an amount equal to 1/c. The preceding solutions are applicable if image f (x, y) is constant also. In this casethe four histograms just discussed would each have only one component. Their location would be affected as described (a) through (d).Problem 3.14(a)Thenumberofboundarypointsbetweentheblackandwhiteregionsismuchlarger in the image on the right. When the images are blurred, the boundarypoints will give rise to a larger number of different values for the image on theright, so the histograms of the two blurred images will be different.(b) To handle the border effects, we surround the image with a border of 0s. We assume that image is of size N ×N (the fact that the image is square is evident from the right image in the problem statement). Blurring is implemented bya 3×3 mask whose coefficients are 1/9. Figure P3.14 shows the different typesof values that the blurred left image will have (see image in the problem statement). The values are summarized in Table P3.14-1. It is easily verified that thesum of the numbers on the left column of the table is N 2 . A histogram is easily constructed from the entries in this table. A similar (tedious) procedure yieldsthe results in Table P3.14-2.Problem 3.16(a)The key to solving this problem is to recognize (1) that the convolution resultat any location (x,y) consists of centering the mask at that point and then formingthesumoftheproductsofthemaskcoefficientswiththecorrespondingpixels in the image; and (2) that convolution of the mask with the entire image results in every pixel in the image being visited only once by every element ofthe mask (i.e., every pixel is multiplied once by every coefficient of the mask). Because the coefficients of the mask sum to zero, this means that the sum of the products of the coefficients with the same pixel also sum to zero. Carrying outthis argument for every pixel in the image leads to the conclusion that the sumof the elements of the convolution array also sum to zero.(b) The only difference between convolution and correlation is that the maskis rotated by 180 ◦. This does not affect the conclusions reached in (a), so cor- relating an image with a mask whose coefficients sum to zero will produce acorrelation image whose elements also sum to zero.Problem 3.17One of the easiest ways to look at repeated applications of a spatial filter is to use superposition. Let f (x, y) and h(x, y) denote the image and the filter function, respectively. Assuming square images of size N ×N for convenience, we can express f (x, y) as the sum of at most N 2 images, each of which has only one nonzero pixel (initially, we assume that N can be infinite). Then, the process of running h(x, y) over f (x, y) can be expressed as the following convolution:h(x,y) ★f (x,y) =h(x,y) ★[f1 (x,y)+ f 2 (x,y)+···+ f N 2 (x,y)]Suppose for illustrative purposes that f i (x,y) has value 1 at its center, while the other pixels are valued 0, as discussed above (see Fig. P3.17a). If h(x,y) is a3×3 mask of 1/9’s (Fig. P3.17b), then convolving h(x,y) with f i (x,y) will produce an image with a 3×3 array of 1/9’s at its center and 0s elsewhere, as Fig.P3.17(c) shows. If h(x,y) is now applied to this image, the resulting image willbe as shown in Fig. P3.17(d). Note that the sum of the nonzero pixels in both Figs. P3.17(c) and (d) is the same, and equal to the value of the original pixel. Thus, it is intuitively evident that successive applications of h(x,y) will ”diffuse”the nonzero value of f i (x,y) (not an unexpected result, because h(x,y)is a blurring filter). Since the sum remains constant, the values of the nonzero elements will become smaller and smaller, as the number of applications of the filter increases. The overall result is given by adding all the convolved f k (x,y),for k =1,2,...,N 2 .It is noted that every iteration of blurring further diffuses the values out- wardly from the starting point. In the limit, the values would get infinitely small, but, because the average value remains constant, this would require an image of infinite spatial proportions. It is at this junction that border conditions become important. Although it is not required in the problem statement, it is instructive to discuss in class the effect of successive applications of h(x,y) to an image of finite proportions. The net effect is that, because the values cannot diffuse out- ward past the boundary of the image, the denominator in the successive appli- cationsofaveragingeventuallyoverpowersthepixelvalues, driving the image to zero in the limit. A simple example of this is given in Fig. P3.17(e), which shows an array of size 1×7 that is blurred by successive applications of the 1×3 mask h(y) =13 [1,1,1]. We see that, as long as the values of the blurred 1 can diffuseout, the sum,S, of the resulting pixels is 1. However, when the boundary is met, an assumption must be made regarding how mask operations on the border are treated. Here, we used the commonly made assumption that pixel value imme- diately past the boundary are 0. The mask operation does not go beyond the boundary, however. In this example, we see that the sum of the pixel values be- gins to decrease with successive applications of the mask. In the limit, the term 1/(3) n would overpower the sum of the pixel values, yielding an array of 0s.Problem 3.21From Fig. 3.33 we know that the vertical bars are 5 pixels wide, 100 pixels high, and their separation is 20 pixels. The phenomenon in question is related to the horizontal separation between bars, so we can simplify the problem by consid- ering a single scan line through the bars in the image. The key to answering this question lies in the fact that the distance (in pixels) between the onset of one bar and the onset of the next one (say, to its right) is 25 pixels.Consider the scan line shown in Fig. P3.21. Also shown is a cross sectionof a 25×25 mask. The response of the mask is the average of the pixels that it encompasses. We note that when the mask moves one pixel to the right, it loses one value of the vertical bar on the left, but it picks up an identical one on the right, so the response doesn’t change. In fact, the number of pixels belonging to the vertical bars and contained within the mask does not change, regardless of where the mask is located (as long as it is contained within the bars, and not near the edges of the set of bars).The fact that the number of bar pixels under the mask does not change is dueto the peculiar separation between bars and the width of the lines in relationto the 25-pixel width of the mask This constant response is the reason why no white gaps are seen in the image shown in the problem statement. Note that this constantresponsedoesnothappenwiththe23×23orthe45×45masksbecause they are not ”synchronized”with the width of the bars and their separation.Problem 3.23The student should realize that both the Laplacian and the averaging process are linear operations, so it makes no difference which one is applied first.。

1数字图像处理 第二版 课后答案 (夏良正 著) 东南大学出版社

1数字图像处理 第二版  课后答案 (夏良正 著) 东南大学出版社

(0⋅(
N
−1))
⎤ ⎥

− e
j
2π N
(1⋅(
N
−1))
⎥ ⎥
M
⎥ ⎥
− e
j
2π N
(( N
−1)⋅( N
−1))
⎥ ⎥⎥⎦
⎡1
1
L
1



( NP)−1
=
⎢1 ⎢M

− e
j
2π N
M
L
− e
j
2π N
(N −1)
⎥ ⎥ ⎥
M
M


⎢ ⎢⎣1
− e
j
2π N
(
N
−1)
L
− e
j
2π N
(N
−1)2
x, y
= ∫∫ f (r cosθ , r sinθ ) exp[− j2π (ur cosθ + vr sinθ )]rdθdr
r ,θ
= ∫∫ E exp[− j2πr(u cosθ + v sinθ )]rdθdr
r ,θ
= ∫∫ E exp[− j2πrρ(cosθ cosϕ + sinθ sinϕ)]rdrdθ
⎡2 −1− i 0 −1+ i⎤
F = 1 ⎢⎢0
0
0
0
⎥ ⎥
2 ⎢0 0 0 0 ⎥
⎢⎣0
0
0
0
⎥ ⎦
⎡1 0 0 −1⎤
W = ⎢⎢0 0 0
0
⎥ ⎥
⎢0 0 0 0 ⎥
⎢⎣0 0 0
0
⎥ ⎦
⎡1 0 0 −1⎤
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

程序:
I=zeros(256,256);
I(118:138,130:137)=256; figure(1);
subplot(4,2,1);
imshow(I);
title('原始图像');
J=fft2(I);
J1=abs(J);
J2=fftshift(J1);
figure(1);
subplot(4,2,2);
imshow(J2,[5 3000]);
title('原始图像的傅里叶频谱');
I1=zeros(256,256);
I1(108:148,130:137)=256; figure(1);
subplot(4,2,3);
imshow(I1);
title('原始图像沿x方向展'); J3=fft2(I1);
J4=abs(J3);
J5=fftshift(J4);
figure(1);
subplot(4,2,4);
imshow(J5,[5 3000]);
title('傅里叶变换后沿x压缩');
I2=zeros(256,256);
I2(118:138,120:147)=256; figure(1);
subplot(4,2,5);
imshow(I2);
title('原始图像沿y方向展'); J6=fft2(I2);
J7=abs(J6);
J8=fftshift(J7);
figure(1);
subplot(4,2,6);
imshow(J8,[5 3000]);
title('傅里叶变换后沿y压缩'); I3=zeros(256,256);
I3(108:148,120:147)=256;
figure(1);
subplot(4,2,7);
imshow(I3);
title('原始图像沿x,y 方向展');
J9=fft2(I3);
J10=abs(J9);
J11=fftshift(J10);
figure(1);
subplot(4,2,8);
imshow(J11,[5 3000]);
title('傅里叶变换后沿x ,y 压缩');
结果显示: 结论:
经傅里叶变换之后图像在x,y 方向的展缩与原来的变换之前相反。

即可证明公式:f(ax,by)<=>1/|ab|F(u/a,v/b)。

原始图像原
始图像的傅里叶频谱原
始图像沿x 方向展傅
里叶变换后沿x 压缩原
始图像沿y 方向展傅
里叶变换后沿y 压缩原
始图像沿x,y 方向展傅里叶变换后沿x ,y 压缩。

相关文档
最新文档