A problem with quantization of HSI space

2 次查看(过去 30 天)
preet
preet 2013-10-10
编辑: preet 2013-10-11
here H(0-360), S(0-1),I(0-1) . i want to divide in this way 12*3*3 .12-h,3-s,3-i
if I want to convert RGB in 4*4*4 , i am working like this
lbin=4;
abin=4;
bbin=4;
l=256/lbin;
a=256/abin;
b=256/bbin;
for(x=0;x<M;x++)
{
for(y=0;y<N;y++)
{
l1=LstarM1[x][y]/l;
a1=aM1[x][y]/a;
b1=bM1[x][y]/b;
bin=(l1*pow(lbin,2))+a1*pow(abin,1)+b1*pow(bbin,0);
count[bin]=count[bin]+1;
colorBin[x][y]=bin;
}//y
}//x
but i am trying to do this way in HSI , i am not getting the exact bins means 108 . when i am divide into 8*4*4 . use abin instead of lbin in following then i get the exact bins according to values and l=360/8
bin=(l1*pow(abin,2))+a1*pow(abin,1)+b1*pow(bbin,0);

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import and Network Parameters 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by