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

2 ビュー (過去 30 日間)
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.

採用された回答

Image Analyst
Image Analyst 2016 年 4 月 13 日
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 件のコメント
s malik
s malik 2016 年 4 月 14 日
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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by