2008/10/7 Christopher Barker <[EMAIL PROTECTED]>: > I wonder if the euclidian norm would make sense for this application: > > HowFarFromBlue = np.sqrt((255-image[...,BLU])**2 + > image[...,GRN]**2 + > image[...,RED]**2) > > smaller numbers would be bluest -- pure blue would be 0, pure red 360, > etc... > > One thing I like about this is that your "blue" may not exactly be an > RBG blue -- so you could see how "far" a given pixel was from any given > color -- in your case, whatever your blue is. Then it would be something > like: > > r, g, b = ref_color > > HowFarFromRefColor = np.sqrt((r - image[...,RED])**2 + > (g - image[...,GRN])**2 + > (b - image[...,BLU])**2 > ) > > > NOTE: I know nothing of image prcessing -- I"ll be there is are some > standard ways to determine how "close" two colors are.
It's a tricky problem, but if you're serious about it you can use Euclidean distance in the CIELUV colour space, or if you're really serious Euclidean distance in CIELAB. Both probably overkill for this project. Anne _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion