Merge pull request #4590 from Beep6581/spotwb

Spot white balance sometimes failes, fixes #4589
This commit is contained in:
Ingo Weyrich 2018-06-07 22:27:10 +02:00 committed by GitHub
commit cdaab6a68b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5143,7 +5143,7 @@ ColorTemp RawImageSource::getSpotWB (std::vector<Coord2D> &red, std::vector<Coor
gloc /= gnbrs; gloc /= gnbrs;
bloc /= bnbrs; bloc /= bnbrs;
if (rloc * initialGain < 64000. && gloc * initialGain < 64000. && bloc * initialGain < 64000.) { if (rloc < clmax[0] && gloc < clmax[1] && bloc < clmax[2]) {
reds += rloc; reds += rloc;
greens += gloc; greens += gloc;
blues += bloc; blues += bloc;
@ -5216,7 +5216,7 @@ ColorTemp RawImageSource::getSpotWB (std::vector<Coord2D> &red, std::vector<Coor
gloc /= std::max(1, gnbrs); gloc /= std::max(1, gnbrs);
bloc /= std::max(1, bnbrs); bloc /= std::max(1, bnbrs);
if (rloc * initialGain < 64000. && gloc * initialGain < 64000. && bloc * initialGain < 64000.) { if (rloc < clmax[0] && gloc < clmax[1] && bloc < clmax[2]) {
reds += rloc; reds += rloc;
greens += gloc; greens += gloc;
blues += bloc; blues += bloc;
@ -5252,7 +5252,7 @@ ColorTemp RawImageSource::getSpotWB (std::vector<Coord2D> &red, std::vector<Coor
gloc /= std::max(gnbrs, 1); gloc /= std::max(gnbrs, 1);
bloc /= std::max(bnbrs, 1); bloc /= std::max(bnbrs, 1);
if (rloc * initialGain < 64000. && gloc * initialGain < 64000. && bloc * initialGain < 64000.) { if (rloc < clmax[0] && gloc < clmax[1] && bloc < clmax[2]) {
reds += rloc; reds += rloc;
greens += gloc; greens += gloc;
blues += bloc; blues += bloc;
@ -5288,7 +5288,7 @@ ColorTemp RawImageSource::getSpotWB (std::vector<Coord2D> &red, std::vector<Coor
gloc /= std::max(gnbrs, 1); gloc /= std::max(gnbrs, 1);
bloc /= std::max(bnbrs, 1); bloc /= std::max(bnbrs, 1);
if (rloc * initialGain < 64000. && gloc * initialGain < 64000. && bloc * initialGain < 64000.) { if (rloc < clmax[0] && gloc < clmax[1] && bloc < clmax[2]) {
reds += rloc; reds += rloc;
greens += gloc; greens += gloc;
blues += bloc; blues += bloc;