processing several images blocks

조회 수: 1 (최근 30일)
Rusmaya Luthfina
Rusmaya Luthfina 2011년 10월 26일
hi all,
i have 10 jpg image with same size 320x320, i've divided each image into 4x4 block. i need to access each block but it's failed. here's the codes
folder = 'F:\Maya\pengenalan pola\tugas image retrieve\image';
fileList = dir(fullfile(folder,'*.jpg'));
for i = 1:length(fileList)
I{i} = imread(fullfile(folder,fileList(i).name));
out{i} = mat2cell(I{i},ones(320/80,1)*80,ones(320/80,1)*80,3);
end
imshow(out{1, 1, 1})
it returns error ??? Error using ==> iptcheckinput Function IMAGEDISPLAYVALIDATEPARAMS expected its first input, I, to be one of these types:
double, single, uint8, uint16, uint32, int8, int16, int32, logical
Instead its type was cell.
Error in ==> imageDisplayValidateParams at 12 iptcheckinput(common_args.CData, {'numeric','logical'},...
Error in ==> imageDisplayParseInputs at 79 common_args = imageDisplayValidateParams(common_args);
Error in ==> imshow at 199 [common_args,specific_args] = ...
but when i load only a single file like this
j = imread('Milk.jpg');
out = mat2cell(j,ones(320/80,1)*80,ones(320/80,1)*80,3);
imshow(out{1, 1})
it's just run correctly like what i need, returns image block(1,1)
really need you helps
thank you,
Maya

답변 (2개)

Walter Roberson
Walter Roberson 2011년 10월 26일
Note that out{1,1,1} is the same as out{1}, which is not the same as out{1}{1,1}
  댓글 수: 1
Rusmaya Luthfina
Rusmaya Luthfina 2011년 10월 26일
i got it Mr. Roberson, thx u.. i change it to imshow(out{1}{n}), where n is the block, and it works,
my i ask u a question??
is sit possible to perform RGB histogram to each blocks of each picture?
how do we do that?
thanks,
maya

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


Rusmaya Luthfina
Rusmaya Luthfina 2011년 10월 26일
my images are RGB, can we perform RGB histogram to each block of each image?

태그

Community Treasure Hunt

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

Start Hunting!

Translated by