日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

一维均值滤波算法matlab,用MATLAB编程实现均值滤波算法?

發(fā)布時間:2023/12/31 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 一维均值滤波算法matlab,用MATLAB编程实现均值滤波算法? 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

用MATLAB編程實現(xiàn)均值濾波算法?

關(guān)注:69??答案:2??手機版

解決時間 2021-01-26 22:33

提問者女人不需要傾國傾城

2021-01-26 07:49

用MATLAB編程實現(xiàn)均值濾波算法? (采用3×3的窗口) 要求簡潔 明了

最佳答案

二級知識專家閃光的男人

2021-01-26 08:52

1:smoothingAverageFilterMain.mclc;clear;fid = fopen('lenai.raw');temp= fread(fid, [256,256]);LenaRaw=uint8(temp');subplot(1,2,1) Imshow(LenaRaw);title('原始圖像')subplot(1,2,2) Imshow(smoothingAverageFilter(LenaRaw,3));title('自制函數(shù),使用用3*3模板,均值濾波圖像')2:smoothingAverageFilter.mfunction returnData=smoothingAverageFilter(arg,arg2)[Iwidth,Ilength]=size(arg);temp=double(arg);returnData=zeros(Iwidth,Ilength);totalLength=arg2*arg2;for i=1:Iwidth-arg2+1 for j=1:Ilength-arg2+1 % temp(i,j)=average(arg(i:i+arg2,j:j+arg2)); sum=0.0; for n=1:arg2 for k=1:arg2 sum=sum+temp(i+n-1,j+k-1); end end returnData(i,j)=sum/totalLength; endendreturnData=uint8(returnData);end

全部回答

1樓椥揂濃

2021-01-26 09:11

隨便寫了一個方法,沒優(yōu)化,運行速度有點慢。對于圖像范圍邊界,只跟圖像內(nèi)部點做均值。

clear all

clc

a=imread('manuo1.jpg');

a=im2double(a);

subplot(1,2,1)

imshow(a);

[line,row]=size(a);

lines=0;

rows=0;

linee=0;

rowe=0;

temp=0;

b=[];

for i=1:1:line

for j=1:1:row

lines=i-1;

linee=i+1;

rows=j-1;

rowe=j+1;

if i==1

lines=1;

linee=2;

end

if i==line

lines=line-1;

linee=line;

end

if j==1

rows=1;

rowe=2;

end

if j==row

rows=row-1;

rowe=row;

end

temp=0;

for m=lines:1:linee

for n=rows:1:rowe

temp=temp+a(m,n);

end

end

b(i,j)=temp/((linee-lines+1)*(rowe-rows+1));

end

end

subplot(1,2,2)

imshow(b);

我要舉報

如以上信息為低俗、色情、不良、暴力、侵權(quán)、涉及違法等信息,可以點下面鏈接進行舉報!

推薦資訊

大家都在看

總結(jié)

以上是生活随笔為你收集整理的一维均值滤波算法matlab,用MATLAB编程实现均值滤波算法?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。