


下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、精選優(yōu)質(zhì)文檔-傾情為你奉上Wiener2濾波C+代碼(2011-03-18 10:17:00)標簽:/code written by Kay() 2011/03/17BOOL WienerFilter(WORD *pData, int iWid, int iHgh, int ihoodW, int ihoodH)if (pData = NULL)return FALSE;int iSize = iWid*iHgh;float *pKernel=new floatihoodW*ihoodH;for ( int i = 0 ; i ihoodW*ihoodH ; i + ) pKerneli =
2、(float)1/(ihoodW*ihoodH);float *pMean=new floatiSize;float *pVal =new floatiSize;for ( i = 0 ; i iSize ; i + ) pMeani = (float)(pDatai*pDatai);Filter2(pVal,pMean,iWid,iHgh,pKernel,ihoodW,ihoodH);Filter2(pMean,pData,iWid,iHgh,pKernel,ihoodW,ihoodH);for ( i = 0 ; i iSize ; i + ) pVali = pVali-(pMeani*
3、pMeani);/temp for meandouble dMean=0;for ( i = 0 ; i iSize ; i + )dMean+=(double)pVali/iHgh;dMean=dMean/iWid;for ( i = 0 ; i 0?(pVali-(float)dMean):0;float ftemp = (pDatai-pMeani)*pVali/(pVali+(float)dMean)+pMeani;if (ftemp (GRAYLEVEL-1)ftemp = GRAYLEVEL-1;pDatai = (WORD)ftemp;delete pKernel;delete
4、pMean;delete pVal;return TRUE;void Filter2(float *pRes,WORD *pData, int iWid, int iHgh, float *pKernel, int iKWid, int iKHgh)float ftemp=0;for ( int j = 0 ; j iHgh ; j + )for ( int i = 0 ; i iWid ; i + )ftemp=0;for ( int x = 0 ; x iKWid ; x + )for ( int y = 0 ; y iKHgh ; y + )int ix=(x-iKWid/2+i)0?0
5、:(x-iKWid/2+i);int iy=(y-iKHgh/2+j)iWid) ix=iWid-1;if (iy+1)iHgh) iy=iHgh-1;ftemp+=pDataix+iy*iWid*pKernelx+y*iKWid;pResj*iWid+i = ftemp;void Filter2(float *pRes,float *pData, int iWid, int iHgh, float *pKernel, int iKWid, int iKHgh)float ftemp=0;for ( int j = 0 ; j iHgh ; j + )for ( int i = 0 ; i iWid ; i + )ftemp=0;for ( int x = 0 ; x iKWid ; x + )for ( int y = 0 ; y iKHgh ; y + )int ix=(x-iKWid/2+i)0?0:(x-iKWid/2+i);int iy=(y-iKHgh/2+j)iWid) ix=iWid-1;if (iy+
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年科室護理工作方案
- 個人2025年下半年工作方案演講稿模板
- 公司保潔服務(wù)協(xié)議
- PHP程序設(shè)計項目化教程電子教案13 用戶注冊-前后端數(shù)據(jù)交互
- 2025年電子政務(wù)綜合管理系統(tǒng)項目可行性研究報告
- 2025年中職計算機全國大賽題庫
- 2025年電動叉車牽引電池項目可行性研究報告
- 2025年玻璃鋼車子項目可行性研究報告
- 2025年煮漂鍋項目可行性研究報告
- 遼寧建筑職業(yè)學院《教育研習(1)》2023-2024學年第二學期期末試卷
- 2024-2025學年人教版初中物理八年級下冊期中檢測卷(第七章-第九章)
- 維修人員管理獎懲制度3篇1
- 國家糧食和物資儲備局招聘考試真題2024
- 產(chǎn)品推廣活動策劃方案詳解
- 手衛(wèi)生知識宣教培訓
- 上門催收技巧培訓
- 【初中地理】《日本》課件-2024-2025學年湘教版初中地理七年級下冊
- 智能定時開關(guān)插座設(shè)計與制作
- 大模型關(guān)鍵技術(shù)與應(yīng)用
- 與信仰對話 課件-2024年入團積極分子培訓
- 2024《整治形式主義為基層減負若干規(guī)定》全文課件
評論
0/150
提交評論