MATLAB关于中图像处理与动画制作问题的研究(摘要及前言)
- 格式:docx
- 大小:127.82 KB
- 文档页数:7
MATLAB中关于图像处理与动画制作问题的研究摘要一、MATLAB 中图像处理MATLAB 基本系统提供了几个简单图像处理函数,利用这些函数对图像进行读写和显示。
MATLAB 还有一个功能更强的图像处理工具箱,可以对图像进行更专业的处理。
1.用imread 函数将图像文件读入MA TLAB 工作空间,用imwrite 函数将图像数据和色图数据一起写入图像文件。
其函数调用格式分别为A=imread(fname) 和imwrite(A,fname,fmt) 。
其中,fname 为读/写的文件名,fmt 为图像文件格式。
2.用image 和imagesc 来将图像显示。
为了保证图像的显示效果,还应使用colormap 函数设置图像的色图。
二、MATLAB 中的动画制作MATLAB 具有动画制作能力,一种是储存一系列各种类型的二维或三维图,然后将它们像电影一样按次序播放出来,称为逐帧动画。
另一种是描绘质点运动轨迹的动画,称为轨迹动画。
1.MATLAB 中逐帧动画用到的函数: getfrname、moviein 和movie 。
其中,getframe 函数的功能是截取一幅画面信息,形成一个很大的列向量;moviein(n) 函数的功能是建立一个足够大的n列矩阵,用来保存n幅画面的数据,以备播放。
Movie(m,n) 函数功能是播放m所定义的画面n次,默认时一次。
2.MATLAB中用comet和comet3 函数展现质点在二维和三维空间的运动轨迹。
这种轨迹称为彗星轨迹曲线,函数调用格式为:comet(x,y,p) 和comet3(x,y,z,p) 。
其中,x、y、z组成曲线的坐标参数,p是彗星长度的参数,默认是0.1。
在二维图形中彗星长度为y向量长度的p倍。
在三维图形中,彗星长度为z向量长度的p倍。
关键字:图像处理;色图;动画制作;彗星轨迹A INVESTIGATION ABOUT DEAL IMAGE AND CREATECARTOONABSTRACTNO.1. Deal images in matlabMatlab basic system provide several simple images deal functions, use those functions to read and write or display images. In addition, matlab include a strong image dealing function toolbox, may deal images much professional.Fist. Use function imread to read imagefile in matlab workplace, and use function imwrite to write image’s data and colormap in imagefile. Their transfer format are : A=imread(fname) and imwrite(A,fname,fmt). Among the the transfer format, fname represent for the filename of the imagefile to be read or written, fmt represent for the filefrmat of the image.Second. Matlab use the functions image and imagesc to display images. To ensure the images’ display effect, yet use function colormap to intercalate the image’s colormap.NO.2. Create cartoon in matlabMatlab can create cartoon. Matlab can save a series of two dimensions images and three dimensions images, then play them out in turn like a movie. This called gradual frame cartoon. Another is to describe a contrail of a particle, which called contrail cartoon.Fist. The functions in matlab to create gradual frame cartoon include getfrname、moviein and movie. Among those functions, getfrname is use to cut and adopt the information of one image to consist a big list vector; moviein(n) is use to build a big enough matrix which include n list to save n images’ data, to prepare for play; movie(m,n) is use to play the menu define by matrix m n times, one time acquiescence.Second. Use function comet to exhibit the contrail of one move particle in two dimensions and comet3 to exhibit the contrail of one move particle in three dimensions. This contrail curvecalled comet contrail curve. The function transfer formats are comet(x,y,p) and comet3(x,y,z,p). Among them, x, y and z consist the coordinate parameter, p is the length parameter of the comet, zero point one is acquiescence. In two dimensions, comet length is p times of the abs y vector, and in the three dimensions, comet length is p times of the abs z vector.Key words: image deal; colormap; create cartoon; comet contrail前言MATLAB 是MATrix LABoratory (矩阵实验室) 的缩写,它自从1984 年又美国Math Works 公司推出以来,经过不断改进和发展,现已成为国际公认的优秀的工程应用开发环境。
MATLAB 广泛应用于工程计算和数值分析领域,它以矩阵为数据操作的基本单位,使得运算变得非常的简捷、方便、高效。
MATLAB 提供了十分丰富的数值计算函数,且与符号计算语言相结合,使其具有符号运算的功能。
MATLAB 还有很强的绘图功能,可以绘制各种二维、三维图形,并且可以对图形进行修饰和控制,以增强图形的表现效果。
MATLAB 具有编程语言的基本特征,可以在其中使用BASIC、FORTRAN、C 等传统的编程语言进行程序设计。
这样,简单易学,编程效率高。
MATLAB 包含基本部分和各种工具箱,其基本部分是其核心内容,工具箱对其功能有扩充作用。
在高等学校,无论是在课程教学,还是在课程设计、毕业设计等培养环节中,MATLAB 的应用都十分普遍,由于MATLAB 提供了很多的底层工具,底层程序,这样为使用者减少了很多的底层工作,简捷高效地解决了相关的问题。
数学领域里,很多问题的解决是非常繁多的数据,对于数值计算和符号计算,无论计算多么的完善,结果多么的准确,人们还是难以直接从大量的数据中感受它们的具体含义和内在规律,这时,图形就解决了数据不能解决的问题。
人们可以通过图形直观感受科学计算的全局意义和内在本质。
MA TLAB 的图像表达能力也是非常强大的,除了可以绘制二维、三维图形外,MATLAB 还可以对图形进行标注、视点、颜色、光照等修饰。
MATLAB 绘图命令有两类:一是直接对图形句柄进行操作的底层绘图命令,二是在底层命令的基础上建立起来的高层绘图命令。
高层绘图命令简单明了,方便高效。
使用者不需要考虑过多的绘图细节,只需给出基本参数就可以得到所需图形。
本课题研究主要针对高层绘图命令及处理命令。
目录1 MATLAB7.0 支持的图像文件格式[3] ................................................................ 错误!未定义书签。
2 图像对象属性的详解[3] .................................................................................. 错误!未定义书签。
2.1 CData属性处理法 .................................................................................... 错误!未定义书签。
2.2 CDataMapping 属性处理法 ...................................................................... 错误!未定义书签。
2.3 XData 和YData 属性处理法 ................................................................... 错误!未定义书签。
3 图像文件的读取 ............................................................................................ 错误!未定义书签。
4 图像文件的写入 ............................................................................................ 错误!未定义书签。