Apply hanning window to all the blocks
1 回表示 (過去 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 件)
参考
カテゴリ
Help Center および File Exchange で Computer Vision with Simulink についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!