图像处理大作业

  • 格式:doc
  • 大小:83.00 KB
  • 文档页数:17

重庆科技学院《图像处理》课程大作业院(系):_电气与信息工程学院_专业班级:计科1004 学生姓名:谢子洋学号: 2010441747 设计地点(单位) I515设计题目:数字图像处理大作业完成日期: 2012年月日指导教师评语: _____________________________________________________________________________________________________________________________________________________________________________________________成绩(五级记分制):______ __________指导教师(签字):________ ________1 大作业题目1.1连续图像f(x.y)和数字图像I(r,c)中各分量的含义是什么?他们有什么联系和区别?取值范围在什么范围?答:连续图像f(x,y)对应一个2-D数组,这里想x,y表示2D空间XY里面的坐标点的位置,f则表示图像在(x,y)的某种性质F的数值,其中图像的实际尺寸更具图像的实际大小所限制的。

数字图像I(r,c)也对应一个2-D数组,I代表离散化都的f,(r,c)代表离散化后的(x,y),r代表图像的行,c代表图像的列,这里的I,r,c都是整数。

连续图像f(x,y)代表的连续实际图像,F是指图像在f的各个分量上的值。

例如:二值灰度值图像,其中f在x,y分量上只有0 和1 两个值。

这个也适用于rgb彩色图像。

一个函数可由n阶泰特公式展开,因此,数字图像虽然没有完全刻画Original图像,利用计数机高速度计算,将这个整体的Original图像分割,以点的值存储到相应的坐标点上。

其中 f(x,y)的值是任意实数,而 I, c,r的值都是整数1.2发光强度及亮度、照度各有什么不同?答:发光强度只指光源的能量辐射强度;亮度是指扩展光源在某个方向上的单位投影面积的发光强度;照度是指光源照射到母体表面的光通量,它是光源对物体辐射的一种量度。

答:1)发光强度,单位坎德拉,即cd。

定义:光源在给定方向的单位立体角中发射的光通量定义为光源在该方向的发光强度。

解释:发光强度是针对点光源而言的,或者发光体的大小与照射距离相比比较小的场合。

这个量是表明发光体在空间发射的会聚能力的。

可以说,发光强度就是描述了光源到底有多“亮”,因为它是光功率与会聚能力的一个共同的描述。

发光强度越大,光源看起来就越亮,同时在相同条件下被该光源照射后的物体也就越亮,因此,早些时候描述手电都用这个参数。

2)亮度,单位尼特,即nt。

定义:单位光源面积在法线方向上,单位立体角内所发出的光流。

解释:这个是最容易被误解的概念了。

亮度是针对光源而言,而且不是对点光源,是对面光源而言的。

无论是主动发光的还是被动(反射)发光的。

亮度是一块比较小的面积看起来到底有多“亮”的意思。

这个多“亮”,与取多少面积无关,但为了均匀,我们把面积取得比较小,因此才会出现“这一点的亮度”这样的说法。

亮度不仅取决于光源的光通量,更取决于等价发光面积和发射的会聚程度。

比如激光指示器,尽管其功率很小,但可会聚程度非常高,因此亮度非常高。

3)光照度,单位勒克斯,即lx。

定义:流明的光通量均匀分布在1平方米表面上所产生的光照度。

解释:光照度是对被照地点而言的,但又与被照射物体无关。

一个流明的光,均匀射到1平方米的物体上,照度就是1 lx。

照度的测量,用照度表,或者叫勒克斯表、lux 表。

常见照度:阳光直射(正午)下,110,000 lx,阴天室外,1000 lx,商场内,500 lx,阴天有窗室内,100 lx,普通房间灯光下,100 lx,满月照射下,0.2 lx。

1.3试讨论连续卷积和离散卷积的不同。

答:连续卷和离散卷在定义域上不同,为了避免重叠失误,在离散卷中需要对被卷积系列进行扩展,即要将有限长的被卷积系列A和B扩展成长度为M=A+B-1的序列以得到以M为周期的结果序列。

1.4为什么一般情况下对离散图像的直方图均衡化并不能产生完全平坦的直方答:因为同意灰度值的各个像素没有理由变换到不同灰度级,所以数字图像直方图均衡化的结果一般不能得到完全均匀分布的直方图,只有近视均衡的直方图。

1.5讨论用于空间滤波的平滑滤波器和锐化滤波器的相同点、不同点和联系。

答:相同点:都能削弱或消除傅里叶空间的某些分量,而不影响或较少影响其它分量,从而达到增强某些频率分量的效果。

不同点:平滑滤波器削弱或消除了傅里叶空间的高频分量,所以达到了增强低频分量,平滑图像中细节的效果;锐化滤波器削弱或消除了傅里叶空间的低频分量,所以达到了增强高频分量,锐化图像中的细节的效果。

联系:两者效果相反,互为补充,从原始图像减去平滑滤波器的效果得到锐化滤波器的效果,如果减去锐化滤波器的效果则得到平滑滤波器的效果。

1.6参考教材公式(11.2.1),如果对数底数不为2,当对数底数为e时,得到的信息单位为奈特(nat),当底数为10时,得到的信息单位成为哈特利(Hartley),推导他们与比特的换算关系。

答:用不同的单位要表达相同数量的意思,根据定义得:1bit =-log2P(E),1nat = -lnP(E)= =-log2ebit1hartley = -lgP(E)==-log210bit2.1编程实现教材第11章习题11-13和11-16题。

答:11-13function [output,table] = lzw2norm(vector)%LZW2NORM LZW Data Compression (decoder)% For vectors, LZW2NORM(X) is the uncompressed vector of X using the LZW algorithm.% [...,T] = LZW2NORM(X) returns also the table that the algorithm produces.%% For matrices, X(:) is used as input.%% Input must be of uint16 type, while the output is a uint8.% Table is a cell array, each element containig the corresponding code. %% This is an implementation of the algorithm presented in the article % /markn/articles/lzw/lzw.htm%% See also NORM2LZW% $Author: Giuseppe Ridino' $% $Revision: 1.0 $ $Date: 10-May-2004 14:16:08 $% How it decodes:%% Read OLD_CODE% output OLD_CODE% CHARACTER = OLD_CODE% WHILE there are still input characters DO% Read NEW_CODE% IF NEW_CODE is not in the translation table THEN% STRING = get translation of OLD_CODE% STRING = STRING+CHARACTER% ELSE% STRING = get translation of NEW_CODE% END of IF% output STRING% CHARACTER = first character in STRING% add translation of OLD_CODE + CHARACTER to the translation table % OLD_CODE = NEW_CODE% END of WHILE% ensure to handle uint8 input vectorif ~isa(vector,'uint16'),error('input argument must be a uint16 vector')end% vector as a rowvector = vector(:)';% initialize table (don't use cellstr because char(10) will be turned to empty!!!)table = cell(1,256);for index = 1:256,table{index} = uint16(index-1);end% initialize outputoutput = uint8([]);code = vector(1);output(end+1) = code;character = code;for index=2:length(vector),element = vector(index);if (double(element)+1)>length(table),% add it to the tablestring = table{double(code)+1};string = [string character];else,string = table{double(element)+1};endoutput = [output string];character = string(1);[table,code] = addcode(table,[table{double(code)+1} character]);code = element;end% ###############################################function code = getcodefor(substr,table)code = uint16([]);if length(substr)==1,code = substr;else, % this is to skip the first 256 known positionsfor index=257:length(table),if isequal(substr,table{index}),code = uint16(index-1); % start from 0breakendendend% ###############################################function [table,code] = addcode(table,substr)code = length(table)+1; % start from 1table{code} = substr;code = uint16(code-1); % start from 011-16function [output,table] = norm2lzw(vector)%NORM2LZW LZW Data Compression (encoder)% For vectors, NORM2LZW(X) is the compressed vector of X using the LZW algorithm.% [...,T] = NORM2LZW(X) returns also the table that the algorithm produces.%% For matrices, X(:) is used as input.%% Input must be of uint8 type, while the output is a uint16.% Table is a cell array, each element containig the corresponding code. %% This is an implementation of the algorithm presented in the article % /markn/articles/lzw/lzw.htm%% See also LZW2NORM% $Author: Giuseppe Ridino' $% $Revision: 1.0 $ $Date: 10-May-2004 14:16:08 $% How it encodes:%% STRING = get input character% WHILE there are still input characters DO% CHARACTER = get input character% IF STRING+CHARACTER is in the string table then% STRING = STRING+character% ELSE% output the code for STRING% add STRING+CHARACTER to the string table% STRING = CHARACTER% END of IF% END of WHILE% output the code for STRING% ensure to handle uint8 input vectorif ~isa(vector,'uint8'),error('input argument must be a uint8 vector')end% vector as uint16 rowvector = uint16(vector(:)');% initialize table (don't use cellstr because char(10) will be turned to empty!!!)table = cell(1,256);for index = 1:256,table{index} = uint16(index-1);end% initialize outputoutput = vector;% main loopoutputindex = 1;startindex = 1;for index=2:length(vector),element = vector(index);substr = vector(startindex:(index-1));code = getcodefor([substr element],table);if isempty(code),% add it to the tableoutput(outputindex) = getcodefor(substr,table);[table,code] = addcode(table,[substr element]);outputindex = outputindex+1;startindex = index;else,% go on loopingendendsubstr = vector(startindex:index);output(outputindex) = getcodefor(substr,table);% remove not used positionsoutput((outputindex+1):end) = [];% ############################################### function code = getcodefor(substr,table)code = uint16([]);if length(substr)==1,code = substr;else, % this is to skip the first 256 known positions for index=257:length(table),if isequal(substr,table{index}),code = uint16(index-1); % start from 0breakendendend% ###############################################function [table,code] = addcode(table,substr)code = length(table)+1; % start from 1table{code} = substr;code = uint16(code-1); % start from 02.2对“Fig0419(a)(chestXray_original).tif”的胸透图像进行空域、频域或混合方法增强,写出源代码并进行逐行注释,用两种以上的方法。