最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【圖像去噪】基于小波變換、contourlet變換、contourlet-小波變換+PCA算法實現(xiàn)SAR圖像

2021-10-12 19:56 作者:Matlab工程師  | 我要投稿

1 算法介紹

模型介紹見這里。

2 部分代碼

clc clear all close all %讀取原始圖像 im=imread('BJ256_N_5.bmp'); im=double(im)/256; figure,imshow(im);title('原始圖像'); n = prod(size(im)); %加噪 sigma=0.09 sigma = 0.09; nim = im + sigma * randn(size(im)); figure,imshow(nim);title(sprintf('噪聲圖像(PSNR = %.2f dB)',PSNR(im, nim))); %************小波去噪****************************************************** %用Donoho通用閾值公式計算閾值 x為要進行處理的圖像 % ? thr = delta * sqrt( 2 * log(n)) %計算delta [C_1, S_1] = wavedec2(nim, 1, 'db1'); ? ? ? ? ? ? ? ? ? ? ? ? ? ? %小波分解 d = C_1( prod( S_1(1,:) ) + 2 * prod( S_1(2,:) ) + 1 : end); ? ? ? ?%HH子帶系數(shù) delta = median( abs(d) ) / 0.6745; thr = delta * sqrt(2*log(n)); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? %閾值 [C, S] = wavedec2(nim, 1, 'db1'); ? ? ? ? ? ? ?%小波分解 dcoef = C( prod(S(1, :)) + 1 : end); ? ? ? ? ? ?%提取細節(jié)部分系數(shù) dcoef = dcoef .* (abs(dcoef) > thr); ? ? ? ? ? ?%硬閾值 C( prod(S(1, :)) + 1 : end) = dcoef; wim = waverec2(C, S, 'db1'); ? ? ? ? ? ? ? ? ? ? ?% 重構(gòu)圖像 figure,imshow(wim);title(sprintf('小波去噪(PSNR = %.2f dB)', ... ? ? ? ? ? ? ?PSNR(wim,im)) );axis on; %************小波去噪-完****************************************************** %***************contourlet變換去噪*************************************** %參數(shù)設(shè)置 pfilt='9-7'; ? ? ? ? ? ? ? ?% ?LP 分解濾波器 dfilt='pkva'; ? ? ? ? ? ? ? % ?DFB 分解濾波器 nlevs = [0,3,3,4,4,5]; ? ? ?% ?nlevs: DFB分解濾波器級數(shù)向量 % Contourlet變換 y = pdfbdec(nim, pfilt, dfilt, nlevs); ? [c, s] = pdfb2vec(y); %閾值估計 nvar = pdfb_nest(size(im,1), size(im, 2), pfilt, dfilt, nlevs); cth = 3 * sigma * sqrt(nvar); fs = s(end, 1); fssize = sum(prod(s(find(s(:, 1) == fs), 3:4), 2)); cth(end-fssize+1:end) = (4/3) * cth(end-fssize+1:end); c = c .* (abs(c) > cth); ? %閾值判斷 % 重構(gòu) y = vec2pdfb(c, s); cim = pdfbrec(y, pfilt, dfilt); figure,imshow(cim);title(sprintf('contourlet去噪(PSNR = %.2f dB)', ... ? ? ? ? ? ? PSNR(cim,im)) );axis on; %**********contourlet變換去噪-完****************** %*****小波-contourlet變換去噪**************************************** [C_1, S_1] = wavedec2(nim, 1, 'db1'); ? ? ? ? ? ? ? ? ? ? ? ? ? ? %小波分解 ca1 = appcoef2(C_1,S_1,'db1',1); ?%提取尺度1的低頻系數(shù) ch1 = detcoef2('h',C_1,S_1,1); ? ?%提取尺度1的水平方向高頻系數(shù) CV1 = detcoef2('v',C_1,S_1,1); ? ?%提取尺度1的垂直方向高頻系數(shù) cd1 = detcoef2('d',C_1,S_1,1); ? ? %提取尺度1的斜線方向高頻系數(shù) xhi_dirLH = dfbdec_l(ch1, dfilt, nlevs(end)); ?%水平方向高頻contourlet變換 xhi_dirHL = dfbdec_l(CV1, dfilt, nlevs(end)); ?%垂直方向高頻contourlet變換 xhi_dirHH = dfbdec_l(cd1, dfilt, nlevs(end)); ?%斜線方向高頻contourlet變換 y = {ca1,xhi_dirLH,xhi_dirHL,xhi_dirHH}; [c, s] = pdfb2vec(y); %閾值估計 nvar = pdfb_nest1(size(im,1), size(im, 2), pfilt, dfilt, nlevs); cth = 3 * sigma * sqrt(nvar); fs = s(end, 1); fssize = sum(prod(s(find(s(:, 1) == fs), 3:4), 2)); cth(end-fssize+1:end) = (4/3) * cth(end-fssize+1:end); c = c .* (abs(c) > cth); ? %閾值判斷 %重構(gòu) y = vec2pdfb(c, s); ch1_rec = dfbrec_l(y{2}, dfilt); CV1_rec = dfbrec_l(y{3}, dfilt); cd1_rec = dfbrec_l(y{4}, dfilt); len = S_1(1,1)*S_1(1,2); C_1(1:len) = ca1(1:end); C_1(len+1:2*len) = ch1_rec(1:end); C_1(2*len+1:3*len) = CV1_rec(1:end); C_1(3*len+1:4*len) = cd1_rec(1:end); wcim = waverec2(C_1, S_1, 'db1'); ? ? ? ? ? ? ? ? ? ? ?% 重構(gòu)圖像 figure,imshow(wcim);title(sprintf('小波-contourlet去噪(PSNR = %.2f dB)', ... ? ? ? ? ? ? PSNR(wcim,im)) );axis on; ? ? ? ? ? ? ? ? %************小波-contourlet變換+PCA閾值*********************************** [C_1, S_1] = wavedec2(nim, 1, 'db1'); ? ? ? ? ? ? ? ? ? ? ? ? ? ? %小波分解 ca1 = appcoef2(C_1,S_1,'db1',1); ?%提取尺度1的低頻系數(shù) ch1 = detcoef2('h',C_1,S_1,1); ? ?%提取尺度1的水平方向高頻系數(shù) CV1 = detcoef2('v',C_1,S_1,1); ? ?%提取尺度1的垂直方向高頻系數(shù) cd1 = detcoef2('d',C_1,S_1,1); ? ? %提取尺度1的斜線方向高頻系數(shù) xhi_dirLH = dfbdec_l(ch1, dfilt, nlevs(end)); ?%水平方向高頻contourlet變換 xhi_dirHL = dfbdec_l(CV1, dfilt, nlevs(end)); ?%垂直方向高頻contourlet變換 xhi_dirHH = dfbdec_l(cd1, dfilt, nlevs(end)); ?%斜線方向高頻contourlet變換 % %PCA處理 %高頻部分設(shè)置閾值去噪 for i = 1:2^nlevs(end) ? ?%LH分量 ? ?LH = cell2mat(xhi_dirLH(i)); ? ?[m,n] = size(LH); ? ?for j = 1:m ? ? ? ?temp1(j,:) = LH(j,:) - mean(LH(j,:)); ? ?end ? ?RLH = temp1 * temp1'/n; ? ?[evLH,edLH] = eig(RLH); ? ?yLH = evLH'*temp1; ? ?clear temp1; ? ?yLHm = mean(mean(abs(yLH))); ? ?LH = LH.*(abs(LH) > yLHm); ? ?xhi_dirLH(i) = {LH}; ? ? ? ? ? ? %HL分量 ? ?HL = cell2mat(xhi_dirHL(i)); ? ? ? ?[m,n] = size(HL); ? ?for j = 1:m ? ? ? ?temp1(j,:) = HL(j,:) - mean(HL(j,:)); ? ?end ? ?RHL = temp1 * temp1'/n; ? ?[evHL,edHL] = eig(RHL); ? ?yHL = evHL'*temp1; ? ?clear temp1; ? ?yHLm = mean(mean(abs(yHL))); ? ?HL = HL.*(abs(HL) > yHLm); ? ?xhi_dirHL(i) = {HL}; ? ? ? ?%HH分量 ? ?HH = cell2mat(xhi_dirHH(i)); ? ? ? ? ? ?[m,n] = size(HH); ? ?for j = 1:m ? ? ? ?temp1(j,:) = HH(j,:) - mean(HH(j,:)); ? ?end ? ?RHH = temp1 * temp1'/n; ? ?[evHH,edHH] = eig(RHH); ? ?yHH = evHH'*temp1; ? ?clear temp1; ? ?yHHm = mean(mean(abs(yHH))); ? ?HH = HH.*(abs(HH) > yHHm); ? ?xhi_dirHH(i) = {HH}; end y = {ca1,xhi_dirLH,xhi_dirHL,xhi_dirHH}; [c, s] = pdfb2vec(y); %重構(gòu) y = vec2pdfb(c, s); ch1_rec = dfbrec_l(y{2}, dfilt); CV1_rec = dfbrec_l(y{3}, dfilt); cd1_rec = dfbrec_l(y{4}, dfilt); len = S_1(1,1)*S_1(1,2); C_1(1:len) = ca1(1:end); C_1(len+1:2*len) = ch1_rec(1:end); C_1(2*len+1:3*len) = CV1_rec(1:end); C_1(3*len+1:4*len) = cd1_rec(1:end); wcim_PCA = waverec2(C_1, S_1, 'db1'); ? ? ? ? ? ? ? ? ? ? ?% 重構(gòu)圖像 figure,imshow(wcim_PCA);title(sprintf('小波-contourlet+PCA去噪(PSNR = %.2f dB)', ... ? ? ? ? ? ? PSNR(wcim_PCA,im)) );axis on;

3 仿真結(jié)果

?

4 參考文獻

[1]盧曉光, 韓萍, 吳仁彪,等. 基于二維小波變換和獨立分量分析的SAR圖像去噪方法[J]. 電子與信息學(xué)報, 2008.

[1]田福苓. 基于Contourlet變換域統(tǒng)計模型的SAR圖像去噪[D]. 西安電子科技大學(xué).

5 代碼下載


【圖像去噪】基于小波變換、contourlet變換、contourlet-小波變換+PCA算法實現(xiàn)SAR圖像的評論 (共 條)

分享到微博請遵守國家法律
印江| 喀喇沁旗| 萝北县| 亚东县| 黄山市| 金寨县| 莱阳市| 漯河市| 神木县| 固原市| 乌兰浩特市| 龙川县| 邯郸市| 宜兰市| 云浮市| 马鞍山市| 镇沅| 盐山县| 武功县| 甘肃省| 阳东县| 汕尾市| 阿克苏市| 潜山县| 巴彦淖尔市| 武强县| 巍山| 贺兰县| 平江县| 云安县| 石首市| 会同县| 龙门县| 淮滨县| 义马市| 揭东县| 井冈山市| 伊通| 仪征市| 汤阴县| 稷山县|