필터 지우기
필터 지우기

how can we do "8-coarse division of RGB color space" for dominant color extraction?

조회 수: 1 (최근 30일)
this is basically for quantized color.

답변 (2개)

Image Analyst
Image Analyst 2012년 12월 31일
Try rgb2ind() or this kmeans example
  댓글 수: 7
Image Analyst
Image Analyst 2012년 12월 31일
It looks like the FAQ applies here: http://matlab.wikia.com/wiki/FAQ#Can_you_program_up_the_algorithm_in_this_article_for_me_and_explain_it_to_me.3F, though it looks somewhat interesting so if I can find the time today or tomorrow maybe I can read the paper.
preet
preet 2012년 12월 31일
편집: Image Analyst 2012년 12월 31일
i appreciate if u do for me... happy new year..

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2012년 12월 31일
dImage = im2double(YourImage);
binned_image = round(dImage);
quadrant_num = binned_image(:,:,1) * 4 + binned_image(:,:,2) * 2 + binned_image(:,:,1);
quadrant 0 would be (low red, low blue, low green), quadrant 1 would be (low red, low blue, high green), quadrant 2 would be (low red, high blue, low green), and so on up to quadrant 7 as (high red, high blue, high green)
You might want to add 1 to the quadrant number, if you want to use it as an index.
  댓글 수: 10
preet
preet 2013년 1월 1일
i said i need the result like rgb2ind()..
Walter Roberson
Walter Roberson 2013년 1월 1일
Okay, here it is:
dImage = im2double(YourImage);
binned_image = round(dImage);
quadrant_num = uint8( binned_image(:,:,1) * 4 + binned_image(:,:,2) * 2 + binned_image(:,:,1) );
quadrant_num will now be exactly like rgb2ind() in that it will return a 2D array of uint8() values, each of which is an "ind". Keep in mind that exactly like rgb2ind(), the value 0 represents the first color in the color map, and 1 represents the second color, and so on.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by