フィルターのクリア

Divide 256*256 image into 2*2 blocks

1 回表示 (過去 30 日間)
niranjan v
niranjan v 2019 年 1 月 25 日
回答済み: Walter Roberson 2019 年 1 月 25 日
I am working on a project of image processing (watermarking) & needs to divide 256*256 image into 2*2 blocks (overlaping) to get 4096 matrices.If anyone knows about it plz help me.

採用された回答

Walter Roberson
Walter Roberson 2019 年 1 月 25 日
if ndims(YourArray) == 2
blocks2x2 = mat2cell(YourArray, 2 * ones(1,128), 2 * ones(1,128) );
else
blocks2x2 = mat2cell(YourArray, 2 * ones(1,128), 2*ones(1,128), size(YourArray,3) );
end
(Really this can be done with just the second of those assignments without an 'if', but splitting the case permits you to avoid a warning.

その他の回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by