資源簡介
該代碼主要是用于圖像的插值處理,希望對大家有幫助!

代碼片段和文件信息
function?[C]?=?resampling(?firstWidthfirstHeightlastWidthlastHeightA?)
rateFirstWidth?=?LCM(?firstWidthlastWidth?)/firstWidth;
rateFirstHeight?=?LCM(?firstHeightlastHeight?)/firstHeight;
rateLastWidth?=?LCM(?firstWidthlastWidth?)/lastWidth;
rateLastHeight?=?LCM(?firstHeightlastHeight?)/lastHeight;
for?i=1:1:lastHeight
????for?j=1:1:lastWidth
????????offsetX=(i-1)*rateLastHeight;
????????offsetY=(j-1)*rateLastWidth;
????????for?x=1:1:rateLastHeight
????????????for?y=1:1:rateLastWidth
????????????????k?=?offsetX?+?x;
????????????????t?=?offsetY?+?y;
????????????????mapX?=?ceil(?k/rateFirstHeight?);
????????????????mapY?=?ceil(?t/rateFirstWidth?);????????????????
????????????????tempMatrix(?xy?)?=?A(?mapXmapY?);
????????????end
????????end
????????C(?ij?)?=?uint8(?round(?mean2(?tempMatrix?)?)?);????????????
????end
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????101562??2006-09-27?01:11??ImageResample(matlab)\cameraman.tif
?????文件??????75774??2006-09-27?03:03??ImageResample(matlab)\Down_Sampling.tif
?????文件????????868??2008-03-09?12:29??ImageResample(matlab)\resampling.m
?????文件????????380??2008-03-09?12:35??ImageResample(matlab)\sc
?????文件?????323072??2008-03-09?12:34??ImageResample(matlab)\solution.doc
?????文件?????117028??2006-09-27?03:04??ImageResample(matlab)\Up_Sampling.tif
?????目錄??????????0??2010-03-26?19:08??ImageResample(matlab)
-----------?---------??----------?-----??----
???????????????618684????????????????????7
- 上一篇:基于內容的圖像檢索源代碼
- 下一篇:分級變速主傳動系統 機械系統設計課程設計
評論
共有 條評論