freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

matlab圖像分割畢業(yè)設(shè)計-資料下載頁

2024-09-15 11:30本頁面
  

【正文】 13. 丁亮,張永平,張雪英 圖像分割方法及性能評價綜述 國際IT傳媒品牌軟件2010年第31卷第12期    附 錄   雙峰法  tic?! =imread(39。39。)。A=I。%A=rgb2gray(I)。figure(1)?! ubplot(1,3,1)。B=imhist(A)。  plot(B)。title(39。直方圖39。)?! ubplot(1,3,2)。  imshow(I)?! itle(39。原始圖像39。)。  [m,n]=size(I)。  for i=1:m for j=1:n  if(I(i,j)50)   I(i,j)=255。  else I(i,j)=0?! ? end   end  end  subplot(1,3,3)?!mshow(I)?! mwrite(I,39。39。)。title(39。閾值40分割圖像39。)?!oc。%圖像的MSE、SNR、PSNR的計算 B=I?! M,N]=size(A)。a=double(A)。b=double(B)。sum1=0?!or i=1:M。   for j=1:N。  sum1=sum1+(a(i,j)b(i,j))^2。 end?!nd?!seValue=sum1/(M*N)。%計算均方誤差MSE sum2=0?!or i=1:M?! ? for j=1:N?! ? sum2=sum2+(a(i,j))^2?!? end?! nd。 P=sum2。snrValue=10*log10(P/mseValue)。%計算信噪比SNR psnrValue=10*log10(255^2/mseValue)。%計算峰值信噪比PSNR  最大類間差法 tic?!=imread(39。39。)。  subplot(1,2,1)?!mshow(x) 。title(39。原始圖像39。)?!ount=imhist(x)。   [m,n]=size(x)。 N=m*n。  L=256。  count=count/N。  for i=1:L if count(i)~=0 st=i1。    break。 end end  for i=L:1:1 if count(i)~=0    nd=i1。   break。   end   end  f=count(st+1:nd+1)。 %f是每個灰度出現(xiàn)的概率 p=st。 q=ndst。 u=0。   for i=1:q   u=u+f(i)*(p+i1)。 %u是像素的平均值   ua(i)=u。 %ua(i)是前i個像素的平均灰度值  end。     for i=1:q    w(i)=sum(f(1:i))。 %w(i)是前i個像素的累加概率  end。  d=(u*wua).^2./(w.*(1w))。 [y,tp]=max(d)。 %可以取出數(shù)組的最大值及取最大值的點  th=tp+p。   for i=1:m    for j=1:n if x(i,j)th   x(i,j)=0。    else   x(i,j)=255。    end end  end  subplot(1,2,2)。 imshow(x)。 title(39。最大類方差法39。)?!oc?!?圖像的MSE、SNR、PSNR的計算 A=imread(39。39。)?!=x?!M,N]=size(A)。a=double(A)。b=double(B)?!um1=0。  for i=1:M。 for j=1:N?! ? sum1=sum1+(a(i,j)b(i,j))^2。 end。  end。  mseValue=sum1/(M*N)。%計算均方誤差MSE  sum2=0?!or i=1:M。 for j=1:N。 sum2=sum2+(a(i,j))^2。  end?! nd?!=sum2。 snrValue=10*log10(P/mseValue)。%計算信噪比SNRpsnrValue=10*log10(255^2/mseValue)。%計算峰值信噪比PSNR 小波分割clear。  tic。imgname=39。39。  wavename=39。haar39。 %用haar小波來分解 mode=39。per39。 [x,map]=imread(imgname)。 %x是像素色值,map是色譜figure(1)。 subplot(2,2,1)。imshow(x)。   title(39。原圖39。)。r=x。 %r=rgb2gray(x) 三維圖像變成二維圖像 xx=histeq(r)。 %直方圖均衡化 subplot(2,2,2)。imshow(xx)。 title(39。增強后的圖像39。)。 deccof=struct(39。ca39。,[],39。ch39。,[],39。cv39。,[],39。cd39。,[])。 %三層分解  reccof=struct(39。rx39。,[])。 sx=size(xx)。 nbcol=size(map,1)。  dx=xx。  deccof(1).ca=xx。  [deccof(2).ca,deccof(2).ch,deccof(2).cv,deccof(2).cd]=dwt2(dx,wavename,39。mode39。,mode)。 %使用小波函數(shù)對圖像dx進行二維小波變換 figure(2)。imshow([deccof(2).ca/255,deccof(2).ch/255。deccof(2).cv/255,deccof(2).cd/255。])。  title(39。小波分解39。)。  am=deccof(2).ca/255。  figure(1)。   subplot(2,2,3)。imshow(am)。 title(39。近似分量39。)。  %找閾值   L=size(am,1)。  W=size(am,2)。   N=L*W。   [Count Ret]=imhist(am)。   Pi=Count39。./N。  g=[]。  for t=0:255 w0=sum(Pi(1:t+1))。   w1=1w0。   mu0=sum(Pi(1:t+1).*(0:t))/w0。   mu1=sum(Pi(t+2:256).*(t+1:255))/w1。    mu=sum(Pi(1:256).*(0:255))。    g=[g w0*w1*(mu0mu1)^2/(w1*(mu0mu)^2+w0*(mu1mu)^2)]。 end  [Ret1 T ]=max(g)。 T1=T。   T=num2str(T1)。  disp([39。最佳灰度threhold: 39。 T])。   %分割 I1=im2bw(am,T1/255)。 figure(1),subplot(2,2,4)。imshow(I1)。  title(39。閾值分割后的圖像39。)。   u=idwt2(I1,deccof(2).ch/127,deccof(2).cv/127,deccof(2).cd/127,wavename,39。mode39。,mode)。  figure(3),imshow(u)。title(39。小波分割圖像39。) ?!oc?!?  %圖像的MSE、SNR、PSNR的計算 A=imread(39。39。)。B=u。 [M,N]=size(A)?!=double(A)。b=double(B)。  sum1=0?!or i=1:M?!? for j=1:N。 sum1=sum1+(a(i,j)b(i,j))^2。 end?!nd。 mseValue=sum1/(M*N)。%計算均方誤差MSE sum2=0?!or i=1:M。   for j=1:N。 sum2=sum2+(a(i,j))^2?! ? end?!nd。P=sum2?!nr=10*log10(P/mseValue)。%計算信噪比SNRpsnr=10*log10(255^2/mseValue)。%計算峰值信噪比PSNR
點擊復制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1