日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

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

用MATLAB編程實現均值濾波算法?

關注:69??答案:2??手機版

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

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

2021-01-26 07:49

用MATLAB編程實現均值濾波算法? (采用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('自制函數,使用用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

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

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);

我要舉報

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

推薦資訊

大家都在看

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。