OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Mon, 13 Jul 2015 04:08:40 -0500Best color difference or distance approximation?http://answers.opencv.org/question/65946/best-color-difference-or-distance-approximation/Currently, a standard way of comparing colors is using "Delta E" metric in CIELab [[Color-difference](https://en.wikipedia.org/wiki/Color_difference)] which is based on Euclidean distance in CIELab color space.
However, for certain applications using the distance metric intensively "Delta E" metric could be a bit slow (e.g. RGB2Lab conversion is necessary, floating point operations can be costly, etc.).
Is there a "good enough approximation" of color difference or distance?
Ex.
* Weighted Manhattan distance (L1 distance) (in RGB) (as suggested [here](http://stackoverflow.com/questions/9018016/how-to-compare-two-colors))
* Hue Manhattan distance (L1 distance) (in HSV) (as suggested [here](http://stackoverflow.com/questions/9018016/how-to-compare-two-colors))
* Any other suggestions?Thu, 09 Jul 2015 20:45:57 -0500http://answers.opencv.org/question/65946/best-color-difference-or-distance-approximation/Comment by mkc for <p>Currently, a standard way of comparing colors is using "Delta E" metric in CIELab [<a href="https://en.wikipedia.org/wiki/Color_difference">Color-difference</a>] which is based on Euclidean distance in CIELab color space.</p>
<p>However, for certain applications using the distance metric intensively "Delta E" metric could be a bit slow (e.g. RGB2Lab conversion is necessary, floating point operations can be costly, etc.).</p>
<p>Is there a "good enough approximation" of color difference or distance?</p>
<p>Ex.</p>
<ul>
<li><p>Weighted Manhattan distance (L1 distance) (in RGB) (as suggested <a href="http://stackoverflow.com/questions/9018016/how-to-compare-two-colors">here</a>)</p></li>
<li><p>Hue Manhattan distance (L1 distance) (in HSV) (as suggested <a href="http://stackoverflow.com/questions/9018016/how-to-compare-two-colors">here</a>)</p></li>
<li><p>Any other suggestions?</p></li>
</ul>
http://answers.opencv.org/question/65946/best-color-difference-or-distance-approximation/?comment=66077#post-id-66077@Guanta Thanks for the comment. Can you elaborate why you think cosine distance might be a "good enough approximation" of color difference or distance? It does have the speed potential as reported in [EVALUATION OF SIMILARITY MEASUREMENT FOR IMAGE RETRIEVAL](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.69.6025&rep=rep1&type=pdf)...Sun, 12 Jul 2015 07:13:47 -0500http://answers.opencv.org/question/65946/best-color-difference-or-distance-approximation/?comment=66077#post-id-66077Comment by mkc for <p>Currently, a standard way of comparing colors is using "Delta E" metric in CIELab [<a href="https://en.wikipedia.org/wiki/Color_difference">Color-difference</a>] which is based on Euclidean distance in CIELab color space.</p>
<p>However, for certain applications using the distance metric intensively "Delta E" metric could be a bit slow (e.g. RGB2Lab conversion is necessary, floating point operations can be costly, etc.).</p>
<p>Is there a "good enough approximation" of color difference or distance?</p>
<p>Ex.</p>
<ul>
<li><p>Weighted Manhattan distance (L1 distance) (in RGB) (as suggested <a href="http://stackoverflow.com/questions/9018016/how-to-compare-two-colors">here</a>)</p></li>
<li><p>Hue Manhattan distance (L1 distance) (in HSV) (as suggested <a href="http://stackoverflow.com/questions/9018016/how-to-compare-two-colors">here</a>)</p></li>
<li><p>Any other suggestions?</p></li>
</ul>
http://answers.opencv.org/question/65946/best-color-difference-or-distance-approximation/?comment=66134#post-id-66134[Comprehensive Survey on Distance/Similarity Measures](http://arabic-icr.googlecode.com/git/Papers/Comprehensive%20Survey%20on%20Distance-Similarity.pdf)Mon, 13 Jul 2015 04:08:40 -0500http://answers.opencv.org/question/65946/best-color-difference-or-distance-approximation/?comment=66134#post-id-66134Comment by Guanta for <p>Currently, a standard way of comparing colors is using "Delta E" metric in CIELab [<a href="https://en.wikipedia.org/wiki/Color_difference">Color-difference</a>] which is based on Euclidean distance in CIELab color space.</p>
<p>However, for certain applications using the distance metric intensively "Delta E" metric could be a bit slow (e.g. RGB2Lab conversion is necessary, floating point operations can be costly, etc.).</p>
<p>Is there a "good enough approximation" of color difference or distance?</p>
<p>Ex.</p>
<ul>
<li><p>Weighted Manhattan distance (L1 distance) (in RGB) (as suggested <a href="http://stackoverflow.com/questions/9018016/how-to-compare-two-colors">here</a>)</p></li>
<li><p>Hue Manhattan distance (L1 distance) (in HSV) (as suggested <a href="http://stackoverflow.com/questions/9018016/how-to-compare-two-colors">here</a>)</p></li>
<li><p>Any other suggestions?</p></li>
</ul>
http://answers.opencv.org/question/65946/best-color-difference-or-distance-approximation/?comment=65994#post-id-65994How about cosine distance (i.e. the angle between two color vectors)?Fri, 10 Jul 2015 09:17:37 -0500http://answers.opencv.org/question/65946/best-color-difference-or-distance-approximation/?comment=65994#post-id-65994