This is an old revision of the document!
Table of Contents
Prereqs
Platform
This currently only runs under Linux from a combination of some autopanoaj magic I do and sloppy path construction. Most things probably run under any UNIX with Python
Software
Core required:
- Python 2.7 (or at least that's what I use)
Stitching:
- ImageMagik
- WINE
- autopanoaj (see section)
autopanoaj
I use Andrew Jenny's control point finder since it gives me a lot better results than autopano-sift-c. symlink autopanoaj to autopano.exe and make it available in your path. Use the Windows version through WINE. The Linux ones are older and I think they had some problem. In any case tools currently assume that they have to patch up WINE stuff so use the Windows version.
Installing
I don't currently have a nice installer. $ROOT/lib/pr0ntools must be in your PYTHONPATH. For example: export PYTHONPATH=$PYTHONPATH:$HOME/pr0ntools/lib
You probably also want to have the executables in your PATH. Example: export PATH=$PATH:$HOME/pr0ntools/stitch
Assumptions and notes
A lot of this can be done much easier and more intuitively if you have a small project through Hugin. More than likely you aren't doing this because you have a small project though and so I'll expect you are at least basically familiar with Hugin and can make the judgment call as to if you should just use Hugin for a particular step
I will use out.pto as the project name, you can use whatever you want
pr0npto has the form pr0npto <input> <output> I'll use the replace version here for simplicity but for safety you might consider creating a new project at each step since previous steps can take some time in case something goes wrong
Step 1: acquire images
Take images with roughly 1/3 overlap to each neighbor. Tag them with x/y or r/c in the file names so that they can be used in positioning heuristics.
Example file name: r0012_c0311.jpg
It shouldn't matter the order or if you use any 0 padding. I generate these using pr0ncnc which could probably be adapted to your system but as of now is fairly specific to mine. I did convert it from g-code generation to live runs over USB without too much effort so someone else's system probably wouldn't be too bad. And the g-code generator probably still works if you can use that.
Step 2: generate features
cd into the directory with your images
Execute a command like: pr0nstitch *.jpg out.pto. This will take some time but should give you a progress indicator of which match its on.
When its done you will get a file called stitch-errors.json. Look through it for images that couldn't be matched. If there are any that have 0 matches you should probably patch them up by hand by loading the project into Hugin
Step 3: optimize
BUG: you must first open and it resave it in Hugin for PToptimizer to take it. I haven't investigated why this is yet. As a workaround use pr0npto –hugin out.pto to do this from the command line
Execute something like:
pr0npto –optimize out.pto
This may take a while but you should get occasional progress indicators. When its done I recommend you center it using pr0npto –center out.pto
Step 4: Crop in Hugin
I might eventually automate this but for now things have to be done manually. Open it Hugin and do the following:
- Calculate optimal field of view. This will give a reasonable baseline when you open it but probably won't be final
- Open GL image preview. This may take a long time but you should see each image loading as it goes along
- Adjust the field of view as needed so that the entire pano is in view but try to still keep it as small as possible
- Go to the crop tab and crop as needed
- Save and exit
Step 5: stitch
You have several options at this point:
- Stitch in Hugin using either its normal or batch option
- Stitch through command line using Hugins makefile. I tend to prefer this over the first since I can run it remotely and its easier to track
- Stitch to tiles using pr0nts. This is the recommended option for large projects since it avoids creating large intermediate images
Execute “pr0nts out.pto”. A folder called out will be created with the tiles. This may take a very long time. There are a lot of options on this tool so try –help and read over them if you need to weak things
You should use the maximum amount of memory you can to create the largest supertile possible. I will eventually add an optimize option where it will calculate the best supertile scheme based on your machine's memory.
Step 6: create map
Now that you have tiles you can turn them into a map. Execute pr0nmap out and it should create a dir called “map” that has index.html an subdirectories with tiles. Try its help options to see what else it offers.
This should be a reasonably quick operation and will get much faster at each successive zoom level as it creates the next generation of tiles. It only loads on 4 tiles at a time so this should not take a lot of memory.
Step 7: finishing up
Open index.html and you should see your chip. If at the highest zoom level you aren't really getting anything over a previous level consider deleting all of the tiles in that directory and lowering the maxZoom parameter in index.html