图像增强参考程序.doc

图像增强参考程序.doc

ID:59217955

大小:36.50 KB

页数:6页

时间:2020-09-09

图像增强参考程序.doc_第1页
图像增强参考程序.doc_第2页
图像增强参考程序.doc_第3页
图像增强参考程序.doc_第4页
图像增强参考程序.doc_第5页
资源描述:

《图像增强参考程序.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、反色functionInverse_Callback(hObject,eventdata,handles)x=imread(‘*.bmp’)y=255-x;直方图均衡HisteQ_Callback(hObject,eventdata,handles)x=imread(‘*.bmp’)N=256;[row,col]=size(x);p=zeros(N);fori=1:row*col;p(x(i)+1)=p(x(i)+1)+1;%%%%%%%计算灰度值为i的个数,类似%%%%%p(i+1)=length(find(x==i))/(m*n); endp=(double(p))/(row*

2、col);fork=2:Np(k)=p(k)+p(k-1);ends=fix(256*p);fori=1:row*col;x(i)=s(x(i)+1)-1;end阈值变换x=imread(‘*.bmp’)prompt={'Threshold(0~255):'};name='InputforThresholding';numlines=1;defaultanswer={'50'};anss=inputdlg(prompt,name,numlines,defaultanswer);th=str2num(anss{1});[row,col]=size(x);fori=1:row*col;

3、ifx(i)>thx(i)=256;elsex(i)=0;endend全局线性变换..f=imread(‘*.bmp’)[row,col]=size(f);f1=double(f);prompt={'themingraylevelforoutputimage(0~255):''themaxgraylevelforoutputimage(0~255):'};name='InputforContrastStretching';numlines=1;defaultanswer={'0''255'};anss=inputdlg(prompt,name,numlines,defaultans

4、wer);b=str2num(anss{1});a=str2num(anss{2});fminGray=min(min(f1));fmaxGray=max(max(f1));g=double(zeros([row,col]));forx=1:rowfory=1:colg(x,y)=[(a-b)*(f1(x,y)-fminGray)/(fmaxGray-fminGray)]+b;endend分段线性变换...f=imread(‘*.bmp’)[row,col]=size(f);f1=double(f);N=256;prompt={'thexofthefirstpoint:''they

5、ofthefirstpoint:''thexofthesecondpoint:''theyofthesecondpoint:''themaximumgraylevelforoutputimage:'};name='InputforContrastStretching';numlines=1;defaultanswer={'80''70''170''180''255'};anss=inputdlg(prompt,name,numlines,defaultanswer);x1=str2num(anss{1});y1=str2num(anss{2});x2=str2num(anss{3}

6、);y2=str2num(anss{4});gmaxGray=str2num(anss{5});fmaxGray=max(max(f1));forx=1:rowfory=1:coliff1(x,y)<=x1g(x,y)=x2*f1(x,y)/x1;elseif(f1(x,y)>x1)&(f1(x,y)<=x2)g(x,y)=(y2-y1)*(f1(x,y)-x1)/(x2-x1)+y1;elseg(x,y)=(gmaxGray-y2)*(f1(x,y)-x2)/(fmaxGray-x2);endendendend对数非线性变换...f=imread(‘*.bmp’)[row,col

7、]=size(f);mode.WindowStyle='modal';mode.Interpreter='tex';msgbox('g(x,y)=a+(ln[f(x,y)+1])/(b*ln(c))','theformul','mode');prompt={'parametera:''parameterb:''parameterc:'};name='InputforLOGtranformation';numlines=1;defaultanswer={'0''1''1

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。