Unified autopano-sift-c needs no script

45 views
Skip to first unread message

Tom Sharpless

unread,
Feb 6, 2008, 8:44:47 PM2/6/08
to hugin and other free panoramic software
I've combined generatekeys and autopano into a single program, APSC,
that hugin can run directly without the need for an intermediate
script.

Its command line is just like autopano's with one extra option, "--
maxdim <int>" that corresponds to the "minDim" argument of
generatekeys (image is reduced so its largest dimension doe not exceed
maxdim). Setting this to 1200 or so dramatically speeds keypoint
generation and cuts memory demand -- which can get very big: I saw
peak usage of 1.2 GB while processing 8MP images.

APSC does not produce keyfiles and so does not support the possibility
of re-using keyfiles to find new matches. Aside from that it should
be functionally equivalent to the current autopano-sift-C. It works
for me on Windows with these command arguments in hugin's preferences
--
" --ransac off --maxdim 1200 --maxmatches %p %o %i "

I've posted the following changes to the autopano source tree. 1) a
new file, APSCmain.c, 2) an updated cmakelists.txt that generates an
APSC build project and includes APSC.exe in the INSTALL, and 3) a
slightly changed utils.c that flushes writes to stdout so that hugin's
"finding keypoints" window shows them in a timely manner. Nothing has
been removed, the old exes and scripts are still built and installed
too.

Please check this out on Linux and OSX.

Cheers, Tom

Ken Warner

unread,
Feb 6, 2008, 9:12:55 PM2/6/08
to hugi...@googlegroups.com
Sequence of 15 images. One image is nearly featureless with only a small
framed photograph in the middle. Lets call it image 10. But the edge of the photograph shows in the image 9. I attempt to add points but when I click
on the corner of the frame ( seems like an obvious choice ) Hugin just stops.

How do I get past this?

I'm brief here because I don't know what information is important. So ask
and I'll try to be as complete as possible in my reply.

Stephan Hegel

unread,
Feb 6, 2008, 10:44:04 PM2/6/08
to hugi...@googlegroups.com
Hi,

Tom Sharpless wrote:
> I've posted the following changes to the autopano source tree. 1) a
> new file, APSCmain.c,

Beside the warnings I've posted two weeks ago or so, on my Linux box
(openSuSE 10.3, x86_64) it spits out a bunch of new warnings:

[ 90%] Building C object CMakeFiles/APSC.dir/APSCmain.o
autopano-sift-C.r2799/APSCmain.c: In function ‘WritePTOFile’:
autopano-sift-C.r2799/APSCmain.c:435: warning: cast to pointer from integer of different size
autopano-sift-C.r2799/APSCmain.c:488: warning: cast from pointer to integer of different size
autopano-sift-C.r2799/APSCmain.c:488: warning: cast from pointer to integer of different size
autopano-sift-C.r2799/APSCmain.c:492: warning: cast from pointer to integer of different size
autopano-sift-C.r2799/APSCmain.c:492: warning: cast from pointer to integer of different size
autopano-sift-C.r2799/APSCmain.c: In function ‘main’:
autopano-sift-C.r2799/APSCmain.c:746: warning: comparison with string literal results in unspecified behaviour
autopano-sift-C.r2799/APSCmain.c:759: warning: comparison with string literal results in unspecified behaviour
Linking C executable APSC

Rgds,
Stephan.

Carl von Einem

unread,
Feb 7, 2008, 2:58:39 AM2/7/08
to hugi...@googlegroups.com
Ken Warner wrote:
> Sequence of 15 images. One image is nearly featureless with
> only a small framed photograph in the middle. Lets call it
> image 10. But the edge of the photograph shows in the image 9.
> I attempt to add points but when I click on the corner of the
> frame (seems like an obvious choice) Hugin just stops.

> How do I get past this?

Hi Ken,

you should try that with the latest build, beta 3 is outdated. Yuv has a
fine little list of available downloads here:
<http://panospace.wordpress.com/downloads/>

If I understand your description correctly you tried to set a CP very
close to the image border, maybe it's the left border. You possibly
activated both options (auto fine-tune, auto estimate) to compute an
optimal pair of CPs. My guess is that hugin now tries to set a CP
outside the actual image frame and fails. A wild guess though.
Can you just deactivate the optimizing options (auto fine-tune / auto
estimate) and manually add your CP? You could drag that around or use
the boxes at the bottom of that tab to enter a different value for the x
and y coordinates.
Does that workaround help in any way?

Carl


- - -

Note to Yuv related to "DISCLAIMER - Never trust a software
download...": md5 is available on OS X, a simple check on 10.3.9:
man md5
...outputs the usual man page

However I also found a related description at Apple's knowledge base
that suggests openssl:
<http://docs.info.apple.com/article.html?artnum=75510>

/usr/bin/openssl md5 /Users/carl/Desktop/hugin0.7_svn2765_20080202.dmg
MD5(/Users/carl/Desktop/hugin0.7_svn2765_20080202.dmg)=
499bed5a12e4bdfcc3d0660a5ae3eb08

which gives me the same result as using md5

md5 /Users/carl/Desktop/hugin0.7_svn2765_20080202.dmg
MD5 (/Users/carl/Desktop/hugin0.7_svn2765_20080202.dmg) =
499bed5a12e4bdfcc3d0660a5ae3eb08


Somewhere else I found this description:
Using hdiutil to Work with System Images
[...] To verify an image against its internal checksum:

$ hdiutil verify myimage.img

This returns some checks and
hdiutil: verify: checksum of
"/Users/carl/Desktop/hugin0.7_svn2765_20080202.dmg" is VALID

You might want to add a short description on that paragraph how to
easily get the correct path to the .dmg file (actually it comes as a
.dmg.gz but I unpacked it first), something like that:

type 'md5 ' (without the single quotes) into a terminal window
(Terminal.app is in Applications/Utilities/), then just drag the file
into that same window. The provided checksum is for the .dmg file, so if
the download didn't uncompress automatically you have to double click
the .dmg.gz first.

Tom Sharpless

unread,
Feb 7, 2008, 9:11:36 AM2/7/08
to hugin and other free panoramic software
Thanks Stephan

On Feb 6, 10:44 pm, Stephan Hegel <stephan.he...@gmx.de> wrote:
> Beside the warnings I've posted two weeks ago or so, on my Linux box
> (openSuSE 10.3, x86_64) it spits out a bunch of new warnings:
>
> [ 90%] Building C object CMakeFiles/APSC.dir/APSCmain.o
> autopano-sift-C.r2799/APSCmain.c: In function 'WritePTOFile':
> autopano-sift-C.r2799/APSCmain.c:435: warning: cast to pointer from integer of different size
> autopano-sift-C.r2799/APSCmain.c:488: warning: cast from pointer to integer of different size
> autopano-sift-C.r2799/APSCmain.c:488: warning: cast from pointer to integer of different size
> autopano-sift-C.r2799/APSCmain.c:492: warning: cast from pointer to integer of different size
> autopano-sift-C.r2799/APSCmain.c:492: warning: cast from pointer to integer of different size
> autopano-sift-C.r2799/APSCmain.c: In function 'main':
> autopano-sift-C.r2799/APSCmain.c:746: warning: comparison with string literal results in unspecified behaviour
> autopano-sift-C.r2799/APSCmain.c:759: warning: comparison with string literal results in unspecified behaviour

The first 5 warnings are due to pointers and integers having different
sizes in your 64 bit target environment. Presumably pointers are 8
bytes and ints are 4. I'm not expert enough to know whether to expect
corresponding runtime errors. The correct fix is to change the type
of the 'item' in the ArrayList and HashTable classes to 'void *' . I
will try to do that today; but it may have side effects that will take
a while to resolve. I hope you will be able to help me test these
changes in a 64 bit build environment before I commit them to SVN?

The last two represent a real coding error -- which is also in
autopano.c of course. I guess nobody has ever tried to run it with
output on stdout, because there are other errors that prevent that as
well. Since this is clearly not a popular option, the easiest fix is
to drop it altogether. I shall do that in APSCmain.c. But I hate to
change the design of autopano (which has a wider sphere of application
because it can read saved keypoint files); so I guess I'l make the "-"
option work there -- someday.

Regards, Tom

Ken Warner

unread,
Feb 7, 2008, 9:14:30 AM2/7/08
to hugi...@googlegroups.com
Hi Carl,

Your capability for guessing approaches prescience :-)

You guessed the exact situation. Deactivating auto fine-tune and auto estimate
let me add a few control points. Only added 3 or 4 to each side of the image
that didn't have control points added by Hugin. The image is an inside wall
with a small framed photograph in the middle. I used faint shadows on slightly
textured paint but Hugin and nona completed the stitch.

Thanks -- I'll take a look a the new (to me) stuff in the downloads area.

Ken

Seb Perez-D

unread,
Feb 7, 2008, 9:19:59 AM2/7/08
to hugi...@googlegroups.com
On Thu, Feb 7, 2008 at 3:11 PM, Tom Sharpless <TKSha...@gmail.com> wrote:
> > autopano-sift-C.r2799/APSCmain.c: In function 'WritePTOFile':
> > autopano-sift-C.r2799/APSCmain.c:435: warning: cast to pointer from integer of different size
> > autopano-sift-C.r2799/APSCmain.c:488: warning: cast from pointer to integer of different size
> > autopano-sift-C.r2799/APSCmain.c:488: warning: cast from pointer to integer of different size
> > autopano-sift-C.r2799/APSCmain.c:492: warning: cast from pointer to integer of different size
> > autopano-sift-C.r2799/APSCmain.c:492: warning: cast from pointer to integer of different size
> The first 5 warnings are due to pointers and integers having different
> sizes in your 64 bit target environment. Presumably pointers are 8
> bytes and ints are 4. I'm not expert enough to know whether to expect
> corresponding runtime errors.

I had already seen these errors when building (standard) autopano, and
have not found a problem with the resulting program (it's a warning).

I suggest that autopano and generatekeys are still compiled. As you
say, they can still be used for legitimate reasons.

Cheers,

Seb

Tom Sharpless

unread,
Feb 7, 2008, 10:17:03 AM2/7/08
to hugin and other free panoramic software
Hi Seb

On Feb 7, 9:19 am, "Seb Perez-D" <sbprzd+...@gmail.com> wrote:
>
> I had already seen these errors when building (standard) autopano, and
> have not found a problem with the resulting program (it's a warning).
>
Thanks, I'll lower my priority for fixing this.

> I suggest that autopano and generatekeys are still compiled. As you
> say, they can still be used for legitimate reasons.
>
Yes, indeed. They are still built and installed along with scripts
for Linux and Windows.

Regards, Tom


Carl von Einem

unread,
Feb 7, 2008, 10:59:08 AM2/7/08
to hugi...@googlegroups.com
Ken Warner wrote:
> Hi Carl,
>
> Your capability for guessing approaches prescience :-)

If I only knew the next lottery numbers!

> You guessed the exact situation. Deactivating auto fine-tune and auto estimate
> let me add a few control points. Only added 3 or 4 to each side of the image
> that didn't have control points added by Hugin. The image is an inside wall
> with a small framed photograph in the middle. I used faint shadows on slightly
> textured paint but Hugin and nona completed the stitch.

Great that it helped.


>
> Thanks -- I'll take a look a the new (to me) stuff in the downloads area.

I tried but wasn't able yet to reproduce this behaviour in the latest
Mac svn. So if that same problem still exists using a newer build please
report that as a bug on hugin's bugtracker. It then would help a lot if
you were able to post the project files somewhere so I can test with the
same set of files.

Carl

Ken Warner

unread,
Feb 7, 2008, 12:28:19 PM2/7/08
to hugi...@googlegroups.com
Heh! Lottery :-)

Can you run your test on just the three relevant image files? That's
all that where really involved. I could upload them to my web site
along with the pto files now if that will help.

It will be a while before I get to the new downloads...

Carl von Einem

unread,
Feb 7, 2008, 12:32:03 PM2/7/08
to hugi...@googlegroups.com
I could try that, sure. Just send me a link...

Carl

Ken Warner

unread,
Feb 7, 2008, 5:51:31 PM2/7/08
to hugi...@googlegroups.com
Hi Carl,

http://pancyl.com/images/CPTest/left.TIF
http://pancyl.com/images/CPTest/middle.TIF
http://pancyl.com/images/CPTest/right.TIF

http://pancyl.com/images/CPTest/Inside1.pto
http://pancyl.com/images/CPTest/Inside1.pto.mk

The pto and mk files are the project files that
I eventually used for a successful stich.

The TIF's are 20meg...

Let me know what you find out...

Stephan Hegel

unread,
Feb 8, 2008, 8:19:56 AM2/8/08
to hugi...@googlegroups.com, Tom Sharpless
Hi all,

Tom Sharpless wrote:
> Please check this out on Linux and OSX.

When running it with the options as described in the original
posting from within hugin it stops with an error message stating
can't open /tmp/ap_rese7935M0.oto
Right, in my tmp is only an ap_rese7935M file, without the 0.oto
extension.

Any idea what went wrong ?

I'm on openSuSE 10.3, x86_64.

Rgds,
Stephan.

Pablo dAngelo

unread,
Feb 8, 2008, 8:52:20 AM2/8/08
to hugi...@googlegroups.com
Hi,

> Hi all,
>
> Tom Sharpless wrote:
> > Please check this out on Linux and OSX.
> When running it with the options as described in the original
> posting from within hugin it stops with an error message stating
> can't open /tmp/ap_rese7935M0.oto
> Right, in my tmp is only an ap_rese7935M file, without the 0.oto
> extension.
>
> Any idea what went wrong ?

You have set Hugin to use the Autopano from A. Jenny. This is not call compatible with the one for autopano-sift (-c)

This is confusing, and I'm tempted to remove support for the (windows only) autopano.exe by A. Jenny from Hugin,
once autopano-sift-c works fine.

ciao
Pablo
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066

Yuval Levy

unread,
Feb 8, 2008, 9:26:44 AM2/8/08
to hugi...@googlegroups.com
Pablo dAngelo wrote:
> I'm tempted to remove support for the (windows only) autopano.exe
> by A. Jenny from Hugin, once autopano-sift-c works fine.

it's unsupported, i don't even know if we have the code, and thanks to
the efforts of Tom and Bruno it is now absolutely redundant, like my VBS
script too.

I vote for remove of both redundant things.

Yuv

Bob Bright

unread,
Feb 8, 2008, 2:12:31 PM2/8/08
to hugi...@googlegroups.com
On Fri, 2008-02-08 at 14:52 +0100, Pablo dAngelo wrote:

You have set Hugin to use the Autopano from A. Jenny. This is not call compatible with the one for autopano-sift (-c)

This is confusing, and I'm tempted to remove support for the (windows only) autopano.exe by A. Jenny from Hugin,
once autopano-sift-c works fine.

ciao
  Pablo

For what it's worth: In the Bad Old Days(TM) when I did all my stitching on Windows, I used to get somewhat better results from autopano.exe than I did from autopano-sift (more control points, better spread).  I found that autopano-sift just wasn't very good at finding control points with my Tokina 10-17 fisheye zoom, even with ransac disabled.  It's still not very good, but I don't have a choice on linux, and as often as not I end up spending a lot of time manually inserting most or all control points.

I would suggest you leave the autopano.exe support in for the time being, as a small consolation for those poor souls who haven't yet dumped their Windows installations.

I sure am looking forward to matchpoint!

Regards,
BBB

Reply all
Reply to author
Forward
0 new messages