darktable-org / darktable-org/rawspeed

Incorrect white level for Canon 5D Mark II at ISO 320

Open
#969 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
456
Forks
147
PR merge metrics
No merged PRs in 30d

Description

Observed in darktable 5.4.1, rawspeed at commit 4c511d611c1beee9aa97a2ec50b0838c6c7be52e

CR2 file from a Canon 5D Mark II shot at ISO 320. Available here

The automatically determined white level is 15312. The sky is clipped, showing the expected magenta hue, but the raw clipping indicator and highlight reconstruction indicator show no clipping.

Image

Manually setting the white level to 12965 activates highlight reconstruction and the raw clipping indicator.

Image

That value is very close to what used to be in cameras.xml for ISO 320

git show 6a54251d
…
        <Camera make="Canon" model="Canon EOS 5D Mark II" decoder_version="1">
                <ID make="Canon" model="EOS 5D Mark II">Canon EOS 5D Mark II</ID>
                <CFA width="2" height="2">
                        <Color x="0" y="0">GREEN</Color>
                        <Color x="1" y="0">BLUE</Color>
                        <Color x="0" y="1">RED</Color>
                        <Color x="1" y="1">GREEN</Color>
                </CFA>
                <Crop x="158" y="51" width="5634" height="3753"/>
                <Sensor black="1024" white="12995" iso_list="160 320 640 1250"/>
                <Sensor black="1024" white="15950"/>

I have been through my entire collection of images form this camera. ISO 160, 640 and 1250 also seem to be affected, as the cameras.xml snippet suggests. Other ISO values seem to have the correct white level, in that I can find images where the automatically determined white level does trigger the raw clipping indicator. I'm happy to provide more samples upon request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the report with the provided Canon EOS 5D Mark II CR2 sample and inspect the current camera metadata, including the cameras.xml entry referenced in the issue. Compare automatic white-level detection for ISO 160, 320, 640, and 1250 against the reported values, and verify that clipping indicators respond correctly when the fix is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, xml
Domain
computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.