[test] better spectral curves for testing#293
Conversation
Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #293 +/- ##
=======================================
Coverage 91.32% 91.32%
=======================================
Files 17 17
Lines 3551 3551
Branches 527 527
=======================================
Hits 3243 3243
Misses 308 308 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
|
||
| #include <nlohmann/json.hpp> | ||
| #include <fstream> | ||
|
|
There was a problem hiding this comment.
do you want to include #include / #include ?
| } | ||
|
|
||
| rta::core::SpectralData | ||
| create_hypothetical_illuminant( const std::string &type ) |
There was a problem hiding this comment.
someone seeing this method might think changing type might change the curve shape, but it won't right?
| return generate_spectral_data( HypotheticalTrainingData ); | ||
| } | ||
|
|
||
| void save_spectral_json( |
There was a problem hiding this comment.
do we want to write units (= "relative") ?
| // Where: | ||
| // a - amplitude | ||
| // b - central wavelength | ||
| // c - shape, c = c1 to the left of the central wavelength, c2 otherwise. |
There was a problem hiding this comment.
not what you do in the code.
The correct version would be
// Asymmetric Gaussian peak:
// f(λ) = a * exp( - (λ - b)² / (2 c²) )
// c = c1 for λ < b, c2 otherwise.
// a = peak amplitude, b = center wavelength (nm), c = width (nm).
if you want to keep the code and update the comment
Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
Description
Generate spectral curves mimicking the camera, CMF and, illuminant and training data.
The curves approximate real world curves, and implemented in a form of parametric function, with only 4 numbers stored per curve.
Tests
Checklist:
need to update the documentation, for example if this is a bug fix that
doesn't change the API.)
(adding new test cases if necessary).
already run clang-format before submitting, I definitely will look at the CI
test that runs clang-format and fix anything that it highlights as being
nonconforming.