2009-07-03

Building Bundler v0.3 on Ubuntu

'The Office Box' requested help with running Bundler on linux ( specifically Ubuntu 9- I have a virtualbox vm of Ubuntu 8.04 fully updated to today, but I'll try this out on Ubuntu 9 soon) so I went through the process myself.

The binary version depends on libgfortran.so.3, which I couldn't find with aptitude, so I tried the building from source- it turned out to be not that hard. The is no 'configure' for bundler 0.3 to search for dependencies that aren't installed, so I built incrementally and installed packages as I ran into build failures. I might be missing a few I already had installed for other purposes, but do a sudo aptitude install on the following:

build-essentials
gfortran-4.2
zlib1g-dev
libjpeg-dev


A missing gfortran produces the cryptic 'error trying to exec 'f951': execvp: No such file or directory)' message.

These might be necessary I'm not sure:

lapack3
libminpack1
f2c


After that run the provided makefile, add the bundler bin folder to your LD_LIBRARY_PATH, and then go into the examples/kermit directory and run ../../RunBundler.sh to see there are good ply files in the bundle directory. Bundler is a lot slower than Photosynth for big jobs, I haven't tried the intel math libs though.

The full output from a successful kermit RunBundler run looks like this:

Using directory '.'
0
Image list is list_tmp.txt
[Extracting exif tags from image ./kermit000.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Extracting exif tags from image ./kermit001.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Extracting exif tags from image ./kermit002.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Extracting exif tags from image ./kermit003.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Extracting exif tags from image ./kermit004.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Extracting exif tags from image ./kermit005.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Extracting exif tags from image ./kermit006.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Extracting exif tags from image ./kermit007.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Extracting exif tags from image ./kermit008.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Extracting exif tags from image ./kermit009.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Extracting exif tags from image ./kermit010.jpg]
[Focal length = 5.400mm]
[Couldn't find CCD width for camera Canon Canon PowerShot A10]
[Found in EXIF tags]
[CCD width = 5.230mm]
[Resolution = 640 x 480]
[Focal length (pixels) = 660.803
[Found 11 good images]
[- Extracting keypoints -]
Finding keypoints...
1245 keypoints found.
Finding keypoints...
1305 keypoints found.
Finding keypoints...
1235 keypoints found.
Finding keypoints...
1220 keypoints found.
Finding keypoints...
1104 keypoints found.
Finding keypoints...
1159 keypoints found.
Finding keypoints...
949 keypoints found.
Finding keypoints...
1108 keypoints found.
Finding keypoints...
1273 keypoints found.
Finding keypoints...
1160 keypoints found.
Finding keypoints...
1122 keypoints found.
[- Matching keypoints (this can take a while) -]
../../bin/KeyMatchFull list_keys.txt matches.init.txt
[KeyMatchFull] Reading keys took 1.020s
[KeyMatchFull] Matching to image 0
[KeyMatchFull] Matching took 0.010s
[KeyMatchFull] Matching to image 1
[KeyMatchFull] Matching took 0.170s
[KeyMatchFull] Matching to image 2
[KeyMatchFull] Matching took 0.380s
[KeyMatchFull] Matching to image 3
[KeyMatchFull] Matching took 0.560s
[KeyMatchFull] Matching to image 4
[KeyMatchFull] Matching took 0.740s
[KeyMatchFull] Matching to image 5
[KeyMatchFull] Matching took 0.960s
[KeyMatchFull] Matching to image 6
[KeyMatchFull] Matching took 1.060s
[KeyMatchFull] Matching to image 7
[KeyMatchFull] Matching took 1.210s
[KeyMatchFull] Matching to image 8
[KeyMatchFull] Matching took 1.410s
[KeyMatchFull] Matching to image 9
[KeyMatchFull] Matching took 1.600s
[KeyMatchFull] Matching to image 10
[KeyMatchFull] Matching took 1.760s
[- Running Bundler -]
[- Done -]

19 comments:

avanindra said...

Hi,

How are you changing resolution while running bundler? In my case it is taking 3072 x 1728 and finally it is giving segmentation fault. I am not able to generate .ply file.

Please help me.

Thanks

binarymillenium said...

You should resize them down to 1600x1200/2MP or less before you run Bundler on them. Google Picasa or imagemagick convert from the command line works well for that ($ convert input.jpg -resize 1600x1200 output.jpg).

I'm kind of curious about this size limitation and I'd like to track it down- maybe it can be removed.

binarymillenium said...
This comment has been removed by the author.
binarymillenium said...

Or in your case, also in a bash loop:

for i in *.jpg;
do
convert $i -resize 35% newdir/$i
done

The 35% will preserve the aspect ratio of your images.

Unknown said...

Hi binarymillenium,

I am interested in reconstructing the model based on the ply output file from bundler. Have you any idea of how this can be achieved ?

Regards,
indi

Paolo Mistrangelo said...

I had the same problem with the missing libgfortran.so.3 lib...is it too demanding to ask "someone" to recompile bundler 0.3 on a Amazon EC2 AMI giving a public address so everyone can easily test it without even install anything?

I'll be delighted.I'm a kind a newbie on Ubuntu...

Regards

binarymillenium said...

Paolo,

It sounds like you have Ubuntu 9 and want to use the pre-built Bundler.
I've could just share the built Bundler files I already generated, those ought to work on Ubuntu 9. But otherwise it's not too hard to build it yourself with these instructions (unless it's your first time building something on Linux), is there anything particular that you don't know how to do?

Mikal said...

Hi

I'm on ubuntu 8.10 AMD64 and can't get bundler to run...

following your instructions bundler give a helpful segfault (gfortran4.3), and for the rest I get the missing gfortran (gfortran4.2) error (although its there...) or ELF32 mismatches when using supplied/external files, etc.

I would really appreciate it you could help me here...

I'm really looking forward to using bundler.

Unknown said...

Hi, i try to use Bundler and I have also like you a vm of Ubuntu 9 64. I recomplile bundler at 64 bit and already get the results that you describe in your post but i have some problem finishing the progess for a "segmentation fault" problem that stop the the matching process. Do you have an idea to resolve the problem?

Thank you

Franz

binarymillenium said...

I have access to a 64-bit machine and eventually I might be able to duplicate these problems. Other than that make sure the pictures are 1600x1200 or smaller.

roybayot said...

hi binarymillenium,

i am also trying to get bundler to work on ubuntu 9.10. i think i was able to compile bundler from source and no more problems with compiling.

but when i go to the kermit example and run ../../RunBundler.sh, it gives out some sort of error after [KeyMatchFull]

[- Running Bundler -]
../../RunBundler.sh: line 93: 5709 Segmentation fault $BUNDLER list.txt --options_file options.txt > bundle/out
[- Done -]


i really dont know what to do but i think i'm close to making it work. any ideas? did you stumble in something similar?

i would be grateful for any help or any direction you can point.

thank you.

binarymillenium said...

Is that with the example picture sets or your own?

roybayot said...

one of the examples. Kermit and ET. :)

binarymillenium said...

Yesterday I tried out the 0.3 binary and source versions on a clean install of 32-bit 9.10 and didn't have any porblems.

I installed
liblapack-dev
gfortran
and the suggested SIFT binary.

roybayot said...

hmm.. i'm currently on a 64 bit ubuntu 9.10. i dont have access to a 32 bit machine right now so i would probably try it next week.

i checked bundle/out and it seems that bundle didnt terminate properly. it stopped somewhere in "Adding matches".

anyway, i'll just try it on a 32 bit and see. thank you. i'll keep you posted.

Laurent said...

Hi,

Yeah bundler segfault when the binaries is compiled on a 64bit machine.
but for now, you can compile a 32bit binaries on your 64bit machine with those flag.

export CC="gcc -m32"
export LD="ld -melf_i386"

and it works.

binarymillenium said...

Laurent,

You did
export CC="gcc -m32"
export LD="ld -melf_i386"
in a bash shell before running the toplevel bundler make file?

I tried that yesterday (on 64-bit Ubuntu 9.10) and it didn't work, it seems like every lib that bundler builds has it's own makefile that sets it's own CC and LD or equivalent- it seems like I'd have to edit each and every one to build 32-bit.

Matthew W said...

Hey I'm running Ubuntu 10.10 and bundler can't seem to find the libgfortran.so.3 file.

when I do an: ldd bundler I get the following error:

libgfortran.so.3 => not found

I did a search on my computer and found that there are several version of the file libgfortran.so.e, but when I copy one of them to the bundler/bin folder, and add it to the path with:

export LD_LIBRARY_PATH="/my_pathto/bundler/bin"

I still get the same error message.

Any idea whats up?

Matthew W said...

So I found out what the problem is. I was running Ubuntu on a 64-bit processor, and had installed the 64-bit version of libgfortran.so.3

The problem is that bundler 0.3, was created in a 32-bit system, and needs the 32-bit version of libgfortran.so.3 to run.

To get this, search for fortran 32, and you should get the correct installer file.

Once this is installed everything should be good.