《数字图像处理》期末大作业(1)

合集下载

数字图像处理大作业

数字图像处理大作业

1、下图是一用于干涉原理进行测试的干涉场图像,要求判读条纹的间距,请给出图像处理的方案并说明每一步的作用及其对其它处理步骤可能产生的影响。

解:步骤与思路:○1.进行模糊处理,消除噪声○2.边缘检测,进行图像增强处理○3.二值化图像,再进行边缘检测,能够得到很清晰的边界。

○4.采用横向标号法,根据值为1像素在标号中的相邻位置可以确定间距I=imread('xz mjt.bmp');I1=medfilt2(I); %对图像中值滤波imshow(I1);[m,n]=size(I1);for i=1:mfor j=1:nif(I1(i,j)<100) %阈值为100I1(i,j)=255;elseI1(i,j)=0; %进行二值化endendendfigure;imshow(I1);Y1=zeros(1,25);y2=y1;c=y2;i=100;for j=1:1200if (I1(i,j)==255&&I1(i,j+1)==0)Y1=j+1;endif (I1(i,j)==0&&I1(i,j+1)==255)Y2=j;endendfor i=1:25c=Y2(i)-Y1(i)endc %找出每两个条纹之间的距离2. 现有8个待编码的符号m0,……,m7,它们的概率分别为0.11,0.02,0.08,0.04,0.39,0.05,0.06,0.25,利用哈夫曼编码求出这一组符号的编码并画出哈夫曼树。

3. 请以图像分割方法为主题,结合具体处理实例,采用期刊论文格式,撰写一篇小论文。

各种算子对图像进行边缘检测效果的研究图像分割是根据需要将图像划分为有意义的若干区域或部分的图像处理技术。

通过边缘检测在Matlab中实现方法,及用四叉数分解函数进行区域分割的方法,掌握了Matlab区域操作函数的使用和图像分析和理解的基本方法,并学到了'roberts','sobel','prewitt','canny','log'算子对图像进行边缘检测的不同效果。

重庆师范大学数字图像处理期末作业

重庆师范大学数字图像处理期末作业

1.绘图函数绘制图案金字塔夜程序:#include<iostream>#include<opencv2/imgproc/imgproc.hpp>#include<opencv2/core/core.hpp>#include<opencv2/highgui/highgui.hpp>usingnamespace std;usingnamespace cv;int main(){Mat img(300,300,CV_8UC3,Scalar::all(200));line(img,Point(200,0),Point(50,50),Scalar(255,20,30));//蓝色流星尾迹ellipse(img,Point(50,50),Size(5,2),-15,0,360,Scalar(255,20,30),3,8,0);//流星头部rectangle(img,Point(0,270),Point(300,300),Scalar(50,220,200),30);//黄色沙漠Point vert1[3]={Point(180,80),Point(60,280),Point(190,295)};//金字塔左部端点Point vert2[3]={Point(180,80),Point(250,260),Point(190,295)};//金字塔右部端点const Point*pts1[2]={vert1};int npts[]={3};int ncontour=1;fillPoly(img,pts1,npts,ncontour,Scalar(10,100,120));//金字塔左部上色const Point*pts2[2]={vert2};fillPoly(img,pts2,npts,ncontour,Scalar(0,180,180));//金字塔右部上色circle(img,Point(250,40),5,Scalar(150,100,80),26);//圆形月球circle(img,Point(240,40),5,Scalar(200,200,200),26);//月缺imshow("Egypt",img);waitKey(0);return0;}2.根据ptr()遍历图像的方法绘制图案日出水面#include<iostream>#include<opencv2/opencv.hpp>#include<cmath> usingnamespace std;usingnamespace cv;int main(){Mat img(300,300,CV_8UC3,Scalar::all(255));int nrow=img.rows;int ncol=img.cols;for(int i=0;i<nrow;i++)//此遍历循环是画太阳光线{Vec3b*data=img.ptr<Vec3b>(i);for(int j=0;j<ncol;j++){if((((i-40)-1*(j-230)<4)&&((i-40)-1*(j-230)>-4))||(((i-40)-2*(j-230)<5)&&((i-40)-2*(j-230)>-5))||(((i-40)-0.5*(j-230)<3)&&((i-40)-0.5*(j-230)>-3))||(((i-40)+0.5*(j-230)<3)&&((i-40)+0.5*(j-230)>-3))||(((i-40)+1*(j-230)<4)&&((i-40)+1*(j-230)>-4))||(((i-40)+2*(j-230)<5)&&((i-40)+2*(j-230)>-5))||((i<43)&&(i>37))||((j<233)&&(j>227))){data[j][0]=0;data[j][1]=255;data[j][2]=255;}}}for(int i=0;i<nrow;i++)//此遍历循环是画水波浪{Vec3b*data=img.ptr<Vec3b>(i);for(int j=0;j<ncol;j++){if(i>3*sin(0.3*j)+230){data[j][0]=230;data[j][1]=120;data[j][2]=5;}}}for(int i=0;i<nrow;i++)//此遍历循环是画太阳{Vec3b*data=img.ptr<Vec3b>(i);for(int j=0;j<ncol;j++){if(((i-40)*(i-40)+(j-230)*(j-230))<=300){data[j][0]=40;data[j][1]=120;data[j][2]=255;}}}imshow("img",img);waitKey(0);return0;}3.用直方图均衡化方法处理图片亮环境处理前亮环境处理后暗环境处理前暗环境处理后我们可以看到这两幅图像的对比度都明显变强,层次分明。

数字图像处理_期末考试及答案(三篇)

数字图像处理_期末考试及答案(三篇)

《数字图像处理》试卷答案(2009级)一、名词解释(每题4分,共20分)1.灰度直方图:灰度直方图(histogram)是灰度级的函数,它表示图象中具有每种灰度级的象素的个数,反映图象中每种灰度出现的频率。

它是多种空间域处理技术的基础。

直方图操作能够有效用于图像增强;提供有用的图像统计资料,其在软件中易于计算,适用于商用硬件设备。

灰度直方图性质:1)表征了图像的一维信息。

只反映图像中像素不同灰度值出现的次数(或频数)而未反映像素所在位置。

2)与图像之间的关系是多对一的映射关系。

一幅图像唯一确定出与之对应的直方图,但不同图像可能有相同的直方图。

3)子图直方图之和为整图的直方图。

2.线性移不变系统:一个系统,如果满足线性叠加原理,则称为线性系统,用数学语言可作如下描述:对于,若T[a+b]=aT[]+bT[]=a+b(2.15)则系统T[·]是线性的。

这里,、分别是系统输入,、分别是系统输出。

T[·]表示系统变换,描述了输入输出序列关系,反映出系统特征。

对T[·]加上不同的约束条件,可定义不同的系统。

一个系统,如果系统特征T[·]不受输入序列移位(序列到来的早晚)的影响,则系统称为移不变系统。

由于很多情况下序号对应于时间的顺序,这时也把“移不变”说成是“时不变”。

用数学式表示:对于y(n)= T[x(n)] 若y(n-)=T[x(n-)] (2.16)则系统是移不变的。

既满足线性,又满足移不变条件的系统是线性移不变系统。

这是一种最常用、也最容易理论分析的系统。

这里约定:此后如不加说明,所说的系统均指线性移不变/时不变系统,简称LSI/LTI系统。

3.图像分割:为后续工作有效进行而将图像划分为若干个有意义的区域的技术称为图像分割(Image Segmentation)而目前广为人们所接受的是通过集合所进行的定义:令集合R代表整个图像区域,对R的图像分割可以看做是将R分成N个满足以下条件的非空子集R1,R2,R3,…,RN;(1)在分割结果中,每个区域的像素有着相同的特性(2)在分割结果中,不同子区域具有不同的特性,并且它们没有公共特性(3)分割的所有子区域的并集就是原来的图像(4)各个子集是连通的区域4.数字图像处理:数字图像处理(Digital Image Processing)又称为计算机图像处理,它是指将图像信号转换成数字信号并利用计算机对其进行处理的过程。

数字图像处理期末试题参考答案

数字图像处理期末试题参考答案

1.用matlab进行图像变换,公式:s=L-1-r答:clear;clc;f=imread('source.jpg');%该图像是一幅灰度图像subplot(211);imshow(f);title('原始灰度图像');s=f;f=double(f);s=256-1-f;subplot(212);imshow(uint8(s),[]);title('变换后的图像')2.图1显示了512×512像素尺寸的黑色背景叠加一个20×20像素尺寸的白色矩形。

此图像在傅里叶变换的计算之前乘以(-1)x+y,从而可以使频率关于中心谱对称,用matlab对图1进行变换答:编程f=zeros(512,512);f(246:266,246:266)=1;F=fft2(f,512,512) ;F2=fftshift(F);imshow(log(abs(F2)),[-1 5]);colormap(jet);colorbar;-0.500.511.522.533.544.53.试给出把灰度范围[0,10]伸长为[0,15],把范围[10,20]伸长为[15,25],并把范围[20,30]压缩为[25,30]的变换方程。

答:由()[]c a y x f ab cd y x g +---=,)(),(得 (1)、3(,)(,)2g x y f x y ⎡⎤=*⎢⎥⎣⎦(2)、5),(),(+=y x f y x g (3)、15),(5.0),(+=y x f y x g4、设一幅图像具有表1所示的概率分布,对其分别进行直方图均衡化和规定化,要求规定化的图像具有表2所示的灰度级分布。

表1表2(1)、直方图均衡化处理结果如下。

【数字图像处理】期末复习资料及期末模拟试卷(含答案)doc(DOC)

【数字图像处理】期末复习资料及期末模拟试卷(含答案)doc(DOC)

Digital Image Processing Examination1. Fourier Transform problem.1) F or an image given by the function f(x,y)=(x+y)3 where x,y are continuous varibales; evaluatef(x,y)δ(x-1,y-2) and f(x,y)* δ(x-1,y-2),where δ is the Dorac Delta function.2) F or the optical imaging system shoen below,consisting of an image scaling and two forwardFourier transforms show that the output image is a scale and inverted replica of the original3) three binary images (with value 1 on black areas and value 0 elsewhere) are shown below. Sketch the continuous 2D FT of these images(don’t do this mathematically, try to use instead the convolution theorem and knowledge of FTs of common functions)2. The rate distortion function of a zero memory Gaussian source of arbitary mean and variance σ2 with respect to the mean-square error criterion is⎪⎩⎪⎨⎧≥≤≤=2220log 21)(σσσD D for D D Ra) Plot this functionb) What is D max c) If a distortion of no mor than 75% of the source’s variance is allowed, what is the maximumcompression that can be achieved?3. The PDF of an image is given by Pr(r) as shown below. Find the transform toconvert the image's PDF to Pr(z). Assume continuity, and find the transform in terms of r and z. Explain the transformation.4. A certain inspection application gathers black & white images of parts as they travel along a con-veyor belt. It is necessary to sort the parts into two categories: parts with holes and parts with-out holes. An example of an image that might be taken by the inspection camera is shown at the right. Propose a method to identify and locate the objects of each category in the image so that they can be picked up by a robotic system and placed in different bins. Assume that the imaging system knows where each image pixel is located on the conveyor belt at every point in time.Provide an annotated flow chart of the algorithm you propose.5.In a given application, an averaging mask is applied to input images to reduce noise and then aLaplacian mask is applied to enhance small details. Would mathematics predict that the result should be the same if the order of the operations were reversed? What practical issues would be encountered in computer implementation?Digital Image Processing Examination1. A preprocessing step in an application of microscopy is concerned with the issue ofisolating individual round particles from similar particles that overlap in groups of two or more.Assuming that all particles are of the same size, propose a morphological algorithm that will produce an image that contains only the isolated (non-overlapping) particles that are not in contact with the boundary of the image.2. An image represented by a continuous function f(x, y) is w = 2 cm wide and h = 3 cm high. The imageis to be converted to an array of pixels by a scanner whose response is zero above 80 lines/centimeter in both the horizontal and vertical directions. The discrete image is represented by an array ˆf(n, m) where n and m take on integer values, 0 ~ n ~ N - 1, 0~ m ~ M-1.(a)Determine suitable values for N and M.(b)Assume that ˆf(n, m) = f(na, mb). Determine the values of a and b.(c)Determine constants A, B, C, D, E such that the DFT of fˆ can be expressed as)(00) ,() , (EvmDuniBnCmemnfAvu F+-==∑∑=(d)Find numbers (P1, P2) such that F(u + jP1, v + kP2) = F(u, v) for any integers j, k, u, v.3. The arithmetic decoding process is the reverse of the encoding procedure. Decode the message 0.23355 given the coding model.4. The gradient of a function f (x) is defined as⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎣⎡∂∂∂∂=⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=∇y f x f G G f y xComputationally, the first derivative is implemented by calculating the difference between adjacent pixels.(a) Is the following a linear operator?2122⎥⎥⎦⎤⎢⎢⎣⎡⎪⎪⎭⎫ ⎝⎛∂∂+⎪⎭⎫ ⎝⎛∂∂=∇y f x f f (b) State how would you implement the above operator using differences between pixels.(c) A Sobel operator uses two masks, Hx and Hy to process an image. Explain why are two masksneeded and what do they measure?(d)Write down the masks Hx and Hy, and identify them in the followingfigures:5. The three images shown were blurred using square averaging masks of sizes n=23, 25 , and 45, respectively. The vertical bars on the left lower part of (a) and (c) are blurred, but a clear separation exists between them. However, the bars have merged in image (b), in spite of the fact that the mask that produced this image is significantly smaller than the mask that produced image (c). explain this.Digital Image Processing Examination1. An image array f(m, n) of size M1 × N1 is to be convolved with a filter array h(m, n) of size M2 × N2 to produce a new image array g(m, n).1)Write a pseudo code program that describes a method to compute g(m, n) throughthe use of Fourier transforms. The result should be the same size as would beachieved with direct convolution.2)Modify the algorithm so that it does the correlation f ~ h rather than theconvolution.2. You have the job of designing an algorithm that will count the number of objects with holes and the number of objects without holes in images of the kind shown here. Assume that the images are binary with 0 corresponding to black and 1 correspondingto white. The imaging system is of low quality and produces images that are corrupted with salt and pepper noise.The objects do not overlap or touch, but may be close to each other in any direction.They may be of any shape or size. The algorithm should not be confused by the salt and pepper noise, and should not count noise pixels as objects.Write a pseudo-code description of your algorithm. You may also include a block diagram and other information to make it understandable to a programmer. State any assumptions you make, such as: “Objects must contain at least 50 pixels.”least 50 pixels.”3. Suppose that an image has the gray-level probability density functions shown. Here, p 1(z) corresponds to objects and p 2(z) corresponds to the background. Assume that p 1=p 2 and find the optimal threshold between object and back ground pixels.4. The Sobel operator computes the following quantity at each location (x, y) in an image array, A:Gx[j,k]=(A[j+1,k+1]+2A[j+1,k]+A[j+1,k-1])-(A[j-1,k+1]+2A[j-1,k]+A[j-1,k-1]) Gy[j,k]=(A[j-1,k-1]+2A[j,k-1]+A[j+1,k-1])-(A[j-1,k+1]+2A[j,k+1]+A[j+1,k+1]) G[j,k] = |Gx[j,k]| + |Gy[j,k]|The position of A[j, k] is column j and row k of the array.The operation is implemented as the convolution of the image array A with two masks, Mx and My followed by the magnitude operation.1) Write a 3 × 3 array for each mask, Mx and My.2) What mathematical operation on an image array is approximated by the Sobeloperator? Show how the Sobel operator is related to the mathematical operation.5. Answer the following questions about morphological image processing.(a) Shown below are two tables with expressions that relate to binary morphological image processing. Associate each expression in the left table with one from the right table.(b) A well-known morphological algorithm uses the following iteration with a structuring element B.(1) Initialize X[p] = 1 for some pixel A p ∈(2) A B X Y )(⊕=(3) If X Y ≠ then set X = Y and repeat (2)An original set A is shown in (A) and an initial pixel p 2 A is shown in (B). The result after one iteration of the algorithm with structuring element⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=010111010Bis shown in (C). Fill in the result of the next two iterations by marking theappropriate pixels for the set Y in (D) and (E). In frame (F) show the result for Y that would be reached after a large number of iterations.Digital Image Processing Examination1. Consider the edge model depicted below. Sketch the gradient and Laplacian of the signal. It is not needed to compute exact numerical values in your answer. Plot of approximate shapes of the responses will be sufficient.2. The white bars in the test pattern shown are 7pixels wide and 210 pixels high. The separation between bars is 17 pixels. What would this image look like after application of .1) A 3*3 arithmetic mean filter?2) A 7*7 median filter.3) A 9*9 contraharmonic mean filter with Q=13. The video coding system introduced in the class utilizes several major components –inter-frame motion estimation, motion compensated prediction, DCT, Huffman coding,and quantization.(a)When an encoded signal can be used to reconstruct the exact value of theoriginal signal, we say the encoding method is lossless; otherwise, it’s calledlossy. A lossy coding technique introduces distortion to the signal.Which component in the above video coding system is lossy?(b)The motion compensation process in the encoder generates a motion vectorand prediction errors for each image block in the video signal. Suppose duringthe transmission of the encoded video stream, one motion vector is lost (e.g.,due to the network erasure error). What will be the visual effects of suchtransmission errors on the decoded image sequence?4.Consider a black-and-white image consisting of round and rectangular objects, as shown in the image below. Assume the sizes of the objects are fixed and known. We also know that the width and length of the rectangles are larger than the diameter of the circles. None of the rectangles are tilted. In general, the objects may overlap with each other.Design a morphological operation based system to automatically detect all the instances of the rounds objects that overlap with rectangular objects.5. An image A, represented by an N × M array of bytes, has a uniform brightnesshistogram. It is desired transform A into an image B in a way that produces a triangular brightness histogram2550,36240][≤≤=k k MNk h bDescribe a process that will accomplish the transformation. If possible, derive an equation for the transformation function. At a minimum, sketch the transformation function and indicate how you would use it in a program to compute the array B.模拟试卷一1.对将一个像素宽度的8通路转换到4通路提出一种算法。

华北理工大学《数字图像处理》2023-2024学年第一学期期末试卷

华北理工大学《数字图像处理》2023-2024学年第一学期期末试卷

华北理工大学《数字图像处理》2023-2024学年第一学期期末试卷《数字图像处理》考试内容:《数字图像处理》;考试时间:100分钟;满分:100分;姓名:——;班级:——;学号:——一、选择题(每题2分,共20分)1. 数字图像处理中最基本的单位是:A. 像素B. 灰度C. 色彩空间D. 分辨率2. 灰度直方图主要用于表示图像的:A. 色彩分布B. 亮度分布C. 纹理特征D. 形状特征3. 在图像滤波中,哪种滤波器通常用于去除图像噪声,同时保留边缘信息?A. 高通滤波器B. 低通滤波器C. 中值滤波器D. 边缘检测滤波器4. 下列哪项不属于图像增强的技术?A. 对比度拉伸B. 锐化C. 压缩D. 平滑5. JPEG是一种常用于哪种类型图像的压缩标准?A. 文本B. 音频C. 静态图像D. 视频6. 图像的几何变换不包括:A. 平移B. 旋转C. 缩放7. 边缘检测中常用的Sobel算子属于哪种类型的滤波器?A. 高通B. 低通C. 带通D. 带阻8. 傅里叶变换在图像处理中主要用于:A. 频域分析B. 空间域分析C. 色彩校正D. 纹理合成9. 下列哪个函数在图像处理中常用于图像的平滑处理?A. 拉普拉斯算子B. 高斯函数C. 罗伯特交叉梯度算子D. 坎尼边缘检测器10. 在直方图均衡化中,目的是使图像的直方图分布更加:A. 均匀C. 陡峭D. 平坦二、填空题(每题2分,共20分)1. 数字图像处理的基本单位是_____。

2. 图像的亮度信息通常通过_____来表示。

3. 在图像处理中,用于去除噪声同时保持边缘信息的常用技术是_____。

4. JPEG是一种广泛应用于_____图像的压缩标准。

5. 图像的几何变换包括平移、旋转、_____和仿射变换等。

6. Sobel算子是一种用于_____检测的滤波器。

7. 傅里叶变换在图像处理中主要用于将图像从_____转换到频域。

8. 直方图均衡化是一种用于改善图像_____分布的技术。

数字图像处理期末考试答案

数字图像处理期末考试答案

数字图像处理期末考试答案《数字图像处理》复习指南选择题1、采⽤幕次变换进⾏灰度变换时,当幕次取⼤于1 时,该变换是针对如下哪⼀类图像进⾏增强。

( B ) A图像整体偏暗B图像整体偏亮C图像细节淹没在暗背景中D图像同时存在过亮和过暗背景2、图像灰度⽅差说明了图像哪⼀个属性(B )A平均灰度B图像对⽐度C 图像整体亮度D图像细节3、计算机显⽰器主要采⽤哪⼀种彩⾊模型(A )A、RGBB、CMY或CMYKC、HSID、HSV4、采⽤模板[-1 1]T主要检测(A)⽅向的边缘。

A.⽔平B.450C.垂直D.13505、下列算法中属于图象锐化处理的是:( C )A.低通滤波B.加权平均法C.⾼通滤波D. 中值滤波6、维纳滤波器通常⽤于( C )A、去噪B、减⼩图像动态范围C、复原图像D、平滑图像7、彩⾊图像增强时,(C)处理可以采⽤RGB彩⾊模型。

A. 直⽅图均衡化B.同态滤波C. 加权均值滤波D. 中值滤波8、 B 滤波器在对图像复原过程中需要计算噪声功率谱和图像功率谱。

A. 逆滤波B.维纳滤波C. 约束最⼩⼆乘滤波D. 同态滤波9、⾼通滤波后的图像通常较暗,为改善这种情况,将⾼通滤波器的转移函数加上⼀常数量以便引⼊⼀些低频分量。

这样的滤波器叫( B )。

A. 巴特沃斯⾼通滤波器B.⾼频提升滤波器C. ⾼频加强滤波器D. 理想⾼通滤波器10、图象与灰度直⽅图间的对应关系是( B )A.⼀⼀对应B.多对⼀C.⼀对多D.都不11、下列算法中属于图象锐化处理的是:( C)A.低通滤波B.加权平均法C.⾼通滤波D. 中值滤波12、⼀幅256*256 的图像,若灰度级数为16,则存储它所需的⽐特数是:(A)A.256KB.512KC. 1M C.2M13、⼀幅灰度级均匀分布的图象,其灰度范围在[0,255],则该图象的信息量为:(D)a.0b.255c.6d.814、下列算法中属于局部处理的是:(D)a.灰度线性变换b.⼆值化c.傅⽴叶变换d.中值滤波15、下列算法中属于点处理的是:(B)a.梯度锐化b.⼆值化c.傅⽴叶变换d.中值滤波16、下列算法中属于图象平滑处理的是:(C)a.梯度锐化b.直⽅图均衡c.中值滤波/doc/dfc0f0e5f424ccbff121dd36a32d7375a517c64d.html placian增强17、设灰度图中每⼀个像素点由1 个字节表⽰,则可表⽰的灰度强度范围是(B)A.128 B.256 C.36 D.9618、对椒盐噪声抑制效果最好的是下列那种图像增强技术?(D)A 低通滤波B Laplace 微分C 邻域平均D 中值滤波19、将图像“name.tif”存储到⽂件中的命令(C)A、imread(’name.tif’)B、loadC、imwrite(’name.tif’)D、imshow(’name.tif’)20.计算机显⽰设备使⽤的颜⾊模型是(A)A.RGBB.HSVC.CMYD.以上都不对21.下列关于直⽅图的叙述错误的是(D)A.描绘了各个灰度级像素在图像中出现的概率B.描述图像中不同灰度级像素出现的次数C. 没有描述出像素的空间关系D. 直⽅图均衡化不能增强图像整体对⽐度的效果22.锐化滤波器的主要⽤途不包括( B)A.突出图像中的细节增强被模糊了的细节B.超声探测成像分辨率低可以通过锐化来使图像边缘模糊C.图像识别中分割前的边缘提取D.锐化处理恢复过度钝化、暴光不⾜的图像23.假设f(x,y)是⼀幅图像,则下列有关f(x,y) 的傅⾥叶变换说法中不正确(C)A.在原点的傅⾥叶变换等于图像的平均灰度级B.⼀个⼆维傅⾥叶变换可以由两个连续⼀维的傅⾥叶运算得到C.图像频率域过滤可以通过卷积来实现D.傅⾥叶变换具有线性移不变性24.列有关图像复原和图像增强的说法错误的是(D)A.与图像增强不同,图像复原的⽬的是提供给⽤户喜欢接收的图像B.图像增强主要是⼀个客观过程,⽽图像复原主要是⼀个主观过程C.图像增强被认为是⼀种对⽐度拉伸,图像复原技术追求恢复原始图像的⼀种近似估计值D.图像复原技术只能使⽤频率域滤波器实现25、下列哪⼀个模板可⽤于图像平滑(AA、1/9 1/9 1/9B、1 1 1C、1/3 1/3 1/3D、-1 -1 -11/9 1/9 1/9 1 -8 1 1/3 1/3 1/3 -1 8 -1 1/9 1/9 1/9 1 1 1 1/3 1/3 1/3 -1 -1 -1 26、对于含有孤⽴线噪声的图像,既要保证图像的边缘,⼜要去除噪声应该⽤那种滤波器(B)A、box模板B、中值滤波器C、gauss模板D、prewitt模板27、对⼀幅⼆值图像做腐蚀的结果(B)A、图像⾯积放⼤B、图像⾯值缩⼩C、图像⾯积不变D、图像边界变圆28、下列算法中属于局部处理的是(D)A、灰度线性变换B、⼆值化C、傅⾥叶变换D、中值滤波判别正确、错误1. 图像按其亮度等级的不同,可以分为⼆值图像和灰度图像两种。

数字图像处理期末试卷及答案

数字图像处理期末试卷及答案

XXXX 学院2020-2021学年学期期末考试卷课程《数字图像处理》考试时间: 120 分钟班级姓名学号一. 填空题(每空1分, 共20分)1.________是指由外部轮廓线条构成的矢量图, 即由计算机绘制的直线、圆、矩形、曲线、图表等。

2.图像根据色彩分为: 彩色图像、___________和___________。

3.对一幅连续图像f(x,y)在二维空间上的离散化过程称为___________,离散化后的采样点称为___________。

4.图像分辨率包括___________和___________两部分, 它们分别由采样点数和灰度级来控制。

5.普通彩色图像中, 一个像素需要24比特构成, R、G、B各占______个比特, 可能的颜色数有______种。

6.RGB模型, 也叫______、______、______模型, 广泛用于彩色显示器, 高质量彩色摄像机中。

7.在HSI空间中, 彩色图像包含色调、___________和___________三个分量。

8.______________是一种线性的积分变换, 常在将信号在时域(或空域)和频域之间变换时使用, 在物理学和工程学中有许多应用。

9.灰度变换是数字图像增强技术的一个重要的手段, 目的是使图像的__________动态范围扩大, 图像的__________扩大, 图像更加清晰, 特征越发明显。

10.图像的退化由系统特性和__________两部分引起。

11._____________是利用图像数据的冗余进行压缩,可完全恢复原始数据而不引起任何失真,压缩率受冗余度的理论限制。

1. ________目的是改善图像质量, 使图像更加符合人类的视觉效果, 从而提高图像判读和识别效果的处理方法。

A.图像增强B.图像变换C.图像分割D.图像复原2. ________是指当观察目标和背景时, 会感到背景较暗的目标物较亮, 而背景较亮的目标物则较暗。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

《数字图像处理》期末大作业大作业题目及要求:一、题目:本门课程的考核以作品形式进行。

作品必须用Matlab完成。

并提交相关文档。

二、作品要求:1、用Matlab设计实现图形化界面,调用后台函数完成设计,函数可以调用Matlab工具箱中的函数,也可以自己编写函数。

设计完成后,点击GUI图形界面上的菜单或者按钮,进行必要的交互式操作后,最终能显示运行结果。

2、要求实现以下功能:每个功能的演示窗口标题必须体现完成该功能的小组成员的学号和姓名。

1)对于打开的图像可以显示其灰度直方图,实现直方图均衡化。

2)实现灰度图像的对比度增强,要求实现线性变换和非线性变换(包括对数变换和指数变换)。

3)实现图像的缩放变换、旋转变换等。

4)图像加噪(用输入参数控制不同噪声),然后使用空域和频域进行滤波处理。

5)采用robert算子,prewitt算子,sobel算子,拉普拉斯算子对图像进行边缘提取。

6)读入两幅图像,一幅为背景图像,一幅为含有目标的图像,应用所学的知识提取出目标。

3、认真完成期末大作业报告的撰写,对各个算法的原理和实验结果务必进行仔细分析讨论。

报告采用A4纸打印并装订成册。

附录:报告模板《数字图像处理》期末大作业班级:计算机小组编号:第9组组长:王迪小组成员:吴佳达浙江万里学院计算机与信息学院2014年12月目录(自动生成)1 绘制灰度直方图,实现直方图均衡化 (5)1.1 算法原理 (5)1.2 算法设计 (5)1.3 实验结果及对比分析 (5)2 灰度图像的对比度增强 (5)2.1 算法原理 (5)2.2 算法设计 (5)2.3 实验结果及分析 (5)3 图像的几何变换 (5)3.1 算法原理 (5)3.2 算法设计 (5)3.3 实验结果及分析 (5)4 图像加噪(用输入参数控制不同噪声),然后使用空域和频域进行滤波处理 (5)4.1 算法原理 (5)4.2 算法设计 (6)4.3 实验结果及分析 (6)5 采用robert,prewitt,sobel,拉普拉斯算子对图像进行边缘提取 (6)5.1 算法原理 (6)5.2 算法设计 (6)5.3 实验结果及分析 (6)6 读入两幅图像,一幅为背景图像,一幅为含有目标的图像,应用所学的知识提取出目标 (6)6.1 算法原理 (6)6.2 算法设计 (6)6.3 实验结果及分析 (6)7 小结(感受和体会) (6)1 绘制灰度直方图,实现直方图均衡化1.1 算法原理图像增强是指按特定的需要突出一幅图像中的某些信息,同时,消弱或去除某些不需要的信息的处理方法。

其主要目的是处理后的图像对某些特定的应用比原来的图像更加有效。

图像增强技术主要有直方图修改处理、图像平滑化处理、图像尖锐化处理和彩色处理技术等。

本实验以直方图均衡化增强图像对比度的方法为主要内容,其他方法同学们可以在课后自行联系。

直方图是多种空间城处理技术的基础。

直方图操作能有效地用于图像增强。

除了提供有用的图像统计资料外,直方图固有的信息在其他图像处理应用中也是非常有用的,如图像压缩与分割。

直方图在软件中易于计算,也适用于商用硬件设备,因此,它们成为了实时图像处理的一个流行工具。

直方图是图像的最基本的统计特征,它反映的是图像的灰度值的分布情况。

直方图均衡化的目的是使图像在整个灰度值动态变化范围内的分布均匀化,改善图像的亮度分布状态,增强图像的视觉效果。

灰度直方图是图像预处理中涉及最广泛的基本概念之一。

图像的直方图事实上就是图像的亮度分布的概率密度函数,是一幅图像的所有象素集合的最基本的统计规律。

直方图反映了图像的明暗分布规律,可以通过图像变换进行直方图调整,获得较好的视觉效果。

直方图均衡化是通过灰度变换将一幅图像转换为另一幅具有均衡直方图,即在每个灰度级上都具有相同的象素点数的过程。

1.2 算法设计f=imread('medicine_pic.jpg');g=imhist(f,256); %显示其直方图g1=imadjust(f,[0 1],[1 0]); %灰度转换,实现明暗转换(负片图像)figure,imshow(g1)%将0.5到0.75的灰度级扩展到范围[0 1]g2=imadjust(f,[0.5 0.75],[0 1]);figure,imshow(g2)g=imread('point.jpg');h=log(1+double(g)); %对输入图像对数映射变换h=mat2gray(h); %将矩阵h转换为灰度图片h=im2uint8(h); %将灰度图转换为8位图figure,imshow(h) I=imread('camera.jpg'); % 读入原图像J=histeq(I); %对原图像进行直方图均衡化处理imshow(I); %显示原图像title('原图像'); %给原图像加标题名%对原图像进行屏幕控制;显示直方图均衡化后的图像figure;imshow(J);%给直方图均衡化后的图像加标题名title('直方图均衡化后的图像') ;%对直方图均衡化后图像进行屏幕控制;作一幅子图,并排两幅图的第1幅figure; subplot(1,2,1) ;imhist(I,64); %将原图像直方图显示为64级灰度title('原图像直方图') ; %给原图像直方图加标题subplot(1,2,2); %作第2幅子图imhist(J,64) ; %将均衡化后图像的直方图显示为64级灰度title('均衡变换后的直方图') ; %给均衡化后图像直方图加标题名1.3 实验结果及对比分析图1 图2分析:直方图均衡化可以增加许多图像的全局对比度,尤其是当图像的有用数据的对比度相当接近的时候,通过这种方法,亮度可以更好地在直方图上分布。

这样就可以用于增强局部的对比度而不影响整体的对比度,直方图均衡化通过有效地扩展常用的亮度来实现这种功能。

2 灰度图像的对比度增强2.1 算法原理术语‘空间域’指的是图像平面本身,在空间与内处理图像的方法是直接对图像的像素进行处理。

空间域处理方法分为两种:灰度级变换、空间滤波。

空间域技术直接对像素进行操作其表达式为g(x,y)=T[f(x,y)]其中f(x,y)为输入图像,g(x,y)为输出图像,T是对图像f进行处理的操作符,定义在点(x,y)的指定领域内。

定义点(x,y)的空间邻近区域的主要方法是,使用中心位于(x,y)的正方形或长方形区域,。

此区域的中心从原点(如左上角)开始逐像素点移动,在移动的同时,该区域会包含不同的领域。

T应用于每个位置(x,y),以便在该位置得到输出图像g。

在计算(x,y)处的g 值时,只使用该领域的像素。

灰度变换T的最简单形式是使用领域大小为1×1,此时,(x,y)处的g值仅由f在该点处的亮度决定,T也变为一个亮度或灰度级变化函数。

当处理单设(灰度)图像时,这两个术语可以互换。

由于亮度变换函数仅取决于亮度的值,而与(x,y)无关,所以亮度函数通常可写做如下所示的简单形式:s=T(r)其中,r表示图像f中相应点(x,y)的亮度,s表示图像g中相应点(x,y)的亮度。

2.2 算法设计f=imread('1.jpg');g=imhist(f,256); %显示其直方图g1=imadjust(f,[0 1],[1 0]); %灰度转换,实现明暗转换(负片图像)figure,imshow(g1)%将0.5到0.75的灰度级扩展到范围[0 1]g2=imadjust(f,[0.5 0.75],[0 1]);figure,imshow(g2)g=imread(2.jpg');h=log(1+double(g)); %对输入图像对数映射变换h=mat2gray(h); %将矩阵h转换为灰度图片h=im2uint8(h); %将灰度图转换为8位图figure,imshow(h)2.3 实验结果及分析通过图形灰度变换实验,了解掌握了一般图像处理所要到达的效果,明白了图像在生活中的作用,但是它只能处理一些黑白的图像,在实验中我用彩色图片就不行,心有余而力不足,很难解决更高层次的问题,所以还需要更多的图像处理方法来处理图像。

3 图像的几何变换3.1 算法原理3.2 算法设计3.3 实验结果及分析4 图像加噪(用输入参数控制不同噪声),然后使用空域和频域进行滤波处理4.1 算法原理a) 调入并显示原始图像Sample2-1.jpg 。

b) 利用imnoise 命令在图像Sample2-1.jpg 上加入高斯(gaussian) 噪声c)利用预定义函数fspecial 命令产生平均(average)滤波器111191111---⎡⎤⎢⎥--⎢⎥⎢⎥---⎣⎦d )分别采用3x3和5x5的模板,分别用平均滤波器以及中值滤波器,对加入噪声的图像进行处理并观察不同噪声水平下,上述滤波器处理的结果;e )选择不同大小的模板,对加入某一固定噪声水平噪声的图像进行处理,观察上述滤波器处理的结果。

f )利用imnoise 命令在图像Sample2-1.jpg 上加入椒盐噪声(salt & pepper)g )重复c)~ e )的步骤h )输出全部结果并进行讨论。

4.2 算法设计I=imread('3.jpg');imshow(I);J = imnoise(I,'gauss',0.02); %添加高斯噪声J = imnoise(I,'salt & pepper',0.02); %添加椒盐噪声figure,imshow(J);ave1=fspecial('average',3); %产生3×3的均值模版ave2=fspecial('average',5); %产生5×5的均值模版K = filter2(ave1,J)/255; %均值滤波3×3 figure,imshow(K);L = filter2(ave2,J)/255; %均值滤波5×5 figure,imshow(L);M = medfilt2(J,[3 3]); %中值滤波3×3模板figure,imshow(M);N = medfilt2(J,[4 4]); %中值滤波4×4模板figure,imshow(N);4.3 实验结果及分析均值滤波对高斯噪声比对椒盐噪声有效,明显看到均值滤波器能很大程度上滤除高斯噪声,滤波后图像中的噪声残留不是很大,用均值滤波处理过后的图像显得有点模糊不清;中值滤波对于噪声离散度较小的高斯噪声无能为力,加入高斯噪声的图像经Butterworth低通滤波器滤波后,可以明显看出噪声已经得到了有效抑制,但是仍然和对椒盐噪声的滤除结果相似,图像中残留大量的噪声,图像质量改善程度不高显得模糊不清。

相关文档
最新文档