Author Topic: Canon 6D  (Read 339527 times)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10709
  • 5D Mark Free
Re: Canon 6D
« Reply #725 on: December 21, 2017, 12:37:52 AM »
Code: [Select]
mlv_dump M18-2132.MLV --dng --no-stripes --no-fixcp
exiftool -BlackLevelRepeatDim="2 2" -BlackLevel="1920 1792 1536 1024" -overwrite_original *.dng
dcraw -W *.dng
dcraw -a -W -b 4 *.dng

gives that fine maze pattern; however:
Code: [Select]
dng_validate.exe -tif out M18-2132_000000.dng

gives clean image to my eye, and so does darktable on the same DNG.

After swapping the black levels on the two greens, RawTherapee also gives clean image.

This one:
Code: [Select]
octave:1> a = read_raw('M18-2132_000000.dng');
octave:2> a(1:2:end,1:2:end) += 128;  # red
octave:3> a(1:2:end,2:2:end) += 256;  # green1
octave:4> a(2:2:end,1:2:end) += 512;  # green2
octave:5> a(2:2:end,2:2:end) += 1024; # blue
octave:6> imwrite(uint16(a), 'out.pgm');
octave:7> system('pgm2dng out.pgm');
octave:8> system('dcraw -a -W -b 4 out.DNG');

gives clean image in dcraw (no black level tweaking required, as pgm2dng hardcodes 2048), but also with different white balance. To run it, you need read_raw and pgm2dng.

So far, the above suggests a bug in dcraw when handling files with different per-channel black levels, but at least darktable and RawTherapee can give a clean image, and I'd expect Adobe programs to do the same (they wrote the DNG spec and dng_validate.exe, after all).

For the end user, given that per-channel black levels do not work as expected in all raw processing programs, I'd say the easiest workaround would be to do what the above octave script does, in mlv_dump (and other software that wants to handle lossless MLVs from 6D). Extremely easy coding task, so I'm going to leave it for novice programmers who may be looking for some low-hanging fruit to get started.

8rnity

  • New to the forum
  • *
  • Posts: 18
Re: Canon 6D
« Reply #726 on: December 21, 2017, 12:32:49 PM »
found.
combination of both options --no-stripes --no-fixcp produces valid dng without pattern.
use just one or none of these two and have a pattern on the image.


what I wrote above is not true. it's mlv_dump version. both "mlv_dump on steroids" and the one used in "simple right clic menu mlv dump batch" produce the issue. used the one in download section and works perfect after exiftool!

bouncyball

  • Senior
  • ****
  • Posts: 466
Re: Canon 6D
« Reply #727 on: December 21, 2017, 06:11:48 PM »
In every proggie I tested there is a pattern in the output (--no-stripes --no-fixcp does not help for mlv_dump), The only correct way to get valid DNG with working good/old plain black level is the method a1ex showed above (octave example).

regards
bb

Danne

  • Hero Member
  • *****
  • Posts: 3611
Re: Canon 6D
« Reply #728 on: December 21, 2017, 06:17:22 PM »
@8rnity
batch_mlv is using mlv_dump_on_steroids only it's called mlv_dump. There is some info about versions in the thread and probably also in the gpl license files.

8rnity

  • New to the forum
  • *
  • Posts: 18
Re: Canon 6D
« Reply #729 on: December 21, 2017, 07:40:49 PM »
In every proggie I tested there is a pattern in the output (--no-stripes --no-fixcp does not help for mlv_dump), The only correct way to get valid DNG with working good/old plain black level is the method a1ex showed above (octave example).

regards
bb
yes, I edited my post. original mlv_dump version and exiftools give dng without pattern. white balance is not the same as not-lossless

bouncyball

  • Senior
  • ****
  • Posts: 466
Re: Canon 6D
« Reply #730 on: December 22, 2017, 04:08:12 PM »
Looks like a bug.

Here is the log from mlv_dump (6D MLV example from @8rnity):

Code: [Select]
Block: EXPO
  Offset: 0x0000015c
  Number: 4
    Size: 40
    Time: 1.751000 ms
     ISO Mode:   0
     ISO:        800
     ISO Analog: 96
     ISO DGain:  0/1024 EV
     Shutter:    0 microseconds (1/inf)

Shutter is not baked to MLV EXPO header. Hence:

$ ./dng_validate 6D_INVALID_000159.dng
Validating "6D_INVALID_000159.dng"...
*** Warning: The ExposureTime is <= 0 ***
*** Warning: Too little padding on left edge of CFA image (possible interpolation artifacts) ***
*** Warning: Too little padding on top edge of CFA image (possible interpolation artifacts) ***
*** Warning: Too little padding on right edge of CFA image (possible interpolation artifacts) ***
*** Warning: Too little padding on bottom edge of CFA image (possible interpolation artifacts) ***
Raw image read time: 0.026 sec
Linearization time: 0.006 sec
Interpolate time: 0.081 sec
Validation complete

Ignore warnings about 'too little padding' they are same for all ML/MLtools produced DNGs.