Pages: 1 ... 13 14 [15] 16 17 ... 78   Go Down

Author Topic: DCamProf - a new camera profiling tool  (Read 767338 times)

AlterEgo

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1995
Re: DCamProf - a new camera profiling tool
« Reply #280 on: May 30, 2015, 12:20:19 am »

Graeme,

txt2ti3 when fed with CGATS file with raw RGB data and .ti3 from chartread with spectral data there will not include spectral details in the output, unless I replace "SPEC_" in source .ti3 with "nm", "NM_", "SPECTRAL_NM_",  "R_" or "SPECTRAL_"... it is certainly for a good reason, but not convenient !
« Last Edit: May 30, 2015, 12:22:32 am by AlterEgo »
Logged

torger

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3267
Re: DCamProf - a new camera profiling tool
« Reply #281 on: May 30, 2015, 05:21:19 am »

It's a topic with lots of inter-twined connections. Here are some of my thoughts on it:

Re-lighting generally has two effects :- it can change the colors of surfaces due to the details of spectral interaction between an illuminant and a colorant, but it also often shifts the white point.

The human eye and brain is always trying to extract the maximum amount of information from the light that hits the retina. One of the mechanisms to do this is chromatic adaptation. A lot of the adaptation seems to be due to the S, M & L w.l. cones independently adapting to a luminance level, explaining the success of the Von-Kries approach to modeling chromatic adaptation, but there are lots of other things going on in our visual path, including in the nerve cells in the retina, and at higher levels in our visual system.

Chromatic adaptation can be seen as a mechanism that helps achived color constancy - our visual system is striving to present an image to our minds that looks the same, independent of what the actual lighting situation is. In this sense, we are trying to "re-light" the scene in our minds. We don't have the spectral information about what's going on though, so we probably use various heuristics, on top of the adaptation that the retina does.

So a chromatic adaptation algorithm (or matrix) is an attempt to model our visual system and minds inexact algorithm for virtually re-lighting a scene.  So re-lighting a scene using exact spectral information will arrive at a result that is a lot like what we are trying to do in our eyes and minds when we look at the original scene, but it is not an exact model of it.

Thanks! I will in the next version make it a user option to either render XYZ for the calibration illuminant and then do CAT02 to get D50 values, or re-render for D50 from spectra directly (like it does now).

When spectral info is missing DCamProf needs to use CAT to get to the right starting point, and in that case it would be best with a CAT that tries to model relighting as close as possible, rather than be based on corresponding color experiments. An extreme example, if we have a reference file without spectra and with D65 XYZ values and we shoot StdA, one would want to convert to StdA with a "spectral" CAT (bradford seems best alternative) and then back up to D50 with CAT02. Not sure if that could make sense though. Now DCamProf always uses CAT02 and will in that case convert from D65 down to D50.

From all the papers I've skimmed it seems like CAT02 is the current best of the established methods to do a "perceptual" CAT, and Bradford is the best at doing a "relighting" CAT.
« Last Edit: May 30, 2015, 05:39:35 am by torger »
Logged

Iliah

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 770
Re: DCamProf - a new camera profiling tool
« Reply #282 on: May 30, 2015, 08:28:57 am »

The spectral data of the light source can be rather accurately guessed from white balance coefficients recorded in the raw file (one can use exiv2 or exiftool to get those; I would prefer exiftool as it is easier to patch when a new camera appears), or from external table (necessary for Nikons, as they do not put white balance coefficients into raw, they have colour data in the form of coefficients for unknown white balance calculation formula).

Chromatic adaptation is the worst case scenario in photography, and encouraging its use is far from best practice. However if it is to be used, we first do spectral adaptation of the reference data (what is called "re-lightning" here, a misleading term for a photographer) to the light used in the shot; and after the colour transform is calculated we calculate chromatic adaptation.

I do not see why not to start from normal workflow, based on 3 shots, Ill. A, 5000K, 6500K; and only after that see what is the error introduced by the methods including smaller number of shots.
« Last Edit: May 30, 2015, 08:32:35 am by Iliah »
Logged

torger

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3267
Re: DCamProf - a new camera profiling tool
« Reply #283 on: May 30, 2015, 10:05:23 am »

Just released version 0.7.1. It has the new commands average-targets (stacking for noise reduction) and match-spectra (comparing spectra between targets), adds TIFF support for flatfield.

I've now altered the use of CAT a bit. Bradford is used whenever spectral data is missing and we need to remap XYZ reference coordinates to the calibration illuminant, needed for the CM. I use Bradford instead of CAT02 as all papers I've skimmed indicate that Bradford is better than CAT02 for this particular task when you don't want to model corresponding colors.

Then in the case spectral data is available CAT02 can *optionally* (-C) be used instead of regeneration from spectra for the conversion from calibration illuminant to Profile Connection Space D50. The purpose of using CAT02 would be to simulate the subtle color appearance differences, this will work best in the StdA to D65 range as the corresponding color experiments that CAT02 is based on are primarily made in that range.

I have not yet decided if I should change the default to use CAT instead of spectral generation, for now the default is same as the old. In the default case a tungsten profile shot under tungsten light will (ideally) render the exact same result as a D65 profile shot under D65 light, and that result is equivalent to how colors appear under D50. If CAT02 is enabled, the tungsten and D65 result will look slightly different, and is supposed to look closer to how the eye experienced the original color condition.

I have not yet found any experimental data when CAT02 and spectral generation is compared concerning matching the corresponding color experiments. If I find that and see that CAT02 is significantly better at simulating the "real" look, then using CAT02 will be the new default for the next release.
Logged

torger

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3267
Re: DCamProf - a new camera profiling tool
« Reply #284 on: May 30, 2015, 10:18:40 am »

I do not see why not to start from normal workflow, based on 3 shots, Ill. A, 5000K, 6500K; and only after that see what is the error introduced by the methods including smaller number of shots.

Concerning DCamProf the camera shots are needed for getting the raw RGB values, but for XYZ they serve no purpose. XYZ values either comes from a manufacturer-provided CGATS reference file, and then often XYZD50 values, or ideally you have a spectrometer and can measure spectral reflectance from the patches.

So making 3 shots is not necessary, if you're making a dual-illuminant profile for StdA and D65 you only need the StdA and D65 shots. For D50 we only need XYZ values and in that case the camera cannot help us.

The question has then been how to generate those D50 values. From corresponding color experiments we know that even with a fully adapted eye colors do not appear exactly the same in StdA and D65. If we want to model that this means that the D50 XYZ values that we need to connect to the profile connection space should be different from StdA and D65, and CAT02 is the current best at modeling that. That is with spectral data available you first generate XYZ for StdA using spectral data and then remap to D50 with CAT02, and the same for D65.

What's still unclear to me is how good the CAT02 is at modeling this. Maybe it's so bad that regenerating the D50 values from spectra (and thus let them be the same for both StdA and D65) would be a smaller error than using CAT02 despite that D65 and StdA will be equalized to D50 look. Before I make CAT02 enabled per default I need to find an answer to that question.
Logged

Iliah

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 770
Re: DCamProf - a new camera profiling tool
« Reply #285 on: May 30, 2015, 10:33:03 am »

> if you're making a dual-illuminant profile for StdA and D65 you only need the StdA and D65 shots
Well, forward matrix is for D50 white point. It is better be computed when the target is physically lit by a light source with CCT around 5000K.
The device response depends on the light spectrum, and white balance does not exactly equalize different light sources even when they are close to SPD of blackbody.

> ideally you have a spectrometer and can measure spectral reflectance from the patches
Not in my experience. Most spectrometers that are in the hands of photographers can't be used to reliably measure a target, especially when it comes to darker patches.

Actually, much more than 3 shots are needed. Black frame needs to be subtracted, division by the saturated frame needs to be performed, flat field needs to be applied. If one is to average 3 shots, he needs 3 blacks and 3 whites too, plus a flat field.
Logged

AlterEgo

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1995
Re: DCamProf - a new camera profiling tool
« Reply #286 on: May 30, 2015, 10:52:51 am »

Actually, much more than 3 shots are needed. Black frame needs to be subtracted, division by the saturated frame needs to be performed, flat field needs to be applied. If one is to average 3 shots, he needs 3 blacks and 3 whites too, plus a flat field.
Iliah, aren't you going into overkill mode ? because then one can say that you need black frame and saturation frame for a flatfield shot too, no ? and 3 of those then
Logged

Iliah

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 770
Re: DCamProf - a new camera profiling tool
« Reply #287 on: May 30, 2015, 10:57:41 am »

> one can say that you need black frame and saturation frame for a flatfield shot too, no ? and 3 of those then

I think you can find a lot on the topic on astronomers' sites.
Logged

AlterEgo

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1995
Re: DCamProf - a new camera profiling tool
« Reply #288 on: May 30, 2015, 11:08:45 am »

0.7.1 build for Windows (mingw = dcamprof.exe + libgomp_64-1.dll) : https://app.box.com/s/x14fjbme5oc0lrrjeck6zlry3nxslavy
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8913
Re: DCamProf - a new camera profiling tool
« Reply #289 on: May 30, 2015, 11:17:40 am »

> one can say that you need black frame and saturation frame for a flatfield shot too, no ? and 3 of those then

I think you can find a lot on the topic on astronomers' sites.

True, but their challenge is a lack of photons. That means that each photon counts, and all sources of noise are a handicap. That's why statisticallly weighted averages are taken from many 'exposures', usually some 16 or more per type of correction (read-noise, dark noise, offset noise, and flat-field).

One of the first things a profile shot needs, is proper levels of exposure, preferably uniform, and illuminated (with a suitable spectral output) at such an angle that subject/target/surface reflections play a minor role. The flat-fielding is to eliminate un-even illumination and lens vignetting and light fall-off.

Cheers,
Bart
« Last Edit: May 30, 2015, 11:25:32 am by BartvanderWolf »
Logged
== If you do what you did, you'll get what you got. ==

Iliah

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 770
Re: DCamProf - a new camera profiling tool
« Reply #290 on: May 30, 2015, 11:21:24 am »

When we add a black traps for accurate flare compensation what good is that if the levels are wrong. Different personal standards exist, but why not to allow for high ones?
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8913
Re: DCamProf - a new camera profiling tool
« Reply #291 on: May 30, 2015, 11:27:44 am »

When we add a black traps for accurate flare compensation what good is that if the levels are wrong. Different personal standards exist, but why not to allow for high ones?

Nothing wrong with high standards, but they should have a meaningful effect.
When diminishing returns no longer have a measurable effect, we've gone too far.

Cheers,
Bart
« Last Edit: May 30, 2015, 11:30:40 am by BartvanderWolf »
Logged
== If you do what you did, you'll get what you got. ==

Iliah

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 770
Re: DCamProf - a new camera profiling tool
« Reply #292 on: May 30, 2015, 11:30:44 am »

Until one checks, how could he know if the effect is meaningful or not? I went to the trouble, and for me and my customers it is meaningful. So I shared my experience.
Logged

torger

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3267
Re: DCamProf - a new camera profiling tool
« Reply #293 on: May 30, 2015, 11:47:00 am »

I haven't seen any indications that astronomy methods need to be applied on camera color profiling, I don't think that level of precision is required. Of what I've seen so far camera profiling is the most approximate among the typical profiling tasks (screen, print, camera). Still I've added stacking in the latest release so one can experiment. Of course it does not hurt to improve the quality of input data, but at some point it becomes overkill and one is doing more work than necessary. From the results I've seen so far flatfield is necessary if you lit the target with one lamp, but if you have a quality "copy" style setup flatfield is overkill. However how large measurement errors one can accept is also a matter of taste, so different users will come to different conclusions.

As a sanity check one can make one profile with "sloppy" measurements and one with all bells and whistles and compare the results. With DCamProf you can also make experiments with SSFs (where measurement errors are nil) and do some noise-adding experiments and see how things start to deviate.

About the D50 whitepoint, the reason FM is D50 is that profile connection space is D50, to be able to get further in the color pipeline we need to get into D50. However, it doesn't necessarily mean that FM must render the color as if the target was lit by D50, you can keep the color appearance of the original illuminant if you want to. If you want to do that depends on the situation of course, if you're making a reproduction profile for Tungsten lights you probably want to make the subject look like it was shot under D50 anyway as it's better for copy applications. If you want to retain the look of Tungsten, to make colors look as they look to the eye under Tungsten, you need to do something else though. This is what the "corresponding color sets" experiments is about which CAT02 is based on. As said I need more data on the quality of its results though before I'll make it the default behavior in DCamProf.

It seems like you are interpreting the FM as it should be lit for D50 as well, that is the camera raw RGB values should be for D50 even if the profile is a StdA. This is not how DCamProf does it currently, RGB values are always for the calibration illuminant. Citing the DNG Spec:

"The use of the forward matrix tags is recommended for two reasons. First, it allows the camera profile creator to control the chromatic adaptation algorithm used to convert between the calibration illuminant and D50. Second, it causes the white bala
nce adjustment (if the user white balance does not match the calibration illuminant) to be done by scaling the camera coordinates rather than by adapting the resulting XYZ values, which has been found to work better in extreme cases."


I've interpreted this like the intention is that RGB values should stem from the calibration illuminant, and how the D50 XYZ values are derived is up to the profile designer ("control the CAT"), that is one can for example choose to re-generate from spectra for a copy profile, or use CAT02 to better preserve actual color appearance.

If we make the FM matrix based on D50 RGB values this means that the matrix will look exactly the same regardless of calibration illuminant, and that does not seem right to me.
Logged

Iliah

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 770
Re: DCamProf - a new camera profiling tool
« Reply #294 on: May 30, 2015, 12:05:23 pm »

Well, I have no intention to interfere. Each of us do the things the way we see fit.
Logged

AlterEgo

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1995
Re: DCamProf - a new camera profiling tool
« Reply #295 on: May 30, 2015, 12:12:52 pm »

Until one checks, how could he know if the effect is meaningful or not? I went to the trouble, and for me and my customers it is meaningful. So I shared my experience.
right - but you just said that most of us do not have a spectrophotometer capable to properly measure all of the target with dark patches (but you have such instruments or access to such instruments), so in that case for those who do not (and i1pro2 is not good) - how does black frame and saturated frame helps when we do not have a target properly measured in the first place ? so certainly while utmost precision is a subject of desire - am I to gain ?... personal testing is good (at least as an experience if nothing else), but I 'd love to hear opinions before testing (because it takes a lot of time and I do have a day job - so I have to consider the time) from those who did... so am I going to gain when I can't do better than i1pro2 with a target ?
« Last Edit: May 30, 2015, 12:22:45 pm by AlterEgo »
Logged

Iliah

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 770
Re: DCamProf - a new camera profiling tool
« Reply #296 on: May 30, 2015, 12:16:18 pm »

But I explained already on another forum. You do not need dark patches in the target for profiling, instead you make a composite CGATS from 2 or more shots with different shutter speeds; and you scale the spectral reference accordingly.
Logged

AlterEgo

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1995
Re: DCamProf - a new camera profiling tool
« Reply #297 on: May 30, 2015, 12:18:51 pm »

But I explained already on another forum. You do not need dark patches in the target for profiling, instead you make a composite CGATS from 2 or more shots with different shutter speeds; and you scale the spectral reference accordingly.
yes, that was about the black patches in SG - but what if you have a target with darker patches different chromacity wise from lighter patches - then you can't use spectrum (measured with i1pro2) from lighter patches for those, right ? and not only then - w/o actually measuring properly (not possible with i1pro2) darker patches you even can't say that they are of the same chromacity as lighter patches even if manufacturer claims that ! catch22 - no ?
« Last Edit: May 30, 2015, 12:21:18 pm by AlterEgo »
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8913
Re: DCamProf - a new camera profiling tool
« Reply #298 on: May 30, 2015, 12:21:00 pm »

I haven't seen any indications that astronomy methods need to be applied on camera color profiling, I don't think that level of precision is required. Of what I've seen so far camera profiling is the most approximate among the typical profiling tasks (screen, print, camera). Still I've added stacking in the latest release so one can experiment. Of course it does not hurt to improve the quality of input data, but at some point it becomes overkill and one is doing more work than necessary. From the results I've seen so far flatfield is necessary if you lit the target with one lamp, but if you have a quality "copy" style setup flatfield is overkill. However how large measurement errors one can accept is also a matter of taste, so different users will come to different conclusions.

Hi Anders,

I think that the averaging of multiple exposures can help in improving (in particular) the darker patch quality, so it's a useful addition. Flat-fielding is more of a must, due to illumination issues and lens vignetting/light fall-off when the target takes up a significant part of the image and/or the use of relatively wide apertures cannot be avoided.

Cheers,
Bart

P.S. I just realized myself that to eliminate most uneven illumination issues, one can shoot the target at a 45 degrees angle, and illuminate the target perpendicular to its surface with a single lightsource. This will eliminate most surface reflection issues, but of course leaves the camera/lens vignetting and light fall-off issues to deal with. Shooting with a longish focal length will reduce the lighting angle effects even further.
« Last Edit: May 31, 2015, 11:06:19 am by BartvanderWolf »
Logged
== If you do what you did, you'll get what you got. ==

Iliah

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 770
Re: DCamProf - a new camera profiling tool
« Reply #299 on: May 30, 2015, 12:24:05 pm »

> darker patches different chromacity wise from lighter patches
Different chromaticity does not matter with a target composed of 5 pigments only.
Logged
Pages: 1 ... 13 14 [15] 16 17 ... 78   Go Up