Quarter of an image.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi everyone, I am stuck with this problem. I need to Write a Matlab function that will drop every second even number pixel. Row-wise: you retain one pixel, and then you drop the next pixel, until you reach the end of that row. Column-wise: you retain one pixel, and you drop the next pixel, until you reach the end of that column. The image should therefore be a quarter of its original size.
Thank you very much. regards.
댓글 수: 0
채택된 답변
Image Analyst
2014년 9월 13일
Try this on your input matrix m:
quarterMatrix = m(2 : 2 : end, 2 : 2 : end);
댓글 수: 0
추가 답변 (1개)
Youssef Khmou
2014년 9월 13일
Using vector function,the problem becomes simple, here is an example to select 1/4 of matrix :
N=400;
H=randn(N);
line=1:2:N;
V=H(:,line);
Final=V(line,:);
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!