How to further divide a sliding window

1 view (last 30 days)
Ciara
Ciara on 16 Apr 2014
Hi I have written the following code which divides applies a 32x32 sliding window to an image.
N = 32;
info = repmat(struct, ceil(size(Z, 1) / N), ceil(size(Z, 2) / N));
for row = 1:N:size(Z, 1)%loop through each pixel in the image matrix
for col = 1:N:size(Z, 2)
r = (row - 1) / N + 1;
c = (col - 1) / N + 1;
imgWindow = Z(row:min(end,row+N-1), col:min(end,col+N-1));
largest = max(imgWindow(:));
[rLarg, cLarg] = find(imgWindow == largest, 1, 'first');
average = mean(imgWindow(:));
window(r, c).average = average;
display(window(r, c).average);
end
end
Can anyone tell me how to further divide the 32x32 windows into 8x8 windows?
Thank you.

Answers (0)

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!