How to Downsample image in both Horizontal and Vertical Direction

120 ビュー (過去 30 日間)
Chandra Shekhar
Chandra Shekhar 2012 年 12 月 7 日
Any one help me how to downsample image in horizontal direction and vertical direction.
i used downsample(image,4), it will down sample image in both the direction, but i need to downsample separately for horizontal and vertical.
Does any know suggest me please.
Thank You

採用された回答

Sean de Wolski
Sean de Wolski 2012 年 12 月 7 日
編集済み: Sean de Wolski 2012 年 12 月 7 日
For grayscale:
Xdown = X(1:2:end,1:2:end);
If it's RGB, keep the third dimension:
Xdown = X(1:2:end,1:2:end,:);
  1 件のコメント
Image Analyst
Image Analyst 2012 年 12 月 7 日
That's how I'd do it for simple subsampling by an integer (2, 3, 4, etc.). There is also the imresize() function that you can use. It will handle interpolation if the subsampling is not by integer amounts.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by