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.
Kshitij Singh answered .
2025-11-20
Xdown = X(1:2:end,1:2:end);
If it's RGB, keep the third dimension:
Xdown = X(1:2:end,1:2:end,:);