Welcome, Guest. Please Login or Register
Home Help Search Login Register
Pages: 1 2 
Send Topic Print
How to work with Picturenaut with "CommandLines".. (Read 10653 times)
SteveMcKlick
Ex Member


How to work with Picturenaut with "CommandLines"..
09/01/11 at 20:54:38
 
...or script.
Hello friends,
I want to use Picturenaut to work automatically through
a bunch of picutres.
It is a timelapse with HDR.
Each HDR group contains 5 pictures.
These group of 5 should be "put together" with PN in
one picture.
This I would like to do at first "by hand" to set the parameters properly. Then I would like to be able
to tell the programm to use the same parameters and
then take the next 5 pictures for "fusion".
...and so on.
Now it should be automatic.
The pictures do have numbers at the end of their file name and those names could be used for "grouping" the pictures of one HDR-Session.

I haven't found any explanation of how to use PN with command line, but it should work, as I could read in the pdf-Manual.

All the best to You and
hope to hear from one of You.

Stefan
Back to top
 
 
IP Logged
 
Marc
Ex Member


Re: How to work with Picturenaut with "CommandLines"..
Reply #1 - 09/01/11 at 23:11:20
 
An automation is only possible so far when you write your own batch file in conjunction with mkhdri.exe. With mkhdri and the -? parameter you receives a description for all mkhdri options.

Here's an example how Picturenaut calls mkhdri.exe:

-f32
-wf:d
-co:result.crv
-out:result.tif
IMG_1276.CR2
IMG_1275.CR2
IMG_1274.CR2
IMG_1273.CR2
IMG_1272.CR2
IMG_1271.CR2
IMG_1270.CR2
IMG_1269.CR2

Picturenaut even wrote a so-called command file, with the parameter -cmdf:[file] that is passed to mkhdri.exe. One could of course pass all options directly to mkhdri.exe. But on older Windows platforms you had sometimes the problem that the options together with the file names blew up the environment.

Here is a short description for the command options.

-f32
Means that a 32-bit TIFF has to be written. Without this option mkhdri writes a LogLuv TIFF (LogLuv is a HDRI format but with minimal loss).

-wf:d
This option determines the weighting function for the calculated inverted camera curve. Consider that an HDRI has no gamma correction. For this reason mkhdri.exe calculates the inverse camera curve, which is then weighted. The d stands for derivative. dh1 means derivative + hat. The last option generates images with higher contrast.

-co:[file] stores the calculated inverse camera curve. This is later reused by the the tone mappers to make a gamma correction.

-out:[file] The HDRI itself.

I hope the information was useful for you. Further questions are welcome.

Regards,
Marc
Back to top
 
 
IP Logged
 
SteveMcKlick
Ex Member


Re: How to work with Picturenaut with "CommandLines"..
Reply #2 - 09/03/11 at 08:52:46
 
Marc,
thanks a lot for you answer.
A long time ago I learned Basic and afterwards a bit of pascal.
But at the moment, I just dont know, which language to use,
or how to write a batchfile in Winows, (Win 7)
to do this simple task.
What I think I know is, that it has to have something,
like a "FOR-Loop" including the lenght of the "group of pictures";
people maybe being asked somethink like:

a) the length of the group of 1 HDRI (lets say 5)
   (after those "pictures" the next group should start
b) the start number of the files or the
   whole name of the startfile, but then
   telling the program, which part is the number part.
c) a possiblilty of telling Picturnaut how
   the "condensed File" should be namend,
   with a "group number part" for
d) maybe a directory, where the HDRImage should be stored.

*****
Maybe I am not the only one, with this problem.
   A lot of cameras do have now a bracketing function
for getting a series of pictures with different
light exposure. So maybe this problem is something,
which other users are also interested in.

So here are my questions.
a) Could it be possible to integrate this "batch option"
   into the GUI of Picturenaut as a
   "special submenue" in "Belichtungsreihe erzeugen"
    - or a Menue like "batch-Run" -
   Maybe the Submenue also should include the
   way how to store it already, since it will be
   necessary for the "batch-Run".
   and a possibility of telling the "stored" tonemapping-paramater, for using it during the batch.

or

b) Which way should I go, using the
   Command-line MKHDRI and a batch-language?


If you can give me some hints, which language to use,
and a manual how to do it, I would like to try, but I
think, I do need help.

**************************************

PS: I tried also to find a simple programm for
renaming the files in groups
like:
01-IMG-678.jpg
01-IMG-679.jpg
01-IMG-680.jpg
01-IMG-681.jpg
01-IMG-682.jpg

The "01-" at the beginning should be the added
"number of the group (here 5 pictures) - followed
by the original name of the file.
Even the very good program "Total Commander" and
its tool "Mehrfach-Umbennungstool" is not able to do
that. (As far as I know)


Greetings and thanks a lot for your effort.
If you are the Marc, who wrote Picturenaut,
I also want to thank you very much for this program
(even I am just at the beginning of using it.)

Stefan

PPS. Something might be wrong, with that "email-me-of somebody was answering your topic" - since I did not get an email, despite checking this.


   
   

   
Back to top
 
 
IP Logged
 
Kel Solaar
God Member
*****
Offline


Curious Apprentice

Posts: 1117
Re: How to work with Picturenaut with "CommandLines"..
Reply #3 - 09/03/11 at 13:06:50
 
Hi Steve,

Could you be more explicit of what you wanna rename your files from / to? Total Commander should be able to do the trick in pretty much every rename case since it has a very good support for regular expressions.
Here is a link to the documentation here: http://www.ghisler.ch/wiki/index.php/Regular_Expressions#Backreferences
Let us know what you wanna achieve exactly Smiley

Cheers,

KS
Back to top
 
 
IP Logged
 
SteveMcKlick
Ex Member


Re: How to work with Picturenaut with "CommandLines"..
Reply #4 - 09/03/11 at 13:33:06
 
Ok, my friend,
thanks a lot for your interest.
I did fear, that my explanation was already boring,
telling the same stuff again.

But wait - I like to explain:

1) I try to get HDRI from my camera - bracketet pictures.
2) brackete pictures means: I can tell my camera,
and my camera is doing with every picture I take,
5 picture (or 3 depends on what I want) with different
times of duration exposure.
Therefore, after exposure, I do have a set of 5 pictures, with continous numbers like
CIMG678
CIMG679....
3) But I also do a Timelapse-series of HDR-Pictures.
   meaning, I will take a pictures every 10 sec.
4) But a HDRI-Timelapse means, that I do have
a group of 5 pictures (with different exposure times)
and after 10 seconds
again 5 pictures (with differenr exposure times)
5) And the camera names the files continuosly
6) Now - if I do this 5 minutes I will have
   a number of picutres like
   (6 pic / minute x 5 (since 5 minutes) x 5 (diff. exposures) = 6 x 5 x 5 = 150 pictures.
7) Now I want to "condens" the 5 pictures with different exposurestimes into one HDR-Image with tonemapping.
8) The first step to do so I thougt, it would be good,
to rename and group the 5 pictures with different exposures into one.
And add all the 5 pictures the number of the Group before.
9. This adding of the number and continously counting,
is something, which can be done bei TotalCommander easy.
10. But what I dont know, is how to tell TotalCommander
to take groups of "5" (or other numbers) pictures
and name them. then the next 5 pictures.

Example:
Those would be the original filenames, given by the camera-software (5x5=25 Pictures):
CIMG3456
CIMG3457
CIMG3458
CIMG3459
CIMG3460
CIMG3461
CIMG3462
CIMG3463
CIMG3464
CIMG3465
CIMG3466
CIMG3467
CIMG3468
CIMG3469
CIMG3470
CIMG3471
CIMG3472
CIMG3473
CIMG3474
CIMG3475
CIMG3476
CIMG3477
CIMG3478
CIMG3479
CIMG3480

I would like to change the names of the files into something like:

01-CIMG3456
01-CIMG3457
01-CIMG3458
01-CIMG3459
01-CIMG3460
02-CIMG3461
02-CIMG3462
02-CIMG3463
02-CIMG3464
02-CIMG3465
03-CIMG3466
03-CIMG3467
03-CIMG3468
03-CIMG3469
03-CIMG3470
04-CIMG3471
04-CIMG3472
04-CIMG3473
04-CIMG3474
04-CIMG3475
05-CIMG3476
05-CIMG3477
05-CIMG3478
05-CIMG3479
05-CIMG3480


I dont know, whether TotalCommander can do something like this. Do you know another program, able to do this?
Did you understand what I was trying to say?

Thanks a lot for you interst.

All the best

Stefan

Back to top
 
 
IP Logged
 
Kel Solaar
God Member
*****
Offline


Curious Apprentice

Posts: 1117
Re: How to work with Picturenaut with "CommandLines"..
Reply #5 - 09/03/11 at 15:47:00
 
Hi Steve,

Yeah I got it now, indeed it's a very specific behavior you need, and I don't think TotalCommander would be able to do that.
However if you know somebody coding a bit it would be fairly easy to do in any scripting language (Python, Ruby, etc...)

KS
Back to top
 
 
IP Logged
 
SteveMcKlick
Ex Member


Re: How to work with Picturenaut with "CommandLines"..
Reply #6 - 09/04/11 at 09:00:40
 
Hi Kel and Marc,
the best thing - of course - would be,
if I dont have to do this renaming stuff,
but that in PNaut, a Menue will offer this option of
special batchprocessing.
Could this be programmed as a plugin?
Which kind of plugin?
Which language to use? C++
I always want to learn the language, but the way
is not easy.
Therefore - maybe - a programmer here in the community
is able to this in 10 minutes...
Do You know people, able to do this?
Maybe you can ask them.

Thanks a lot for your interest.

Steve
Back to top
 
 
IP Logged
 
Kel Solaar
God Member
*****
Offline


Curious Apprentice

Posts: 1117
Re: How to work with Picturenaut with "CommandLines"..
Reply #7 - 09/04/11 at 10:38:30
 
Here you go,

I didn't tried it much but it should work Smiley

You will need to have Python 2.7 installed on your computer (not Python 3). Be sure to have the python executable in your system path then just issue this command in the folder where the script is:

Code:
python addBatchSizePrefix.py -s "Path/To/Your/Images" 



or even easier you can copy the script in the folder where your images are and do this:

Code:
python addBatchSizePrefix.py
 



If you execute this command, you will get the various parameters:
Code:
python addBatchSizePrefix.py --help
 



Code:
Lilith:src KelSolaar$ python addBatchSizePrefix.py --help
Usage: addBatchSizePrefix.py [options]

Options:
  -h, --help
        'Display this help message and exit.'
  -b BATCHSIZE, --batchSize=BATCHSIZE
        'Renaming batch size'.
  -f FILESEXTENSIONS, --filesExtensions=FILESEXTENSIONS
        'Files extensions to rename'.
  -s SOURCEDIRECTORY, --sourceDirectory=SOURCEDIRECTORY
        'Source directory.
  -p PADDING, --padding=PADDING
        'Renaming prefix padding. 



No undo, no ui, but should do the job.

Voila Smiley

KS
Back to top
 

addBatchSizePrefix_py.zip (Attachment deleted)
 
IP Logged
 
Marc
Ex Member


Re: How to work with Picturenaut with "CommandLines"..
Reply #8 - 09/05/11 at 06:48:51
 
Hi all,

I think I should implement a batch processor as a plugin. And yes of course nearly all can be written as a plugin for Picturenaut Wink

@Steve, you will group files by a number range. For that you must first specify the start file and the number of files that will then follow. This is not realy a grouping by a pattern its more like a grouping by a special function. I do not know exactly one can solve this as a generalized problem.
Back to top
 
 
IP Logged
 
SteveMcKlick
Ex Member


Re: How to work with Picturenaut with "CommandLines"..
Reply #9 - 09/05/11 at 07:33:37
 
HI Kel (Master of python),
thanks a lot for your help.
I had some problems in using the line command,
but then I copied the unzipped zipfile
into the testfolder, just doubleclicked
on the program and - whoops- the job was done,
everything got the correct name - beside one
problem:
the number 01 - only has been given to the first
file. Therefore all the others are also wrong,
since they all are shifted.
Is there a way for me, to change this or do you have to do this.
There are still a lot of questions left,
but python got my interest now.

thanks a lot so far.

steve
Back to top
 
 
IP Logged
 
Kel Solaar
God Member
*****
Offline


Curious Apprentice

Posts: 1117
Re: How to work with Picturenaut with "CommandLines"..
Reply #10 - 09/05/11 at 08:26:58
 
Hi Steve,

Fixed, it was a "Ohh I didn't properly checked the result!" error Smiley"

Don't hesitate if you have questions, and you can easily modify the script, it's fairly simple Smiley
Notice that the padding is not intelligent, you must specify it so that it fit your convenience (It's 2 by default). It would be easy to make it intelligent:
When you have the number of images and the batch size, you can guess the number of batches, your intelligent padding is the number of digits of that batches number.

KS
Back to top
 

addBatchSizePrefix_py_001.zip (Attachment deleted)
 
IP Logged
 
SteveMcKlick
Ex Member


Re: How to work with Picturenaut with "CommandLines"..
Reply #11 - 09/05/11 at 10:05:33
 
HI Kel,
1. Thank u vy much!
2. Is Python difficult to learn and is there
   a online help or book or... about the commands.
   It seems to be helpful for a lot of problems.
   Which manual(tutorial) could u recommend?
3. Which way would u go, to automize the "condensing"
   of the "now-in-groups-of-5" files in Pnaut.
   It should be "partially autonom", meaning, that
   for a charakterstic group I want to define the
   tonemapping-parameters. Those should be used
   afterwards in all the other groups for condensing
   them into 1 resulat picture.
   (I dont know, whether it is possible to understand
    what I mean, but I do hope!)

Tx again!

Stefan
Back to top
 
 
IP Logged
 
SteveMcKlick
Ex Member


Re: How to work with Picturenaut with "CommandLines"..
Reply #12 - 09/05/11 at 14:09:45
 
Hi Kel,
in trying to understand the sourcecode,
I do not understand how the program
is avoiding to change the name of itself,
since it is also a file in this folder...

cu
steve
Back to top
 
 
IP Logged
 
SteveMcKlick
Ex Member


Re: How to work with Picturenaut with "CommandLines"..
Reply #13 - 09/05/11 at 14:11:39
 
Ah,
maybe because of filesExtension, restricted to jpg...
Back to top
 
 
IP Logged
 
Kel Solaar
God Member
*****
Offline


Curious Apprentice

Posts: 1117
Re: How to work with Picturenaut with "CommandLines"..
Reply #14 - 09/05/11 at 21:33:37
 
you can specify a custom extension by using the "-f" flag on the command line Smiley
Did you managed to get it work from a shell?

You can even edit the script directly to use the extension you want by default, change the "jpg" to whatever suit your needs in this line:

Code:
	parser.add_option("-f", "--filesExtensions", action="store", type="string", dest="filesExtensions", default="jpg", help="'Files extensions to rename'.")
 



KS
Back to top
 
 
IP Logged
 
Pages: 1 2 
Send Topic Print