interpolation done without imresize
12 ビュー (過去 30 日間)
古いコメントを表示
How to do nearest neighbor interpolation and bilinear interpolation on a gray scale image without using imresize? The code is supposed to mimic the operation of imresize but should not use any functions available on matlab.
2 件のコメント
Matt J
2013 年 1 月 24 日
should not use any functions available on matlab
I don't see how you're going to do nearest neighbor interpolation without MATLAB's round() function. You might want to clarify the scope of that restriction.
採用された回答
Image Analyst
2013 年 1 月 24 日
You'll have to scan your output image, figure out where the input pixel lies on your input pixel - it will be located somewhere in a square between 3 original input pixels. Then use the bilinear interpolation formula on Wikipedia to get the output pixel value. You can use a pair of for loops for this - one over rows and one over columns.
6 件のコメント
Image Analyst
2013 年 1 月 24 日
The formula for weighting the value according to how close it is to the different corners is in Wikipedia.
その他の回答 (1 件)
Sean de Wolski
2013 年 1 月 24 日
I would use interp2 or griddedInterpolant.
doc interp2
doc griddedInterpolant
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!