收藏 分销(赏)

图像处理工具箱-英.ppt

上传人:pc****0 文档编号:13360548 上传时间:2026-03-07 格式:PPT 页数:48 大小:834.50KB 下载积分:10 金币
下载 相关 举报
图像处理工具箱-英.ppt_第1页
第1页 / 共48页
图像处理工具箱-英.ppt_第2页
第2页 / 共48页


点击查看更多>>
资源描述
单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,*,数字图像处理,,2008,年,中山大学信息科学与技术学院计算机系,黄剑,Matlab with DIP,教学,The,MATLAB Image Processing Toolbox,The Image Processing Toolbox is a collection,of MATLAB functions(called,M-functions,or,M-files,)that extend the capability of the MATLAB environment for the solution of digital image processing problems.,The,MATLAB Image Processing,Toolbox(cont,.),Including:,-Spatial image transformations,-Morphological operations,-Neighborhood and block operations,-Linear filtering and filter design,-Transforms,-Image analysis and enhancement,-Image registration,-,Deblurring,-Region of interest operations,How do I know M-function?,Find it in,Matlab,Help.,-by category.,-by alphabetical order.,Find it on the textbook.,Matlab,内建图像,C:MATLAB7toolboximagesimdemos,皆为,Matlab,Help,中范例的原始图像,。,使用时只需直接在指令中输入文件名,即可使用。,适用于观察影像处理结果,Different Image Types,Indexed images,Intensity(grayscale)images,Binary images,RGB(true-color)images,Reading an image,imread,(),功用,:,将图像加载并存成,array,格式备用,用法,:,I,map,=,imread(filename,);,I=,imread(filename,);,ex:I=,imread(pout.tif,);,I,为指向影像的变量,不指定变数,则为,ans,Displaying an image,imshow,(),功用,:,开启一个窗口显示影像,用法,:,imshow(I,),imshow(I,map,),Figure,imshow,(),功用,:,开启一个新窗口显示影像,用法,:,figure,imshow(I,),Displaying an,image(cont,.),imshow(,I,low,high,),imshow(,I,),功用,:displays I as a grayscale intensity image,specifying the data range for I.The minimum value in I is displayed as black,and the maximum value is displayed as white.,Displaying an,image(cont,.),Spatial domain,Displaying an,image(cont,.),pixval,:,功能,:c,ursor on image to show pixel values,用法,:,imshow(I),pixval,Displaying an,image(cont,.),colorbar,功能,:To display an image with a,colorbar,that indicates the range of intensity values.,用法:,imshow(I,),colorbar,ex:,I=,imread(pout.tif,);,imshow(I,),colorbar,Writing an image,imwrite,(),功能,:,将影像写入成档案,用法:,imwrite(I,filename,format,),ex:,imwrite(I,pout.jpg,JPEG,);,Image information,Image size:,size(),ex:,I=,imread(saturn.png,);,size(I,),M,N=,size(I,),M=,影像,I,的高,N=,影像,I,的宽,Image information,whos,功用,:display information about an image.,ex,:,whos,I,Imfinfo,(,filename,),功用,:display information about image file.,ex:i,nfo=,imfinfo(saturn.png,),Digital Image processing,图像二值化,g=,im2bw,(I,T);,功用,:Convert intensity image I to binary image g using threshold T,where T must be in range 0,1.,ex:,I=,imread(pout.tif,);,g=im2bw(I,0.4);,imshow(g,),colorbar,Digital Image,processing(cont,.),彩色转灰阶,Rgb2gray(),功用,:,将,RBG,彩色影像转换成,gray-level,影像。,ex:,I=,imread,(,saturn.png,);,g=rgb2gray(I);,imshow(g,),colorbar,Digital Image,processing(cont,.),反相,imcomplement,(),功用,:The negative of an image.,ex:J=,imcomplement(g,);,imshow(J,),Digital Image,processing(cont,.),变更影像大小,imresize(I,scale,method,);,功用,:To change the size of an image.,interpolation Method:,-nearest:Nearest-neighbor interpolation,-bilinear:Bilinear(the default),-,bicubic,:,Bicubic,interpolation,Digital Image,processing(cont,.),ex:,I=,imread(circuit.tif,);,J=imresize(I,1.25);,imshow(I,),figure,imshow(J,),ex:,I=,imread(circuit.tif,);,J=imresize(I,100 150,bilinear,);,imshow(I,),figure,imshow(J,),Digital Image,processing(cont,.),旋转影像,imrotate(I,angle,);,功用,:To rotate an image.,ex:,I=,imread(,pout.tif,);,J=imrotate(I,35);,imshow(J,),More Example,Using affine transformatio,n,1.Rotation 45 degree,I=,imread(,cameraman.tif,);,T=maketform(affine,cosd(45)-sind(45)0;sind(45)cosd(45)0;0 0 1);,tformfwd(10 20,T);,I2=,imtransform(I,T,);,imshow(I2),More,Example(cont,.),2.Translation,I=,imread(cameraman.tif,);,se=translate(strel(1),25 25);,J=,imdilate(I,se,);,imshow(I,),title(Original,),figure,imshow(J,),title(Translated,);,More,Example(cont,.),3.shear,I=,imread(,cameraman.tif,);,T=maketform(affine,1 0 0;1 2 0;0 0 1);,tformfwd(10 20,T);,I2=,imtransform(I,T,);,imshow(I2),More,Example(cont,.),Edge detectors,1.Sobel edge detector,Code:,/Both horizontal and vertical,I=,imread(,cameraman.tif,);,BW2=edge,(I,sobel,0.02,both);,figure,imshow(BW2),More,Example(cont,.),2.the Canny method,low threshold:,0.04,high threshold:,0.10,sigma is,1,Code:,I=,imread(,cameraman.tif,);,BW4=edge(,I,canny,0.04 0.10,1);,figure,imshow(BW4),More Example(cont.),Canny,以,C,语言来实作会困难很多,!,More,Example(cont,.),Filter(mean,filter),Code:,I=,imread(coins.png,);,h=ones(5,5)/25;,I2=,imfilter(I,h,);,imshow(I,),title(Original,Image);,figure,imshow(I2),title(Filtered,Image),More Example(cont.),Filter(unsharp,masking filter),Code:,I=,imread(cameraman.tif,);,h=,fspecial(unsharp,);,I2=,imfilter(I,h,);,imshow(I,),title(Original,Image),figure,imshow(I2),title(Filtered,Image),M-function,不够用怎么办,?,自己写。,在网络上寻找高手的,package,。,当找到新的,M-files,时,需帮它设定路径,才可以像一般内建,function,直接使用。,Set path,Set path(cont.),MATLAB Compiler,MATLAB Compiler,能让您将,MATLAB,程序转换为可单独执行的应用程序和软件组件,并分享给其它使用者。,MATLAB Compiler,可免除您经由手动编写方式将,MATLAB,程序代码转译为,C,或,C+,的程序。,要再安装,MATLAB Component Run-time(MCR),组件等。,MATLAB Compiler(cont.),C to,Matlab,设定了合适的编译器,,matlab,会自动帮我们编译这个程序。,Example:hello world,指令:,-,编译,:,mex,filename,ex:,mex,hello.c,-,执行,:,filename,ex:hello,MATLAB Compiler(cont.),hello.c,#include,#include,mex.h,void mexFunction(int nlhs,mxArray*,plhs,int,nrhs,const,mxArray,*,prhs,),printf(Hello,world.);,mex.h,定义了所有,Matlab,和,C,沟通所用到的,subroutine,。,mexFunction,是程序的进入点,等价于,ANSI C,的,main,。,參考書籍,Digital Image Processing Using MATLAB,by,Rafael C.Gonzalez,Richard E.Woods,Steven L.,Eddins,3,个,Projects,电能表读数识别,人脸检测,印刷线路板缺陷检测,电能表读数识别,对字轮进行精确定位与识别;,对条码进行精确定位与识别,Matlab,Package,模式识别包:,PRTools,:,,www.prtools.org,/,SPRTool,:,www4.utsouthwestern.edu/wardlab/index_files/SPRTool.htm,OCR,Matlab,例子:,face detection library:,level,),图象处理卡,数位转换二进位资料线路,二进位图象,(0,或,1),(Pixels):,铜箔,基材,Current,Scan,line,检测缺点方式,:,设计规范,(DRC),检查,标准母板,(REF),比较法,1,.Golden Board:,以量产板择一当作标准板,记录板上所有,Feature,位置,检测时与其它电路板比对,藉以发现短断路之缺点,.,优点,:,Feature,位置与其它电路板几乎相同,故假缺点较少,.,缺点,:,共同性缺点几乎无法测得,.,于,DRC,检查时,:,(1),如短路宽度,最小线宽 则无缺点报告,而于,母板生成该短路处将记录两,“,Junction”,且,该短路将被视为正常,.,短路,母板,(REF),生成方式与优缺点,于,DRC,检查时,:,如板上包含许多,SMD,区域则所有,SMD Pad,将报,告为断路,.,(1),如缺点数,100,则使用者可检视缺点后发现真,正断路缺点,.,(2),如缺点数过多则使用者将因耗时而多放弃检视,所有缺点,此时真正断路缺点将被遗漏,.,而于生,成母板后该断路将被视为正常,.,断路,母板,(REF),生成方式与优缺点,(,续,),透过,Skeleton,演算方式决定所有,Feature,位置,Open,Junction,Open,母板,(REF),逻辑比较方式,
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服