How to access the image's blocks in an iterative way
Mostra commenti meno recenti
Hi
i have a database of 100 images of size 256X384 RGB images.
i divided each image into 6 equal blocks.
now i want to make this in a big nested loop with keeping record of every image and blocks.
i thought to make a big 2D array of size(100 , 6*128 , 128) but i have a problem to access the first layer of each block
i tried this code :
for i=1:6
hblock(k,i*128,128)=iblock(k,i*128,128)(:,:,1);
end
but i got this error:
()-indexing must appear last in an index expression.
i tried using cell arrays but the results wasn't as accurate as numeric arrays.
any help will be appreciated Thank you
Risposte (1)
Image Analyst
il 31 Dic 2011
0 voti
You can't have two indexing things with an array, like array()(). You can have only one set of parentheses. I'm not sure what you're after. Do you want to store the kth slice, or the first slice in your new 3D array?
5 Commenti
yasmine
il 31 Dic 2011
Image Analyst
il 31 Dic 2011
Do "size(iblock)" - what does it report in the command window?
Image Analyst
il 31 Dic 2011
Do you have this "database of 100 images of size 256X384 RGB images" already in an array or cell array? Or do you still need to read in those images from a database (Oracle, Access???) or a folder?
yasmine
il 31 Dic 2011
Image Analyst
il 31 Dic 2011
Answer my question on using size(). What is iblock? How did you create that array?
Categorie
Scopri di più su Neighborhood and Block Processing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!