Square rooting is slow, and not calculating square root do not throw off 
comparison.

On Jun 17, 2014, at 21:14, Mills, Steve <smi...@makemusic.com> wrote:

> On Jun 17, 2014, at 06:43:54, Maxthon Chan <xcvi...@me.com> wrote:
> 
>> One easy-to-implement method: colour cube.
>> 
>> Define a colour using its RGB values as a 3-tuple (r, g, b) and standard 
>> colours (ri, gi, bi) (where i = 0..n).The square distance between the given 
>> colour and a standard colour is (ri-r)^2+(gi-g)^2+(bi-b)^2. You can 
>> calculate square distances between the given colour and each of the standard 
>> colours, and the one with the minimal squared distance is the best match.
> 
> The algorithm I've seen then takes the square root of that value.
> 
> --
> Steve Mills
> office: 952-818-3871
> home: 952-401-6255
> 

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to