Hi,
I have already divided a picture into 100 smaller pictures and stored each image in a 10×10 cell array. I am now trying to save them to my computer as a file using imwrite.
[m,n] = size(Pgray);Blocks = cell(m/100,n/100);counti = 0;for i = 1:100:m-99 counti = counti + 1; countj = 0; for j = 1:100:n-99 countj = countj + 1; Blocks{counti,countj} = Pgray(i:i+99,j:j+99); endend
I think I need to create a for loop that does this for each cell, but I'm not sure how:
imwrite(Blocks{1,1}, 'Image1.jpg')
I want it to do this for every image of cell array size 10×10 so that it stores them into a folder and is labelled 'Image(1 through 100).jpg'.
Thanks in advance!
Best Answer