Skip to content

Commit

Permalink
Exposure iop: compute_correction(): use sep blacks. Refs darktable-or…
Browse files Browse the repository at this point in the history
…g#10995, Refs darktable-org#10996.

For some cameras rawspeed provides some really bogus value
for black level, e.g for  PENTAX K-5 it is reported as 512,
while sep blacks are calculated at ~67.

For deflickering it is really unfortunate.

Since this is the only place where we use black level,
and everywhere else we use sep blacks, let's just
average those. If sep blacks are wrong - we will notice.

Note: this technically does change the output,
but only in cases where rawspeed is lying.
  • Loading branch information
LebedevRI committed Apr 17, 2016
1 parent f20a637 commit c1be2cc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/iop/exposure.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,17 @@ static void compute_correction(dt_iop_module_t *self, dt_iop_params_t *p1, const
}
}

float black = 0.0f;
for(uint8_t i = 0; i < 4; i++)
{
// FIXME: get those from rawprepare IOP somehow !!!
black += (float)self->dev->image_storage.raw_black_level_separate[i];
}
black /= 4.0f;

// FIXME: get those from rawprepare IOP somehow !!!
const double ev
= raw_to_ev(raw, self->dev->image_storage.raw_black_level, self->dev->image_storage.raw_white_point);
const double ev = raw_to_ev(raw, (uint32_t)black, self->dev->image_storage.raw_white_point);

*correction = p->deflicker_target_level - ev;
}

Expand Down

0 comments on commit c1be2cc

Please sign in to comment.