Lightroom plugin cr2hdr v3.0 DEV (WIP)

Started by kichetof, March 18, 2014, 05:04:33 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

kichetof


Walter Schulz

Must confess I haven't tested LR mobile ...

kichetof

You can test it with Lr Mobile or other background tasks.
I had a blocking task (syncing mobile) when summary was open but I don't know if it appear with other task ..
Normally this bug is fixed, I hope so!

dfort

Wish I could help out but now I'm busy on a job and don't have my gear with me to test out the new features. Guess I could take a look at the menus and see if any English grammar mestakes be made more better.

DavidSamish

I've been using the cr2hdr-r_9.9_lut_lab to process my dual iso photos with some success, but I was looking forward to using the Lightroom plugin to simplify the process.

I finally got it to work, but the exposure on the processed file is way too high; the highlights are blown out and I can't adjust them back.

Here is a before and after sample. I'm using Lightroom CS6 on a Mac with El Capitan. These are shot with a Canon 70D with ML 70D.111A.

I don't know how to add attachment to this forum, so here is a dropbox link to the files: https://www.dropbox.com/sh/na83wgkdeq05rso/AAAi9k4bS0_GdAWBw4dV4Y7aa?dl=0

What am I doing wrong?

I've updated to the LR Plugin Beta 3.3 and get a error #256 when I try to export. LR 6.3CS Mac El Capitan

DavidSamish

Oops. I had the wrong url, but I edited it.

Danne

There are known problems with eos 70D and dual iso conversion. I had problems using adobe dng converter with the 70D.
By the way, you could update to the latest cr2hdr-r_12.3. It gives the in camera white balance to the converted DNG files. I get the multipliers with dcraw. Don,t know if this could be implemented in the lightroom plugin as well.

kichetof

That's a good feature! I'll try it on both windows and Mac to check if it's possible with Lr :)

Danne

Cool. Here is the way I use the multipliers.
http://www.magiclantern.fm/forum/index.php?topic=16024.msg155569#msg155569

-i -v gives some useful info from dcraw.
dcraw -i -v  DUAL3755.CR2

Gives below
Camera multipliers: 2032.000000 1024.000000 2009.000000 1024.000000

Then writing som bash to divide and insert the result with exiftool to AsShoNeutralValues. I,d like to pint out that the --wb=exif doesn,t really work al the time so dcraw multipliers are more robust to obtain correct wb values.

Code snippet below is the way cr2hdr-r is working to get the numbers and dividing them etc. It also creates a lists which it uses after conversions to add the correct values after conversions.


ls *.CR2 *.DNG > /tmp/magic_l_prores/d_iso_list

while grep -q 'CR2' /tmp/magic_l_prores/d_iso_list
do
   
grep 'CR2' /tmp/magic_l_prores/d_iso_list | awk 'FNR == 1 {print}' > /tmp/magic_l_prores/d_iso_CR2
CR2=$(cat /tmp/magic_l_prores/d_iso_CR2)
rm /tmp/magic_l_prores/d_iso_CR2

~/Library/Services/folder_ProRes444_lut.workflow/Contents/dcraw -i -v $CR2 | awk '/Camera multipliers/ { print $3; exit }' > /tmp/magic_l_prores/CR2_01
CR2_01=$(cat /tmp/magic_l_prores/CR2_01)

echo 1024.000000/$CR2_01 | bc -l | awk 'FNR == 1 {print}' > /tmp/magic_l_prores/CR2_01
CR2_01=$(cat /tmp/magic_l_prores/CR2_01)
rm /tmp/magic_l_prores/CR2_01

~/Library/Services/folder_ProRes444_lut.workflow/Contents/dcraw -i -v $CR2 | awk '/Camera multipliers/ { print $5; exit }' > /tmp/magic_l_prores/CR2_02
CR2_02=$(cat /tmp/magic_l_prores/CR2_02)

echo 1024.000000/$CR2_02 | bc -l | awk 'FNR == 1 {print}' > /tmp/magic_l_prores/CR2_02
CR2_02=$(cat /tmp/magic_l_prores/CR2_02)
rm /tmp/magic_l_prores/CR2_02

echo "-AsShotNeutral=$CR2_01 1 $CR2_02" > /tmp/magic_l_prores/CR2_R
CR2_R=$(cat /tmp/magic_l_prores/CR2_R)

grep 'DNG' /tmp/magic_l_prores/d_iso_list | awk 'FNR == 1 {print}' > /tmp/magic_l_prores/d_iso_DNG
DNG=$(cat /tmp/magic_l_prores/d_iso_DNG)
rm /tmp/magic_l_prores/d_iso_DNG

~/Library/Services/folder_ProRes444_lut.workflow/Contents/exiftool $CR2_R $DNG -overwrite_original

echo "$(tail -n +3 /tmp/magic_l_prores/d_iso_list)" > /tmp/magic_l_prores/d_iso_list
list=$(cat /tmp/magic_l_prores/d_iso_list)

mkdir -p CR2_ORIGINALS

mv $CR2 CR2_ORIGINALS

done


kichetof

@Danne thanks for your snippet!

I'm trying to obtain same result on Windows...
If someone with more skill on Windows CMD is able to obtain the value, bingo!


for /f "tokens=3-6" %a in ('dcraw.exe -i -v "E:\Tof\Photos\Photographies\2015\2015_10_18 Lausanne automne\_MG_9488.CR2" ^| findstr /C:"Camera multipliers"') do set n1=%a && set n2=%b && set n3=%c && set n4=%d
set /a res=%n1:.000000=%/%n2:.000000=%
echo %res% <-- 1 ... NO FLOAT!!!


value used
(set n1=1802.000000  && set n2=1024.000000   && set n3=1765.000000   && set n4=1024.000000)
n1/n2 = 1.759765625

Walter Schulz

"Set /a" can't handle float.
Powershell will do. Or normalize.

C:\Windows\system32>powershell 1802/1024
1,759765625


EDITEDIT:for /F "tokens=3-6" %a in ('dcraw -i -v *.cr2 ^|findstr /C:"Camera multipliers"') do for /F %m in ('powershell %a/%b') do set res=%m
set res=%res:,=.%

kichetof

Thanks Walter!

The final target is

exiftool "-AsShotNeutral=XXX 1 YYY" DUAL3755.DNG

XXX and YYY come from dcraw, but we need to parse value from dcraw before running exiftool on the same command :)
I'll try your command!

dcraw parse output:


for /F "tokens=3-6" %a in ('dcraw.exe -i -v "E:\Tof\Photos\Photographies\2015\2015_10_18 Lausanne automne\_MG_9488.CR2" ^| findstr /C:"Camera multipliers"') do (for /F %m in ('powershell %a/%b') do set res1=%m & for /F %u in ('powershell %c/%d') do set res2=%u)
echo %res1:,=.%
echo %res2:,=.%

Walter Schulz


kichetof

final code

for /F "tokens=3-6" %a in ('dcraw.exe -i -v "E:\Tof\Photos\Photographies\2015\2015_10_18 Lausanne automne\_MG_9488.CR2" ^| findstr /C:"Camera multipliers"') do (for /F %m in ('powershell %a/%b') do set res1=%m & for /F %n in ('powershell %c/%d') do set res2=%n) & exiftool.exe "-AsShotNeutral=%res1:,=.% 1 %res2:,=.%" "E:\Tof\Photos\Photographies\2015\2015_10_18 Lausanne automne\_MG_9488.CR2"


Next step --> Mac

Danne

Really glad to see that this is getting implemented to your fine plugin Kichetof.

kichetof

first try on Mac

./exiftool "-AsShotNeutral=$(./dcraw -i -v DUAL4726.CR2 | awk '/Camera multipliers/ { print $3/$4}') 1 $(./dcraw -i -v DUAL4726.CR2 | awk '/Camera multipliers/ { print $5/$6}')" DUAL4726.CR2


Someone see a best solution ?

@Danne thanks to you for the tip!

dmilligan

Why not just parse the output from dcraw in Lua and then call exiftool? Then you shouldn't need different complicated shell scripts for Mac/Win. You might not even need exiftool, but be able to apply the WB with Lr API.

kichetof

That's right @dmilligan!
But from LrTask.execute only return code is catches and if return code is ok I'll not have the dcraw output.

Do you know if io.popen is present on Lr? No access until tomorrow <-- normally yes: Lua 5.1

I'm looking how to transform dcraw multipliers to temp/tint to apply them on Lr, do you know how to convert?

Danne

Isn,t the division results giving you the the temp/tint values via AsShotNeutral values? Or are there other values you looking for?

dcraw -i -v DUAL3755.CR2

Camera multipliers: 2032.000000 1024.000000 2009.000000 1024.000000


1024.000000/2032.000000=0.50393701

1024.000000/2009.000000=0.50970632

exiftool "-AsShotNeutral=0.50393701 1 0.50970632" DUAL3755.DNG


dmilligan


CKING018

Hey guys

I need some help. I am pretty sure I have downloaded everything including the cr2hdr, as well as dcraw and exiftool (which I think I did because if I type "dcraw" or "exiftool" in to the Terminal it outputs the app? But when I try to export a picture to cr2hdr it gives me this. Any suggestions?


CKING018

I actually saw that right after I posted and now it is working for me. I did notice though that on my Canon 7D, when I turn the video mode to RAW (either the normal or MLV) and go to Dual Iso it says it is on with the green dot but it is not lit. Does the 7D support dual iso in video or no?

Walter Schulz

No Dual-ISO support in video mode for 7D, 50D, 5D2.

kichetof

@Danne I'm looking for a mathematical transformation from multipliers divided to temp (°K) / tint (green to violet), or maybe its wrong and don't use the right way!

@dmilligan thanks I'll test that!

@CKING018 which version of plugin? The latest like Danne give you? Which version of Mac OS X?

Hmmmm ... that doesn't work ...


local LrDialogs = import 'LrDialogs'
local LrLogger = import 'LrLogger'
local LrPathUtils = import 'LrPathUtils'
local LrTasks = import 'LrTasks'

local log = LrLogger( 'popenLr' )
log:enable( "print" )

local cmd = string.format('"%s" -i -v "%s"', LrPathUtils.child(_PLUGIN.path, 'dcraw.exe'), LrPathUtils.child(_PLUGIN.path, '_MG_9542.CR2'))
log:debug(cmd) -- "C:\Users\tof\Scripts\popen\popen.lrplugin\dcraw.exe" -i -v "C:\Users\tof\Scripts\popen\popen.lrplugin\_MG_9542.CR2"
local stdout = io.popen(cmd) -- cmd open and close quickly
local output = stdout:read('*all') -- nothing
for line in stdout:lines() do -- nothing printed, so no data in stdout
    log:debug(line)
end


Another way is to capture output to a temp file, but it's less beautiful !