How to Downsample image in both Horizontal and Vertical Direction

56 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by