spektrafilm tech discussions

nah, it’s just lazy. i mean i could have used rational splines or what but this is just pysr/symbolic regression running on the spectral data and the cr/cb projections directly. i confined the search to +,*,/,cos() other than that it’s just the optimiser defaults. sometimes this reveals structure in the data, this time it doesn’t have melanin() and hemoglobin() to make sense of the values :slight_smile:

I wondered: would measured camera-SSFs “help” your RGB-to-Spectral algorithm @hanatos ? As in: improve the spectral guess?
Forgive me if it they were useful in creating the algorithm in the first place, I haven’t read the paper yet.
@Dissipatio has posted in the other thread a comparison of Film vs. Alexa and for the Alexa I think someone has measured and published the SSFs iirc.
Our @ggbutcher has a nice collection at Github SSF data including the Alexa.
Or maybe all of this is trivially obvious knowledge already? Sorry.

I have a larger collection, reticent to post some without a clear license. Thinking about that, using such to generate a camera profile would be okay, not sure about transforming it to another format like dcamprof json…

initial integration of skin spectra into spectral upsampling:

2 Likes

didn’t know about this kind of regression, sounds fun though!

i do not think this is trivial and obvious. the way i see the framework of the problem at this stage is: limit our input to RGB/XYZ from RAWs >> have strategies to reduce the roundtrip exposure errors on measured reflected spectra, while keeping the smooth rendering across the xy plane.

from the film side we are already fully considering the sensitivities.

how the specific camera sensitivities can inform the upsampling alg to make use of the additional information that might be present is a cool direction. but sounds less universal and not very portable.

as far as i understand it, the sigmoid spectra are obtained from an elegantly defined problem (and fitting strategy) that just considers 1931 cmfs and XYZ roundtrip error. so it is very self contained and not aware of the camera sensitivity transform at all.

1 Like

i had to watch this video several times in a row. so satisfying to see the smooth changes. and so cool to have an interactive way to visualize it in vkdt!

i believe that we might want to have a transition that is as smooth as we can across the xy plane. maybe even smoother than the actual distribution of the nist-dataset chromaticities. but data and output will speak about this.

if we ever feel in the need of more spectra (with possible more variability) there is also the ISSA dataset The International Skin Spectra Archive (ISSA): a multicultural human skin phenotype and colour spectra collection | Scientific Data with 15k spectra on 2k subjects. they pitch it as a modern multicultural human skin phenotype dataset.

i can try to get them and plot the xy distribution and see if it can help in this.

3 Likes

absolutely less universal.
But when comparing RA-4 scans (what’s the scanners SSF? maybe less important for sampling the film dye densities as scene-spectra have already collapsed into a CMY triplet? not sure.) to a camera-RGB of the same scene, it might be useful for tuning to have an accurate idea how the camera responded to a spectral input.
The “worst” benefit would be that minimizing the roundtrip error converges faster, no?

yeah absolutely agree! and this gets outside of my expertise really fast, but i am happy to grow and learn.

maybe trivial set of comments, just reasoning loudly.

we are not working with an hyperspectral camera or spectrometer as input data for the simulation, thus we are accepting information loss in the projection of the the scene on a tristimulus. any upsampling from a tristimulus will work with reduced information and give out a “smooth/average” guess of the scene spectra. let’s say we work with raw readout of a camera and we upsample with the best possible alg. let’s define a good alg to have zero round trip error on the camera SSFs (similar to the sigmoids on 1931 CMFs). there will be a family of such algorithms, all sharing zero-error, but with slightly different characteristics. which one is the best and why?

any zero-error alg will give a deterministic solution to the RGB_raw → spectrum problem. one triplet in, one spectrum out. now, real life scene spectra will always have metameric variability (same projections on SSFs but different shapes, equally for CMFs of course), and real life is complex. thus the projection of the upsampled spectra on film SSFs will have a “metameric noise distribution” compared to the real projection of the scene on film SSFs. among the classes of zero-error algs, the best one is the one that will minimize the metameric error distribution cloud. but we will never have zero-error because of the information loss in step one.

to define the error cloud, and converge on an algorithm for the second step, we need to define a good corpus of realistic spectra that mimic what we are actually imaging. there must be an infinite family of algs that minimize the error on infinite corpus of spectra that we might assemble (maybe imaging Mars rocks with a skin optimize alg will give intolerable errors).

but essentially we are trying to find a good solution for the transform camera SSFs → film SSFs (i believe there is ton of science and expert smart people in this that might have very good opinions :slight_smile: including you guys). we want to minimize the metameric errors that inevitably will be there. so we should also probably be aware that working to correct issues that have smaller errors might just act inside of the error cloud and not change too much the transform.

starting from an alg with zero error on 1931 CMFs, is a similar story as the step one and two on camera SSFs. i guess there is a certain level of similarity in the error clouds of camera SSFs and 1931 CMFs, since both mimic the human vision. so the big question is, how impactful is starting from the camera SSFs and how much would this minimize the total metameric exposure error? the answer might be that the error difference is within the spread of the round trip exposure error clouds, or maybe it would be very impactful, especially for SSFs that differs more form the 1931 CMFs.

many words to say that, of course i don’t have any answer in this. and i am probably the less knowledgeable person here to have the most accurate opinion. :grin:

and I agree that scanning RA-4 and CMY dyes should make the issue quite “stable”, because we have a very well defined class of scene spectra.

1 Like

and, here a small analysis of the ISSA spectra.

they have a little more variability than the NIST dataset and they cover a slightly larger chromaticity area. they are delivering in the promise of a multicultural dataset i guess.

(ISSA are dark brown dots, NIST light brown)

here some random spectra from the dataset, and the Y-normalized upsampled twins.


here some more stats on the full corpus and distance from hanatos2025

the standard deviation band of the ISSA spectra is not that much larger than the NIST one. but it is indeed broader. also the mean has tiny differences.

overall the ISSA dataset seems to be a refinement on top of the NIST if we want to upgrade, i believe it might not require changes in the symbolic regression model, just fine tuning. i like that it has a softer shape in the xy plane.

1 Like

and here is the exposure error mismatch from the otsu/munsell “metameric plane”.
no surprises here.

awesome. i was worried my c_r, c_b gaussian is so small. will switch over to the larger set.

yes. there’s a thing about pysr assuming full dataset evaluation at every step of the optimiser. but they have a mini-batching switch that i already use for the nist dataset. also in the grand scheme of things this optimisation didn’t take all that long.

camera ssf can be very different from the 1931 cmf. after good input device transform this is really only about metamer mismatch. the spectral input transform vkdt uses has better colour accuracy, i can especially see that for the Canon 5D Mark II (i should recreate it with the skin spectra too…). but the killer feature is that it doesn’t produce impossible colours (negative L) as the matrix input device transforms routinely do.

unfortunately limiting this feature to cameras with known/good measured ssf rules out quite a few camera models. i’d err on the side of portability here for the film sim.