www.photomacrography.net :: View topic - Automating Partial stacks in Zerene Stacker
www.photomacrography.net Forum Index
An online community dedicated to the practices of photomacrography, close-up and macro photography, and photomicrography.
Photomacrography Front Page Amateurmicrography Front Page
Old Forums/Galleries
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Automating Partial stacks in Zerene Stacker
Goto page 1, 2  Next
 
Post new topic   Reply to topic    www.photomacrography.net Forum Index -> Macro and Micro Technique and Technical Discussions
View previous topic :: View next topic  
Author Message
elf



Joined: 18 Nov 2007
Posts: 1319

PostPosted: Sun Oct 02, 2011 5:24 pm    Post subject: Automating Partial stacks in Zerene Stacker Reply with quote

The batch processing utility in Zerene Stacker can really make it easy to edit deep stacks, but creating the batch file can be a lot work. See the Zerene Stacker tutorials at http://www.zerenesystems.com/cms/stacker/docs/howtouseit for more information on batch processing.

I've written a little C# command line application to generate the xml files that are consumed by Zerene Stacker's batch utility. It can create batch files that will do partial (incremental) stacks as well as stacks suitable for movies. See http://www.photomacrography.net/forum/viewtopic.php?t=9320 for an example of the movie mode)

There is a readme.txt file in the zip file, that has detailed information on how to run the application. Download the zip file to your computer, unzip to a folder, and execute the program (specifying the necessary parameters).

The zip file is located at http://myplace.frontier.com/~edward.french2/ZereneVSZip/ZereneVS_0712.zip Running the application may require .NET 3.5 to be installed. I have only used this on Windows 7, so can't guarantee that it will work on any other OS.

Enjoy
Back to top
View user's profile Send private message
Chris S.
Site Admin


Joined: 05 Apr 2009
Posts: 2814
Location: Ohio, USA

PostPosted: Sun Oct 02, 2011 7:13 pm    Post subject: Reply with quote

Wow, Ed, thanks! Excellent.

I could use a film like that to show people what it is we gain from focus stacking. Your film does this, but I'd like to have one that matches one of my subjects, taken at a higher magnification. Now, to put it on the list of things to get around to. . . .

Thanks for sharing!

--Chris
Back to top
View user's profile Send private message Send e-mail
seta666



Joined: 19 Mar 2010
Posts: 860
Location: Castellon, Spain

PostPosted: Mon Oct 03, 2011 11:56 am    Post subject: Reply with quote

Thank you Elf; this is a wonderfull utility, specially whern many partial stacks are needed
Regards
_________________
http://www.flickriver.com/photos/seta666/
www.macrosmuymacros.com
Back to top
View user's profile Send private message
johan



Joined: 06 Sep 2011
Posts: 961

PostPosted: Sat May 05, 2012 4:10 am    Post subject: Reply with quote

This looks really useful! I just did my first manual substack stack and it makes quite the difference... so big thank you Elf!

Just checking if I'm doing this right

Unzip etc
use DOS window, fill params 1 by 1, start by giving it a name?

(I'm a little unclear on these please, what do they mean?)

Code:
-SelectedStackOverlap
   Amount of overlap in Selected Stack
-AllImageStackType
   0: Don't create an All Image stack
   1: PMAX only
   2: DMAP only
   3: PMAX and DMAP
   4: Align All


then call this xml from inside zerene
close zerene, reopen, stack substacks using dmap

That's it, condensed?

Thank you very much

update: I have discovered exe.config, makes things much easier. But still a bit unclear what some of these params are.
_________________
My extreme-macro.co.uk site, a learning site. Your comments and input there would be gratefully appreciated.
Back to top
View user's profile Send private message Visit poster's website
johan



Joined: 06 Sep 2011
Posts: 961

PostPosted: Sat May 05, 2012 5:20 am    Post subject: Reply with quote

ok, specific question.

I've filled in exe.config, but I cannot for the life of me get the xml file generated. Can someone give me noddy foolproof instructions please what I should be doing - @"ZereneVS in dos in the right directory returns me a message "Number of command line parameters = 0" but doesn't generate an xml out of the info I put into exe.config.

Help?!

Thank you
_________________
My extreme-macro.co.uk site, a learning site. Your comments and input there would be gratefully appreciated.
Back to top
View user's profile Send private message Visit poster's website
elf



Joined: 18 Nov 2007
Posts: 1319

PostPosted: Sun May 06, 2012 11:23 am    Post subject: Reply with quote

The commandline shoud be something like this:
ZereneVS.exe -SourceImageFolder <path to images> -SourceImageFileMask jpg -OutputType 1 -SelectedStackImageCount 7 -SelectedStackType 4 -SelectedStackOverlap 2 -AllImageStackType 0

The above assumes you're using jpegs and want PMax stacks. Individual stacks will contain seven images with the first two images and last two images also contained in the previous and next stack.

There is a little bug in ZereneVS.exe. It sets the OutputImagesDesignatedFolder value to <source image folder>\Automation\zOut but creates a folder named <source image folder>\Automation\zsOut. Renaming the folder to zOut cures the problem.
Back to top
View user's profile Send private message
descall



Joined: 01 Oct 2011
Posts: 163
Location: United Kingdom

PostPosted: Sun Jun 03, 2012 2:41 pm    Post subject: Reply with quote

Many thanks for sharing this; exceptionally useful! Very Happy

I have a quick query. With 62 input images I used the following commands to create partial stacks ('slabs'):
-SelectedStackImageCount 10
-SelectedStackOverlap 4

After the batch completed I end up with 10 partial stacks in the zOut subfolder. How was the number of partial stacks determined by the script and is it possible to identify which images went into each partial stack?

Thanks for your help (and thanks again for a very useful piece of work!).

Best wishes,
Des
Back to top
View user's profile Send private message
rjlittlefield
Site Admin


Joined: 01 Aug 2006
Posts: 18165
Location: Richland, Washington State, USA

PostPosted: Sun Jun 03, 2012 3:18 pm    Post subject: Reply with quote

Zerene's batch scripts are human-readable XML. You can open them with any text editor, and the tag names should be suggestive enough to figure out what's going on. In this case, look for SelectedInputIndices followed by a list of SelectedInputIndex values. The index values start numbering at 0 within the list of input files.

Quote:
With 62 input images I used the following commands to create partial stacks ('slabs'):
-SelectedStackImageCount 10
-SelectedStackOverlap 4

From the parameters you've listed, I imagine that the stacks will consist of selected indices as follows:

0-9 (first slab: 10 images)
6-15 (second slab: 10 images, 4 shared with first slab)
12-21 (third slab: 10 images, 4 shared with second slab)
18-27 etc.
24-33
32-41
38-47
44-53
50-59
56-61 (tenth slab: all the remaining images, sharing 4 images with ninth slab)

If you'd like to have the slab outputs named to include bits of the file names, then consider changing the output image naming template as described at http://zerenesystems.com/cms/stacker/docs/faqlist#is_there_some_way_to_control_those_output_names.

--Rik
Back to top
View user's profile Send private message Visit poster's website
elf



Joined: 18 Nov 2007
Posts: 1319

PostPosted: Sun Jun 03, 2012 8:45 pm    Post subject: Reply with quote

Rik has it exactly right Smile

You can set the output naming template by adding the parameter to the ZereneVS command line.

Example:
-OutputImageNamingTemplate "{method} skip={FSF},EstimationRadius={ER},ContrastThresholdPct={CTPCT}"

Note: When a Zerene Stacker parameter has a '.', just delete the '.' to create the ZereneVS parameter.
Back to top
View user's profile Send private message
descall



Joined: 01 Oct 2011
Posts: 163
Location: United Kingdom

PostPosted: Sun Jun 03, 2012 10:53 pm    Post subject: Reply with quote

Wonderful, many thanks indeed Very Happy
Back to top
View user's profile Send private message
Rollin



Joined: 11 Jan 2011
Posts: 33
Location: Belgium

PostPosted: Wed Jun 06, 2012 1:41 am    Post subject: Reply with quote

Quote:
Zerene's batch scripts are human-readable XML.


Rik, Humans come in many types. A sheet of Rachmaninov music is also human readable (dots go up= higher pitch: very easy).

I'm struggling all day now with this, and I'm still nowhere. I keep on trying, but for people who hear the word xml for the first time this way of working is extremely complicated.

Just venting some frustration ;-))

Kind regards,

Rollin

edit1: I'm getting somewhere, I have a XML file now that Zerene seems to accept, but nothing happens. This was the command line

ZereneVS.exe
-SourceImageFolder C:\substack\substackfolder\images -ProjectsDesignatedFolder C:\substack\project -OutputImagesDesignatedFolder C:\substack\substackfolder\output -SourceImageFileMask jpg
-OutputType 1
-SelectedStackImageCount 10
-SelectedStackType 4
-SelectedStackOverlap 2
-AllImageStackType 0
-BatchXmlName rollinbatch1.xml

78 images, substacks of 10 images with an overlap of 2.

edit2: For other simple minds like myself: you should run this batch with the images imported in Zerene. Batch>load batch script>rollinbatch1.xml (in this case). Now it seems to work more or less, nothing is opened nor saved automatically. But it worked.
Back to top
View user's profile Send private message Visit poster's website
elf



Joined: 18 Nov 2007
Posts: 1319

PostPosted: Thu Jun 07, 2012 1:16 am    Post subject: Reply with quote

I think the more you use the batch file capabilities, whether you use ZereneVS or the Zerene Stacker batch dialog, the more you'll understand what you need to set for a particular set of images. Zerene Stacker is a pretty complex program and it's amazing Rik was able to expose most of it in the batch xml file format. The first batch file I created was over 11,000 lines long and would have been rather tedious to do manually Smile See http://www.photomacrography.net/forum/viewtopic.php?t=9320&highlight=movie.

The following additions to your commandline will create PMax and DMap stacks of all images plus PMax slabs and loads the source images:

ZereneVS.exe
-SourceImageFolder C:\substack\substackfolder\images
-ProjectsDesignatedFolder C:\substack\project
-OutputImagesDesignatedFolder C:\substack\substackfolder\output
-SourceImageFileMask jpg
-OutputType 1
-SelectedStackImageCount 10
-SelectedStackType 4
-SelectedStackOverlap 2
-BatchXmlName rollinbatch1.xml
-AllImageStackType 3
-Source C:\substack\substackfolder\images
-OutputImageDispositionCode 3
-OutputImageNamingTemplate "{method} skip={FSF},EstimationRadius={ER},ContrastThresholdPct={CTPCT}"


p.s. The DMap stack will require user input unless you add more parameters to control those settings.
Back to top
View user's profile Send private message
Rollin



Joined: 11 Jan 2011
Posts: 33
Location: Belgium

PostPosted: Thu Jun 07, 2012 2:53 am    Post subject: Reply with quote



Thank you very much for your help. You know, in our language Elf means Fairy?

I've been thinking why it is so hard to understand for me, but there is a double language barrier. First, I have to cope with English jargon before I can begin with the structure of the XML. Imagine all these words and phrases would be in French or Dutch. That's why lots of things that are easy to understand for Americans are difficult for the rest of us.

I hope Rik will find the time to add this function to Zerene. On the other hand, there must be some challenge left I guess ;-)

Thanks again!

Rollin
Back to top
View user's profile Send private message Visit poster's website
rjlittlefield
Site Admin


Joined: 01 Aug 2006
Posts: 18165
Location: Richland, Washington State, USA

PostPosted: Thu Jun 07, 2012 12:29 pm    Post subject: Reply with quote

Rollin wrote:
Quote:
Zerene's batch scripts are human-readable XML.

Rik, Humans come in many types. A sheet of Rachmaninov music is also human readable (dots go up= higher pitch: very easy).

Well said. I apologize for the difficulty.

--Rik
Back to top
View user's profile Send private message Visit poster's website
Rollin



Joined: 11 Jan 2011
Posts: 33
Location: Belgium

PostPosted: Thu Jun 07, 2012 1:53 pm    Post subject: Reply with quote

No need to apologize of course. I guess it was not you who invented XML in the first place nor that nearly all IT jargon is in English.

Well, I can blame the Dutch for that, something to do with the second Anglo-Dutch war and New Amsterdam becoming New York.

I'm slabbing away now, no worries

Rollin
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.photomacrography.net Forum Index -> Macro and Micro Technique and Technical Discussions All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group