Divide 256*256 image into 2*2 blocks
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
niranjan v
am 25 Jan. 2019
Beantwortet: Walter Roberson
am 25 Jan. 2019
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.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 25 Jan. 2019
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 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!