Re: Cpfind should accept filenames and wildcards

94 views
Skip to first unread message

Tduell

unread,
Jun 25, 2012, 2:01:16 AM6/25/12
to hugin and other free panoramic software
Hello John,

On Jun 25, 10:47 am, John Eklund <jclo...@gmail.com> wrote:
> In short:
> I strongly suggest making Cpfind accept filenames and wildcards to make it
> usable for scripting.

It's not something I am familiar with through use, but if I understand
it correctly, pto_gen should be able to build a pto file using
filenames and wildcards, which can then be passed to cpfind.

i.e pto_gen -o fred.pto *.jpg
cpfind -o output_project fred.pto



Cheers,
Terry


Bruno Postle

unread,
Jun 25, 2012, 2:03:13 AM6/25/12
to hugi...@googlegroups.com

On 25 Jun 2012 06:39, "John Eklund" <jcl...@gmail.com> wrote:
>
> In short:
> I strongly suggest making Cpfind accept filenames and wildcards to make it usable for scripting.

cpfind doesn't take filenames on the command line in part because of limitations if the Windows shell.

Hugin now has a tool called pto_gen for preparing the input files for cpfind and autopano-sift-c: http://wiki.panotools.org/Pto_gen

This does take filenames as input. If you have problems with the command line length, you can use pto_merge to do it in steps: http://wiki.panotools.org/Pto_merge

--
Bruno

Bart van Andel

unread,
Jun 25, 2012, 1:04:20 PM6/25/12
to hugi...@googlegroups.com
If you like you could also create a little batch script to create your command line. The following script just creates a set of filenames based on a wildcard. The wildcard has been hard coded here, but I assume you know a bit about scripting already so you could easily modify this to your needs.


@echo off & setlocal enabledelayedexpansion

set wildcard=*
set files=

echo Generating a list of files using wildcard: %wildcard%

for %%f in (%wildcard%) do (
  rem For full path, use %%~ff
  rem For just filename and extension, use %%~nxf
  rem For plain use, use %%f

  set file=%%f

  rem Check for spaces and escape if necessary
  if not "!file!"=="!file: =_!" (
    set file="!file!"
  )

  rem Add file to our list of files
  set files=!files! !file!
)

echo Done.
echo.
echo List:
echo %files%
echo.


Good luck with your giant set of photos! What kind of your are we walking about?

--
Bart


On Monday, June 25, 2012 2:47:41 AM UTC+2, John Eklund wrote:
In short:
I strongly suggest making Cpfind accept filenames and wildcards to make it usable for scripting.

Elaborated:

For the last few years I've been on-off working on a big panorama project where over 60.000
individual images of mine are to be stitched into a couple of hundred panormas for a virtual tour.
With this huge amount of material, a streamlined workflow becomes crucial.
I have developed a tightly slimmed workflow where I develop several panoramas
in parallel through my processing pipeline. I work mostly in the command prompt
through batch scripts and avoid the Hugin GUI for the most part.

My control point generator of choice has always been Alexandre Jenny's great old Autopano 1.03,
which wins out over Autopano-SIFT in ease of use (Autopano-SIFT does not interpret wildcards,
which makes usage a pain on Windows systems where the shell does not expand them for me).

After upgrading my system, I've found that Autopano crashes on Windows 7
and I'm suddenly out of control point generator. The introduction of CPFind in the Hugin package
is even worse from a batch-usage standpoint as it inconceivably expects a complete
pre-made project file as input which would force me to handle every panorama in the GUI.
As most of my images are preprocessed (including a stacking utility I developed myself),
EXIF information is usually not preserved. This has never meant any trouble as Autopano
doesn't need it anyway (thus I'd venture to say no control point generator or panorama stitcher
should ever need it). Now having to manually add images and enter bogus lens parameters
in Hugin to make CPFind work seems ridiculous.


I'd wholeheartedly suggest adding an alternative method of calling CPFind
by supplying images and making it process wildcards.

I'm currently unsure how to get past this setback. I guess until CPfind is fixed,
either I'll have to adjust to using Autopano-SIFT (and spend most of my time
editing endless command lines of filenames), change to Linux or install Windows XP
on a virtual machine just to get good old Autopano to work again.

Any suggestions?

Best regards
John Eklund, Sweden

John Eklund

unread,
Jun 25, 2012, 2:46:28 PM6/25/12
to hugi...@googlegroups.com
On Monday, June 25, 2012 7:04:20 PM UTC+2, Bart van Andel wrote:
If you like you could also create a little batch script to create your command line. The following script just creates a set of filenames based on a wildcard. The wildcard has been hard coded here, but I assume you know a bit about scripting already so you could easily modify this to your needs.

Good luck with your giant set of photos! What kind of your are we walking about?

Thanks!
It's a labor of love but sometimes overwhelming (world record?)
I've been documenting an old power station that 's subject of an ongoing industrial preservation effort combined with a leisure / entertainment facility currently being built. Nothing is officially published yet and the project has been in suspended animation for some time, regrettably. You can find a few excerpts of my work below: (some hotspots are clickable but not all are finished). I make a point out of banning nadir caps. :)

http://www.angkraftverket.se/panorama/

/John

Bart van Andel

unread,
Jun 25, 2012, 6:23:53 PM6/25/12
to hugi...@googlegroups.com
On Monday, June 25, 2012 8:46:28 PM UTC+2, John Eklund wrote:
I've been documenting an old power station that 's subject of an ongoing industrial preservation effort combined with a leisure / entertainment facility currently being built. Nothing is officially published yet and the project has been in suspended animation for some time, regrettably. You can find a few excerpts of my work below: (some hotspots are clickable but not all are finished). I make a point out of banning nadir caps. :)

http://www.angkraftverket.se/panorama/

Wow, that's really cool! How big a part have you finished until now? It's like moving around in a Myst III-like world, but then for real, amazing! I'd definitely like to see more when you're done!

--
Bart

Bruno Postle

unread,
Jun 26, 2012, 5:26:24 PM6/26/12
to Hugin ptx
On Mon 25-Jun-2012 at 10:35 -0700, John Eklund wrote:
>On Monday, June 25, 2012 8:03:13 AM UTC+2, Bruno Postle wrote:
>>
>> Hugin now has a tool called pto_gen for preparing the input files for
>> cpfind and autopano-sift-c: http://wiki.panotools.org/Pto_gen
>>
>> This does take filenames as input. If you have problems with the command
>> line length, you can use pto_merge to do it in steps:
>> http://wiki.panotools.org/Pto_merge
>
>Thanks! Pto_gen was new to me. I assume it will be in the regular Hugin
>package?

It should be in any recent snapshot since December and will be in
the 2012.0.0 release.

>If nothing else maybe Hugin could include a batch script to call pto_gen
>and cpfind, making it more straight-forward.

A Windows batch script for this would be welcome and can be distributed
with Hugin.

>It still seems pto_gen needs an FOV number for non-EXIF files. I'm not
>knowledgeable on the complex optic math but just pragmatically notice that
>Autopano was fine without. :-) AFAIK that's something that can be deduced
>at a later stage with control points in place?

Yes it can, but a good initial estimate will get you a better spread
of control points. With a 'normal' lens you can usually do ok
giving a FoV of 50, with any other lens it would be better to try
and estimate the actual angle.

--
Bruno

JohnPW

unread,
Jul 2, 2012, 9:34:26 PM7/2/12
to hugi...@googlegroups.com
Wow. Quite a big project. And very nice images.
Nice work.
John
Reply all
Reply to author
Forward
0 new messages