i have divided an RGB image into 4*4 non overlapping blocks. Aft which I hv stored the blocks into a cell array if the standard deviation value is more than a fixed value. Now I wan to put these 16 images back and reconstruct the image. How do i do

조회 수: 1 (최근 30일)
This cell array contains the 16 blocks:
T_arr = {T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16};
I have a blank image which is same size as the original undivided image:
Mosaic = cell(size(Original,1), size(Original,2),3);
cnt = 1;
for i = 1:1:4
for j=1:1:4
Mosaic{i,j} = T_arr{cnt};
cnt = cnt+1;
end
end
After execution with no error, the Mosaic image contains all blank images. Plz Help.

채택된 답변

Image Analyst
Image Analyst 2015년 1월 27일
How did you determine that the Mosaic cell array consists of cells that contain completely blank images?
You aren't just doing imshow(Mosaic) are you, because you can't do that. Are you actually looking in the variable editor at the contents of the individual cells? But I have no idea why you're creating a cell array with the same number of cells across and the same number of cells down as your image? Why???? You only have 16 cells to begin with, not a million or so. Do you want Mosaic to be an RGB image or grayscale image (which would make sense), or do you really want it to be a cell array with millions of cells but of which you're only using the tiny 4 by 4 upper left corner of it (like you're doing and which makes little sense)?
I'm pretty sure you don't know how to use cell arrays and the FAQ should help with that: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F
  댓글 수: 3
Image Analyst
Image Analyst 2015년 1월 28일
편집: Image Analyst 2015년 1월 28일
Now you've changed it. Now T_arr is a numerical matrix instead of a cell array as before. Which is it? If they have different number of rows, it must be a cell array. It can be a numerical array if the Tn have the same number of rows, but different number of columns.
Why not just do
Mosaic = [T1,T2,T3,T4;T5,T6,T7,T8;T9,T10,T11,T12;T13,T14,T15,T16]
Why bother with cell arrays and loops if you have the Tn???

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by