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