<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262904</link>
    <title>MATLAB Central Newsreader - Lab color space issue</title>
    <description>Feed for thread: Lab color space issue</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 12 Oct 2009 13:15:21 -0400</pubDate>
      <title>Lab color space issue</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262904#686424</link>
      <author>rubionelove </author>
      <description>Dears all, &lt;br&gt;
I've a color in Lab format&lt;br&gt;
&lt;br&gt;
L=69&lt;br&gt;
a=30&lt;br&gt;
b=71&lt;br&gt;
&lt;br&gt;
if I fix L value  to 30. How can I find a and b values of the colour&lt;br&gt;
since they do not change in a linear way?&lt;br&gt;
&lt;br&gt;
thank you very much</description>
    </item>
    <item>
      <pubDate>Mon, 12 Oct 2009 14:30:21 -0400</pubDate>
      <title>Re: Lab color space issue</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262904#686471</link>
      <author>rubionelove </author>
      <description>any suggestions?</description>
    </item>
    <item>
      <pubDate>Mon, 12 Oct 2009 14:43:21 -0400</pubDate>
      <title>Re: Lab color space issue</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262904#686474</link>
      <author>John D'Errico</author>
      <description>&quot;rubionelove &quot; &amp;lt;rubionelove@gmail.com&amp;gt; wrote in message &amp;lt;haveht$as8$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; any suggestions?&lt;br&gt;
&lt;br&gt;
I already responded to your question. I've worked in&lt;br&gt;
color science, gamut mapping, color characterization,&lt;br&gt;
modeling, etc, for 20 years. And I have no idea that&lt;br&gt;
your question is asking.&lt;br&gt;
&lt;br&gt;
Please be more specific. Nobody is answering because&lt;br&gt;
nobody else has any idea what you want either.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Mon, 12 Oct 2009 15:15:56 -0400</pubDate>
      <title>Re: Lab color space issue</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262904#686486</link>
      <author>ImageAnalyst</author>
      <description>I second what John says.  This question makes no sense (not to mention&lt;br&gt;
the fact that you were hoping for responses practally instantly).  You&lt;br&gt;
need to clarify.  If you must have an answer without clarifying, then&lt;br&gt;
I submit this: use a colorimeter or spectrophotometer instrument to&lt;br&gt;
&quot;find&quot; a and b.</description>
    </item>
    <item>
      <pubDate>Mon, 12 Oct 2009 16:24:03 -0400</pubDate>
      <title>Re: Lab color space issue</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262904#686501</link>
      <author>rubionelove </author>
      <description>I'm sorry john and Imageanalyst  if the question was not clear.&lt;br&gt;
I'll try to clarify the problem. &lt;br&gt;
&lt;br&gt;
I'm currently facing a problem computing the euclidean distance between the &quot;a&quot; and &quot;b&quot; components of two colours. &lt;br&gt;
For example I have 4 colours in rgb format&lt;br&gt;
dark gray, light gray&lt;br&gt;
dark brown and light brown&lt;br&gt;
&lt;br&gt;
I converted the four colours in lab space.&lt;br&gt;
I observed that for the two greys the &quot;L&quot; value is different but &quot;a&quot; and &quot;b&quot; remains quite the same, so the euclidean distance between &quot;a&quot; and &quot;b&quot; components of the two grays is very small. &lt;br&gt;
&lt;br&gt;
I observed also that for the two browns the euclidean distance between two different colours (dark brown and clear brown) is generally larger than with grays. Because also &quot;a&quot; and &quot;b&quot; components are changing.&lt;br&gt;
In my opinion this is due to the 3dimensional shape of the lab space.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
My goal is to remove a selected colour in an image.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;C=makecform('srgb2lab');&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;imLAB= applycform(Image,C); &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SelectedColor= applycform(color,C);  &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% Extract a* and b* values&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;imA = imLAB(:,:,2);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;imB = imLAB(:,:,3);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;colA = SelectedColor(1,2); &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;colB = SelectedColor(1,3); &lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% compute distance from selected color&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;distTresh=5;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;imMask = zeros(r,c);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;imDist =hypot(imA-colA ,imB-colB );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;imMask(imDist&amp;gt;distTresh)=1;&lt;br&gt;
&lt;br&gt;
This is working good with grays (color= gray). But to have the same result with other colours I've to change the treshold.&lt;br&gt;
So, my idea was to convert all the colours in my image in colors available at L=50 for example. And then to be able to remove a colour from the image without changing the treshold.&lt;br&gt;
&lt;br&gt;
thank you very much for answer&lt;br&gt;
I'm a bit confused about working in this colour space</description>
    </item>
    <item>
      <pubDate>Tue, 13 Oct 2009 00:13:05 -0400</pubDate>
      <title>Re: Lab color space issue</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262904#686575</link>
      <author>John D'Errico</author>
      <description>&quot;rubionelove &quot; &amp;lt;rubionelove@gmail.com&amp;gt; wrote in message &amp;lt;havl73$3pj$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I'm sorry john and Imageanalyst  if the question was not clear.&lt;br&gt;
&amp;gt; I'll try to clarify the problem. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm currently facing a problem computing the euclidean distance between the &quot;a&quot; and &quot;b&quot; components of two colours. &lt;br&gt;
&amp;gt; For example I have 4 colours in rgb format&lt;br&gt;
&amp;gt; dark gray, light gray&lt;br&gt;
&amp;gt; dark brown and light brown&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I converted the four colours in lab space.&lt;br&gt;
&amp;gt; I observed that for the two greys the &quot;L&quot; value is different but &quot;a&quot; and &quot;b&quot; remains quite the same, so the euclidean distance between &quot;a&quot; and &quot;b&quot; components of the two grays is very small. &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Neutrals in Lab all fall on the L* axis, where a*=b*=0.&lt;br&gt;
&lt;br&gt;
So very logically, the difference between a* and b*&lt;br&gt;
MUST be small for neutrals.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; I observed also that for the two browns the euclidean distance between two different colours (dark brown and clear brown) is generally larger than with grays. Because also &quot;a&quot; and &quot;b&quot; components are changing.&lt;br&gt;
&amp;gt; In my opinion this is due to the 3dimensional shape of the lab space.&lt;br&gt;
&lt;br&gt;
I don't think you understand the different color spaces.&lt;br&gt;
But certainly it makes little sense to talk about the&lt;br&gt;
&quot;shape&quot; of these spaces in this context. These color&lt;br&gt;
spaces are simply cartesian coordinate systems, unless&lt;br&gt;
you start talking about a space like LCH, in which case&lt;br&gt;
it is a cylindrical coordinate system.&lt;br&gt;
&lt;br&gt;
Regardless, you are asking questions about what are&lt;br&gt;
called color names. We learn from childhood what&lt;br&gt;
colors are described by the color names &quot;red&quot;, &quot;blue&quot;,&lt;br&gt;
&quot;black&quot;, &quot;brown&quot;, etc. And of course, everybody might&lt;br&gt;
have a slightly different definition of those boundaries&lt;br&gt;
in a given color space from everyone else. &lt;br&gt;
&lt;br&gt;
The color name boundary of the set of colors one&lt;br&gt;
might describe as &quot;neutral&quot;, lives in Lab space along&lt;br&gt;
the L* axis, at a*=b*=0. Slightly off that axis, one&lt;br&gt;
has the set of colors described as &quot;near neutrals&quot;.&lt;br&gt;
In RGB space, these neutrals live NEAR the line where&lt;br&gt;
R=G=B. It turns out that the neutrals will generally&lt;br&gt;
not be exactly on that line, but they will lie close to&lt;br&gt;
it. The specific RGB space chosen will differ slightly&lt;br&gt;
in where the neutrals will lie. (RGB has a MUCH less&lt;br&gt;
exact definition than does Lab. In fact, there are many&lt;br&gt;
different spaces that can loosely be called RGB.)&lt;br&gt;
&lt;br&gt;
How about &quot;brown&quot;? The color name brown describes&lt;br&gt;
a set of colors that live in the first quadrant in the&lt;br&gt;
(a*,b) plane. Whereas the set of neutrals lives along&lt;br&gt;
a roughly linear set in RGB or Lab, the set of browns&lt;br&gt;
lives in more of a &quot;blob&quot;. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; My goal is to remove a selected colour in an image.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;     C=makecform('srgb2lab');&lt;br&gt;
&amp;gt;     imLAB= applycform(Image,C); &lt;br&gt;
&amp;gt;     SelectedColor= applycform(color,C);  &lt;br&gt;
&amp;gt;     &lt;br&gt;
&amp;gt;     % Extract a* and b* values&lt;br&gt;
&amp;gt;     imA = imLAB(:,:,2);&lt;br&gt;
&amp;gt;     imB = imLAB(:,:,3);&lt;br&gt;
&amp;gt;     colA = SelectedColor(1,2); &lt;br&gt;
&amp;gt;     colB = SelectedColor(1,3); &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;     % compute distance from selected color&lt;br&gt;
&amp;gt;     distTresh=5;&lt;br&gt;
&amp;gt;     imMask = zeros(r,c);&lt;br&gt;
&amp;gt;     imDist =hypot(imA-colA ,imB-colB );&lt;br&gt;
&amp;gt;     imMask(imDist&amp;gt;distTresh)=1;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This is working good with grays (color= gray). But to have the same result with other colours I've to change the treshold.&lt;br&gt;
&amp;gt; So, my idea was to convert all the colours in my image in colors available at L=50 for example. And then to be able to remove a colour from the image without changing the treshold.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Sorry, but this simply will NOT work.&lt;br&gt;
&lt;br&gt;
I'd suggest that you try my fuzzycolor tool, found&lt;br&gt;
on the file exchange. It has the ability to identify&lt;br&gt;
pixels in an RGB image that satisfy a given color&lt;br&gt;
name. (If you disagree with my definition of the&lt;br&gt;
color name boundary for brown, you can change&lt;br&gt;
it as you like, using the tools I provide there.)&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/12326&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/12326&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
HTH,&lt;br&gt;
John</description>
    </item>
  </channel>
</rss>

