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