Skip to main content
. 2013 Jul 12;13(7):8895–8915. doi: 10.3390/s130708895

Algorithm 1: Algorithm for codebook construction

Cϕ
for t= 1 → N do
  xt = (R, G, B), IR2+G2+B2
  Find the codeword, cm, in C matching to xt based on two conditions:
  (a) colordist(xt, vm) ≤ ϵ1
  (b) brightness (I, 〈 Iminm, Imaxm〉) = true
  if C = ϕ or there is no match then
   {Create new codeword and add it to C}
  else
   {Update matched codeword}
  end if
end for