How to further divide a sliding window
조회 수: 3 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File 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!