Imatest
September 08, 2010, 04:35:16 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the Imatest Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Lab color space  (Read 2658 times)
nroux
Newbie
*
Posts: 4


View Profile
« on: June 30, 2009, 01:18:32 am »

Hi,

I need to understand the formula you use to transform colorMacbeth chart into La*b* color space.
I had an old code that doesn't match with the one in Imatest.
This old code is a reference for us, but we wish to use Imatest instead.
The formula we used is from : http://www.tsi.enst.fr/tsi/enseignement/ressources/mti/RVB_ou_LAB/html/colorspace.html

First we convert our RGB data into XYZ:
The range of the RGB and XYZ is [0:1].
The matrix is:
        X =  0.618 * red + 0.177 * green + 0.205 * blue
        Y =  0.299 * red + 0.587 * green + 0.114 * blue
        Z =  0.056 * green + 0.944 * blue

Second we transform from XYZ into La*b* (using illuminant D65 (95.04,100,108.Cool)
        ty = Y / 100
     if(ty > 0.008856)
           L = 116 * pow(ty, 1/3) - 16
     else
         L= 903.3 * ty
       
        tx = X / 95.04
        tz = Z / 108.8
       
     if(tx > 0.008856)
           fx = pow(tx, 1/3)
        else
      fx = 7.7787 * tx + 16/116
        if(ty > 0.008856)
      fy = pow(ty, 1/3)
        else
        fy = 7.7787 * ty + 16/116
        if(tz > 0.008856)
      fz = pow(tz, 1/3)
     else
             fz = 7.7787 * tz + 16/116
       
        a = 500 * (fx - fy)
        b = 200 * (fy - fz)

Do you see why our code and Imatest code is different ?
Thanks for your help ;-)

Cheers,
Nicolas.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!