Obsolete

See my Camera Profiler application instead.

 

This application creates DNG matrices by optimizing Delta E from a raw photo of x-rites color checker. The color temperature for the photograph is also estimated.  Inputs are raw data from RawDigger and generic camera color response from DXO Mark.

Initialization

   

NULL

NULL

NULL

NULL

NULL

XYZoptical to RGB to XYZdata

 

 

Sr,g,b is the relative spectral transmittance of the filter array not selectivity for XY or Z of a given color.

Pulling Sr,g,b out of the integral assumes they are scalars. For example Sr attenuates X, Y and Z by the same amount.

Raw Balance is not White Point Adaptation.

The transmission loss of Red and Blue pixels relative to green is compensated by D=inverse(S). The relation to incident chromaticity, xy is unchanged as S.D=1.

(See Bruce Lindbloom; "Spectrum to XYZ" and "RGB/XYZ Matrices" also, Marcel Patek; "Transformation of RGB Primaries")

 

 

X = (Int(I*xbar*S, lambda))/N:

Y = (Int(I*ybar*S, lambda))/N:

Z = (Int(I*zbar*S, lambda))/N:

N = Int(I*ybar, lambda):

• 

XYZ to RGB

(Vector(3, {(1) = R_Tbb, (2) = G_Tbb, (3) = B_Tbb})) = (Matrix(3, 3, {(1, 1) = XR*Sr, (1, 2) = YR*Sr, (1, 3) = ZR*Sr, (2, 1) = XG*Sg, (2, 2) = YG*Sg, (2, 3) = ZG*Sg, (3, 1) = XB*Sb, (3, 2) = YB*Sb, (3, 3) = ZB*Sb})).(Vector(3, {(1) = X_Tbb, (2) = Y_Tbb, (3) = Z_Tbb}))

NULL

(Vector(3, {(1) = R_Tbb, (2) = G_Tbb, (3) = B_Tbb})) = (Matrix(3, 3, {(1, 1) = Sr, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = Sg, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = Sb})).(Matrix(3, 3, {(1, 1) = XR, (1, 2) = YR, (1, 3) = ZR, (2, 1) = XG, (2, 2) = YG, (2, 3) = ZG, (3, 1) = XB, (3, 2) = YB, (3, 3) = ZB})).(Vector(3, {(1) = X_Tbb, (2) = Y_Tbb, (3) = Z_Tbb}))

 

Camera_Neutral = (Matrix(3, 3, {(1, 1) = Sr, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = Sg, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = Sb})).(Matrix(3, 3, {(1, 1) = XR, (1, 2) = YR, (1, 3) = ZR, (2, 1) = XG, (2, 2) = YG, (2, 3) = ZG, (3, 1) = XB, (3, 2) = YB, (3, 3) = ZB})).(Vector(3, {(1) = X_wht, (2) = Y_wht, (3) = Z_wht}))

NULL

NULL

NULL

• 

RGB to XYZ (The extra step of adaptation to D50 is included below)

 

(Vector(3, {(1) = X_D50, (2) = Y_D50, (3) = Z_D50})) = (Matrix(3, 3, {(1, 1) = XTbbtoXD50, (1, 2) = YTbbtoXD50, (1, 3) = ZTbbtoXD50, (2, 1) = XTbbtoYD50, (2, 2) = YTbbtoYD50, (2, 3) = ZTbbtoYD50, (3, 1) = XTbbtoZD50, (3, 2) = YTbbtoZD50, (3, 3) = ZTbbtoZD50})).(Matrix(3, 3, {(1, 1) = RX*Dr, (1, 2) = GX*Dg, (1, 3) = BX*Db, (2, 1) = RY*Dr, (2, 2) = GY*Dg, (2, 3) = BY*Db, (3, 1) = RZ*Dr, (3, 2) = GZ*Dg, (3, 3) = BZ*Db})).(Vector(3, {(1) = R_Tbb, (2) = G_Tbb, (3) = B_Tbb})) NULL

NULL

(Vector(3, {(1) = X_D50, (2) = Y_D50, (3) = Z_D50})) = (Matrix(3, 3, {(1, 1) = XTbbtoXD50, (1, 2) = YTbbtoXD50, (1, 3) = ZTbbtoXD50, (2, 1) = XTbbtoYD50, (2, 2) = YTbbtoYD50, (2, 3) = ZTbbtoYD50, (3, 1) = XTbbtoZD50, (3, 2) = YTbbtoZD50, (3, 3) = ZTbbtoZD50})).(Matrix(3, 3, {(1, 1) = RX, (1, 2) = GX, (1, 3) = BX, (2, 1) = RY, (2, 2) = GY, (2, 3) = BY, (3, 1) = RZ, (3, 2) = GZ, (3, 3) = BZ})).(Matrix(3, 3, {(1, 1) = Dr, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = Dg, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = Db})).(Vector(3, {(1) = R_Tbb, (2) = G_Tbb, (3) = B_Tbb}))

NULL

(Vector(3, {(1) = X_D50, (2) = Y_D50, (3) = Z_D50})) = (Matrix(3, 3, {(1, 1) = RX_D50, (1, 2) = GX_D50, (1, 3) = BX_D50, (2, 1) = RY_D50, (2, 2) = GY_D50, (2, 3) = BY_D50, (3, 1) = RZ_D50, (3, 2) = GZ_D50, (3, 3) = BZ_D50})).(Matrix(3, 3, {(1, 1) = Dr, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = Dg, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = Db})).(Vector(3, {(1) = R_Tbb, (2) = G_Tbb, (3) = B_Tbb}))

NULL

(Vector(3, {(1) = X_D50wht, (2) = Y_D50wht, (3) = Z_D50wht})) = (Matrix(3, 3, {(1, 1) = RX_D50, (1, 2) = GX_D50, (1, 3) = BX_D50, (2, 1) = RY_D50, (2, 2) = GY_D50, (2, 3) = BY_D50, (3, 1) = RZ_D50, (3, 2) = GZ_D50, (3, 3) = BZ_D50})).(Matrix(3, 3, {(1, 1) = Dr, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = Dg, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = Db})).Camera_Neutral

NULL

Functions

   

NULL

Input Data

   

NULL

Solve for Camera to XYZ D50 and T

   

NULL

 

 


Please Wait...