Using blockproc to simply copy an array
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi can I use blockproc to copy 3 arrays
and them merge them
redChannel = I(:, :, 1);
greenChannel = I(:, :, 2);
blueChannel = I(:, :, 3);
%% output functions
funr = redChannel + greenChannel + blueChannel;
fung = S(:,:,2);
funb = S(:,:,3);
blockSize = [64 64];
@(block_struct) (block_struct.data) * ones(size(block_struct.data));
%% blocks
blockyImageR = blockproc(I, blockSize, funr)
blockyImageR = blockproc(redChannel, blockSize, fung)
The above trials are not working.
output should be blocks of 64x64x3
댓글 수: 0
답변 (1개)
Matt J
2020년 11월 22일
Using sepblockfun from the file exchange,
blockSize = [64 64];
R=sepblockfun(I,[blockSize,3],'sum');
R=repelem(R,blockSize);
I(:,:,1)=R;
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!