autopano-sift-c sourceforge tarball build instructions ?

94 views
Skip to first unread message

Barney Holmes

unread,
Nov 11, 2014, 3:08:30 PM11/11/14
to hugi...@googlegroups.com
Hi,

I wanted to try autopano-sift-c again as it was the first algorithm I discovered for matching images. I also had some bad performance from cpfind and wanted to compare with sift.

I followed this guide ...

http://mayukhmukherjee.wordpress.com/2014/04/05/installing-hugin-autopano-sift-c-in-linux/

But I always get a segmentation fault.

But I found "(Note February 2011: The latest source code of autopano-sift-C has been unstable for a long time now and nobody is working to fix it. Use the 2.5.1 release tarball instead)" - http://wiki.panotools.org/Hugin_Compiling_Ubuntu#Autopano-sift-C

However I can't see how to build the release tarball from sourceforge. There are no build instructions. I tried adapting the mercurial build instructions but it fails in being unable to find AutoPanoSift.h

Thanks for any help in advance.

Terry Duell

unread,
Nov 11, 2014, 7:18:34 PM11/11/14
to hugi...@googlegroups.com
Hello Barney,

On Wed, 12 Nov 2014 07:08:30 +1100, Barney Holmes
<temporal...@gmail.com> wrote:

> Hi,
>
> I wanted to try autopano-sift-c again as it was the first algorithm I
> discovered for matching images. I also had some bad performance from
> cpfin and wanted to compare with sift.
>
[snip]

>
> However I can't see how to build the release tarball from sourceforge.
> There are no build instructions. I tried adapting the mercurial build
> instructions but it fails in being unable to find AutoPanoSift.h
>

Which linux distro are trying to build for?
If you are building for Fedora I can provide you with a .rpm for fedora
20, or a .src.rpm if you want to rebuild from that.
If it's any help, to build the rpm from the tarball I use cmake.
AutoPanoSift.h should be included in the tarball. If it isn't, sing out,
and I'll see if I can get a complete source to you.

Cheers,
--
Regards,
Terry Duell

Barney Holmes

unread,
Nov 12, 2014, 9:03:25 AM11/12/14
to hugi...@googlegroups.com

 Hi Terry,

I'm using Debian but I think I can use the binaries in the fedora RPM, or failing that build the source rpm.

The AutoPanoSift.h *is* in the tarball. I think I'm starting cmake in wrong directory.

Thanks !

Barney Holmes

unread,
Nov 12, 2014, 10:28:16 AM11/12/14
to hugi...@googlegroups.com
Ok, I managed to find the Fedora source RPM. I had to do a little fixing to make it build on my Debian 64bit system (see console output at end of message as well).

"/usr/bin/ld: warning: libjpeg.so.62, needed by may conflict with libjpeg.so.8" fixed by installing default "libjpeg-dev" which removed conflicting packages.

"undefined reference to symbol 'exp@@GLIBC_2.2.5'" fixed by adding "m" to following lines in CMakeLists.txt (adds explicit search for library) - "TARGET_LINK_LIBRARIES(generatekeys ${all_libs} m) ... TARGET_LINK_LIBRARIES(autopano ${all_libs} m)"

"autopano-sift-c" executes with no options to the point of showing its help message ...

=========================

djbarney@djbarney-osiris-64bit ~/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp
$ ./autopano-sift-c

APSCpp, enhanced Autopano-sift-c
autopano-sift-c: Find control points giving a Hugin project file

Version 2.5.1 for hugin 0.7

autopano-sift-c [options] output.pto image1 image2 [..]
hugin project file output.pto gets the results
input images can be jpeg, tiff, or other formats.

autopano-sift-c [options] output.pto projectfile
projectfile: a hugin project or other PT compatible
script with image file names, projections and angular
widths. Enables stereographic projection.

Options
--ransac <on|off|1|0> Switch RANSAC filtration on or off (default: off).
--maxmatches <matches> Output no more that this many control points per
image pair (default: 25, zero means unlimited)
--maxdim <n> Make largest image dimension <= n (default: 1600).
--projection <n>,<d> n = PT format code, d = hfov in degrees. These
apply to all images, reprojection is enabled.
--ANNmatch <on|off|1|0> Use fast keypoint matching tree (default: on).
--disable-areafilter Do not use max-area filtration, which is default.
See manpage for details.
--integer-coordinates Truncate match coordinates to integer numbers.
--absolute-pathnames <on|off|1|0> Use the absolute pathname of the image
file in the PTO output file. Disabled by default.

Alignment options
--align Automatically pre-align images in PTO file.
--bottom-is-left
--bottom-is-right Use in case the automatic algorithm fails.
--generate-horizon <c> Generate up to 'c' horizon lines.

Refinement options
--refine Refine the found control points using the
original images.
--refine-by-middle Use the best middle point to refine (default).
--refine-by-mean Use the mean of the patches control points.
--keep-unrefinable <on|off|1|0>
Keep unrefinable matches (default: on).
output.pto: The output PTO panorama project file.
The filename can be "-", then stdout is used
image<n>: input image files (any common format: JPEG, PNG, TIFF, ..)
Notice: for the aligning to work, the input images shall be
1. All of the same dimension and scale
2. The first images must be an ordered row. See manpage.

=========================

But giving anything else results in a segmentation fault.

djbarney@djbarney-osiris-64bit ~/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp
$ ./autopano-sift-c --projection 0,65 output.pto XRebirth.pto

APSCpp, enhanced Autopano-sift-c
Reading project file XRebirth.pto
Stereographic projection enabled.
Filename XRebirth_1.png
Segmentation fault

djbarney@djbarney-osiris-64bit ~/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp
$ ./autopano-sift-c --projection 0,65 output.pto XRebirth_1.png XRebirth_2.png XRebirth_3.png

APSCpp, enhanced Autopano-sift-c
Stereographic projection enabled.
Filename XRebirth_1.png
Segmentation fault

It's the same with the Hugin sourceforge tarball download of the same code.

Can you get it to build and stay stable ? I am using Debian Testing. So there's possibility that there might be a bug in a library somewhere. I'll try building on another system when I get some time.

=====================

djbarney@djbarney-osiris-64bit ~/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1
$ cmake .
-- Found TIFF: /usr/include/x86_64-linux-gnu
-- Found JPEG: /usr/include
-- Found PNG: /usr/include
-- WARNING: you are using the obsolete 'PKGCONFIG' macro, use FindPkgConfig
-- Configuring done
CMake Warning (dev) at CMakeLists.txt:130 (add_executable):
Policy CMP0003 should be set before this line. Add code such as

if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

as early as possible but after the most recent call to
cmake_minimum_required or cmake_policy(VERSION). This warning appears
because target "autopano" links to some libraries for which the linker must
search:

m

and other libraries with known full path:

/home/djbarney/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/liblibsift.a

CMake is adding directories in the second list to the linker search path in
case they are needed to find libraries from the first list (for backwards
compatibility with CMake 2.4). Set policy CMP0003 to OLD or NEW to enable
or disable this behavior explicitly. Run "cmake --help-policy CMP0003" for
more information.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/djbarney/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1


djbarney@djbarney-osiris-64bit ~/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1
$ make
[ 43%] Built target libsift
Linking C executable autopano
[ 46%] Built target autopano
Scanning dependencies of target generatekeys
[ 48%] Building C object CMakeFiles/generatekeys.dir/GenerateKeys.o
Linking C executable generatekeys
[ 48%] Built target generatekeys
Scanning dependencies of target ANN
[ 51%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/ANN.o
[ 53%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/brute.o
[ 56%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/kd_tree.o
[ 58%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/kd_util.o
[ 60%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/kd_split.o
[ 63%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/kd_dump.o
[ 65%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/kd_search.o
[ 68%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/kd_pr_search.o
[ 70%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/kd_fix_rad_search.o
[ 73%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/bd_tree.o
[ 75%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/bd_search.o
[ 78%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/bd_pr_search.o
[ 80%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/bd_fix_rad_search.o
[ 82%] Building CXX object APSCpp/ANN/CMakeFiles/ANN.dir/perf.o
Linking CXX static library libANN.a
[ 82%] Built target ANN
Scanning dependencies of target autopano-sift-c
[ 85%] Building CXX object APSCpp/CMakeFiles/autopano-sift-c.dir/ANNkd_wrap.o
[ 87%] Building C object APSCpp/CMakeFiles/autopano-sift-c.dir/APSCpp_main.o
/home/djbarney/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp/APSCpp_main.c: In function ‘WritePTOFile’:
/home/djbarney/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp/APSCpp_main.c:440:50: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
HashTable_AddItem(imageNameTab, kx->imageFile, (void*)imageIndex);
^
/home/djbarney/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp/APSCpp_main.c:511:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(int)HashTable_GetItem(imageNameTab, ms->file1), (int)HashTable_GetItem(imageNameTab, ms->file2),
^
/home/djbarney/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp/APSCpp_main.c:511:55: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(int)HashTable_GetItem(imageNameTab, ms->file1), (int)HashTable_GetItem(imageNameTab, ms->file2),
^
/home/djbarney/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp/APSCpp_main.c:515:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(int)HashTable_GetItem(imageNameTab, ms->file1), (int)HashTable_GetItem(imageNameTab, ms->file2),
^
/home/djbarney/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp/APSCpp_main.c:515:55: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(int)HashTable_GetItem(imageNameTab, ms->file1), (int)HashTable_GetItem(imageNameTab, ms->file2),
^
[ 90%] Building C object APSCpp/CMakeFiles/autopano-sift-c.dir/APSCpp.o
/home/djbarney/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp/APSCpp.c: In function ‘MultiMatch_ANN’:
/home/djbarney/Temp/autopano/autopano-sift-C-2.5.1-8.fc20.src/autopano-sift-C-2.5.1/APSCpp/APSCpp.c:490:4: warning: ‘kp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
d = kp->featureVectorLength; // # of dimensions
^
[ 92%] Building C object APSCpp/CMakeFiles/autopano-sift-c.dir/CamLens.o
[ 95%] Building C object APSCpp/CMakeFiles/autopano-sift-c.dir/HermiteSpline.o
[ 97%] Building C object APSCpp/CMakeFiles/autopano-sift-c.dir/saInterp.o
[100%] Building C object APSCpp/CMakeFiles/autopano-sift-c.dir/saRemap.o
Linking CXX executable autopano-sift-c
[100%] Built target autopano-sift-c



Terry Duell

unread,
Nov 12, 2014, 4:54:28 PM11/12/14
to hugi...@googlegroups.com
Hello Barney,

On Thu, 13 Nov 2014 02:28:16 +1100, Barney Holmes
<temporal...@gmail.com> wrote:

> Ok, I managed to find the Fedora source RPM. I had to do a little fixing
> to make it build on my Debian 64bit system (see console output at end of
> message as well).
>
> "/usr/bin/ld: warning: libjpeg.so.62, needed by may conflict with
> libjpeg.so.8" fixed by installing default "libjpeg-dev" which removed
> conflicting packages.
>
> "undefined reference to symbol 'exp@@GLIBC_2.2.5'" fixed by adding "m"
> to following lines in CMakeLists.txt (adds explicit search for library)
> - "TARGET_LINK_LIBRARIES(generatekeys ${all_libs} m) ...
> TARGET_LINK_LIBRARIES(autopano ${all_libs} m)"
>
> "autopano-sift-c" executes with no options to the point of showing its
> help message ...
>

[snip]

> =========================
>
> But giving anything else results in a segmentation fault.
>

[snip]

>
> It's the same with the Hugin sourceforge tarball download of the same
> code.
>
> Can you get it to build and stay stable ? I am using Debian Testing. So
> there's possibility that there might be a bug in a library somewhere.
> I'll try building on another system when I get some time.
>

It builds OK and is stable here on Fedora 20.
The cmake messages look a bit suspect to me, but I am guessing.

I'm not sure if it will help you, but I have put my Fedora rpm and src.rpm
on Dropbox, here...

https://www.dropbox.com/sh/ix5nsjjsy5fprzu/AAAFTPCEPWuLxRr_qQoBH5s8a?dl=0

Looking at the date that I built the rpm (Jan 2014) I would have been
using libpano13-2.9.19.

Terry Duell

unread,
Nov 12, 2014, 6:25:09 PM11/12/14
to hugi...@googlegroups.com
Hello Barney,

On Thu, 13 Nov 2014 02:28:16 +1100, Barney Holmes
<temporal...@gmail.com> wrote:

> Ok, I managed to find the Fedora source RPM. I had to do a little fixing
> to make it build on my Debian 64bit system (see console output at end of
> message as well).

Does this help...

http://www.deb-multimedia.org/dists/testing/main/binary-amd64/package/autopano-sift-c

Barney Holmes

unread,
Nov 14, 2014, 8:29:11 AM11/14/14
to hugi...@googlegroups.com
Ah, got it.

I converted my PNG images to TIFF and now it no longer seg faults. Glad I remembered to try some simple tests first before delving into gdb which I'm not familiar with.

I'll put this in as a bug report.

Thanks for the help Tduell ! :)

Barney Holmes

unread,
Nov 14, 2014, 8:47:16 AM11/14/14
to hugi...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages