[argyllcms] Re: Calculating profile from sensor spectral data?
- From: Gerhard Fuernkranz <nospam456@xxxxxx>
- To: argyllcms@xxxxxxxxxxxxx
- Date: Mon, 17 Apr 2006 13:57:06 +0200
Per Baekgaard wrote:
Having recently found this list, I'm hoping to get a little input from
some of the more seasoned colour guru's here...
I'm using argyll to build some profile data for a specific
application, and have also been discussing a bit off-list with Graeme
on this a other not related colour/argyll issues. Even though this is
not directly related to the way the code works, I thought I'd ask for
advice on the list here -- hope that is OK?
Anyway, I have spectral data for how the R, G and B sensors behaves
for a particular input device. This is probably a quite thorough
characterization of the device, and I figured I should be able to
build a profile based on this data.
I have a number of ideas how it could be done...
First approximation would be to find the "best fit" (least RMS)
weights giving coefficient of x-bar, y-bar and z-bar for each R, G and
B spectral curve. This would leave me with a 3x3 matrix mapping device
RGB into xyz, although I'm sure this will be quite "rough".
A better idea, I think, is to calculate, for a given set of
theoretical colours, the resulting RGB and XYZ coordinates, and use
this data to build a profile.
The key will then be in selecting the theoretical colours in a
suitables way.
I assume that the more data the better, but I also guess that there is
not a guaranteed "good" mapping. By definition (since the sensors do
not directly measure xyz-bar), two metamers (identical looking but
different spectral distributions) will not give the same RGB response,
even though their XYZ values are the same.
One option is to calculate the expected corresponding RGB response and
XYZ coordinates for pure spectral colours, sweeping from 380nm to
780nm in 2nm increments or some such. By then mixing this with the
response of the selected illuminant (D65), I can create a number of
more or less saturated colours, and by varying the luminance, I can at
the end of the day generate a pretty full set of colours and matching
RGB->XYZ values to feed to "profile".
However, I'm not sure if this will give me a good profile. I expect
real world colours are not too often purely spectral, and I guess that
some real world spectra would have been better to use. I have found
the 24 Gretag spectra and can use those too, as a supplement. But I
don't have access to a large database of e.g. skin and paint spectra.
You already hit the essential point. If your sensor responses are not
colorimetric (and most usual sensors aren't), then there exists no
single unique mapping between XZY and captured sensor RGB for arbitrary
spectra. So you basically need to know the set of all spectra you intend
to capture, then you can try to establish a (hopefully unique) mapping
for this (rather small) subset of all possible visible spectra. For
resolving conflicts, if a uniqe mapping cannot be established, you
should probably even know the probability for the occurance each
spectrum in captured scenes. As far as I know, there do exist spectral
databases in the web, but I don't have a link at hand.
Regards,
Gerhard
Any ideas on how the above would work?
Or any better ideas for how to do this?
Note that this profile will be used for further refinements and
tweaks; I just want to start out with as "accurate" a profile as
possible.
Thanks in advance,
-- Per.
- Follow-Ups:
- [argyllcms] Best (smallest) profiling patch set
- From: Andrej Javoršek
- References:
- [argyllcms] Re: Adobe BPC (maybe OT?)
- From: Roger Breton
- [argyllcms] Calculating profile from sensor spectral data?
- From: Per Baekgaard
Other related posts:
- » [argyllcms] Calculating profile from sensor spectral data?
- » [argyllcms] Re: Calculating profile from sensor spectral data?
I'm using argyll to build some profile data for a specific application, and have also been discussing a bit off-list with Graeme on this a other not related colour/argyll issues. Even though this is not directly related to the way the code works, I thought I'd ask for advice on the list here -- hope that is OK?
Anyway, I have spectral data for how the R, G and B sensors behaves for a particular input device. This is probably a quite thorough characterization of the device, and I figured I should be able to build a profile based on this data.
I have a number of ideas how it could be done...
First approximation would be to find the "best fit" (least RMS) weights giving coefficient of x-bar, y-bar and z-bar for each R, G and B spectral curve. This would leave me with a 3x3 matrix mapping device RGB into xyz, although I'm sure this will be quite "rough".
A better idea, I think, is to calculate, for a given set of theoretical colours, the resulting RGB and XYZ coordinates, and use this data to build a profile.
The key will then be in selecting the theoretical colours in a suitables way.
I assume that the more data the better, but I also guess that there is not a guaranteed "good" mapping. By definition (since the sensors do not directly measure xyz-bar), two metamers (identical looking but different spectral distributions) will not give the same RGB response, even though their XYZ values are the same.
One option is to calculate the expected corresponding RGB response and XYZ coordinates for pure spectral colours, sweeping from 380nm to 780nm in 2nm increments or some such. By then mixing this with the response of the selected illuminant (D65), I can create a number of more or less saturated colours, and by varying the luminance, I can at the end of the day generate a pretty full set of colours and matching RGB->XYZ values to feed to "profile".
However, I'm not sure if this will give me a good profile. I expect real world colours are not too often purely spectral, and I guess that some real world spectra would have been better to use. I have found the 24 Gretag spectra and can use those too, as a supplement. But I don't have access to a large database of e.g. skin and paint spectra.
Any ideas on how the above would work?
Or any better ideas for how to do this?
Note that this profile will be used for further refinements and tweaks; I just want to start out with as "accurate" a profile as possible.
Thanks in advance,
-- Per.
- [argyllcms] Best (smallest) profiling patch set
- From: Andrej Javoršek
- [argyllcms] Re: Adobe BPC (maybe OT?)
- From: Roger Breton
- [argyllcms] Calculating profile from sensor spectral data?
- From: Per Baekgaard