图像增强参考程序

图像增强参考程序

ID:22296625

大小:102.50 KB

页数:7页

时间:2018-10-28

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

《图像增强参考程序》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

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=l:row*col;p(x(i)+l)=p(x(i)+l)+l;%%%%%%%汁算灰度值为i的个数,类似%%%%%p(i+l)=length(find(x==i))/(m*n);endp=

2、(double(p))/(row*col);fork=2:Np(k)=p(k)+p(k-l);ends=fix(256*p);fori=l:row*col;x(i)=s(x(i)+1)-1;end阈值变换x=imread('*.bmp')prompt={1Threshold(0-255):1};name=1InputforThresholding1;numlines=l;defaultanswer={'501};anss=inputdlg(prompt,name,numlines,defaultanswer);th=str2num(anss{l}

3、);[row,col]=size(x);fori=l:row*col;ifx(i)>thx(i)=256;elseX(i)=0;endend全局线性变换..f=imread(、*.bmpz)[row,col]=size(f);fl=double(f);prompt={1themingraylevelforoutputimage(0-255):11themaxgraylevelforoutputimage(0-255):'};name=1InputforContraststretching';numlines=l;defaultanswer={10

4、112551};anss=inputdig(prompt,name,numlines,defaultanswer);b=str2num(anss{1});a=str2num(anss{2});fminGray=min(min(f1));fmaxGray=max(max(f1));g=double(zeros([row,col]));forx=l:rowfory=l:colg(x,y)=[(a-b)*(f1(x,y)-fminGray)/(fmaxGray-fminGray)]+b;endend分段线性变换...f=imread('*.bmp')[

5、row,col]=size(f);fl=double(f);N=256;prompt={"thexofthefirstpoint:11theyofthefirstpoint:11thexofthesecondpoint:1'theyofthesecondpoint:11themaximumgraylevelforoutputimage:1};name=1InputforContraststretching1;numlines=l;defaultanswer={'801170111701'180r'255'};anss=inputdlg(promp

6、t,name,numlines,defaultanswer);)3})4})xl=str2num(anssyl=str2num(anssx2=str2num(anssy2=str2num(anssgmaxGray=str2num(anss{5})fmaxGray=max(max(f1));forx=l:rowfory=l:coliff1(x,y)<=xlg(x,y)=x2*f1(x,y)/xl;elseif(f1(x,y)>xl)&(f1(x,y)<=x2)g(x,y)=(y2-yl)*(f1(xzy)-xl)/(x2-xl)+yl;elseg(

7、x,y)=(gmaxGray-y2)*(f1(x,y)-x2)/(fmaxGray-x2);endendendend对数非线性变换...f=imread(、★•bmp')[row,col]=size(f);mode.WindowStyle=1modal1;mode.Interpreter:1tex1;msgbox(’g(x,y)=a+(In[f(x,y)+1])/(b*ln(c))1,1theformul1,,mode1);prompt:{1parametera:11parameterb:'1parameterc:1};name=1Inputfo

8、rLOGtranformation1;numlines=l;defaultanswer={'0'111丨10丨};anss=inputd

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

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

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