图像处理实验指导书(英文)
数字图像处理实验指导书
数字图像处理实验指导书Digital image processing ExperimentalInstruction崔艳秋许爽大连民族学院Dalian nationalities university数字图像处理实验指导书机电信息工程学院(College of Electromechanical and Information Engineering)2009年7月10日基本要求Basic requirements1.学生必须按时到实验室做实验,不得迟到早退,未经老师批准不得中途离开。
凡迟到者,应给予批评并作适当扣分。
实验课迟到20分钟以上及无故缺席者视为旷课,旷课者不予补做实验,本次实验以零分计。
学生因病或特殊情况不能按时到实验室做实验时,应办理正常请假手续。
请病假必须有医生签字的病假条,请事假必须有班主任签字的事假条。
不符合请假手续的,以旷课论处。
请假的学生由指导教师安排补做实验。
对于未做实验数达三分之一以上(含三分之一)的学生,实验课程按0分计。
2.学生在每次实验课之前,应仔细阅读实验教材,查阅相关的资料,写出预习报告。
预习报告的具体内容包括:实验内容、实验目的、实验原理图、实验步骤、实验数据记录表格等。
实验课前由任课教师检查预习报告,未写预习报告者不予做实验。
3.做实验前,了解设备的原理和正确使用方法。
在没有弄懂仪器设备的使用方法前,不得贸然使用,否则因使用不当造成仪器设备损坏的,根据大连民族学院《仪器设备损坏丢失处理暂行办法》规定进行处理。
实验室内设备在实验过程中不准任意搬动和调换,非本次实验所用仪器设备,未经指导教师允许不得动用。
4.要求每位学生在实验过程中,要具有严谨的学习态度、认真、踏实、一丝不苟的科学作风。
实验过程中学生按照预习的内容进行实验,且重视实验的调试过程,学会如何根据实验现象判断问题所在。
坚持每次实验都要亲自动手,不可“坐车”,每个实验每个学生都要独立完成,不允许抄袭,无特殊原因,中途不得退出实验,否则本次实验无效。
图像处理外文翻译 (2)
附录一英文原文Illustrator software and Photoshop software difference Photoshop and Illustrator is by Adobe product of our company, but as everyone more familiar Photoshop software, set scanning images, editing modification, image production, advertising creative, image input and output in one of the image processing software, favored by the vast number of graphic design personnel and computer art lovers alike.Photoshop expertise in image processing, and not graphics creation. Its application field, also very extensive, images, graphics, text, video, publishing various aspects have involved. Look from the function, Photoshop can be divided into image editing, image synthesis, school tonal color and special effects production parts. Image editing is image processing based on the image, can do all kinds of transform such as amplifier, reducing, rotation, lean, mirror, clairvoyant, etc. Also can copy, remove stain, repair damaged image, to modify etc. This in wedding photography, portrait processing production is very useful, and remove the part of the portrait, not satisfied with beautification processing, get let a person very satisfactory results.Image synthesis is will a few image through layer operation, tools application of intact, transmit definite synthesis of meaning images, which is a sure way of fine arts design. Photoshop provide drawing tools let foreign image and creative good fusion, the synthesis of possible make the image is perfect.School colour in photoshop with power is one of the functions of deep, the image can be quickly on the color rendition, color slants adjustment and correction, also can be in different colors to switch to meet in different areas such as web image design, printing and multimedia application.Special effects production in photoshop mainly by filter, passage of comprehensive application tools and finish. Including image effects of creative and special effects words such as paintings, making relief, gypsum paintings, drawings, etc commonly used traditional arts skills can be completed by photoshop effects. And all sorts of effects of production aremany words of fine arts designers keen on photoshop reason to study.Users in the use of Photoshop color function, will meet several different color mode: RGB, CMY K, HSB and Lab. RGB and CMYK color mode will let users always remember natural color, users of color and monitors on the printed page color is a totally different approach to create. The monitor is by sending red, green, blue three beams to create color: it is using RGB (red/green/blue) color mode. In order to make a complex color photographs on a continuous colour and lustre effect, printing technology used a cyan, the red, yellow and black ink presentation combinations from and things, reflect or absorb all kinds of light wavelengths. Through overprint) this print (add four color and create color is CMYK (green/magenta/yellow/black) yan color part of a pattern. HSB (colour and lustre/saturation/brightness) color model is based on the way human feelings, so the color will be natural color for customer computer translation of the color create provides an intuitive methods. The Lab color mode provides a create "don't rely on equipment" color method, this also is, no matter use what monitors.Photoshop expertise in image processing, and not graphics creation. It is necessary to distinguish between the two concepts. Image processing of the existing bitmap image processing and use edit some special effects, the key lies in the image processing processing; Graphic creation software is according to their own idea originality, using vector graphics to design graphics, this kind of software main have another famous company Adobe Illustrator and Macromedia company software Freehand.As the world's most famous Adobe Illustrator, feat graphics software is created, not graphic image processing. Adobe Illustrator is published, multimedia and online image industry standard vector illustration software. Whether production printing line draft of the designers and professional Illustrator, production multimedia image of artists, or Internet page or online content producers Illustrator, will find is not only an art products tools. This software for your line of draft to provide unprecedented precision and control, is suitable for the production of any small design to large complex projects.Adobe Illustrator with its powerful function and considerate user interface has occupied most of the global vector editing software share. With incomplete statistics global 37% of stylist is in use Adobe Illustrator art design. Especially the patent PostScript Adobe companybased on the use of technology, has been fully occupied professional Illustrator printed fields. Whether you're line art designers and professional Illustrator, production multimedia image of artists, or Internet page or online content producers, had used after Illustrator, its formidable will find the function and concise interface design style only Freehand to compare. (Macromedia Freehand is launched vector graphics software company, following the Macromedia company after the merger by Adobe Illustrator and will decide to continue the development of the software have been withdrawn from market).Adobe company in 1987 when they launched the Illustrator1.1 version. In the following year, and well platform launched 2.0 version. Illustrator really started in 1988, should say is introduced on the Mac Illustrator 88 version. A year after the upgrade to on the Mac version3.0 in 1991, and spread to Unix platforms. First appeared on the platform in the PC version4.0 version of 1992, this version is also the earliest Japanese transplant version. And in the MAC is used most is5.0/5.5 version, because this version used Dan Clark's do alias (anti-aliasing display) display engine is serrated, make originally had been in graphic display of vector graphics have a qualitative leap. At the same time on the screen making significant reform, style and Photoshop is very similar, so for the Adobe old users fairly easy to use, it is no wonder that did not last long, and soon also popular publishing industry launched Japanese. But not offering PC version. Adobe company immediately Mac and Unix platforms in launched version6.0. And by Illustrator real PC users know is introduced in 1997, while7.0 version of Mac and Windows platforms launch. Because the 7.0 version USES the complete PostScript page description language, make the page text and graphics quality got again leap. The more with her and Photoshop good interchangeability, won a good reputation. The only pity is the support of Chinese 7.0 abysmal. In 1998 the company launched landmark Adobe Illustrator8.0, making version - Illustrator became very perfect drawing software, is relying on powerful strength, Adobe company completely solved of Chinese characters and Japanese language support such double byte, more increased powerful "grid transition" tool (there are corresponding Draw9.0 Corel, but the effect the function of poor), text editing tools etc function, causes its fully occupy the professional vector graphics software's supremacy.Adobe Illustrator biggest characteristics is the use of beisaier curve, make simpleoperation powerful vector graphics possible. Now it has integrated functions such as word processing, coloring, not only in illustrations production, in printing products (such as advertising leaflet, booklet) design manufacture aspect is also widely used, in fact has become desktop publishing or (DTP) industry default standard. Its main competitors are in 2005, but MacromediaFreehand Macromedia had been Adobe company mergers.So-called beisaier curve method, in this software is through "the pen tool" set "anchor point" and "direction line" to realize. The average user in the beginning when use all feel not accustomed to, and requires some practice, but once the master later can follow one's inclinations map out all sorts of line, and intuitive and reliable.It also as Creative Suite of software suit with important constituent, and brother software - bitmap graphics software Photoshop have similar interface, and can share some plug-ins and function, realize seamless connection. At the same time it also can put the files output for Flash format. Therefore, can pass Illustrator let Adobe products and Flash connection.Adobe Illustrator CS5 on May 17, 2010 issue. New Adobe Illustrator CS5 software can realize accurate in perspective drawing, create width variable stroke, use lifelike, make full use of paint brush with new Adobe CS Live online service integration. AI CS5 has full control of the width zoom along path variable, and stroke, arrows, dashing and artistic brushes. Without access to multiple tools and panel, can directly on the sketchpad merger, editing and filling shape. AI CS5 can handle a file of most 100 different size, and according to your sketchpad will organize and check them.Here in Adobe Illustrator CS5, for example, briefly introduce the basic function: Adobe IllustratorQuick background layerWhen using Illustrator after making good design, stored in Photoshop opens, if often pattern is in a transparent layer, and have no background ground floor. Want to produce background bottom, are generally add a layer, and then executed merge down or flatten, with background ground floor. We are now introducing you a quick method: as long as in diagram level on press the upper right version, choose new layer, the arrow in the model selection and bottom ", "background can quickly produce. However, in Photoshop 5 after the movementmerged into one instruction, select menu on the "new layer is incomplete incomplete background bottom" to finish.Remove overmuch type clothWhen you open the file, version 5 will introduce the Illustrator before Illustrator version created files disused zone not need. In order to remove these don't need in the zone, click on All Swatches palette Swatches icon and then Select the Select clause in the popup menu, and Trash Unused. Click on the icon to remove irrelevant type cloth. Sometimes you must repeat selection and delete processes to ensure that clear palette. Note that complex documents will take a relatively long time doing cleanup.Put the fabric to define the general-screeningIn Illustrator5 secondary color and process color has two distinct advantages compared to establish for easy: they provide HuaGan tonal; And when you edit the general-screening prescription, be filled some of special color objects will be automatically updated into to the new color. Because process color won't let you build tonal and provides automatic updates, you may want to put all the fabric is defined as the general-screening. But to confirm Illustrator, when you are in QuarkXPress or when PageMaker quaclrochramatic must keep their into process of color.Preferred using CMYKBecause of Illustrator7 can let you to CMYK, RGB and HSB (hue, saturation, bright) color mode, so you want to establish color the creation of carefully, you can now contains the draft with the combination of these modes created objects. When you do, they may have output various kinds of unexpected things will happen. Printing output file should use CMYK; Only if you don't use screen display manuscript RGB. If your creation draft will also be used for printing and screen display, firstly with CMYK create printing output file, then use to copy it brings As ordered the copy and modify to the appropriate color mode.Information source:" Baidu encyclopedia "附录二中文译文Illustrator软件与Photoshop软件的区别Photoshop与Illustrator都是由Adobe公司出品的,而作为大家都比较熟悉的Photoshop软件,集图像扫描、编辑修改、图像制作、广告创意,图像输入与输出于一体的图形图像处理软件,深受广大平面设计人员和电脑美术爱好者的喜爱。
数字图象处理实验指导书
数字图像处理课程实验报告班级学号姓名实验一常用MATLAB图像处理命令一、实验目的1、熟悉并掌握MATLAB工具的使用;2、实现图像的读取、显示、代数运算和简单变换。
二、实验环境MATLAB 6.5以上版本、WIN XP或WIN2000计算机三、常用函数●读写图像文件1、imreadimread函数用于读入各种图像文件,如:a=imread('e:\w01.tif')2、imwriteimwrite函数用于写入图像文件,如:imwrite(a,'e:\w02.tif',‟tif‟)3、imfinfoimfinfo函数用于读取图像文件的有关信息,如:imfinfo('e:\w01.tif')●图像的显示1、imageimage函数是MATLAB提供的最原始的图像显示函数,如:a=[1,2,3,4;4,5,6,7;8,9,10,11,12];image(a);2、imshowimshow函数用于图像文件的显示,如:i=imread('e:\w01.tif');imshow(i);title(…原图像‟)%加上图像标题3、colorbarcolorbar函数用显示图像的颜色条,如:i=imread('e:\w01.tif');imshow(i);colorbar;4、figurefigure函数用于设定图像显示窗口,如:figure(1);/figure(2);5、subplot把图形窗口分成多个矩形部分,每个部分可以分别用来进行显示。
Subplot(m,n,p)分成m*n个小窗口,在第p个窗口中创建坐标轴为当前坐标轴,用于显示图形。
6 、plot绘制二维图形plot(y)Plot(x,y)xy可以是向量、矩阵。
图像类型转换1、rgb2gray把真彩图像转换为灰度图像i=rgb2gray(j)2、im2bw通过阈值化方法把图像转换为二值图像I=im2bw(j,level)Level表示灰度阈值,取值范围0~1(即0.n),表示阈值取自原图像灰度范围的n%3、imresize改变图像的大小I=imresize(j,[m n])将图像j大小调整为m行n列图像运算1、imadd两幅图像相加,要求同样大小,同种数据类型Z=imadd(x,y)表示图像x+y2、imsubtract两幅图像相减,要求同样大小,同种数据类型Z=imsubtract(x,y)表示图像x-y3、immultiplyZ=immultiply(x,y)表示图像x*y4、imdivideZ=imdivide(x,y)表示图像x/y四、实验内容1、读入一幅RGB图像,变换为灰度图像和二值图像,并在同一个窗口内分成三个子窗口来分别显示RGB图像和灰度图像,注上文字标题。
河北工业大学《计算机图像处理》实验指导书
实验一 MATLAB数字图像处理基本操作一、实验目的与要求1.熟悉MATLAB软件的开发环境、基本操作以及图像处理工具箱,为编写图像处理程序奠定基础。
2.掌握二值、灰度和彩色图像的读、写和显示方法,以及图像的高、宽、颜色等参数的获取方法。
3.根据实验内容进行问题的简单分析和初步编码。
二、实验相关知识1、Matlab软件Image Processing Toolbox简介MatLab的原文是Matrix Laboratory,它包括若干个工具箱,如Communications Toolbox、Control System Toolbox、Neural Network Toolbox、Wavelet Toolbox等等,其中Image Processing Toolbox图像处理工具箱可以完成Geometric Operations、Enhancement、Color Segmentation、Image Transformation、Image Analysis、Morphological Operations等操作。
在MatLab中,图像就是一个矩阵,在进行处理时当作一个变量即可,因此运算的书写十分简洁,故MatLab有草稿纸式的算法语言之称。
例如:J=I+50; %为原始图像I加上一常数50,并将结果赋予变量J,其效果相当于得到一幅加亮的图像J以此类推可以书写出减法J=I-0.5;乘法J=I*2;除法J=I/3;等等。
利用MatLab提供的imread和imwrite函数可以完成对图像文件的读写操作,它们所支持的一些常用的图像文件格式见表1-1。
MatLab Command窗口的提示符号“>>”下直接键入命令即可运行,如键入:>>clear %执行本命令将会清除内存中的全部变量>> figure(1); %生成一个图像窗口1>> I=imread('e:lena.bmp'); %将硬盘e:根目录上的图像文件lena.bmp的数据读入矩阵变量I中>> imshow(I); %在当前的图像窗口中显示图像矩阵I>> title('原始图像'); %在当前的图像窗口中加上标题但为了能够对程序进行调试和重复应用,我们要求用M文件的方式完成实验中各个程序的编写。
《ENVI》实验指导
《ENVI》实验指导书ENVI快速入门一、软件概况介绍:ENVI(The Environment for Visualizing Images)遥感影像处理软件是由美国著名的遥感科学家用IDL开发的一套功能齐全的遥感影像处理软件,它是处理、分析并显示多光谱数据、高光谱数据和雷达数据的高级工具。
曾获2000、2001年美国权威机构NIMA遥感软件测评第一。
ENVI的应用领域包括:地质、林业、农业、模式识别、军事、自然资源勘探、海洋资源管理、环境和土地利用管理等。
二、ENVI的安装1、ENVI永久许可1)ENVI浮动license:服务器版,多个用户可以同时访问一个服务器,服务器需要安装license,客户端不需要安装license,但是需要进行设置。
2)ENVI加密狗:加密狗也需要license安装,但是有灵活、不依赖网卡的特点。
3)ENVI网卡加密:利用网卡号的唯一性进行加密,如果更换机器时,需要将原来的网卡拔下重新安装在新机器上。
2、ENVI临时许可三、目录结构介绍一般情况下ENVI安装在RSI文件夹下,完全版本包括IDL60、License等文件夹,ENVI的所有文件及文件夹保存在IDL60\products\ENVI40下。
✧Bin:相应的ENVI运行目录。
✧Data:数据目录,保存一矢量文件夹(一些矢量数据)和一些例子数据(有些数据有头文件,有些数据没有头文件)。
✧Flt_func:ENVI常规传感器的光谱库文件。
例如:aster、modis、spot、tm等。
✧Help:ENVI的帮助文档。
✧Lib:IDL生成的可编译的程序,用于二次开发。
✧Map_proj:影像的投影信息,文本格式,客户可以进行定制。
✧Menu:ENVI菜单文件,可以进行中、英文菜单互换。
并不是所有的英文菜单都已经汉化,汉化工作我们正在做,以后会陆续推出。
✧Save:应用IDL可视化语言编译好的、可执行的ENVI程序。
数字图像处理试验指导书new1
1.1图像点实验1.1.1图像反色实验1.1.1.1实验目的1.熟悉视频显示程序的运行过程、控制过程,搞清数据处理、传输途径;2.结合实例学习如何在视频显示程序中增加图像处理算法;3.了解图像反色的算法和用途;4.了解RF-5 程序框架。
1.1.1.2 实验内容1.系统初始化;2.RF-5 程序框架实现;3.反色算法实现。
1.1.1.3实验背景知识将图像按象素进行求反,取得类似照相底片效果。
求反处理的图像与原始图“黑白颠倒”,可以看清原始图中灰黑区域的情况。
求反的图像一般用于数字图像的初步处理。
设D A表示输入图像的灰度,D B表示输出图像的灰度。
灰度变换方程为:D B=f(D A)=255-D A1.1.1.4程序简介1.1.1.4.1 程序包含文件介绍1.main.c:实验的主程序。
系统使用到资源、CSL、BIOS 以及任务初始化。
2.appData.c:SCOM 模块初始化。
3.tskVideoInput.c:视频输入任务初始化及输入任务处理。
4.tskVideoOutput.c:视频输出任务初始化及输出任务处理。
5.DEC643.gel:系统初始化。
6.*.h:程序使用的头文件。
7.*.lib:程序使用的库文件。
8.link_dm642.cmd:库文件连接命令文件。
9.VideoReverseloop2.tcf:BIOS 配置文件。
10. VideoReverseloop2cfg.cmd:DSP 存储器及资源分配与程序各段的连接关系。
1.1.1.4.2 程序架构简介实验例程采用RF-5(参考设计框架5)实现视频的采集、处理及显示。
程序使用2 个任务模块,视频采集任务以及视频处理输出任务。
(一)初始化模块介绍1.系统初始化模块功能介绍:初始化CSL 以及BIOS设置64K 的CACHE,并将其映射到EMIF 的CE0 及CE1 空间设置DMA 优先级序列,长度2.RF-5 模块初始化初始化RF-5 框架中用于内部单元传递消息的SCOM 模块3.任务模块初始化启动任务存储空间分配及管理(二)任务模块介绍1.输入任务输入任务从输入设备驱动程序获得视频图像,使用FVID(视频驱动程序)提供的FVID_exchange 函数调用输入设备按照4:2:2 格式获取一帧视频图像。
图像处理技术实验指导书
数字图像处理实验指导书彭智勇实验1 matlab数字图像处理基础1实验目的●熟悉MatLab软件中图像输入/输出/显示/转换的基本命令;●了解图像IO基本函数、矩阵与图像和图像格式的对应关系、灰度/彩色/二值图像的相互转换2实验原理●数字图像读入与输出:1) InImg=imread(‘图像文件’): 读入指定的图像文件到内存InImg:矩阵变量,保存读入的数字图像;图像文件:全路径的图像文件名(格式为:*.bmp 或 *.jpg);2) imwrite(OutImg, ‘图像文件’): 输出内存中图像数据到文件OutImg:矩阵变量,保存的数字图像;图像文件:全路径的图像文件名(格式为:*.bmp 或 *.jpg);3) whos ImgData: 屏幕输出图像的相关信息ImgData: 矩阵变量,保存在内存中的数字图像●数字图像显示:1) imshow(ImgData): 将图像文件显示到屏幕ImgData: 矩阵变量,保存待显示的数字图像;2) subPlot(行数,列数,区域索引); imshow(ImgData): 将图像文件显示到指定的屏幕区域ImgData: 矩阵变量,保存待显示的数字图像;行数,列数:屏幕划分区域数(行数x列数);区域索引:第n 块区域(1<=n<=行数x列数)●数字图像转换:1) I=rgb2gray(rgbImg): 将彩色图像转换为灰度图像rgbImg: 矩阵变量,保存彩色图像;I: 矩阵变量,保存灰度图像2) bw=im2bw(Img,level): 将灰度图像转换为二值图像;Img: 矩阵变量,保存彩色图像或灰度图像;level: 灰度级阀值(> level 为1;< level 为0)bw: 矩阵变量,二值图像3) I=mat2gray(X) : 将矩阵转换为灰度图像;X: 矩阵变量;I: 灰度图像;3实验内容1) 熟悉运用以上命令,得出各条指令的运行效果,参考代码如下(需修改):例如1:InImg=ImRead(‘d:\DirName\demoImg_InPut.bmp’);I=rgb2gray(InImg);subPlot(1,2,1);Imshow(InImg);显示彩色图像于屏幕第一块区域subPlot(1,2,2);Imshow(I);显示灰度图像于屏幕第二块区域ImWrite (I,‘d:\DirName\demoImg_outPut.bmp’)例如2:InImg=ImRead(‘d:\DirName\demoImg_InPut.bmp’)bw = im2bw (InImg,0.5)subPlot(1,2,1);Imshow(InImg);显示彩色图像于屏幕第一块区域subPlot(1,2,2);Imshow(bw) ;显示二值图像于屏幕第二块区2)综合设计程序:●将给定彩色图像转换为灰度图像,从大到小设定不同的6个灰度级阀值,分别将其二值化,将原图、灰度图及二个二值化结果显示在屏幕的8个区域并存成磁盘文件,对比前后结果;●设计一矩阵,将其转化为图像,得出图像的相关信息,将图像显示在屏幕上并存盘。
数字图像处理实验指导书-河北工业大学2014-实验六 图像分割
实验六图像分割
一、实验目的
使用MatLab 软件进行图像的分割。
使学生通过实验体会一些主要的分割算子对图像处理的效果,以及各种因素对分割效果的影响。
二、实验要求
要求学生能够自行评价各主要算子的分割性能。
完成图像的处理并要求正确评价处理结果,能够从理论上作出合理的解释。
三、实验内容与步骤
(1)使用Roberts 算子的图像分割实验
调入并显示图像中图像;使用Roberts 算子对图像进行边缘检测处理; Roberts 算子为一对模板:
(2)使用Roberts 算子的图像分割实验
调入并显示图像中图像;使用Roberts 算子对图像进行边缘检测处理; Roberts 算子为一对模板:
(3)使用Prewitt 算子的图像分割实验
(4)使用Sobel 算子的图像分割实验
(5)使用拉普拉斯算子的图像分割实验
四、实验设备及软件
1.计算机;
2.MATLAB程序;
3.移动式存储器(软盘、U盘等)。
4.记录用的笔、纸。
五、实验报告要求
1.叙述实验过程;
2.提交实验的原始图像和结果图像。
六、思考题/问答题
1. 评价一下Roberts 算子、Prewitt 算子、Sobel 算子对于噪声条件下边界检测的性能。
2. 实验中所使用的五种算子所得到的边界有什么异同?。
数字图像处理实验指导书资料
实验一 灰度图像的对比度线性展宽一、实验目的让学生通过使用对图像采用线性对比度展宽的方法进行处理,获得对图像画质的改善。
二、实验原理与方法对比度线性展宽处理,其实质是对图像灰度值的一个线性映射——通过这种方式来实现突出图像中重要信息的目的。
通常情况下,处理前后的图像灰度级是相同的,即处理前后的图像灰度级都为[0,255]。
那么,从原理上讲,我们就只能通过抑制非重要信息的对比度来腾出空间给重要信息进行对比度展宽。
设原图像的灰度为),(j i f ,处理后的图像的灰度为),(j i g ,对比度线性展宽的原理示意图如图1.1所示。
假设原图像中我们关心的景物的灰度分布在[a f ,b f ]区间内,处理后的图像中,我们关心的景物的灰度分布在[a g ,b g ]区间内。
在这里)(a b g g g -=∆)(a b f f f -=∆<,也就是说我们所关心的景物的灰度级得到了展宽。
根据图中所示的映射关系中分段直线的斜率我们可以得出线性对比度展宽的计算公式:b g a g a b )j图1.1 对比度线性展宽映射关系),(j i f α, a f j i f <≤),(0=),(j i g a a g f j i f +-)),((β,b a f j i f f <≤).,( (1-1)b b g f j i f +-)),((γ,255),(<≤j i f f b(m i ,3,2,1 =;n j ,3,2,1 =) 其中,a a f g =α,a b a b f f g g --=β,bbf g --=255255γ,图像的大小为m ×n 。
三、实验内容与步骤1.熟悉MATLAB 语言的使用,主要包括图像处理相关的语句、表达式,以及变量的使用。
2.按照所给出的参考伪代码编写程序,实现对一幅灰度图像的对比度线性展宽。
3.调整α,β,γ的值,观察对处理结果的影响。
四、思考问题1.在映射关系中,分段直线的斜率的大小对图像处理结果有哪些影响? 2.在进行对比度展宽的时候,如果确定和选取所关心的景物?五、参考伪代码程序[image, map]=imread(‘实验图像.BMP’);%读入一幅灰度图像,放在二维数组变量image 中。
图像处理基本实验
实验一 图像的基本操作1.读取并显示一幅tif 格式的图像,并将新图像存存储成bmp, png 格式并显示出来.所用图片像素为264x264I=imread('dog_gray.tif'); % 读取tif 图像 [m,n]=size(I) % 显示图像规模imwrite(I,'dog_gray.bmp');% 图像保存为bmp 格式 imwrite(I,'dog_gray.png');% 图像保存为png 格式 I1=imread('dog_gray.bmp'); %读取bmp 图像 I2=imread('dog_gray.png'); %读取png 图像subplot(1,3,1),imshow(I);% 在1x3子屏中的第1个子图显示为dog_gray.tif title('dog_gray.tif');% 显示图像标题subplot(1,3,2),imshow(I1); %在1x3子屏中的第2个子图显示为dog_gray.bmp title('dog_gray.bmp');% 显示图像标题subplot(1,3,3),imshow(I2); % 在1x3子屏中的第2个子图显示为dog_gray.png title('dog_gray.png');% 显示图像标题m = 264 n = 264dog g ray.tif dog g ray.bmp dog g ray.png2 读取一幅RGB 彩色图像,在同一窗口输出原图像及R, G, B 三个分量图像.所用图片大小为352x351RGB=imread('fruits.tif'); %读取图像 [m,n,p]=size(RGB) % 矩阵大小 R=RGB(:,:,1); % 显示R 分量 G=RGB(:,:,2); %显示G 分量 B=RGB(:,:,2); %显示B 分量subplot(2,2,1),image(RGB); % 在2x2子屏中的第1个子图显示原图 title('原图'); % 显示标题subplot(2,2,2),image(R); % 在2x2子屏中的第2个子图显示R 分量图像 title('R 分量'); % 显示标题subplot(2,2,3),image(G); % 在2x2子屏中的第3个子图显示G 分量图像 title('G 分量'); % 显示标题subplot(2,2,4),image(B); % 在2x2子屏中的第4个子图显示B 分量图像 title('B 分量'); % 显示标题m = 352 n = 351 p = 31002003001002003001002003001002003001002003001002003001002003001002003003 & 4读取一幅RGB彩色图像,将其转换为灰度图像保存为tif格式,并在同一窗口显示原图像与灰度图像.将4中得到灰度图像转化为二值图像,并对其进行取反操作,在同一窗口显示灰度图所用图像像素为264x352RGB=imread('flower-0170.jpg'); % 读取图像[m,n,p]=size(RGB) %矩阵大小I=rgb2gray(RGB); % 真彩色图像转换为灰度图像I1=im2bw(I); % 灰色图像二值画I2=~I1; %对二值图像取反imwrite(I,'flower-0170.tif') % 将图像保存为tif格式subplot(1,2,1),imshow(RGB);%在1x2子屏的第1个子屏中显示原图title('flower-0170.jpg'); %显示标题subplot(1,2,2),imshow(I); % 在1x2子屏的第1个子屏中显示灰度图像title('flower-0170.tif'); %显示标题figure % 新建个图形窗口subplot(1,3,1),imshow(I); %在1x3子屏的第1个子屏中显示灰度图像subplot(1,3,2),imshow(I1); %在1x3子屏的第2个子屏中显示二值图像subplot(1,3,3),imshow(I2); %在1x3子屏的第3个子屏中显示二值图像取反后的图像m =264n =352p =3flower-0170.jpg flower-0170.tif5读取两幅图像,进行加,减,乘,除运算,并显示原图像与运算结果.所用图片像素为512x512I1=imread('baboon.tif'); % 读取图像I2=imread('barbara.tif'); % 读取图像[m1,n1]=size(I1)% I1的大小[m2,n2]=size(I2) % I2的大小 ADD=imadd(I1,I2); %两个图像相加 SUB=imsubtract(I1,I2);%两个图像相减 MUL=immultiply(I1,I1);%两个图像相乘 DIV=imdivide(I1,I2);%两个图像相除subplot(2,3,1),imshow(I1); %在2x3子屏的第1个子屏中显示baboon.tif title('baboon.tif');subplot(2,3,2),imshow(I2); %在2x3子屏的第2个子屏中显示barbara.tif title('barbara.tif');subplot(2,3,3),imshow(ADD); %在2x3子屏的第3个子屏中显示ADD title('ADD 图像');subplot(2,3,4),imshow(SUB); %在2x3子屏的第4个子屏中显示SUB title('SUB 图像');subplot(2,3,5),imshow(MUL); %在2x3子屏的第5个子屏中显示MUL title('MUL 图像');subplot(2,3,6),imshow(DIV); %在2x3子屏的第6个子屏中显示DIV title('DIV 图像');m1 = 512 n1 = 512 m2 = 512 n2 = 512baboon.tifbarbara.tifADD 图像SUB 图像MUL 图像DIV 图像6验证教材2.7节(点运算)中对图像的线性变换(例2-1),非线性变换(例2-2)及直方图均衡化实验.%图像线性变换a=imread('cameraman.tif'); % 读入cameraman图像figure(1);imshow(a);b1=a+45; % 图像灰度值增加45figure(2);imshow(b1);b2=1.2*a; % 图像对比度增大figure(3);imshow(b2);b3=0.65*a; % 图像对比度减少figure(4);imshow(b3);b4=-double(a)+225; %图像求补figure(5);imshow(uint8(b4));%用函数对cameraman图像进行非线性变换a=imread('cameraman.tif') ; %读取原始图像figure(1);imshow(a);xlabel('(a)原始图像');x=1:225;y=x+x.*(255-x)/255;figure(2);plot(x,y); %绘制函数图像xlabel('(b)函数的曲线图');b1=double(a)+0.006*double(a).*(255-double(a)); figure(3);imshow(uint8(b1)); %显示非线性图像xlabel('(c)非线性处理效果');(a)原始图像(c)非线性处理效果% 对cameraman进行直方图均衡化histgram=zeros(1,256); % 生成直方图数组cdf=zeros(1,256);[cm,map]=imread('cameraman.tif'); [a,b]=size(cm);for i=1:afor j=1:bk=cm(i,j);histgram(k)=histgram(k)+1;endend % 得到直方图cdf(1)=histgram(1);for i=2:256cdf(i)=cdf(i-1)+histgram(i);endfor i=1:afor i=1:bk=cm(i,j);cm_equ(i,j)=cdf(k)*256/(a*b); endendimshow(uint8(cm_equ));figure(2);imhist(uint8(cm_equ));050100150200250%对tire.tif图像进行均衡化处理I=imread('tire.tif');J=histeq(I);H=adapthisteq(I);figure(1);imshow(I);xlabel('原始图像');figure(2);imshow(J);xlabel('histeq均衡化');figure(3);imshow(H);xlabel('adapthisteq均衡化');原始图像histeq均衡化adapthisteq均衡化彩色图像和灰度图像中包含的信息内容有什么区别?彩色图像,每个像素通常是由红(R)、绿(G)、蓝(B)三个分量来表示的,分量介于(0,255)。
图像处理_AmsterdamLi...
Amsterdam Library of Object Images(美国弗吉尼亚大学物体图像数据库)数据摘要:ALOI is a color image collection of one-thousand small objects, recorded for scientific purposes. In order to capture the sensory variation in object recordings, we systematically varied viewing angle, illumination angle, and illumination color for each object, and additionally captured wide-baseline stereo images. We recorded over a hundred images of each object, yielding a total of 110,250 images for the collection. See Technical Details for a description of the acquisition setup.中文关键词:目标识别,视角,光照角度,光照颜色,立体图像,英文关键词:object recognition viewing angle,illumination angle,illumination color,-baseline stereo images,数据格式:IMAGE数据用途:To use object recognition数据详细介绍:Amsterdam Library of Object Images (ALOI)ALOI is a color image collection of one-thousand small objects, recorded for scientific purposes. In order to capture the sensory variation in object recordings, we systematically varied viewing angle, illumination angle, and illumination color for each object, and additionally captured wide-baseline stereo images. We recorded over a hundred images of each object, yielding a total of 110,250 images for the collection. See Technical Details for a description of the acquisition setup.Details have been published in: J. M. Geusebroek, G. J. Burghouts, and A. W. M. Smeulders, The Amsterdam library of object images, Int. J. Comput. Vision, 61(1), 103-112, January, 2005Please consult the paper for all details on recording of the collection.Each object was recorded with only one out of five lights turned on, yielding five different illumination angles (conditions l1-l5). By switching the camera, and turning the stage towards that camera, the illumination bow is virtually turned by 15 (camera c2) and 30 degrees (camera c3), respectively. Hence, the aspect of the objects viewed by each camera is identical, but light direction has shifted by 15 and 30 degrees in azimuth. In total, this results in 15 different illumination angles.Furthermore, combinations of lights were used to illuminate the object. Turning on two lights at the sides of the object yielded an oblique illumination from right (condition l6) and left (condition l7). Turning on all lights (condition l8) yields a sort of hemispherical illumination, although restricted to a more narrow illumination sector than true hemisphere. In this way, a total of 24 different illumination conditions were generated, conditions c[1..3]l[1..8].Each object was recorded in frontal view, with all five lamps turned on. Illumination color temperature is changed from 2175K to 3075K. Cameras were white balanced at 3075K, resulting in objects illuminated under a reddish to white illumination color, conditions i110, i120, ..., i250.The frontal camera was used to record 72 aspects of the objects by rotating the object in the plane at 5 degree resolution, conditions r0..r355. This collection is similar to the COIL collection.The frontal camera was used to record 72 aspects of the objects by rotating the object in the plane at 5 degree resolution, conditions r0..r355. This collection is similar to the COIL collection.数据预览:点此下载完整数据集。
数字图像处理实验指导书(英文版)
EXPERIMENT 1 Showing and Orthogonal Transform of the Image一.Experimental purpose1.Master the orders of reading/writing and showing.2.Master the methods of transformations between the images of the differenttype.3.Master the methods of the orthogonal transform and the inverse transform.二.Be familiar with the common orders as follows:(skillful mastery)1.The orders of reading/writing and showing:imread read the image fileimfinfo read the related information of the image fileimwrite output the imageImshow show function of the standard imageImage establish and show a image objectImagesc adjust automatically the value field and show theimageColorbar show the color bartheimageMontage spliceImmovie turn the image sequence composed by the index colorimage into the cartoonSubimage show the multi-piece images in a graph windowzoom the image zoomwarp show the image in a curved face by the texturemapping2. The transform orders of image type:Dither image dither, turn the grey scale image into the binaryimage or dither the real color image into the index imageGray2ind turn the grey scale image into the index imageGrayslice turn the grey scale image into the index image by settingthe field valueIm2bw turn the real color, the index color and the grey scale imageinto the binary image by setting the luminance field valueInd2gray turn the index color image into the grey scale imageInd2rgb turn the index color image into the real color imageMat2gray turn the data matrix into the grey scale imageRgb2gray turn the real color image into the grey scale imageRgb2ind turn the real color image into the index color image3. The orders of the orthogonal transform and the inverse transformfft2 two-dimension fft transform ifft2 two-dimension fftinverse transformfftn N-dimensionfft transformifftn N-dimension fft inverse transform fftshift move the center of the spectrum by fft,fft2 and fftn transformsinto the center of the matrix or the vectordct2 two-dimension dct transform idct2 two-dimension dctinverse transform三.Experimental contents:1. read/write and show the image:① Read cameraman.tif file;② Examine the related information of the image and point out the file layout and the type ofthe image;③ Show the image and observe its zoom;④ Show the color bar;⑤ Show the image in imagesc function. Its grey-scale range is 64-128;⑥ Map cameraman.tif into the surface of the cylinder in the warp order;⑦ Load the mri images in the load order and show these images in the montage function,then, turn these image into the cartoon and show the cartoon in the movie function. Attention: the immovie function is applied only to the index image.Cue: load mrimontage (data matrix of the mri, the color map matrix of the mri)mov =immovie (data matrix of the mri, the color map matrix of the mri)colormap (map )movie (mov )2. Transformations between the images of the different type① Turn the RGB image flowers.tif into the grey scale image. Show and compare the twoimages in the same image window;② Turn the index image chess.mat into the grey scale image. Show and compare the twoimages in the same image window;③ Turn the grey scale image cameraman.tif into the binary image (realize individually inthe im2bw and the dither), show and compare the three images in the same image window;④ Turn the grey scale image pout.tif into the index image X (the corresponding colorimages are the gray (128) and gray (16) ). Show and compare the three images in the same image window;3. The orthogonal transform and inverse transform①Calculate two-dimension fast Fourier transform of the saturn2 image and show its spectrum amplitude .Cue: extract the image: load imdemos saturn2②Do the DCT transform to the saturn2 image.③Do two-dimension hadamard transform to the saturn2 image.Cue: firstly: create a two-dimension hadamard orthogonal matrix in the matlab, then,image data multiply the orthogonal matrix.④What are differences of the ①②③ transformations in the energy focus?⑤Remake ①—④ to the autumn.tif image.Cue: need to turn the image into the grey scale image.四.Thought after the class1. Which are the file layouts of image? How do these transformations each other? Which are image types? How do these transformations each other? How do the images of the different type show? Which are the data matrixes of image? How do these transformations each other?2. Which types of image can not be used directly to image processing?EXPERIMENT 2 Image Enhancement 一.Experimental purpose1. Master the fundamental method of the image enhancement and observe the results of theimage enhancement;2. Be familiar with the denoise method of the image processing;3. Be familiar with the transformations of the file layouts and of the color systems;二.Be familiar with the common orders as follows:imadust adjust the contrast by the histogram transformationhisteq histogram equalizationhist show the histogram of the image dataimnoise add the representative noise to the image(gaussian,salt&pepper, speckle)medfilt2 two-dimension median filteringordfilt2 two-dimension sequential statistic filteringwiener2 two-dimension Wiener filtering三.Experimental contents:1.Contrast enhancement① Read the cameraman.tif file;② Show the original image;③ Show the histogram of the image;④ Enhance the contrast of image by the histeq⑤ Show the histogram of the image after the contrast and compare it with the histogram ofthe list ③;⑥ Show the image after the contrast and compare it with the original image.四. Image smoothing① Read the eight,tif file. Show the images added individually by the Gaussiannoise, Salt & pepper noise and multiplicative noise and compare these images.② Three previous images added by the noise make individually two-dimensionmedian filtering, two-dimension sequential statistic filtering and two-dimension Wiener filtering③Compare the original image with the image polluted by the noise and the image after thefilter. Think that which filter is effective to suppress the corresponding noise and the influence of the neighborhood to suppressing noise and image blurring.五. The color of the RGB image flowers.tif becomes more clear and bright.①Read the flower.tif file;②Show the image;③Color space transformation. Turn the RGB color space into the HSV color space(transform function is rgb2hsv )④Enhance saturation component S by the histogram equalization in the HSV color space;⑤Return the HSV color space into the RGB color space;⑥Compare the images transformed previously with the original image and observe whetherthese become more clear and bright.六. Thought after the classWhy the image is dealt with by the Histogram Equalization? Which methods of the image enhancement you can think?EXPERIMENT 3 Boundary Detection and Texture Detection一. Experimental purpose1. Be familiar with the common orders of the boundary detection and boundary detection operator;2. Be familiar with the methods of the boundary detection.二. Be familiar with the common orders as follows:Edgethe boundary detection Sobel Sobel operatorCanny a antinoise and keeping weak boundary operator Robert Robert operatorPrewitt Prewitt operatorLog Log operator(Marr)blkproc block treatingstd22D standard deviation imhist image grey scale statistic三. Experimental contents:1. Boundary detection① Read the rice.tif file;② Show the image;③ Show five images detected individually in the Sober operator, Robert operator, Prewitt operator, Log operator, Canny operator and observe the difference of connectivity in the difference operators. Find the effective method of boundary detection to the rice.tif file. Cue: BW=edge (data matrix of the image, ‘operator’)④ Reduplicate the operation of ①②③ operations to the Saturn.tif image.⑤Help menu->demos->toolboxes->image processing->morphology, analysis and segmentation->egde detection in the matlab. Operate the demo program. Observe the value of the boundary detection by choosing the different images and operators.2. Texture detectionTexture detection can be realized by the method of local grey-scale statistic. The common methods have 2D standard deviation measurement and information entropy measurement. Texture detection is the method of the local detection. So, the texture detection can be realized by the blocking method. Computing formulas of standard deviation and information entropy are()p E is the grey scale mean. k p is the probability of the k grade grey scale.Compute the information entropy of the image by programming function and analyze the texture of the 4×4 block,8×8 block to image in the texture analyse of information entropy.()[]∑∞=−=12k k k p p E x D ∑−=kkk p p E logCue: Refer to the following example during the programming. Attention: firstly, Program information entropy function yourself. (MATLAB supplies 2D standard deviation function in the command line fun=@std2 )Example: texture analyse of the 8×8 sub-block to image in 2D standard deviation measurement.man=imread('cameraman.tif');fun=@std2; % std2 is the 2D standard deviation function.text1=blkproc(man,[8 8],fun);text=imresize(text1,[256 256],'bicubic');subplot(121);imshow(man);title('cameraman');subplot(122);imshow(text,[]); title('8X8 std');EXPERIMENT 4 Image Compression Encoding一. Experimental purpose1. Be familiar with the fundamental of the image compression encoding;2. Be familiar with the fundamental performance of the orthogonal image compression encoding.二.Be familiar with the common orders as follows:dct2 - Compute 2-D discrete cosine transformdctmtx - Compute discrete cosine transform matrix.fft2 - Compute 2-D fast Fourier transform .fftshift - Reverse quadrants of output of FFT.idct2 - Compute 2-D inverse discrete cosine transform.ifft2 - Compute 2-D inverse fast Fourier transform.Hadamard - Hadamard matrix.bestblk - Choose block size for block processing.blkproc - Implement distinct block processing for image.col2im - Rearrange matrix columns into blocks.im2col - Rearrange image blocks into columns.三.Experimental contents:1. Compress the image in the FFT transformation;①Read the rice.tif file;②Normalize the image;③Show the original image;④The image compression ratio is 4:1;⑤Separate the image to the 16×16 sub-image and make the FFT transform;⑥Realign the transform coefficient matrix and Sequence the coefficient matrix;⑦Reserve the higher-order coefficient according to the compression ratio;⑧Realign the coefficient matrix⑨Obtain the recovery images of the sub-images by the FFT inverse transform to sub-images;⑩Show the image compressed and compare it with the original image.2. Compress individually the image in the DCT and HT transforms according to the upper steps. Cue: the orders of the blocking and Hadamard transforms in the Hadamard transform. areT= hadamarda(image blocking size);for example, the image is separated 16×16 blocking, so the blocking size is 16.Hdcoe=blkproc(the image normalized,[16 16]),’P1*x*P2’,T,T)。
《图像处理》实验指导书2016版
调用格式:
C=imdivide(A,B)。
四、参考代码
参考代码中实现了彩色图像的灰度化、旋转、缩放两种几何变换以及镜像及拼接。
Image1=imread('peppers.jpg'); %红绿通道互换 Image2=Image1; Image2(:,:,1)=Image1(:,:,2); Image2(:,:,2)=Image1(:,:,1); imshow(Image2); imwrite(Image2,'changecolor.jpg');
《图像处理》实验指导书
蔡利梅 编
信息与电气工程学院
学生实验守则
一、学生进入实验室必须遵守实验室的规章制度,遵守课堂纪律,保持实验室的安静和整洁,爱护 实验室的一切设施。 二、实验课前要认真预习实验指导书,写出实验预习报告,并经教师批阅后方可进行实验。 三、实验课中要遵守操作规程,不要带电连接、更改或拆除线路。线路接好后,经指导老师检查后, 方可接通电源进行实验。对于软件上机实验,不得随意删改计算机中原有的文件。 四、学生实验前对实验所用仪器设备要了解其操作规程和使用方法,凡因不预习或不按使用方法进 行操作而造成仪器设备损坏者,除书面检查外,按学校规定进行赔偿。 五、实验中主意安全,遇到事故应立即关断电源并报告教师检查处理。 六、实验完毕后要做好整理工作,实验数据必须经指导教师签阅后,才能拆除线路,并将仪器、设 备、凳子等按规定放好,经同意后方可离开实验室。 七、因故缺课的学生可向实验室申请一次补做机会。无故缺课或无故迟到(15 分钟以上)的不予补 做,该次实验无成绩;累计三次者,该实验课以不及格论,并不得参加该门理论课程的考试。 八、实验室仪器设备不能擅自搬动调换,更不能擅自带出实验室。
数字图像处理实验指导书(带源程序)
实验一Matlab图像处理工具箱的初步练习一. 实验目的1. 掌握有关数字图像处理的基本概念;2. 熟悉Matlab图像处理工具箱;3. 熟悉使用Matlab进行数字图像的读出和显示;4. 熟悉运用Matlab指令进行图像旋转和缩放变换。
二. 练习1. 文件的读入与显示(1) 运行Matlab。
(2) MATLAB窗口构成:在缺省的情况下,由三个窗口组成。
命令窗口(command window)、命令历史(command history)、工作空间(workspace)。
注意:缺省窗口的设置步骤为:MATLAB菜单/view选项/Desktop layout/default。
(3) 调入一个文件:i=imread('pout.tif');%注意:前面的“%”是用于注释的,不会被执行,只是说明这个语句的作用。
此时的i出现在什么窗口?是什么类型的变量?大小是多少?(4) 显示这幅图:imshow(i);(5) 将变量i转置成j,即j=i';显示j即imshow(j);%在胸前左侧花纹怎么会跑到右边的呢?举一个例子加以验证:设a=[1 2 3 4 5;6 7 8 9 10;11 12 13 14 15];b=a’;此时的b与a有什么区别?(6) 写入到一个新的图像文件'abc.tif'中,即imwrite(j,'abc.tif')。
(7) 清除变量命令:clear执行这个命令后,workspace窗口中的变量有没有?怎么验证?(8) 清除用户开设的窗口命令:close all(9) 调入图像文件'abc.tif'并显示。
问题:(1) 操作符“’”是图像的转置的意思,转置两次后,是否回到原图像?(2) 命令后的符号“;”所起的作用是什么?(3) 命令是否可以大写母?2. 灰度图像分别选择不同的灰度级(如2、4、16、64、128个)来显示同一幅图像(如testpat1.tif)。
数字图像处理实验书
数字图像处理实验实验指导书图像处理实验<一)直方图灰度变换是图像增强的一种重要手段,使图像对比度扩展,图像更加清晰,特征更加明显。
灰度级的直方图给出了一幅图像概貌的描述,通过修改灰度直方图来得到图像增强。
1、灰度直方图<1)计算出一幅灰度图像的直方图clearclose allI=imread('004.bmp'>。
imhist(I>title('实验一<1)直方图'>。
<2)对灰度图像进行简单的灰度线形变换,figuresubplot(2,2,1>imshow(I>。
title('实验2-灰度线性变换'>。
subplot(2,2,2>histeq(I>。
<3)看其直方图的对应变化和图像对比度的变化。
原图像 f(m,n> 的灰度范围 [a,b] 线形变换为图像 g(m,n>,灰度范围[a’,b’]公式:g(m,n>=a’+(b’-a’>* f(m,n> /(b-a>figuresubplot(2,2,1>imshow(I>J=imadjust(I,[0.3,0.7],[0,1],1>。
title(' 实验一<3)用g(m,n>=a’+(b’-a’>* f(m,n> /(b-a>进行变换 '>。
b5E2RGbCAPsubplot(2,2,2>imshow(J>subplot(2,2,3>imshow(I>J=imadjust(I,[0.5 0.8],[0,1],1>。
subplot(2,2,4>imshow(J>(4> 图像二值化 <选取一个域值,(5> 将图像变为黑白图像)figuresubplot(2,2,1>imshow(I>J=find(I<150>。
图像处理lab3
Exercise 1 – 2-D Fourier TransformsUsing the image files hardware.tif,shuttle.tif,and xray.tif,read in each of the images and compute the 2-D DFT magnitude for each of the images.On a single plot,plot the following:●the original gray scale image in the upper left cell●the image representation of the 2-D DFT magnitude of the image being studiedin the upper right cell● a clipped and scaled version of the 2-D DFT magnitude that is clipped and scaleat a level where you can see the nature of the 2-D DFT magnitude for each image;this plot should be placed in the lower left cell●the log transformed 2-D DFT magnitude plotted again on a scale that enablesyou to see the structure of the transform magnitude;this plot should be placed in the lower right cellYou will need to use the MATLAB routine FS=fftshift(F) to shift the DC magnitude point from the upper left corner of the image to the center of the magnitude range.In your Lab3 report,include the MATLAB code along with image plots of the three images for which you repeat the analysis.Can you say how the image properties are seen in the 2-D DFT magnitude plots?>>im=imread('hardware.tif');>>im=double(im);>>F=fft2(im);>>S=abs(F);>>Fc=fftshift(F);>>S2=log(1+abs(Fc));>>subplot(2,2,1),imshow(im,[]);>>subplot(2,2,2),imshow(S,[]);>>subplot(2,2,3),imshow(Fc,[]);>>subplot(2,2,4),imshow(S2,[]);>> f1=imread('hardware.tif'); >> f2=imread('shuttle.tif'); >> f1=double(f1);>> f2=double(f2);>> F=fft2(f1);>> Fc=fftshift(F);>> S=fft(f2);>> P=angle(S);>> subplot(2,2,1),imshow(f1,[]); >> subplot(2,2,2),imshow(Fc,[]); >> subplot(2,2,3),imshow(f2,[]); >> subplot(2,2,4),imshow(P,[]);Exercise 3 – Linear Filtering of Images(a)Using the MATLAB routine H=lpfilter(type,M,N,D0,n) for designing lowpass filters,where theinput arguments are:Type=’guassian’,’ideal’ or ‘btw’M,N=dimensionality of filter frequency responseD0=filter cutoff frequencyn=filter order for Butterworth filtersand the output H is the frequency response of the filter,write a MATLAB m-file that accepts as input the filter type,the cutoff frequency D0,and the filter order n.Within the MATLAB program,plot the filter frequency response along with the filter impulse response.Test your program for the following conditions:1.ftype=’guassian’,D0=502. 1.ftype=’ideal’,D0=503. 1.ftype=’btw’,n=4,D0=50function H = lpfilter(type, M, N, D0, n)% creates the transfer function of a lowpass filter, H, of the specified TYPE and size (M-by-N). [U, V] = dftuv(M, N);D = sqrt(U.^2 + V.^2); % Compute the distances D(U, V).% Begin filter computations.switch typecase 'ideal'H = double(D <= D0);case 'btw'if nargin == 4n = 1;endH = 1./(1 + (D./D0).^(2*n));case 'gaussian'H = exp(-(D.^2)./(2*(D0^2)));otherwiseerror('Unknown filter type.')endfunction H=hpfilter(type,M,N,D0,n)%HPFILTER Computes frequency domain highpass filters. P136if nargin==4n=1;endHlp=lpfilter(type,M,N,D0,n);H=1-Hlp;function [U,V]=dftuv(M,N)%DFTUV computes meshgrid frequency matrices.%[U,V]=DFTUV(M,N) computes meshgrid frequency matrices U and V.U and V areuseful for computing frequency-domain filter functions that can be usedwith DFTFILT.U and V are both M-by-N%set up range of variables.u=0:(M-1);v=0:(N-1);%compute the indices for use in meshgrididx=find(u>M/2);u(idx)=u(idx)-M;idy=find(v>N/2);v(idy)=v(idy)-N;%compute the meshgrid arrays.[V,U]=meshgrid(v,u);function g=dftfilt(f,H)% dftfilt performs frequency domain filtering.F=fft2(f,size(H,1),size(H,2));g=real(ifft2(H.*F));g=g(1:size(f,1),1:size(f,2));>> f=imread('shuttle.tif');>> f=f(:,:,1);>> PQ=paddedsize(size(f));>> H=lpfilter('gaussian',PQ(1),PQ(2),50);>> mesh(H);>> H=lpfilter('ideal',PQ(1),PQ(2),50);>> mesh(H);>> H=lpfilter('btw',PQ(1),PQ(2),50,4); >> mesh(H);b)>> H=hpfilter('gaussian',PQ(1),PQ(2),50); >> mesh(H);c)>> f=imread('lena.tif');>> f=f(:,:,1);>> f=double(f);>> PQ=paddedsize(size(f));>> H=lpfilter('gaussian',PQ(1),PQ(2),50); >>g=dftfilt(f,H);>> imshow(g,[]);>> H=lpfilter('gaussian',PQ(1),PQ(2),100);>> g=dftfilt(f,H);>> imshow(g,[]);>> H=lpfilter('ideal',PQ(1),PQ(2),50); >> g=dftfilt(f,H);>> imshow(g,[]);>> H=lpfilter('ideal',PQ(1),PQ(2),150); >> g=dftfilt(f,H);>> imshow(g,[]);>> H=lpfilter('btw',PQ(1),PQ(2),50,4); >> g=dftfilt(f,H);>> imshow(g,[]);>>H=hpfilter('gaussian',PQ(1),PQ(2),50); >>g=dftfilt(f,H);>>imshow(g,[]);>> H=hpfilter('gaussian',PQ(1),PQ(2),100); >> g=dftfilt(f,H);>>imshow(g,[]);>> H=hpfilter('gaussian',PQ(1),PQ(2),200); >> g=dftfilt(f,H);>>imshow(g,[]);。
ImageProcessing3-ImageEnhancement(HistogramProcessing) 数字图像处理 英文版
What Is Image Enhancement?
Image enhancement is the process of making images more useful The reasons for doing this include:
– Highlighting interesting detail in images – Removing noise from images – Making images more visually appealing
equalisation is given where sk T (rk )
– rk: input intensity – sk: processed intensity – k: the intensity range
k
pr (rj ) j 1
(e.g 0.0 – 1.0)
– nj: the frequency of intensity j – n: the sum of all frequencies
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Summary
We have looked at:
– Different kinds of image enhancement – Histograms – Histogram equalisation
3
4
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Equalisation Examples (cont…)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
实验一数字图像的基本认识Experiment 1 Introduction of Digital ImageI. experimental purpose.1. Be familiar with the file structure of different types of images, and master the reading and writing process of image files.2. Master the calculation methods of various statistical indicators of images.II. Experimental principle.1. Basic types of images.In the computer, the image can be divided into binary image, grayscale image and true color RGB image according to the color and grayscale.2. Discrete convolutionFor discrete sequences, convolution can be obtained by a similar method to continuous functions. Therefore, the convolution formula of two sequences with two lengths m and n is:The above formula gives an output sequence of length. Discrete convolution and continuous convolution in digital image have almost corresponding properties, which can be described by continuous convolution.3. Gray histogram.Gray histogram is a function of grayscale, describes the image with the number of pixel grayscale the abscissa is grayscale, ordinate is the frequencies of the gray scale (the number of pixels). It is worth noting that the histogram only reflects the frequency of different grayscale values in the image, and does not reflect the location of a gray value pixel. Different images may have the same histogram; The sum of the histogram of each subregion of an image is equal to the histogram of the graph.预备知识:读取图像:F=imread(’e:\图片.jpg’)显示图像:imshow(f)返回指定点的坐标和颜色值:[c r p]=impixel(f)RGB彩色图像转换为灰度图像:rgb2gray(x)灰度图像转换为二值图像:im2bw(x)图像滤波(图像与模板卷积):imfilter(x1,w,'replicate'),或用P填充边界获得图像直方图:imhist(f)三、实验题目1. 编制一个程序,读取位图并显示在屏幕上,将图像数据化并显示结果,学会如何返回指定点的像素坐标。
2. 编制一个程序,将RGB彩色图像转换为灰度图像,将灰度图像转换为二值图像。
3. 编制一个程序,实现二维离散卷积,用于对图像滤波。
4. 编制一个程序,对任意图像统计灰度值,并在屏幕上绘出直方图。
四、实验步骤1.编写程序。
2.调试程序。
3.写出程序运行结果。
五、实验要求1. 提交题目1、2的源程序清单、程序流程图及代码各部分的详细说明。
2. 提交题目3的原始图像和直方图结果。
实验二数字图像的基本运算Experiment 2 Operation of Digital ImageI. experimental purpose.1. Understand the concepts of point operation, algebraic operation and geometric operation.2. Grasp the basic methods of grayscale transformation, gradient amplitude and geometric transformation.II. Experimental principle.1. The point of operationIn image processing, point arithmetic is a simple but important class of technology that allows users to change the gray scale of image data. For an input image, an output image is generated by the point operation, and the grayscale value of each pixel in the output image is determined only by the corresponding input pixel value. Point, therefore, operation is not possible to change the image spatial relations, operation point is sometimes referred to as contrast enhancement or gray-scale transformation, image is digital software and an important part of the image display software. The application of point operation is very wide, which can be used for contrast enhancement, photometric calibration, display calibration and cropping.2. Algebraic operationAlgebraic operation is the operation of the output image by adding, subtracting, multiplying and dividing the two input images. The mathematical expressions of the four image processing algebraic operations are as follows:),(),(),(yxByxAyxC+=),(),(),(yxByxAyxC-=),(),(),(yxByxAyxC⨯=),(),(),(yxByxAyxC÷=Where),(yxA and),(yxB are input images, and),(yxC is the output image.The image gradient function can be obtained by subtracting the image. Gradient is a vector function, and the gradient range can be obtained from the following approximation:|))1,(),(||,),1(),(max(||),(|+-+-≈∇yxfyxfyxfyxfyxfIn other words, the gradient is the largest of the absolute value of the difference between adjacent pixels in the horizontal direction and the absolute value of the difference between the adjacent pixels in the vertical direction.3. Geometric operationGeometrical operation can change the spatial position relation between objects in the image, which can be regarded as moving objects in the image.A geometric operation requires two separate algorithms. First, an algorithm is needed to define the spatial transform itself, which describes how each pixel moves from its initial position to the termination position, namely the motion of each pixel. At the same time, an algorithm is needed for the gray level interpolation. This is because, in general, the position coordinates of the input image are integers, and the position coordinates of the output image are not integers, and vice versa.The control point method is to determine the coefficient of the coordinate transformation equation by determining the displacement of certain coordinate points. If known input images and output images corresponding points on displacement of (that is, the control points of), can use these known control points of the coordinate transformation equation coefficient, and to determine the relations of coordinate transformation.一、实验题目1.编制一个程序,对图像进行灰度变换,以增强其对比度。