How to divide image and calculating quantized mean values of hsv and lab color channel.

2 visualizaciones (últimos 30 días)
I want to divide an image into 8* 16 overlapping blocks,
blocks are overlapping of 50% in horizontal and vertical.
then from each block, I want to compute quantized mean values
of HSV and lab color channel.

Respuesta aceptada

Image Analyst
Image Analyst el 13 de Abr. de 2016
Easily accomplished with blockproc(). See my attached demos for about 6 or 8 different ways to call blockproc(). Find the one you want and adapt it to your situation. Post your adapted code back here if you still need help.
  1 comentario
s malik
s malik el 14 de Abr. de 2016
I have read your tutorial and It is quite helpful. Specifically I have changed the code as under.
Img=imread('v1.tif');% specifically the size of the image is 128*48
hsvImg=rgb2hsv(Img);% as I want the mean HSV values
% meanFilterFunction = @(theBlockStructure) mean2(theBlockStructure.data(:)) ;
blockSize = [8 16];
overlap=[4 8];
blockyImage = blockproc(hsvImg, blockSize, meanFilterFunction,'BorderSize', overlap,'TrimBorder', 0);
[rows, columns] = size(blockyImage);
please tell me whether overlapping is correct as i need 50% blocks overlapping.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by