How to Downsample image in both Horizontal and Vertical Direction
조회 수: 93 (최근 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
댓글 수: 0
채택된 답변
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
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 Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!