divide image into block of size 1*2
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
aditya kumar sahu
am 12 Okt. 2016
Kommentiert: Walter Roberson
am 12 Okt. 2016
I have a 512*512 image and I want to divide into blocks each having 1x2 pixels.So I will get total 131072 blocks.Now I want to process each blocks.
i am doing in matlab code.. Any idea?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 12 Okt. 2016
image_blocks = num2cell(TheImage);
Now image_blocks{J,K} will be the 1 x 1 block corresponding to the pixel at TheImage{J,K}
I cannot think of any advantage of dividing into 1 x 1 blocks, unless perhaps it is for convenience in holding the bit equivalent as a unit ? But if that is the situation then
bit_cells = arrayfun(@(V) dec2bin(V,8), TheImage, 'Uniform', 0);
2 Kommentare
Walter Roberson
am 12 Okt. 2016
image_blocks = mat2cell(TheImage, ones(1,size(TheImage,1), 2 * ones(1, size(TheImage,2)/2) );
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Encryption / Cryptography finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!