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

2 views (last 30 days)
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.

Accepted Answer

Image Analyst
Image Analyst on 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 Comment
s malik
s malik on 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.

Sign in to comment.

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!