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

1 Ansicht (letzte 30 Tage)
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.

Akzeptierte Antwort

Image Analyst
Image Analyst am 13 Apr. 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 Kommentar
s malik
s malik am 14 Apr. 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by