Whitebalance - Removed GUI Itcwb from whitebalance and preferences (#6710)

* Change Preferences for observer whitebalance

* Change label white balance preferences

* Added Preferences 2 parameters Whitebalance auto correlation

* Add Preference Temperature correlation - sort and tooltip

* Change to rtengine cmakelist

* Apply patch from Lawrence37

* Small comment code

* Change defaut order prefrences wba

* Added force extra algoritm to Preferences

* Harmonize itcwb sorted

* Add fields to Preferences Itcwb

* Change settings precision Itcwb in Preferences

* Change tooltip Itcwb preferences

* First stage Itwcwb settings in main with pp3 and selction in preferences

* Second stage Itwcwb settings in main with pp3 and selction in preferences

* Third stage Itwcwb settings in main with pp3 and selction in preferences

* Add itcwb_fgreen student - green optimize

* Add Itcwb green range

* Itcwb history msg - first tooltips

* Remove force-extra because always used

* reused force-extra to use entire CIExy for sampling datas

* Removed inwanted text in console

* Set sensitive for Itcwbframe

* Various change - comment ..

* Small code review - chnage tooltips

* Remove settings itcwb_delta in Rawimagesource.cc to simplify

* Remove Itcwb Observer - put a single observer for everything - general - itcwb

* Fixed conflicts in colortemp.cc

* Various change - fixed bug - simplify

* Fixed limits for settings pp3 - chnage tooltip

* Clean unused code

* Put itcwb_findgreen in GUI

* Added checkbox 'Low sampling' to find the settings of 5.9

* Set Observer to Observer 10° - preferences default

* Missing setting Low sampling

* Show white balance multipliers

* Change default settings - Itcwb_sorted

* Move observer from preferences to WB

* Make observer selectable for camera WB

* Ensure observer checkbox is in sync with PP3

* Set default ITCWB low sampling for PP3s from <=5.9

Ensure temperature correlation white balance algorithm 1 is used when
opening edits from versions 5.9 and earlier.

* Removed unused White-balance frame in Preferences

* Comment some GUI sliders checkbox

* Removed all GUI itcwb in preferences and whitebalance

* Removed forgotten code in preferences

* Remove labels tooltips history Itcwb

---------

Co-authored-by: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com>
This commit is contained in:
Desmis
2023-03-19 07:47:58 +01:00
committed by GitHub
parent ca08a279d5
commit 69c1caafa1
38 changed files with 1073 additions and 311 deletions

View File

@@ -194,7 +194,7 @@ namespace rtengine
using namespace procparams;
Thumbnail* Thumbnail::loadFromImage (const Glib::ustring& fname, int &w, int &h, int fixwh, double wbEq, bool inspectorMode)
Thumbnail* Thumbnail::loadFromImage (const Glib::ustring& fname, int &w, int &h, int fixwh, double wbEq, StandardObserver wbObserver, bool inspectorMode)
{
StdImageSource imgSrc;
@@ -310,8 +310,9 @@ Thumbnail* Thumbnail::loadFromImage (const Glib::ustring& fname, int &w, int &h,
tpp->blueAWBMul = avg_b / double (n);
tpp->wbEqual = wbEq;
tpp->wbTempBias = 0.0;
tpp->wbObserver = wbObserver;
cTemp.mul2temp (tpp->redAWBMul, tpp->greenAWBMul, tpp->blueAWBMul, tpp->wbEqual, tpp->autoWBTemp, tpp->autoWBGreen);
cTemp.mul2temp (tpp->redAWBMul, tpp->greenAWBMul, tpp->blueAWBMul, tpp->wbEqual, tpp->wbObserver, tpp->autoWBTemp, tpp->autoWBGreen);
}
tpp->init ();
@@ -543,7 +544,7 @@ RawMetaDataLocation Thumbnail::loadMetaDataFromRaw (const Glib::ustring& fname)
return rml;
}
Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, eSensorType &sensorType, int &w, int &h, int fixwh, double wbEq, bool rotate, bool forHistogramMatching)
Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, eSensorType &sensorType, int &w, int &h, int fixwh, double wbEq, StandardObserver wbObserver, bool rotate, bool forHistogramMatching)
{
RawImage *ri = new RawImage (fname);
unsigned int tempImageNum = 0;
@@ -982,9 +983,10 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
tpp->blueAWBMul = ri->get_rgb_cam (2, 0) * reds + ri->get_rgb_cam (2, 1) * greens + ri->get_rgb_cam (2, 2) * blues;
tpp->wbEqual = wbEq;
tpp->wbTempBias = 0.0;
tpp->wbObserver = wbObserver;
ColorTemp cTemp;
cTemp.mul2temp (tpp->redAWBMul, tpp->greenAWBMul, tpp->blueAWBMul, tpp->wbEqual, tpp->autoWBTemp, tpp->autoWBGreen);
cTemp.mul2temp (tpp->redAWBMul, tpp->greenAWBMul, tpp->blueAWBMul, tpp->wbEqual, tpp->wbObserver, tpp->autoWBTemp, tpp->autoWBGreen);
}
if (rotate && ri->get_rotateDegree() > 0) {
@@ -1121,18 +1123,19 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT
float iso = metadata->getISOSpeed(imgNum);
float fcomp = metadata->getExpComp(imgNum);
// check if the WB's equalizer value has changed
if (wbEqual < (params.wb.equal - 5e-4) || wbEqual > (params.wb.equal + 5e-4) || wbTempBias < (params.wb.tempBias - 5e-4) || wbTempBias > (params.wb.tempBias + 5e-4)) {
// check if the WB's equalizer, temperature bias, or observer value has changed
if (wbEqual < (params.wb.equal - 5e-4) || wbEqual > (params.wb.equal + 5e-4) || wbTempBias < (params.wb.tempBias - 5e-4) || wbTempBias > (params.wb.tempBias + 5e-4) || wbObserver != params.wb.observer) {
wbEqual = params.wb.equal;
wbTempBias = params.wb.tempBias;
wbObserver = params.wb.observer;
// recompute the autoWB
ColorTemp cTemp;
cTemp.mul2temp (redAWBMul, greenAWBMul, blueAWBMul, wbEqual, autoWBTemp, autoWBGreen);
cTemp.mul2temp (redAWBMul, greenAWBMul, blueAWBMul, wbEqual, wbObserver, autoWBTemp, autoWBGreen);
autoWBTemp += autoWBTemp * wbTempBias;
}
// compute WB multipliers
ColorTemp currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method);
ColorTemp currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method, params.wb.observer);
if (!params.wb.enabled) {
currWB = ColorTemp();
@@ -1141,9 +1144,9 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT
double cam_r = colorMatrix[0][0] * camwbRed + colorMatrix[0][1] * camwbGreen + colorMatrix[0][2] * camwbBlue;
double cam_g = colorMatrix[1][0] * camwbRed + colorMatrix[1][1] * camwbGreen + colorMatrix[1][2] * camwbBlue;
double cam_b = colorMatrix[2][0] * camwbRed + colorMatrix[2][1] * camwbGreen + colorMatrix[2][2] * camwbBlue;
currWB = ColorTemp (cam_r, cam_g, cam_b, params.wb.equal);
currWB = ColorTemp (cam_r, cam_g, cam_b, params.wb.equal, params.wb.observer);
} else if (params.wb.method == "autold") {
currWB = ColorTemp (autoWBTemp, autoWBGreen, wbEqual, "Custom");
currWB = ColorTemp (autoWBTemp, autoWBGreen, wbEqual, "Custom", wbObserver);
}
double rm, gm, bm;
@@ -1588,27 +1591,28 @@ void Thumbnail::getDimensions (int& w, int& h, double& scaleFac)
}
}
void Thumbnail::getCamWB (double& temp, double& green)
void Thumbnail::getCamWB (double& temp, double& green, StandardObserver observer)
{
double cam_r = colorMatrix[0][0] * camwbRed + colorMatrix[0][1] * camwbGreen + colorMatrix[0][2] * camwbBlue;
double cam_g = colorMatrix[1][0] * camwbRed + colorMatrix[1][1] * camwbGreen + colorMatrix[1][2] * camwbBlue;
double cam_b = colorMatrix[2][0] * camwbRed + colorMatrix[2][1] * camwbGreen + colorMatrix[2][2] * camwbBlue;
ColorTemp currWB = ColorTemp (cam_r, cam_g, cam_b, 1.0); // we do not take the equalizer into account here, because we want camera's WB
ColorTemp currWB = ColorTemp (cam_r, cam_g, cam_b, 1.0, observer); // we do not take the equalizer into account here, because we want camera's WB
temp = currWB.getTemp ();
green = currWB.getGreen ();
}
void Thumbnail::getAutoWB (double& temp, double& green, double equal, double tempBias)
void Thumbnail::getAutoWB (double& temp, double& green, double equal, double tempBias, StandardObserver observer)
{
if (equal != wbEqual || tempBias != wbTempBias) {
if (equal != wbEqual || tempBias != wbTempBias || observer != wbObserver) {
// compute the values depending on equal
ColorTemp cTemp;
wbEqual = equal;
wbTempBias = tempBias;
wbObserver = observer;
// compute autoWBTemp and autoWBGreen
cTemp.mul2temp (redAWBMul, greenAWBMul, blueAWBMul, wbEqual, autoWBTemp, autoWBGreen);
cTemp.mul2temp (redAWBMul, greenAWBMul, blueAWBMul, wbEqual, wbObserver, autoWBTemp, autoWBGreen);
autoWBTemp += autoWBTemp * tempBias;
}
@@ -1665,7 +1669,7 @@ void Thumbnail::getSpotWB (const procparams::ProcParams& params, int xp, int yp,
double gm = colorMatrix[1][0] * reds + colorMatrix[1][1] * greens + colorMatrix[1][2] * blues;
double bm = colorMatrix[2][0] * reds + colorMatrix[2][1] * greens + colorMatrix[2][2] * blues;
ColorTemp ct (rm, gm, bm, params.wb.equal);
ColorTemp ct (rm, gm, bm, params.wb.equal, params.wb.observer);
rtemp = ct.getTemp ();
rgreen = ct.getGreen ();
}