Apply hanning window to all the blocks
2 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Image Analyst
on 11 Jan 2014
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 Comments
More Answers (0)
See Also
Categories
Find more on Computer Vision with Simulink 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!