Apply hanning window to all the blocks
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
rest12
el 11 de En. de 2014
Respondida: Image Analyst
el 11 de En. de 2014
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 comentarios
Respuesta aceptada
Image Analyst
el 11 de En. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Computer Vision with Simulink en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!