How to divide color image into blocks and calculate mean and std of each block.
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to divide color image into 5 * 5 blocks. For each block I want to calculate mean and std. How to do it?
댓글 수: 0
답변 (1개)
KSSV
2016년 12월 15일
I = rand(100,100,3); % be your image after imread..
R = I(:,:,1) ; G = I(:,:,2) ; B = I(:,:,3) ;
I1 = reshape(I,5,5,[]) ;
G1 = reshape(G,5,5,[]) ;
B1 = reshape(B,5,5,[]) ;
But be careful that, when you reshape into 5x5 the number of columns and rows must be divisible by 5. If not, you have to either change 5x5 to desired divisible number of dimensions or take 5X5 and last one block will not have 5X5.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!