Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

how do i divide image into subblocks in 1:2:1 proportion like shown in the figure

1 Ansicht (letzte 30 Tage)
teja jayavarapu
teja jayavarapu am 31 Jan. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
please help me with this

Antworten (1)

Walter Roberson
Walter Roberson am 31 Jan. 2018
[r, c, p] = size(YourImage);
rq = floor(r/4); rh = floor(r/2); rq3 = r - rq - rh;
rparts = [rq rh rq3];
cq = floor(c/4); ch = floor(c/2); cq3 = c - cq - ch;
cparts = [cq ch cq3];
blocks = mat2cell(YourImage, rparts, cparts, p);
I do operations this way because of the possibility that the size is not exactly divisible by 4, and wanting to be sure that we do not get an off-by-one due to round-off.

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by