How to further divide a sliding window

조회 수: 3 (최근 30일)
Ciara
Ciara 2014년 4월 16일
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.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by