필터 지우기
필터 지우기

How do i fill a matrix from smaller matrices?

조회 수: 2 (최근 30일)
eri ccartman
eri ccartman 2016년 10월 30일
편집: Massimo Zanetti 2016년 10월 31일
I have 32x32 blocks of an image. The block size is 8x8. How can i reconstruct the 256X256 image?
I wrote the following code but reshape(...) is not giving a proper result.
idcts = zeros(32,32,8,8);
for c=1:size(dcts,1)
for r=1:size(dcts,2)
temp = double(dcts{c,r});
temp = idct2(temp);
idcts(c,r,:,:) = temp;
end
end
idcts = reshape(idcts,256,256);

답변 (1개)

Massimo Zanetti
Massimo Zanetti 2016년 10월 31일
편집: Massimo Zanetti 2016년 10월 31일
It seems from you code that your blocks are stored in a cell array of size 32x32 called dcts. If it is so, and each block is 8x8, then just convert the cell to matrix:
mat_dcts = cell2mat(dcts)

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by