Darktable HDRmerge alignment

Hello,
Does LUA script for HDRmerge align images before merging?
Use-case: Merging bracketed shots, that are bit off due to strong wind swinging the tripod.
I am using LUA addon for HDRmerge in Darktable and have a feeling the shots were not aligned before merging. There is also no way to check. Just basic HDR controls.
image

I know there is alignment option in HDRmerge, but I don’t know how to activate it in LUA addon. Maybe someone could share a tip on how it can be done.

From the hdrmerge CLI docs:

The MTB alignment and crop algorithms are enabled by default, and can be disabled with the switches --no-align and --no-crop, respectively.

I don’t see anything in the lua code which turns off alignment.

2 Likes

Thanks @paperdigits
Then it was me shaking the camera :persevere:

Stupid question. I have installed HDRmerge and started the lua script. I instructed the module where the executable file was and now the HDRMerge module looks like this. I select a couple of images to be merged and click on the merge button. A couple of brief screens popup and disappear and no DNG is created. What an I doing wrong?
image

EDIT: It seems the problem is that I have CR3 files and I presume they are not they supported.

Similar situation. The terminal writes an error: “No such file or directory”.

That error message does not seem to be about some unsupported file format.

“No such file or directory” indicates a missing file or directory, not a format error. Nor does it indicate a permission problem.

To say more, we’d need more info from @fogary: OS, distribution, program version, perhaps full command line.
If it concerns a snap or flatpak version, I’m out straight away: I don’t use them, and from what I hear, using those with external directories can be very unfunny.

Manjaro Linux, Darktable 4.7.0+1369~g683ff9faed. Full error message (in terminal):

sh: line 1: '/usr/bin/hdrmerge' -b 32 -p half -o '/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7158-7162_01.dng' '/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7158.pef' '/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7159.pef' '/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7160.pef' '/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7161.pef' '/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7162.pef': No such file or directory

If you copy this command and execute it, it runs without errors.

Maybe the script is trying to execute it the wrong way, as if it were a single command string (the name of a single executable).

Try with bash instead of sh

Tell me in which line of the script can I change sh to bash?

Disclaimer : only residual knowledge about LUA and c++.

But having a look into the code my understandig is there is no simple way to just replace sh by modifying code of HDRMerge.lua. I find a chain of function calls from HDRMerge.lua over dtutils.lua, system.lua and more to build the external command for your OS.

The problem is not in sh or bash.

To execute the command, the script calls the dtutils_system.external_command() function.

Inside this function contains the line: result = dt.control.execute(ds.sanitize(command)).

If you replace the line in the script:
resp = dsys.external_command(run_cmd)
on the:
resp = dt.control.execute(run_cmd)
then no error occurs, the DNG file is created, but is not automatically added to the library.

Apparently there is some problem with the ds.sanitize() function.

@wpferguson is the LUA guru here, perhaps he can help.

In order to troubleshoot, I need some information

What OS are you running?

What version of darktable?

Can you print the generated command before it gets sent to dsys.external_command?

Can you print the results of ds.sanitize(run_cmd)?

Manjaro Linux

Darktable 4.7.0+1369~g683ff9faed

'/usr/bin/hdrmerge' -b 32 -p half -o '/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7160-7161.dng' '/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7160.pef' '/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7161.pef'
''\''/usr/bin/hdrmerge'\'' -b 32 -p half -o '\''/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7160-7161.dng'\'' '\''/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7160.pef'\'' '\''/home/fogary/PhotoRaws/HDR/HDR_190719_12-32/IMGP7161.pef'\'''

I’m working on it.

See sanitization causes external_command calls to fail on linux/posix · Issue #481 · darktable-org/lua-scripts · GitHub for updates.

2 Likes

Thanks, now there are no more errors.

1 Like