View Single Post
Old 4th November 2006, 15:23   #13  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Ok, i think i see the problem. I haven't found out the correct formulas yet, which takes into account that scale problem.

@Ignues2,

Apart from the problem above, I was thinking about the following metric:

color1 (which is given in advance): Y1Cb1Cr1 -> hue1 -> mask=1
color2: Y2Cb2Cr2 such that -> hue2= |180-hue1| -> mask=0

linear interpolation:

hue = (hue1-|180-hue1|)*mask+|180-hue1| = 180*sign(hue1)*mask+|180-hue1|

with sign(hue1) = 1 for hue1>0, = 0 for hue1=0, < 1 for hue1<0

and thus for an arbitrary pixel:

YCbCr -> hue -> mask = (hue - |180-hue1|)/(180*sign(hue1))

Is that the one you tried? If so, what kind of problems does it give?

edit: corrected formulas!

Last edited by Wilbert; 27th May 2007 at 15:57.
Wilbert is offline   Reply With Quote