Color::Similarity::HCL - compute color similarity using the HCL color space


NAME

Color::Similarity::HCL - compute color similarity using the HCL color space

Back to Top


SYNOPSIS

  use Color::Similarity::HCL qw(distance rgb2hcl distance_hcl);
  # the greater the distance, more different the colors
  my $distance = distance( [ $r1, $g1, $b1 ], [ $r2, $g2, $b2 ] );

Back to Top


DESCRIPTION

Computes color similarity using the color space and distance metric defined in the research report:

HCL: a new Color Space for a more Effective Content-based Image Retrieval

M. Sarifuddin <m.sarifuddin@uqo.ca> - Rokia Missaoui <rokia.missaoui@uqo.ca> Département d'informatique et d'ingénierie, Université du Québec en Outaouais C.P. 1250, Succ. B Gatineau Quéebec Canada, J8X 3X7

http://w3.uqo.ca/missaoui/Publications/TRColorSpace.zip

Back to Top


FUNCTIONS

distance

  my $distance = distance( [ $r1, $g1, $b1 ], [ $r2, $g2, $b2 ] );

Converts the colors to the HCL space and computes their distance.

rgb2hcl

  [ $h, $c, $l ] = rgb2hcl( $r, $g, $b );

Converts between RGB and HCL color spaces.

distance_hcl

  my $distance = distance_hcl( [ $h1, $c1, $l1 ], [ $h2, $c2, $l2 ] );

Computes the distance between two colors in the HCL color space.

Back to Top


SEE ALSO

http://w3.uqo.ca/missaoui/Publications/TRColorSpace.zip

Corrected the RGB -> HCL transformation (see rgb2hcl) as per the research report by the same authors (thanks to David Hoerl for finding the document with the corrected formula).

the Color::Similarity manpage, the Color::Similarity::RGB manpage, the Color::Similarity::Lab manpage

Back to Top


AUTHOR

Mattia Barbon, <mbarbon@cpan.org>

Back to Top


COPYRIGHT

Copyright (C) 2007, Mattia Barbon

This program is free software; you can redistribute it or modify it under the same terms as Perl itself.

Back to Top

 Color::Similarity::HCL - compute color similarity using the HCL color space