Mac automator and kandaoRaw+

Started by Levas, October 31, 2018, 08:36:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Levas

I'v found this program, KandaoRaw+, which can blend/average multiple raw files into a single new raw file (and remove ghosting and such).
What I like is the fact that it outputs a new raw file  :D and not just a jpg file or something  :P
And it does this really fast.

The program is free and available for Mac and windows:
https://www.kandaovr.com/en/software/#KDRAW

The program can blend/average up to 16 raw files into a single new raw file.

Now I would like to use this on a magic lantern raw video dng sequence.
The idea is to use kandaoraw+ to blend/average the frames, by starting with frame 1 and using the 15 following frames to create a new frame 1 file.
Next thing to do is blend/average frame 2 and the following 15 frames to create a new blended/average frame 2.
etc.

The problem is, I have no idea how to automate this and if it is even possible to automate, my first thought was using automator on Mac.
But I can't find out how to use automator with kandaoraw+ and let it blend each frame with their 15 following frames...
Anybody here an idea ?


Danne

Does it work with command line(terminal) or only through gui? If you can get it to work through terminal there is no problems wrapping it in automator.
An alternative is HDRmerge which works with command line options. Outputs to dng.

Walter Schulz

Quote from: Danne on October 31, 2018, 09:15:43 PM
Outputs to dng.

As Kandao Raw+ does
QuoteTo achieve that it combines a burst of Raw images into one single DNG file

Levas

I'm affraid it doesn't work with command line.
Tried looking into the app (show app contents, folder style) and tried to run the executable rawplus in terminal, but it didn't work, so it's probably GUI  only :-\

I recall of suggesting using HDR merge before, but a few quick tests at that time didn't give satisfactory results.
The deghosting of Kandaoraw+ is really good.

But maybe I should give HDRmerge another try  ???

How would you suggest to automate the use of HDRmerge, to blend/average out a certain amount of frames(4, 8 or 16), for each frame in dng movie sequence ?
I'm not looking for something really fancy, only something that works.
If I can use a simple command file to achieve the blending done on a folder full off dng's then I'm really happy  :)

So for each frame in a folder, blend it with the following (4, 8 or 16) frames and save it as a new blended dng.


Walter Schulz


Danne

There are three ways. One is using hdrmerge binary and use the automated group function based on time interval. Check command line options for more info.
Grouping can be done outside with a script also. I use some techniques in Switch in bash script section.
You can also group manually if you now in advance the amount of files you want to group.
If you describe how you think you gonna use it I could help you out.
Also, compile hdrmerge yourself since official version is a bit buggy. This helper will take you there:
https://bitbucket.org/Dannephoto/hdrmerge_compiler/src/default/

Levas

The way I want to use it is as follows, I have a folder of a dng sequence, then I want to average/blend each frame with the 15 following frames.
So let's say I have a ML raw dng sequence folder with files:
M22-2029_frame_000000.dng going to M22-2029_frame_000215.dng

Then I want M22-2029_frame_000000.dng to be averaged/blend with M22-2029_frame_000000.dng to M22-2029_frame_000015.dng and be saved somewhere else as M22-2029_frame_000000.dng.
After that it should go to M22-2029_frame_000001.dng and average/blend that with M22-2029_frame_000001.dng to M22-2029_frame_000016.dng and save that somewhere else as M22-2029_frame_000001.dng
etc.
So each frame should be averaged with the 15 following frames within a folder.

Is that possible with a simple command file and HDR Merge?




Levas

As a side note:
I have used multiple timelines and composite blending in video editors, and I really like the noise canceling results.
Problem however is the ghosting with moving subjects, so I'm looking for a way to have frame blending without ghosting.

Levas

Alex optical flow script works really good too, but it is very very slow, and in HD resolutions my computer crashes  :P , also it doesn't do the trick with raw files.
https://www.magiclantern.fm/forum/index.php?topic=20999.msg193367#msg193367

Danne

Yes, I know how you mean and what you are after. Been thinking the same and also posted results around this to some coders here at the forum. It´s possible with HDRmerge. I tested it briefly before but results weren´t always what I wanted. Needs more testing. Not very hard to script but time is needed. I could see if I could get some time for this the next couple of days.

Here is something I tested in Mlv App working with enfuse and hugin align_image:
#!/bin/bash
cd "$(cat /tmp/mlvapp_path/file_names.txt | head -1 | cut -d "." -f1)"

while grep -E "tif" <<< $(find . -maxdepth 1 -iname '*.tif')
do
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack -a aligned.tif \
$(find -s . -maxdepth 1 -name '*.tif' | head -n $(printf "%.0f\n" $(cat fps)))
/Applications/Hugin/tools_mac/enfuse --exposure-optimum=0.5 --exposure-width=0.5 $(find . -maxdepth 1 -iname 'aligned.*tif') -o $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 1' | cut -d "." -f2 | tr -d "/").tiff
rm aligned.*tif
mkdir -p tif_tmp
mv $(find -s . -maxdepth 1 -name '*.tif' | head -n $(printf "%.0f\n" $(cat fps))) tif_tmp
done


It averages the amount of tif files as we get fps. So 1/24 fps will average 24 images into one etc. It´s useful with higher iso mainly. In the example I just run it on a MLV file:


Original(6400 iso):


Averaged(aligned and enfused)



Denoiser in Mlv App(not too good looking :))




Pixel peep:

Iso 6400


Averaged


Levas

Yes  :o this is the type of stuff I'm after.
For use with high iso, low light situations.
Would be cool if this would become an option in MLVapp.
If implemented in MLVapp you could do some preprocessing, such as removing hot and cold pixels.

Also sended an email to KandaoRaw+ if their program can be used in command line.

Danne

Mlv App will be dependent on intermediate files but the result is really good.
I will try and get a script woring with hdrmerge in time...

Levas

Cool, take your time  :)
Not needing it for anything serious.

Danne

Here´s a script to try out:
https://bitbucket.org/Dannephoto/magic-lantern/downloads/averaging_idea.command

Inside a folder with dng files or tif files you simply double click the averaging_idea.command. For now it´s no use multiprocess or iterate over a bunch of folders. If proven useful I might build some script in Mlv App.

Regarding amount of frames it will do half amount of frames according to fps when processing dng files(e.g 24 will become 12 and so on).
Tif files is set to 15 files.

Your averaging_idea.command script needs sudo rights before double clicking. In terminal do:
chmod u=rwx averaging_idea.command
enter

Dependecies if missing will be installed.

Inside a folder looking like this:

Levas

Thanks Danne, will give this command a testdrive  :D