Apply hanning window to all the blocks
조회 수: 2 (최근 30일)
이전 댓글 표시
If I have an Image of 256x256 and I want to divide it into 32x32 regions, I can do it using following code. But If I want to apply hanning window to all the blocks how can I do that?
rgbImage = imread('image.jpg');
rgbImage = imresize(rgbImage, [256 256]);
[rows columns numberOfColorBands] = size(rgbImage)
ca = mat2cell(rgbImage,32*ones(1,size(rgbImage,1)/32),32*ones(1,size(rgbImage,2)/32),3);
plotIndex = 1;
for c = 1 : size(ca, 2)
for r = 1 : size(ca, 1)
fprintf('c=%d, r=%d\n', c, r);
subplot(8,8,plotIndex);
imshow(ca{r,c});
plotIndex = plotIndex + 1;
end
end
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
댓글 수: 0
채택된 답변
Image Analyst
2014년 1월 11일
ca{r, c} is the array in that block. Multiply that by a hanning array that is the same size. Use hanning() or hann().
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!