I have converted image into 16*16 block. How can i convert these block into video?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
vidya naveen
am 29 Jan. 2015
Beantwortet: Geoff Hayes
am 29 Jan. 2015
my code is
I=imread(image);
img=rgb2gray(I);
[col, row] = find(img<250);
imout = I(min(col):max(col), min(row):max(row));
imshow(imout);
[rows columns numberOfBands]=size(imout);
blockSizeR = 16;
blockSizeC = 16;
wholeBlockRows = floor(rows / blockSizeR);
wholeBlockCols = floor(columns / blockSizeC);
blockNumber=1;
for row = 1 : blockSizeR : rows
for col = 1 : blockSizeC : columns
row1 = row;
row2 = row1 + blockSizeR - 1;
row2 = min(rows, row2);
col1 = col;
col2 = col1 + blockSizeC - 1;
col2 = min(columns, col2);
block=imout(row1:row2, col1:col2);
subplot(16,16,blockNumber);
imshow(block);
blockNumber = blockNumber + 1;
end
end
0 Kommentare
Akzeptierte Antwort
Geoff Hayes
am 29 Jan. 2015
Vidya - consider using the videowriter to write each of your block images to file. See the examples in the provided link to get an idea on what you can try.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type 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!