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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

boxfilter 实现

發(fā)布時間:2024/10/12 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 boxfilter 实现 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

A implementation of boxfilter



? ? ? ? ? ? ? ? ?boxfilter 是均值濾波的一種改進。在以下這篇blog里面有介紹。

http://www.cnblogs.com/easymind223/archive/2012/11/13/2768680.html


這里我使用matlab對其進行實現(xiàn)。

可是這里邊界問題沒有處理好,假設viewer有好的意見歡迎告訴我




% % ********************************************************* % code writer : EOF % code file : my_boxfilter.m % code date : 2014.10.21 % e-mail : jasonleaster@gmail.com % % Code description : % Here is my implementation of boxfilter :) % It work correctly in the region where is not close to % the end boundary but will meet problem on some where % close to the image end boundary. % *********************************************************function Filted_Img = my_boxfilter(Image)if size(Image,3) ~= 1fprintf('ERROR Imput-Image must be ##ONE## channel image\n');return;endHeight_Img = size(Image,1);Width_Img = size(Image,2);Buffer = zeros(1,Width_Img);Filted_Img = zeros(Height_Img,Width_Img);% treat this varible as a constantSEARCH_WIN_HEIGHT = 10;SEARCH_WIN_WIDTH = 10;for row = 1: Height_Imgfor col = 1: Width_Imgsum_value = 0;if (row + SEARCH_WIN_HEIGHT) < Height_Imgfor temp = row : (row + SEARCH_WIN_HEIGHT)sum_value = sum_value + Image(temp,col);endelsefor temp = row : Height_Imgsum_value = sum_value + Image(temp,col);end endBuffer(col) = sum_value;endfor col = 1:Width_Imgif (col + SEARCH_WIN_WIDTH) < Width_Imgfor temp = col : col + SEARCH_WIN_WIDTHFilted_Img(row,col) = Filted_Img(row,col) + Buffer(temp);endelsefor temp = col : Width_ImgFilted_Img(row,col) = Filted_Img(row,col) + Buffer(temp);endendendendFilted_Img = Filted_Img./(SEARCH_WIN_HEIGHT * SEARCH_WIN_WIDTH); end


版權聲明:本文博客原創(chuàng)文章,博客,未經同意,不得轉載。

轉載于:https://www.cnblogs.com/bhlsheji/p/4682760.html

總結

以上是生活随笔為你收集整理的boxfilter 实现的全部內容,希望文章能夠幫你解決所遇到的問題。

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